From patchwork Thu Feb 29 16:32:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 208412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp526953dyb; Thu, 29 Feb 2024 08:42:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwMKF3tSiGbd+GVu5L8ly8XwK9mNt7nLtmdzDOw9xPr7rX0UfVvT61mryxmx2xevnVaiJft2Inx0EPfNUuaPMJdnyZYQ== X-Google-Smtp-Source: AGHT+IEDGTjiIwzrhHt+z+dl7S02M00ymRduhPqVDfl39HvSFc/yQK0CTxNTZ61MA9cgZs12xU16 X-Received: by 2002:a05:6a00:814:b0:6e5:872:5a03 with SMTP id m20-20020a056a00081400b006e508725a03mr3076378pfk.0.1709224958072; Thu, 29 Feb 2024 08:42:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709224958; cv=pass; d=google.com; s=arc-20160816; b=NcvEBES7Fv5C13lDW4eDzz2lNH8isowGodt3dcmRY1CafZjHB3xiaoYM8EyAdxvnoE Y6eOfLRShKiaUFABOKz3q2KcFprakwcx2V3bQyA1758twS8C5xJIXJyE9breh3QAbN3z vmJLu9cRjMmDst/HdAryimPU7g5beXoNLQxK/5pscuJSppjQHrrG09FET7HQlKEXMBa2 Vls6oFFeySBRQhZt7V71s/rs/ZWfPp0MhWSs9cnJJgG0cjz+EnZfiKdUpwQB9xlyNH+p pOZfEQv4ZvvRf9xoy5XfVQ43Bc/sxfsh6GW/LXblnj32yAQReH8QpBRznZ39OQtEjURH A95w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=awX93XYYOxlTZwf1q0pv/ZFKofFLg8xBniH5XkUNA10=; fh=7XSIr8Xjulxf+MSUMiv40M4y1vmhjcWAs45vsN3OKnk=; b=EQImZ28yKCnRipndjPx4PjGpnFezM6sRrKvcFUhVNk0dK/jY/dllOXJGoM9BvZa6VC B7CAMKZqDmLOkKnaMt21bPe8+UGNPRqmkbtqosh2BNIggY1yMWmyoDeUMJdT/63f4E/C nik6lgjunj2mT8uJUEWJo+bk8dp1GiFTP5kwvq4aYetk3oyWQTJKlD/XAK5At3Gu89Vl p63ebYrV0tyR08R5QC+ULAB1tXWY3bnUtl7Nj2KGkW1FGcX8JKP7Er9uZ6o6mkshnI6G czQWdOREsZfT88fUTKq1B91BNei7q4N7qPCz42bHIBIy5pVcrfr6H2QegMbh4D3PIEq3 t6LQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-87093-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87093-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u29-20020a056a00099d00b006e56e5abc01si1584437pfg.355.2024.02.29.08.42.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 08:42:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87093-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-87093-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87093-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 47C5F28C83E for ; Thu, 29 Feb 2024 16:34:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 880CA4AED4; Thu, 29 Feb 2024 16:33:08 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B843416063D for ; Thu, 29 Feb 2024 16:33:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709224387; cv=none; b=b2Y7EqWIzkFlEfiMcULajV2FqaYY9UfHGR0yyvInD7Dq12jC+fjx+dax2853Zi19PeQkLDwKutCyERzWXs4K7bPx1MWB2sdPsoI+gC5Mp5GnyXWQ7eDEW6oyVxL7xJjCmH+j1pTwy1bSJPVnaHe+DKM+Schizh8ieLyWg/ONEp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709224387; c=relaxed/simple; bh=sePhUcPjkcFqzWnN7R/fomNhNX1xSNAJjz1E157zh24=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pdLbX5jgTHN9+9qSj1URysvlsV05ablJ2K60BW7BvoJ6tGICSC9MgYJ5N4kXMbVSfeYZpsSn5t/a4jEx+1IQ4n4w05ClmTmyxkq9wsYLBEC2PDIQedIu5/ypvSEEXrPxjsHb0M1RdyLqMMd93Upzz+eI8xzszzAFlUdcpfheyw0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA4B21FB; Thu, 29 Feb 2024 08:33:42 -0800 (PST) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A11FE3F6C4; Thu, 29 Feb 2024 08:33:02 -0800 (PST) From: Suzuki K Poulose To: "Michael S . Tsirkin" Cc: Jason Wang , Alex Williamson , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, Suzuki K Poulose , Feng Liu , Yishai Hadas , Jean-Philippe Brucker Subject: [RESEND PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h: Date: Thu, 29 Feb 2024 16:32:54 +0000 Message-Id: <20240229163254.236017-1-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792252269979909558 X-GMAIL-MSGID: 1792252269979909558 Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function") added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers build failures in the consumer userspace applications without proper "definition" of __packed (e.g., kvmtool build fails). Moreover, the structures are already packed well, and doesn't need explicit packing, similar to the rest of the structures in all virtio_* headers. Remove the __packed attribute. Fixes: 92792ac752aa ("virtio-pci: Introduce admin command sending function") Cc: Feng Liu Cc: Michael S. Tsirkin Cc: Yishai Hadas Cc: Alex Williamson Cc: Jean-Philippe Brucker Reviewed-by: Jean-Philippe Brucker Acked-by: Michael S. Tsirkin Signed-off-by: Suzuki K Poulose --- Changes since v1: - Fix description for the "Fixes" tag format - Collect Tags from Jean-Philippe and Michael --- include/uapi/linux/virtio_pci.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index ef3810dee7ef..a8208492e822 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h @@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap { #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5 #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6 -struct __packed virtio_admin_cmd_hdr { +struct virtio_admin_cmd_hdr { __le16 opcode; /* * 1 - SR-IOV @@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr { __le64 group_member_id; }; -struct __packed virtio_admin_cmd_status { +struct virtio_admin_cmd_status { __le16 status; __le16 status_qualifier; /* Unused, reserved for future extensions. */ __u8 reserved2[4]; }; -struct __packed virtio_admin_cmd_legacy_wr_data { +struct virtio_admin_cmd_legacy_wr_data { __u8 offset; /* Starting offset of the register(s) to write. */ __u8 reserved[7]; __u8 registers[]; }; -struct __packed virtio_admin_cmd_legacy_rd_data { +struct virtio_admin_cmd_legacy_rd_data { __u8 offset; /* Starting offset of the register(s) to read. */ }; @@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data { #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4 -struct __packed virtio_admin_cmd_notify_info_data { +struct virtio_admin_cmd_notify_info_data { __u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */ __u8 bar; /* BAR of the member or the owner device */ __u8 padding[6];