From patchwork Thu Jan 25 23:20:39 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: 192334 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp324359dyb; Thu, 25 Jan 2024 15:21:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCo9elQ9d4q78Ch2u14LUWorh3Wr3+OkDppoMvoG2VRol5DLMeJmvJjNqEw3FBmo1tqnoE X-Received: by 2002:a92:d585:0:b0:361:b219:6e83 with SMTP id a5-20020a92d585000000b00361b2196e83mr531244iln.10.1706224886873; Thu, 25 Jan 2024 15:21:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706224886; cv=pass; d=google.com; s=arc-20160816; b=eZjcYfRG2mcE3msGrZJAiNaMFaks/fDv3dqLqPxoTMR9RHd0lctL54pdXcphAXx3gK T8KCL/oajYNYyRnYbHyNnwGhPZ/LsEtcwEqfu9L++bdvoQbuv/OvCJODR0jGkx+z28M5 QTdDAMwT3ahCU5QyN51UVH+3Fj8FZ1aKSdZ6EnIkeY8W5ZMNKRzir1RcmigfADUZzCm2 XDtnc6qKLQhJcNrmY5TA80/lztOQvD5PcyRZ5mhe/qSMMc4l/YFgbGz7urPWipiJf+kC KHDBZO4a8AACky2f6igowdIPLCznp5UJWI7HIsu1fLyyn0g5loy3O/MZjkdGgnOcmgNk F+5g== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=VE5w+HC8jV7V9FNo2jyl1wXGwtFlrnHwzxUjH7uytd8=; fh=MlvA4EHnq8P2vK4O4hYKV4f9rT019nzyyK3WxN4Onr8=; b=Y56ry2dhYr02oY+ovZF8l6eTG0Kjo5yyjeBqrugeYzI2qz9f5ZdpnHni8q3KAAxuno PZWvIMzZm/7qIwxh7iS3BiYS3lem9iDAwSPdjcfS1+diJpQfE69npKzKe6aL5VVmGupM mL5/T3XVpEwrLqIV15fdgOCwOA1OqX04STokt9DoJKS+NSch+XJKlbd679YXztfgmCRw Wbni2VI4+8LZtdmmvVPLAU38Dw70o5Rygj54M74pHtHysO+ehRvLD60lRbmxNrvYZzKZ s2G4UbbPGwl7KIp9Z8LK703s4fMybaTqxA8XnxVESZjxcKNKWEQs1lN02i/Ez4+zzJ5G 62sA== 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-39409-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39409-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 o9-20020a639a09000000b005ce071556e6si42998pge.874.2024.01.25.15.21.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 15:21:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39409-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-39409-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39409-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 8AFCD292A9D for ; Thu, 25 Jan 2024 23:21:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD92217585; Thu, 25 Jan 2024 23:21:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B39FC12E46; Thu, 25 Jan 2024 23:20:58 +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=1706224861; cv=none; b=TwnhZ06ldPL7zEnhddMaVeoMIkp9dC1irGdwvRnNhPcRLzSEtbZwNxeeriZ/G+s9LyJSRRzMXZOEbYVoq0Ltba1RXjcpoemiRu78ZCq6wiowoosLhz4j6UG56f+vyGAsMimvwgsZw6BtW3Z4CqAwUppdQ3/654Ggd8NMTbp/EFQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706224861; c=relaxed/simple; bh=X3hblOpAlzSee7dtBXWTEp8eOvWcRUuPAZEtXlPckKQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JfOWBv4WUFdS3VXvAIQSHqDHwE+06CuCbp7gIA8nFL2ehFvsKDETMLK2BKrX8NwPAUOvaf8ZDcGyBU1gDW7PpIgT+pj3fz86unWG1aNmQAMUDzkR2Tnd09mtAMEX2yo5hiUYXr2zHSuccS0k+xADnVmOslGwHx0JkW+1VnRNFrU= 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 3A9261FB; Thu, 25 Jan 2024 15:21: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 BFEF03F5A1; Thu, 25 Jan 2024 15:20:56 -0800 (PST) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org, mst@redhat.com Cc: kvm@vger.kernel.org, Suzuki K Poulose , Feng Liu , Yishai Hadas , Alex Williamson , Jean-Philippe Brucker Subject: [PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h Date: Thu, 25 Jan 2024 23:20:39 +0000 Message-Id: <20240125232039.913606-1-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240125181227-mutt-send-email-mst@kernel.org> References: <20240125181227-mutt-send-email-mst@kernel.org> 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: 1789106466982585961 X-GMAIL-MSGID: 1789106466982585961 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];