From nobody Wed Apr 24 07:00:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1593251762; cv=none; d=zohomail.com; s=zohoarc; b=WEz+F61zfTOldpiSzpHfVCFS8wlGpOMzzu0zAmXFdBMrIPzI7Fu+O0zq2497GSXl9s1AIHatsOQtJzq9p1yr22hBlg9A621qNzGomjmVJrSIQiXygkiqJY/LRKWgLJjke/7YG7FKCUs/HLwvRnRfsestGN2OjTtdBYMvDK3Mo6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593251762; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=xjeUBoQCrN/DHWvdaE0IKA8sH/SoZ4DdwjG9sdN1ffY=; b=a9yI6RpQBroAc6XY3m3BiEEV4n9uwRoPiEjfdboubwmmJm8b9DunlLRewPySGnHhxNeOBRTSPJwcNtpeOcBvY7mk0TlsLjEus3XB2JfSf+MVfiR/oLFYaDBodpIIxnSVNpdFF0f0bxY50FaSljNAGN4E9NwnyRUQJEAwwhNkJF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1593251762659729.4497388447326; Sat, 27 Jun 2020 02:56:02 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7Yi-00071y-OO; Sat, 27 Jun 2020 09:55:40 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7Yh-00071t-Uf for xen-devel@lists.xenproject.org; Sat, 27 Jun 2020 09:55:39 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5a612ae6-b85c-11ea-8353-12813bfff9fa; Sat, 27 Jun 2020 09:55:38 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7Yf-0005pP-MZ; Sat, 27 Jun 2020 09:55:37 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jp7Yf-00017R-Dg; Sat, 27 Jun 2020 09:55:37 +0000 X-Inumbo-ID: 5a612ae6-b85c-11ea-8353-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xjeUBoQCrN/DHWvdaE0IKA8sH/SoZ4DdwjG9sdN1ffY=; b=F8a+xmakUaJqm0pG+6tDocgp3j h4DDInQ9XU5v+VKtqBc6Lr0O9g/h5HLTpbUlXhyxXSfogJ51+vTfN1nK3eoXq0ubrXGK8+pQXIvzA SZIIWUJVgCKlhzYqqm25Iqsw/IdzuY8i+I8voW/jxZgzQatwZITHrktmXdjLIaAV9Kpw=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference Date: Sat, 27 Jun 2020 10:55:32 +0100 Message-Id: <20200627095533.14145-2-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200627095533.14145-1-julien@xen.org> References: <20200627095533.14145-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Julien Grall , paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall A recent thread on xen-devel [1] pointed out that the header was provided as a reference for the specification. Unfortunately, this was never written down in xen.git so for an external user (or a reviewer) it is not clear whether the spec or the header shoudl be followed when there is a conflict. To avoid more confusion, a paragraph is added at the top of the header to clearly spell out it is only provided for reference. [1] https://lore.kernel.org/xen-devel/alpine.DEB.2.21.2006151343430.9074@ss= tabellini-ThinkPad-T480s/ Signed-off-by: Julien Grall Reviewed-by: Juergen Gross --- Changes in v4: - New patch --- xen/include/public/io/pvcalls.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcall= s.h index cb8171275c13..905880735dda 100644 --- a/xen/include/public/io/pvcalls.h +++ b/xen/include/public/io/pvcalls.h @@ -3,6 +3,9 @@ * * Refer to docs/misc/pvcalls.markdown for the specification * + * The header is provided as a C reference for the specification. In + * case of conflict, the specification is authoritative. + * * Permission is hereby granted, free of charge, to any person obtaining a= copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation = the --=20 2.17.1 From nobody Wed Apr 24 07:00:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1593251761; cv=none; d=zohomail.com; s=zohoarc; b=jELZAp+zoju8nFkbGKgjz/kywhaQLzR9FfntmYKsC8bB/1Ixjkn/Y668HsFQ/ECJ4TssI4LabBxA8lG8pww3F1feGwsi8lu7RLzuQwAtEbV5WhzpEcPJ2Cu4YznFP6HoHodIyGxWLpqF90BPv2pDZpVDNhBZA3n3u1UdtiMIKgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593251761; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ToWAhOBizK7AhT+LuF1MG0+z4Ou3oX83o1ykrw66Sw8=; b=QzoBHY0x/H3f0qazfPtGg6XFF491a60S/kglS0YAB9G+eIBU6xf0CYk+Nk70UeeR357YLjKuMQjBRzJg8Q/odsBnUYZoqqkQJ1zVsxRzuj92eSCvLPvn/+FJF7hgYOI9tqkdw9KTUkuiCXjwyVtZwCo+3+9OpyRutScFz3F9sHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1593251761706998.0786250222853; Sat, 27 Jun 2020 02:56:01 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7Yn-00072Q-06; Sat, 27 Jun 2020 09:55:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7Yl-00071i-7W for xen-devel@lists.xenproject.org; Sat, 27 Jun 2020 09:55:43 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5b952b42-b85c-11ea-bca7-bc764e2007e4; Sat, 27 Jun 2020 09:55:40 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7Yh-0005pb-EW; Sat, 27 Jun 2020 09:55:39 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jp7Yh-00017R-55; Sat, 27 Jun 2020 09:55:39 +0000 X-Inumbo-ID: 5b952b42-b85c-11ea-bca7-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ToWAhOBizK7AhT+LuF1MG0+z4Ou3oX83o1ykrw66Sw8=; b=aFNlYAfDwg9xx6gyCp3FpqEA1c /BkSNm2k9jy+KiZ58TVbt8HJ43i2+l8Ktp14blO3XovY8HAPgKRdE+usRG0n5gChvHCuaY3RdxpJw xmOiW8j+/LhmrmYkyzumzSrSMYfE9flTbAm9+1/3E5F3bcDfhUKhsOoyRaLF2tzpgBmw=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Date: Sat, 27 Jun 2020 10:55:33 +0100 Message-Id: <20200627095533.14145-3-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200627095533.14145-1-julien@xen.org> References: <20200627095533.14145-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , paul@xen.org, Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall The specification of pvcalls suggests there is padding for 32-bit x86 at the end of most the structure. However, they are not described in in the public header. Because of that all the structures would be 32-bit aligned and not 64-bit aligned for 32-bit x86. For all the other architectures supported (Arm and 64-bit x86), the structure are aligned to 64-bit because they contain uint64_t field. Therefore all the structures contain implicit padding. Given the specification is authoriitative, the padding will the same for the all architectures. The potential breakage of compatibility is ought to be fine as pvcalls is still a tech preview. As an aside, the padding sadly cannot be mandated to be 0 as they are already present. So it is not going to be possible to use the padding for extending a command in the future. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini Reviewed-by: Juergen Gross Reviewed-by: Stefano Stabellini --- This wants to be included in Xen 4.14 to avoid more users to rely on wrong public headers. Changes in v4: - Revert back to v1 for the patch and expand the commit message Changes in v3: - Use __i386__ rather than CONFIG_X86_32 Changes in v2: - It is not possible to use the same padding for 32-bit x86 and all the other supported architectures. --- docs/misc/pvcalls.pandoc | 8 -------- xen/include/public/io/pvcalls.h | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/misc/pvcalls.pandoc b/docs/misc/pvcalls.pandoc index 665dad556c39..971cd8f4b122 100644 --- a/docs/misc/pvcalls.pandoc +++ b/docs/misc/pvcalls.pandoc @@ -246,9 +246,7 @@ The format is defined as follows: uint32_t domain; uint32_t type; uint32_t protocol; - #ifdef CONFIG_X86_32 uint8_t pad[4]; - #endif } socket; struct xen_pvcalls_connect { uint64_t id; @@ -257,16 +255,12 @@ The format is defined as follows: uint32_t flags; grant_ref_t ref; uint32_t evtchn; - #ifdef CONFIG_X86_32 uint8_t pad[4]; - #endif } connect; struct xen_pvcalls_release { uint64_t id; uint8_t reuse; - #ifdef CONFIG_X86_32 uint8_t pad[7]; - #endif } release; struct xen_pvcalls_bind { uint64_t id; @@ -276,9 +270,7 @@ The format is defined as follows: struct xen_pvcalls_listen { uint64_t id; uint32_t backlog; - #ifdef CONFIG_X86_32 uint8_t pad[4]; - #endif } listen; struct xen_pvcalls_accept { uint64_t id; diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcall= s.h index 905880735dda..6da6b5533a10 100644 --- a/xen/include/public/io/pvcalls.h +++ b/xen/include/public/io/pvcalls.h @@ -68,6 +68,7 @@ struct xen_pvcalls_request { uint32_t domain; uint32_t type; uint32_t protocol; + uint8_t pad[4]; } socket; struct xen_pvcalls_connect { uint64_t id; @@ -76,10 +77,12 @@ struct xen_pvcalls_request { uint32_t flags; grant_ref_t ref; uint32_t evtchn; + uint8_t pad[4]; } connect; struct xen_pvcalls_release { uint64_t id; uint8_t reuse; + uint8_t pad[7]; } release; struct xen_pvcalls_bind { uint64_t id; @@ -89,6 +92,7 @@ struct xen_pvcalls_request { struct xen_pvcalls_listen { uint64_t id; uint32_t backlog; + uint8_t pad[4]; } listen; struct xen_pvcalls_accept { uint64_t id; --=20 2.17.1