From patchwork Tue Jan 14 11:38:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 857251 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1874827wrc; Tue, 14 Jan 2025 03:48:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrQq2yygi8Qv2H8gaQmaQJ6afg/F4pmiFxanvWAifemIaha2VUCd842xUECRO/QX4CWkXAFQ==@linaro.org X-Google-Smtp-Source: AGHT+IGaycwRWqSmMPKpKTuvEZxnJf+ksQo01U9zXAznsas4Js5CvD2zb4PIG8/WBFbltbZhM6Ts X-Received: by 2002:a05:622a:49:b0:466:8f68:a606 with SMTP id d75a77b69052e-46c710840demr340288971cf.40.1736855307016; Tue, 14 Jan 2025 03:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736855307; cv=none; d=google.com; s=arc-20240605; b=chVlwUXy8h59IDMMB1+UhnLmb0G+3zWyln+Sw8yezV17DEUqoP316jjiYiQXI3zFca pvCRHrmC3g7S6WmG7kDtz/7uTaQHe8L5BXUsOaiwSjRclx19LiDZIycpXfqip2EmMfaA i8Li2U07ZL20Vo/GPiR04bG5i0pz5n2hBDLXxcHwsgG+DjCJiip9DmKRkXbp6XTDj+A+ KWjsuJ8Xp6kx80/zXcZlt6j1cd9cX34k6JJ0VcA6eGQLgU6cqCFz54aOL86XCrJk12hc E1Q3yLwE8UZOia/bZQEtAYjNSqbw7HDy7DEq5hFQCUet2p51HmV9lEFcoJ+NxNsmbijy tQ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; fh=95PAdNcXqdHDTaoqemM4Q9DG3vXDbbUtZQPB3d3GPtk=; b=lv276bLv5+OnelBy3Qbp7E7l16pcTWm/Iac1pkpmvqUqoJG4W1qDVXyZFO3h4x67fk bHmDm08bznB+CSkPj0sgq5VU7c9tExWV2a12rAsqBN5K0DURlriByhlwQwjVUYGr18vE Tj7tZ2h8/Ksn2+PcK4L7J7RRoApW8jabhqCE+Bi1Xm5c7QTUfPkAqgwZWYvH7/ZyRLjq ok25Cl7mMf5Q/4r1Ts/T32fTWiK5dh5Sz3et8ZOMDBZ6elEqKUmoE4witSo4xDSYafeM EB+acJoSPGvghnbNRe47k09b/MoUCTArhqcNRomEwG0BZe3a/rB/y/MiPGtOdS6wV2GM b3BA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g0+uU6/C"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873fde82si122124631cf.402.2025.01.14.03.48.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jan 2025 03:48:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g0+uU6/C"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOX-0004e1-4E; Tue, 14 Jan 2025 06:47:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfNr-0004L2-WD for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:00 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNp-0006ee-8C for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436ce2ab251so38450865e9.1 for ; Tue, 14 Jan 2025 03:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855216; x=1737460016; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=g0+uU6/CsHp+Erbqo2m0MsAPZNeqvyo9Cze+ORQGjSyiywmiYrASK1Jag9HmT4qeAZ 6E00O4dGBcYKUIbptYpKIjYLo7xN9EnVYCDHbFMgye2cyCZz3hC76WcmOFo9A8tb8c67 4Q2eBTBL9b5XiuNkicA9cn5kARblutcHkWU8Ge+KKJFniVD2vT6oPkIAO94vrYPJbHxP KJaj4jm/Mpz9oEhFk7gwN4dfGNOI850DhGnryqT4WwV8ca0Np9O7nhREJiGoQ5JbB+Ys M6rjlHb320hg1fsDX6w4aidmr5LKFlSs/GizYWHr4KX1yVUGX2L6jRdJjHhrN3Qasqdn xuiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855216; x=1737460016; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=aVe/C8rFYY/qXXYIIFxnlsWESEckYynJxxpcb7z3ueiAZlKqORrAoqT63h+vg4hs32 Jo7XY9DJXNBooavFZ28jKGcCVYzks/dQdifD7LdMu3J4hl9Z60e9/S/VKwfoNivoq2Iu jQ0lkC40ui7mS4K2Iq+I76J9lIv2pqDAGRwjyreEK2x/xkPYFqrgub8rxNNaWZuBkF4d Q2PJpgfWhMjC+Rh9F9jiLO6W1D5w0NWTEtD21KNZS6GeomjwOw8P1JaIU6v5FexMzuEy MDqrkq7kz8fKLHmV+/AhQTgPJJWS3kUjkOP2AG5k9YaFpV60RxUpNOEreO4w0AggF71e aH2A== X-Gm-Message-State: AOJu0YxQBZfJFBXUBDHac5LvG9rRoZbMiAjkDXvHdjg3KjlmY6bhuOzi QmgzrNOyjOozQeQf0E3B4MAUzL25vmS5GOtMTrCxfk0g6SQyiw1SmTBmfx3WxAo= X-Gm-Gg: ASbGncse1GJNrat+lTetKndnN+zGxevvDwqFH0Xr+xEtDt5TXVnknbG0BzlzbQfidN7 6yoIkrNxQDqKY9VFS9H1cj4ut8tazL6ZVB8rZWmex6PQXx14sCCVBktDm3/ci8hj3BalObl7gFO tM7DWGFYk0eF2ULeAFZbKdWqouWHaEodABiv6RAp5LAl9Z+4pwIEW3S9n3/9GyiaB/onDVeOH8f 7DevRnPsN3axOZ/teqMvnYkIfQeaTtHFaX6siLXvo3V0styZveJSy0= X-Received: by 2002:a05:600c:1c98:b0:436:1b7a:c0b4 with SMTP id 5b1f17b1804b1-436e2677c65mr177990345e9.1.1736855215735; Tue, 14 Jan 2025 03:46:55 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e92f60sm207387445e9.40.2025.01.14.03.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EAD665F935; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , Stefano Garzarella , "Michael S . Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH v2 23/37] win32: remove usage of attribute gcc_struct Date: Tue, 14 Jan 2025 11:38:07 +0000 Message-Id: <20250114113821.768750-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier This attribute is not recognized by clang. An investigation has been performed to ensure this attribute has no effect on layout of structures we use in QEMU [1], so it's safe to remove now. In the future, we'll forbid introducing new bitfields in packed struct, as they are the one potentially impacted by this change. [1] https://lore.kernel.org/qemu-devel/66c346de-7e20-4831-b3eb-1cda83240af9@linaro.org/ Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Acked-by: Stefano Garzarella Signed-off-by: Pierrick Bouvier Acked-by: Michael S. Tsirkin Tested-by: Stefan Weil Tested-by: Philippe Mathieu-Daudé Message-Id: <20250110203401.178532-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- meson.build | 5 ----- include/qemu/compiler.h | 7 +------ scripts/cocci-macro-file.h | 6 +----- subprojects/libvhost-user/libvhost-user.h | 6 +----- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index d06f59095c..da279cc112 100644 --- a/meson.build +++ b/meson.build @@ -377,11 +377,6 @@ elif host_os == 'sunos' qemu_common_flags += '-D__EXTENSIONS__' elif host_os == 'haiku' qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC'] -elif host_os == 'windows' - if not compiler.compiles('struct x { int y; } __attribute__((gcc_struct));', - args: '-Werror') - error('Your compiler does not support __attribute__((gcc_struct)) - please use GCC instead of Clang') - endif endif # Choose instruction set (currently x86-only) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c06954ccb4..d904408e5e 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -22,12 +22,7 @@ #define QEMU_EXTERN_C extern #endif -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif - +#define QEMU_PACKED __attribute__((packed)) #define QEMU_ALIGNED(X) __attribute__((aligned(X))) #ifndef glue diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index d247a5086e..c64831d540 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -23,11 +23,7 @@ #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define G_GNUC_NULL_TERMINATED __attribute__((sentinel)) -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif +#define QEMU_PACKED __attribute__((packed)) #define cat(x,y) x ## y #define cat2(x,y) cat(x,y) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h index deb40e77b3..2ffc58c11b 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -186,11 +186,7 @@ typedef struct VhostUserShared { unsigned char uuid[UUID_LEN]; } VhostUserShared; -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define VU_PACKED __attribute__((gcc_struct, packed)) -#else -# define VU_PACKED __attribute__((packed)) -#endif +#define VU_PACKED __attribute__((packed)) typedef struct VhostUserMsg { int request;