From nobody Tue Apr 16 10:19:39 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=1596131574; cv=none; d=zohomail.com; s=zohoarc; b=Hgqp87SZyA1C9Za27EkuCnj6ykWiC6+wxd6PrKz4RjiuHhWAtfUG/mRfbUwek1qvdYTqZhBHM7LyuXOo0BBaKNHwhnfQVID2LsaPryfbQZhmW+FAEO8FvdijIW4F4sg0/uKbj3MtwqzSBDRV+wexZpn1fx5qU72dKVkt2sur09M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131574; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ShgvcGkxdE4OnoXDwV1go3UlHBZgZS/RIoOwLBZvFGA=; b=Ag5UpNYV0eOBkj2CbN7RnHJXjb/WJhWxVoV7S036341koTuJTqCeY/S6H4oOu89kA18/2ogElolvJKbiqN+JlABVyGsDExR/bl6lOK47tg1bnK8oAK0iMvoDzn6Z6Fu9v6xRGYM/2VKI+JhBT5WtTAU16AthPoQI5WM6vygPBNo= 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 1596131574057870.7991797834611; Thu, 30 Jul 2020 10:52:54 -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 1k1Cj6-00089U-UP; Thu, 30 Jul 2020 17:52:20 +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 1k1Cj6-00089P-4Z for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:20 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6968361a-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:19 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Cj4-000798-EE; Thu, 30 Jul 2020 17:52:18 +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 1k1Cj4-0004nV-43; Thu, 30 Jul 2020 17:52:18 +0000 X-Inumbo-ID: 6968361a-d28d-11ea-aaff-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=ShgvcGkxdE4OnoXDwV1go3UlHBZgZS/RIoOwLBZvFGA=; b=3yYE6hNH7/Yi413rAoLlj7WaZE 6WFLMIUCKYMPIcDQBdWAMgxD7pQRMwgummE0EsQYZVId82ittNXnFIprH5AkaaZbwjMVSIiGUIwdD ekNZ+2dAKDU674SKp5IuopBTRdjLmw+1QV9RBsL+JB0CeQHlsgSokI64JpVrN3ttYP4w=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 1/6] xen/arm: kernel: Re-order the includes Date: Thu, 30 Jul 2020 18:52:01 +0100 Message-Id: <20200730175213.30679-2-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , julien@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 We usually have xen/ includes first and then asm/. They are also ordered alphabetically among themselves. Signed-off-by: Julien Grall --- xen/arch/arm/kernel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 8eff0748367d..f95fa392af44 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -3,20 +3,20 @@ * * Copyright (C) 2011 Citrix Systems, Inc. */ +#include #include +#include #include #include +#include #include -#include #include -#include -#include -#include -#include #include =20 +#include #include #include +#include =20 #define UIMAGE_MAGIC 0x27051956 #define UIMAGE_NMLEN 32 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131576; cv=none; d=zohomail.com; s=zohoarc; b=gKEPSQ2cK5Abeq6c9e3sH9Zmbnhqwt0GJrc/TtlQ/UMv3VUolvj4+wOsS8DxpPw3JmksjqoCSdm2OA0cwwQwA8IxtoiXzAUksXHgWX+6nPvcT6WHqyqu+YANngUWF7mw7PGzlF7X98eZ5+YRSvK0Dqy67AN9Ner6RdD0sBOtTRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131576; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=YMp6yPrLfWKrTtFlQljFXWPvFCrq7jJMWfWyLnEct0g=; b=CDzlhZCFg0DsNiGSsRYugq+E/fZ8La40bEWIeqxLWKye9x2n1NgJyNANDtTLTSma3eqr6f+oGNW2S/wS10N/kYVON04soDZi530baXYpB53i3il/o7P8Vo1IQ3HL2UO/RCBVO7Lyo92XL+bu5ZaJDDB/y83K2fJqN/tijuFFaGo= 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 1596131576569316.81828447345265; Thu, 30 Jul 2020 10:52:56 -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 1k1CjH-0008AQ-OH; Thu, 30 Jul 2020 17:52:31 +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 1k1CjF-00089P-WB for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:30 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6a6afc82-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:20 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Cj6-00079I-2x; Thu, 30 Jul 2020 17:52:20 +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 1k1Cj5-0004nV-PA; Thu, 30 Jul 2020 17:52:20 +0000 X-Inumbo-ID: 6a6afc82-d28d-11ea-aaff-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=YMp6yPrLfWKrTtFlQljFXWPvFCrq7jJMWfWyLnEct0g=; b=dFsiwvxroEX580uHUCUg7Aoyyg ViSgZYMP4Yd22r4r5I/adNrFQV99Z7R7hPdhrPN3XJi3b1PXMdebgY2LMz54V5M4fZpKqTmAsQ3Fd btY1QUvSzlC2TdVqy6APhnbrGt8BP+f095I/dfQzVmeeG+vMOZCS29arIJB06MLpTDkc=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 1/7] xen/guest_access: Add emacs magics Date: Thu, 30 Jul 2020 18:52:02 +0100 Message-Id: <20200730175213.30679-3-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Stefano Stabellini , julien@xen.org, Wei Liu , Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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 Add emacs magics for xen/guest_access.h and asm-x86/guest_access.h. Signed-off-by: Julien Grall Acked-by: Jan Beulich --- Changes in v2: - Remove the word "missing" --- xen/include/asm-x86/guest_access.h | 8 ++++++++ xen/include/xen/guest_access.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/xen/include/asm-x86/guest_access.h b/xen/include/asm-x86/guest= _access.h index 2be3577bd340..3ffde205f6a1 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -160,3 +160,11 @@ }) =20 #endif /* __ASM_X86_GUEST_ACCESS_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index 09989df819ce..ef9aaa3efcfe 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -33,3 +33,11 @@ char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char)= u_buf, size_t size, size_t max_size); =20 #endif /* __XEN_GUEST_ACCESS_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131574; cv=none; d=zohomail.com; s=zohoarc; b=Dz3Al4dwQBcdXl439E6JNravZQb3g5d0hrfn5YHgK7B4DiF4YSJUOfGaGUU+ka6wu+DCz7MjJ09yFDn+zF/CQujStC/DLSFGcdcs8E/1Se0VsWKt7QKW1W76n4u6nyuwn8nrufkZDN9TDCC1wutecOmjqBfR9OrFpk5qbfrkLVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131574; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=wKQvWLwb3vbFbaN60ANqWtb/FsamZy4DJptrPdgq66M=; b=lK0JLVCfdVkCtshzO/MmAApif8BHlkm0X2eyaAiBOcbkC9BRiyi07fyqg0WveuQAEoPyuYJp+c6XS4u62g4vPRzpYwjNSOLjAslm/K4JQZQwVpxTT/WweFdpzrcvH93KMdY7PUAN1CLbV6XN9BlWsJeJX+YA3c6RTdh6RYGuZmA= 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 1596131574364465.60587651229696; Thu, 30 Jul 2020 10:52:54 -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 1k1CjM-0008Cl-Dz; Thu, 30 Jul 2020 17:52:36 +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 1k1CjL-00089P-06 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:35 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6aec02dc-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:21 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Cj7-00079P-3v; Thu, 30 Jul 2020 17:52:21 +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 1k1Cj6-0004nV-RI; Thu, 30 Jul 2020 17:52:21 +0000 X-Inumbo-ID: 6aec02dc-d28d-11ea-aaff-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=wKQvWLwb3vbFbaN60ANqWtb/FsamZy4DJptrPdgq66M=; b=RJJdGv2/Ln4j/f/bvPNc53qsTO HQgXPmfNqiP2RNI9xPcid5Nwq1t2LIFicZE29u1RrwzzyhMnBxuhj2Sv6QJnt792+AJTmKjJqWjJk khoysomvWkvhpCiIvb52VefNQ3UKNs6gBSO1Fydxt+1RYDy/z1E1fXP3OaiYWm3SgVSc=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 2/6] xen/arm: decode: Re-order the includes Date: Thu, 30 Jul 2020 18:52:03 +0100 Message-Id: <20200730175213.30679-4-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , julien@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 We usually have xen/ includes first and then asm/. They are also ordered alphabetically among themselves. Signed-off-by: Julien Grall --- xen/arch/arm/decode.c | 5 +++-- xen/arch/arm/kernel.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c index 8b1e15d11892..144793c8cea0 100644 --- a/xen/arch/arm/decode.c +++ b/xen/arch/arm/decode.c @@ -17,11 +17,12 @@ * GNU General Public License for more details. */ =20 -#include +#include #include +#include + #include #include -#include =20 #include "decode.h" =20 diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index f95fa392af44..032923853f2c 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include #include @@ -14,7 +15,6 @@ #include =20 #include -#include #include #include =20 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131577; cv=none; d=zohomail.com; s=zohoarc; b=C0gPIYPTfeXvSBAEXqMPAFVhDXpdlIclHWiSvEsGy0WabVYfDeLUh6WiFvEFu+3jKrasqj+NzoYlMsxvsI4H1kMC3z1mHBOyLSzQpnyxpEFHSLIZg8b3s2NVvEYTuiSLgKk9e8Ost5CBEsbFJwL0QdxTRv6B+Kkw0vAlzDN2Lqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131577; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ShgvcGkxdE4OnoXDwV1go3UlHBZgZS/RIoOwLBZvFGA=; b=bfXZD/EcurRPD2tFimiyAkbxxRGZzx8kKBcyROfR+9DLr2qwHrMe7fBwHHsFDA0W1cELHF+gJbJvyJnb4nB1vQFElhgRQoCGVZ82GgY+etWrAFAJYAvktSY9ItH0QonmUXw72DZKcg7IlqjAccP26tTmd2gW0lnH5lm8kPcgMYU= 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 1596131577065295.2410263961982; Thu, 30 Jul 2020 10:52:57 -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 1k1CjR-0008FV-P6; Thu, 30 Jul 2020 17:52:41 +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 1k1CjQ-00089P-07 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:40 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6b914058-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:22 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Cj8-00079Z-5l; Thu, 30 Jul 2020 17:52:22 +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 1k1Cj7-0004nV-TG; Thu, 30 Jul 2020 17:52:22 +0000 X-Inumbo-ID: 6b914058-d28d-11ea-aaff-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=ShgvcGkxdE4OnoXDwV1go3UlHBZgZS/RIoOwLBZvFGA=; b=RDzByCdshJW1Er+0IgfzylPy5n 4CksJB+yJgm3fDSmBtpzBWNIMHaGppj0H2NfFZix3KvYNmR6ZYEPN9zAtvNu6q3X1PCPFIsBiVFYZ lZtf4jomHPAu6PuhOslzMMPbRPMF2aB7iN9AcMIoJ8+4zGUYHyKTEFoy9rQNhYuOZzFQ=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 2/7] xen/arm: kernel: Re-order the includes Date: Thu, 30 Jul 2020 18:52:04 +0100 Message-Id: <20200730175213.30679-5-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , julien@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 We usually have xen/ includes first and then asm/. They are also ordered alphabetically among themselves. Signed-off-by: Julien Grall --- xen/arch/arm/kernel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 8eff0748367d..f95fa392af44 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -3,20 +3,20 @@ * * Copyright (C) 2011 Citrix Systems, Inc. */ +#include #include +#include #include #include +#include #include -#include #include -#include -#include -#include -#include #include =20 +#include #include #include +#include =20 #define UIMAGE_MAGIC 0x27051956 #define UIMAGE_NMLEN 32 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131584; cv=none; d=zohomail.com; s=zohoarc; b=Uvfzti/N6k/SLBJAoTm2O5QN7tRddLnRapsKofKaKbz483fBRPlveK8xbmIoUezMPMyMYyJfkjAW5oCLzq8lm489HCXHyYCfOL4po6PewXPdY8efaq27QTPayqTKuztY74JehP730slC6U1nmhh6+Kf+p5uvlb/dsRrHEHzQNcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131584; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=wKQvWLwb3vbFbaN60ANqWtb/FsamZy4DJptrPdgq66M=; b=boUXkjdW3yBOfP+AhX98AQxvvKEvfjLcft+kNEWatlt7zed6lghMujscbpuB9jah8TpfZj3nWjYpBAWifJXdgmnFbxNbey9fvrNHS/zSleNC5zvckp+WIIBowW9xLAn+n2uE5GdcEwRWZnLQOHGEUoxZoBFN9L2iFcxsSsGXRuY= 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 1596131584005686.2081923198938; Thu, 30 Jul 2020 10:53:04 -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 1k1CjX-0008IA-30; Thu, 30 Jul 2020 17:52:47 +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 1k1CjV-00089P-0B for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:45 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6c29e948-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:23 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Cj9-00079i-8i; Thu, 30 Jul 2020 17:52:23 +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 1k1Cj8-0004nV-VM; Thu, 30 Jul 2020 17:52:23 +0000 X-Inumbo-ID: 6c29e948-d28d-11ea-aaff-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=wKQvWLwb3vbFbaN60ANqWtb/FsamZy4DJptrPdgq66M=; b=QYgK3JxNc9pNbpXnViLPgxcRRN Yn79mzTi/xICc7L3eS5nahFQ4D0f8WDxm/mem2/w/kMTMhOOw8rtCEl4wfCAPwHn1+q8akaJfaN6e 5F/rVQoytrqMNikKVXQ0lenWUlZXQkfBStk0lPQYlD0lth7khFY2iYvLs7uXdU2lB7bk=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 3/7] xen/arm: decode: Re-order the includes Date: Thu, 30 Jul 2020 18:52:05 +0100 Message-Id: <20200730175213.30679-6-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , julien@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 We usually have xen/ includes first and then asm/. They are also ordered alphabetically among themselves. Signed-off-by: Julien Grall --- xen/arch/arm/decode.c | 5 +++-- xen/arch/arm/kernel.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c index 8b1e15d11892..144793c8cea0 100644 --- a/xen/arch/arm/decode.c +++ b/xen/arch/arm/decode.c @@ -17,11 +17,12 @@ * GNU General Public License for more details. */ =20 -#include +#include #include +#include + #include #include -#include =20 #include "decode.h" =20 diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index f95fa392af44..032923853f2c 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include #include @@ -14,7 +15,6 @@ #include =20 #include -#include #include #include =20 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131573; cv=none; d=zohomail.com; s=zohoarc; b=D4jEkMzCBY1B9tMIAe9RLRdbhOyQphcnWZ/Y2py5wpSoQ1Kd7O5SGHU/zzkX16waD/ktiPEq1gvrb+aWsJhIN9UvLSGTq0f5meiaM4HKCvc9IpgxTxUsV5t8HR/1Pbca0E1S9VfkCVsfkLmQmjJv/PBYYCxLQ/sAH4ASexEYTlA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131573; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=uz1f4JaSlPa4wvD4/wRGUINT1oVECe/gDerhHtYEvBE=; b=UjVNiWXWlIn5F6rhfKYT/2wkeZolfu7IiYL6MemzH0fIuBQkZrzIutx0/7XV+Xt6DlZFL8kzVYcCzXLbKzDoO75bn6PzFmqJdH5dB1R271Uf7kfBwW5dTfOD5aTL4KzxHXLwagoHWvs3PfRhy1vl5QZT2bXdnCOZp0fFTdg7LuE= 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 1596131573410544.2657050873759; Thu, 30 Jul 2020 10:52:53 -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 1k1CjC-00089v-FR; Thu, 30 Jul 2020 17:52:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1CjB-00089g-G1 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:25 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6cd457a2-d28d-11ea-8db0-bc764e2007e4; Thu, 30 Jul 2020 17:52:24 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1CjA-00079q-9f; Thu, 30 Jul 2020 17:52:24 +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 1k1CjA-0004nV-14; Thu, 30 Jul 2020 17:52:24 +0000 X-Inumbo-ID: 6cd457a2-d28d-11ea-8db0-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=uz1f4JaSlPa4wvD4/wRGUINT1oVECe/gDerhHtYEvBE=; b=Sy5oj9eXYQSRViI4imhGOKOsMe cW0inVI1B0gMPiQDKoenLOTJpmE8qI1Qn1b9bdy3MGRZJG9HLSQynX7eLWlHBhOZJXXzfaJRRql8V ViqP1HhNRcTuGQ5GsUVqrTxQUHeQl1vzCqdP2QQUaRHtGIbYVzoVwW76el4kS8udv1Yo=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 3/6] xen/arm: guestcopy: Re-order the includes Date: Thu, 30 Jul 2020 18:52:06 +0100 Message-Id: <20200730175213.30679-7-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , julien@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 We usually have xen/ includes first and then asm/. They are also ordered alphabetically among themselves. Signed-off-by: Julien Grall --- xen/arch/arm/guestcopy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index 7a0f3e9d5fc6..c8023e2bca5d 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -1,7 +1,8 @@ -#include #include +#include #include #include + #include #include =20 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131586; cv=none; d=zohomail.com; s=zohoarc; b=gvQB/86DiDRPQWPVC6lHsMpKUQpEP/o21+Nt4ZdtdtTWAf7PJRkCcNmdarFtSsw41LVs6r//OT4tHcwAoN6H0kRogTA8xzCGtSxD9jrvp32o0qvUNlBcygdxDqlG2GTxp70+ibr7kfm5zw8sOLDP0Mm2JU12mtoD3w1q1bDuiX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131586; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=uz1f4JaSlPa4wvD4/wRGUINT1oVECe/gDerhHtYEvBE=; b=KI+BhdVbBxpz8SosDkWGDuMiQhmZDb2lTDiolZL72VmGnTmejxPm3Hzt3o1qjCF5Hq4CTRp7zD3/AB2ejQQ0keMYh3j2pEmZ63ybDSeouX1NS7TjO0rmA6DlIORJylcjEf7knr/KmVHnrYySU6cRru9umJReOIOFTgkIL7wWecE= 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 1596131586050325.70640700274794; Thu, 30 Jul 2020 10:53:06 -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 1k1Cja-0008KR-Gy; Thu, 30 Jul 2020 17:52:50 +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 1k1Cja-00089P-0G for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:50 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6d683210-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:25 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1CjB-00079x-Bs; Thu, 30 Jul 2020 17:52:25 +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 1k1CjB-0004nV-38; Thu, 30 Jul 2020 17:52:25 +0000 X-Inumbo-ID: 6d683210-d28d-11ea-aaff-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=uz1f4JaSlPa4wvD4/wRGUINT1oVECe/gDerhHtYEvBE=; b=VkdeK6gKU2GAWLM4+0LNe9lRPY OzYChfIbjn6R+t7jQwgOiDCuQBLel0khAdojYu7+IKshY5lg5BDgTl3a4R2hlipRZFdi65yPnMTLC eWsxsdNO+PJ/SyC2/sgV6FtqOuawJCpcw1dTYfCYg9eOsXouqh4f61dyzla1BOLFgK/w=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 4/7] xen/arm: guestcopy: Re-order the includes Date: Thu, 30 Jul 2020 18:52:07 +0100 Message-Id: <20200730175213.30679-8-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , julien@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 We usually have xen/ includes first and then asm/. They are also ordered alphabetically among themselves. Signed-off-by: Julien Grall --- xen/arch/arm/guestcopy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index 7a0f3e9d5fc6..c8023e2bca5d 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -1,7 +1,8 @@ -#include #include +#include #include #include + #include #include =20 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131597; cv=none; d=zohomail.com; s=zohoarc; b=ACfuvknP+vfkxneYOcnaFsnhjWplIIQTAapnYIs3HkDUWdR6gMD+oH2zarfZ2KtezVxy0Ld9YWUD3wCJZQ3zGrzW1yWcYnkDCcN06fEOGIGPtiR7wcsOUV3hScNF6T9HWDDwZgTVDZNCpEYjVxP6SXXvHGq7+rD84xgulwRe6G4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131597; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=JvdgUN4G+hJQeSgeZrRHkKlqRzJx599CQaDONH0J3Tw=; b=D+RtjdmB5oQTV0v0O3NytjIbv0I/DhyJk9JqLUtswQhvmv6cZPg29l4ABUIaq7q7j1KSNL4ORFUjaXMaW2xE1+D2OKoAI/DjOxJuvU9Et5WVXHYsGsRgT4XtiNRoAo0pzvCUrMnpf1/LtMO2HUyFbTLJz0FslIxkzg4v2/Z23cc= 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 1596131597403989.0661486620949; Thu, 30 Jul 2020 10:53:17 -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 1k1Cjf-0008Op-RQ; Thu, 30 Jul 2020 17:52:55 +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 1k1Cjf-00089P-0Y for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:55 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6faa351e-d28d-11ea-aaff-12813bfff9fa; Thu, 30 Jul 2020 17:52:29 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1CjD-0007A5-Fv; Thu, 30 Jul 2020 17:52:27 +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 1k1CjD-0004nV-7A; Thu, 30 Jul 2020 17:52:27 +0000 X-Inumbo-ID: 6faa351e-d28d-11ea-aaff-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=JvdgUN4G+hJQeSgeZrRHkKlqRzJx599CQaDONH0J3Tw=; b=v8qSCiyGVTfxkTpFTI1hiNTT2i m2CiGGXqL3M+qtt7lAPHIcTyQ6PS2JYXBWQD0/lSU0Hqu3L1Lz9LvveBYKBBHrmVwyim0Uk49y7ti tEMKamxKVZU1XVSzHNzqcZGJ4z9MF5iUMLuzjKd8/D34LWKVt9WL1/G9TUbBveI/AzY8=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 4/6] xen: include xen/guest_access.h rather than asm/guest_access.h Date: Thu, 30 Jul 2020 18:52:08 +0100 Message-Id: <20200730175213.30679-9-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Kevin Tian , Stefano Stabellini , julien@xen.org, Jun Nakajima , Wei Liu , Paul Durrant , Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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 Only a few places are actually including asm/guest_access.h. While this is fine today, a follow-up patch will want to move most of the helpers from asm/guest_access.h to xen/guest_access.h. To prepare the move, everyone should include xen/guest_access.h rather than asm/guest_access.h. Interestingly, asm-arm/guest_access.h includes xen/guest_access.h. The inclusion is now removed as no-one but the latter should include the former. Signed-off-by: Julien Grall --- Changes in v2: - Remove some changes that weren't meant to be here. --- xen/arch/arm/decode.c | 2 +- xen/arch/arm/domain.c | 2 +- xen/arch/arm/guest_walk.c | 3 ++- xen/arch/arm/guestcopy.c | 2 +- xen/arch/arm/vgic-v3-its.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/viridian/viridian.c | 2 +- xen/arch/x86/hvm/vmx/vmx.c | 2 +- xen/common/libelf/libelf-loader.c | 2 +- xen/include/asm-arm/guest_access.h | 1 - xen/lib/x86/private.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c index 144793c8cea0..792c2e92a7eb 100644 --- a/xen/arch/arm/decode.c +++ b/xen/arch/arm/decode.c @@ -17,12 +17,12 @@ * GNU General Public License for more details. */ =20 +#include #include #include #include =20 #include -#include =20 #include "decode.h" =20 diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 31169326b2e3..9258f6d3faa2 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c index a1cdd7f4afea..b4496c4c86c6 100644 --- a/xen/arch/arm/guest_walk.c +++ b/xen/arch/arm/guest_walk.c @@ -16,8 +16,9 @@ */ =20 #include +#include #include -#include + #include #include =20 diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index c8023e2bca5d..32681606d8fc 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -1,10 +1,10 @@ #include +#include #include #include #include =20 #include -#include =20 #define COPY_flush_dcache (1U << 0) #define COPY_from_guest (0U << 1) diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c index 6e153c698d56..58d939b85f92 100644 --- a/xen/arch/arm/vgic-v3-its.c +++ b/xen/arch/arm/vgic-v3-its.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index ca3bbfcbb355..7301f3cd6004 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -16,6 +16,7 @@ * this program; If not, see . */ =20 +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridi= an/viridian.c index 977c1bc54fad..dc7183a54627 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -5,12 +5,12 @@ * Hypervisor Top Level Functional Specification for more information. */ =20 +#include #include #include #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index eb54aadfbafb..cb5df1e81c9c 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -15,6 +15,7 @@ * this program; If not, see . */ =20 +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-l= oader.c index 0f468727d04a..629cc0d3e611 100644 --- a/xen/common/libelf/libelf-loader.c +++ b/xen/common/libelf/libelf-loader.c @@ -16,7 +16,7 @@ */ =20 #ifdef __XEN__ -#include +#include #endif =20 #include "libelf-private.h" diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest= _access.h index 31b9f03f0015..b9a89c495527 100644 --- a/xen/include/asm-arm/guest_access.h +++ b/xen/include/asm-arm/guest_access.h @@ -1,7 +1,6 @@ #ifndef __ASM_ARM_GUEST_ACCESS_H__ #define __ASM_ARM_GUEST_ACCESS_H__ =20 -#include #include #include =20 diff --git a/xen/lib/x86/private.h b/xen/lib/x86/private.h index b793181464f3..2d53bd3ced23 100644 --- a/xen/lib/x86/private.h +++ b/xen/lib/x86/private.h @@ -4,12 +4,12 @@ #ifdef __XEN__ =20 #include +#include #include #include #include #include =20 -#include #include =20 #define copy_to_buffer_offset copy_to_guest_offset --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596132620; cv=none; d=zohomail.com; s=zohoarc; b=JLa7hfQ2ZXz4vgrYcF/zcGhNvmOPszk+sZMILCcv1wJYq8p9IZdvCcjRyV2t6Mntd/gwCd5kMLEGo17LIOZKPSlDTmU+Ynu9inkj6ZxusYYOm82aN/nB8RRROtIVTG9pJMrRjBvT4idDfFwtikrFKtb7WO+HFc0qCyZhmasCDBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596132620; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=JvdgUN4G+hJQeSgeZrRHkKlqRzJx599CQaDONH0J3Tw=; b=So+0f//TGn7EYNJVG2ioA0RXknZHEJxbzppT7V8IIF+aIDydoLRm12KIBKEc8qU11dGeMrWMK4sOUZcgwtZvtyt7+U/moLBXbMdC/uuE4wh4Q27QzQYKtOgoUdcoG9I2wUWuLUhLq72Q4xU3bU0iZv27V5j+VTWc87UEuCtHFk4= 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 1596132620884874.0477748629218; Thu, 30 Jul 2020 11:10:20 -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 1k1D0E-0001p9-AA; Thu, 30 Jul 2020 18:10:02 +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 1k1D0D-0001eP-AE for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:10:01 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dd9a0340-d28f-11ea-ab01-12813bfff9fa; Thu, 30 Jul 2020 18:09:52 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D02-0007cn-95; Thu, 30 Jul 2020 18:09:50 +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 1k1CjH-0004nV-7m; Thu, 30 Jul 2020 17:52:31 +0000 X-Inumbo-ID: dd9a0340-d28f-11ea-ab01-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=JvdgUN4G+hJQeSgeZrRHkKlqRzJx599CQaDONH0J3Tw=; b=G49/hj4voipbAEp54p6KOONjVL EBBtQPz9TM37BQARWen0u2rGIiCOM1lKpy75LRQzyev8VMWqqlUICDLopFXH0SngWA8QF4oU9bjWr ids1sQqsfB7kGAiv53cNyyeC0f6Q1iXu+IPIEECd1++ggXCiZHOgzVpjmI1hZYI/nAjw=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 5/7] xen: include xen/guest_access.h rather than asm/guest_access.h Date: Thu, 30 Jul 2020 18:52:10 +0100 Message-Id: <20200730175213.30679-11-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Kevin Tian , Stefano Stabellini , julien@xen.org, Jun Nakajima , Wei Liu , Paul Durrant , Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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 Only a few places are actually including asm/guest_access.h. While this is fine today, a follow-up patch will want to move most of the helpers from asm/guest_access.h to xen/guest_access.h. To prepare the move, everyone should include xen/guest_access.h rather than asm/guest_access.h. Interestingly, asm-arm/guest_access.h includes xen/guest_access.h. The inclusion is now removed as no-one but the latter should include the former. Signed-off-by: Julien Grall --- Changes in v2: - Remove some changes that weren't meant to be here. --- xen/arch/arm/decode.c | 2 +- xen/arch/arm/domain.c | 2 +- xen/arch/arm/guest_walk.c | 3 ++- xen/arch/arm/guestcopy.c | 2 +- xen/arch/arm/vgic-v3-its.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/viridian/viridian.c | 2 +- xen/arch/x86/hvm/vmx/vmx.c | 2 +- xen/common/libelf/libelf-loader.c | 2 +- xen/include/asm-arm/guest_access.h | 1 - xen/lib/x86/private.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c index 144793c8cea0..792c2e92a7eb 100644 --- a/xen/arch/arm/decode.c +++ b/xen/arch/arm/decode.c @@ -17,12 +17,12 @@ * GNU General Public License for more details. */ =20 +#include #include #include #include =20 #include -#include =20 #include "decode.h" =20 diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 31169326b2e3..9258f6d3faa2 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c index a1cdd7f4afea..b4496c4c86c6 100644 --- a/xen/arch/arm/guest_walk.c +++ b/xen/arch/arm/guest_walk.c @@ -16,8 +16,9 @@ */ =20 #include +#include #include -#include + #include #include =20 diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index c8023e2bca5d..32681606d8fc 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -1,10 +1,10 @@ #include +#include #include #include #include =20 #include -#include =20 #define COPY_flush_dcache (1U << 0) #define COPY_from_guest (0U << 1) diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c index 6e153c698d56..58d939b85f92 100644 --- a/xen/arch/arm/vgic-v3-its.c +++ b/xen/arch/arm/vgic-v3-its.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index ca3bbfcbb355..7301f3cd6004 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -16,6 +16,7 @@ * this program; If not, see . */ =20 +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridi= an/viridian.c index 977c1bc54fad..dc7183a54627 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -5,12 +5,12 @@ * Hypervisor Top Level Functional Specification for more information. */ =20 +#include #include #include #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index eb54aadfbafb..cb5df1e81c9c 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -15,6 +15,7 @@ * this program; If not, see . */ =20 +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-l= oader.c index 0f468727d04a..629cc0d3e611 100644 --- a/xen/common/libelf/libelf-loader.c +++ b/xen/common/libelf/libelf-loader.c @@ -16,7 +16,7 @@ */ =20 #ifdef __XEN__ -#include +#include #endif =20 #include "libelf-private.h" diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest= _access.h index 31b9f03f0015..b9a89c495527 100644 --- a/xen/include/asm-arm/guest_access.h +++ b/xen/include/asm-arm/guest_access.h @@ -1,7 +1,6 @@ #ifndef __ASM_ARM_GUEST_ACCESS_H__ #define __ASM_ARM_GUEST_ACCESS_H__ =20 -#include #include #include =20 diff --git a/xen/lib/x86/private.h b/xen/lib/x86/private.h index b793181464f3..2d53bd3ced23 100644 --- a/xen/lib/x86/private.h +++ b/xen/lib/x86/private.h @@ -4,12 +4,12 @@ #ifdef __XEN__ =20 #include +#include #include #include #include #include =20 -#include #include =20 #define copy_to_buffer_offset copy_to_guest_offset --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596131574; cv=none; d=zohomail.com; s=zohoarc; b=c38MXFmlo02h7EG7bADJSlOZzBt9LOBgPpEitjC0mFWz6gkHslvjoNnJE5uUkdLbmTs08s9L/jUR22pRg8cYe0kSWapmscoTBez31swgYcXT1Obq3WxHY/aiAvMcSFDREsmBMlcS91+FJ66vwebfyM456XAdQQ0SAIDW/oPghi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596131574; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=iYWCfYUjsOmxaTuM6icRxDZYgMO7DF187Z293r7Hn8E=; b=HsJCN4GlS2tuw8pyO/C1XZxZkMgns8nzcuuPAKhsICqr4MYeGVUz9xwlLp4OjQNtv3/Qo0+FjumkW5Vb0i9EHlDP2dueyaQFvEPFGr9g2hClHgoNfUNEWt9LmWzKXUwnWPJDaS1rTHva4O1PiBcccXVUiL+vDOLOYwphz4zX/V0= 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 1596131574385178.5270562397484; Thu, 30 Jul 2020 10:52:54 -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 1k1CjI-0008Ag-4K; Thu, 30 Jul 2020 17:52:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1CjH-0008AL-Dr for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 17:52:31 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6fc03d5b-d28d-11ea-8db0-bc764e2007e4; Thu, 30 Jul 2020 17:52:29 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1CjF-0007AR-DV; Thu, 30 Jul 2020 17:52:29 +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 1k1CjF-0004nV-0B; Thu, 30 Jul 2020 17:52:29 +0000 X-Inumbo-ID: 6fc03d5b-d28d-11ea-8db0-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=iYWCfYUjsOmxaTuM6icRxDZYgMO7DF187Z293r7Hn8E=; b=ingw4Z4pScDYE3j2IreY1+IRC0 icn/tMqmdO7H9xRdKMD2zQMj4r+XXK+/A7U0zrxuvGOciuNdI9PjKu8PqNB25PqoHiXXLHwsj+n7U 19bLoF1qc6oM/a4snUwaJ+PolAD487gTOo71IPRWj0yH1ANLJOQMTeKELKCxuiitAqzo=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 5/6] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h Date: Thu, 30 Jul 2020 18:52:09 +0100 Message-Id: <20200730175213.30679-10-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Stefano Stabellini , julien@xen.org, Wei Liu , Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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 Most of the helpers to access guest memory are implemented the same way on Arm and x86. The only differences are: - guest_handle_{from, to}_param(): while on x86 XEN_GUEST_HANDLE() and XEN_GUEST_HANDLE_PARAM() are the same, they are not on Arm. It is still fine to use the Arm implementation on x86. - __clear_guest_offset(): Interestingly the prototype does not match between the x86 and Arm. However, the Arm one is bogus. So the x86 implementation can be used. - guest_handle{,_subrange}_okay(): They are validly differing because Arm is only supporting auto-translated guest and therefore handles are always valid. In the past, the ia64 and ppc64 port use a different model to access guest parameter. They have been long gone now. Given Xen currently only support 2 archictures, it is too soon to have a directory asm-generic as it is not possible to differentiate it with the existing directory xen/. If/When there is a 3rd port, we can decide to create the new directory if that new port decide to use a different way to access guest parameter. For now, consolidate it in xen/guest_access.h. While it would be possible to adjust the coding style at the same, this is left for a follow-up patch so 'diff' can be used to check the consolidation was done correctly. Signed-off-by: Julien Grall --- Changes in v2: - Expand the commit message explaining why asm-generic is not created. --- xen/include/asm-arm/guest_access.h | 114 --------------------------- xen/include/asm-x86/guest_access.h | 108 -------------------------- xen/include/xen/guest_access.h | 119 +++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 222 deletions(-) diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest= _access.h index b9a89c495527..53766386d3d8 100644 --- a/xen/include/asm-arm/guest_access.h +++ b/xen/include/asm-arm/guest_access.h @@ -23,88 +23,6 @@ int access_guest_memory_by_ipa(struct domain *d, paddr_t= ipa, void *buf, #define __raw_copy_from_guest raw_copy_from_guest #define __raw_clear_guest raw_clear_guest =20 -/* Remainder copied from x86 -- could be common? */ - -/* Is the guest handle a NULL reference? */ -#define guest_handle_is_null(hnd) ((hnd).p =3D=3D NULL) - -/* Offset the given guest handle into the array it refers to. */ -#define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) -#define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) - -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) - * to the specified type of XEN_GUEST_HANDLE_PARAM. */ -#define guest_handle_cast(hnd, type) ({ \ - type *_x =3D (hnd).p; \ - (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ -}) - -/* Convert a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ -#define guest_handle_to_param(hnd, type) ({ \ - typeof((hnd).p) _x =3D (hnd).p; \ - XEN_GUEST_HANDLE_PARAM(type) _y =3D { _x }; \ - /* type checking: make sure that the pointers inside \ - * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ - * the same type, then return hnd */ \ - (void)(&_x =3D=3D &_y.p); \ - _y; \ -}) - -#define guest_handle_for_field(hnd, type, fld) \ - ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) - -#define guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) -#define const_guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) - -/* - * Copy an array of objects to guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \ -}) - -/* - * Clear an array of objects in guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define clear_guest_offset(hnd, off, nr) ({ \ - void *_d =3D (hnd).p; \ - raw_clear_guest(_d+(off), nr); \ -}) - -/* - * Copy an array of objects from guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -/* Copy sub-field of a structure to guest context via a guest handle. */ -#define copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -/* Copy sub-field of a structure from guest context via a guest handle. */ -#define copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - /* * Pre-validate a guest handle. * Allows use of faster __copy_* functions. @@ -113,38 +31,6 @@ int access_guest_memory_by_ipa(struct domain *d, paddr_= t ipa, void *buf, #define guest_handle_okay(hnd, nr) (1) #define guest_handle_subrange_okay(hnd, first, last) (1) =20 -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ -}) - -#define __clear_guest_offset(hnd, off, ptr, nr) ({ \ - __raw_clear_guest(_d+(off), nr); \ -}) - -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -#define __copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - __raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -#define __copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - __raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - #endif /* __ASM_ARM_GUEST_ACCESS_H__ */ /* * Local variables: diff --git a/xen/include/asm-x86/guest_access.h b/xen/include/asm-x86/guest= _access.h index 3ffde205f6a1..08c9fbbc78e1 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -38,81 +38,6 @@ clear_user_hvm((dst), (len)) : \ clear_user((dst), (len))) =20 -/* Is the guest handle a NULL reference? */ -#define guest_handle_is_null(hnd) ((hnd).p =3D=3D NULL) - -/* Offset the given guest handle into the array it refers to. */ -#define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) -#define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) - -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) - * to the specified type of XEN_GUEST_HANDLE_PARAM. */ -#define guest_handle_cast(hnd, type) ({ \ - type *_x =3D (hnd).p; \ - (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ -}) - -/* Convert a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ -#define guest_handle_to_param(hnd, type) ({ \ - /* type checking: make sure that the pointers inside \ - * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ - * the same type, then return hnd */ \ - (void)((typeof(&(hnd).p)) 0 =3D=3D \ - (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \ - (hnd); \ -}) - -#define guest_handle_for_field(hnd, type, fld) \ - ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) - -#define guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) -#define const_guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) - -/* - * Copy an array of objects to guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \ -}) - -/* - * Copy an array of objects from guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -#define clear_guest_offset(hnd, off, nr) ({ \ - void *_d =3D (hnd).p; \ - raw_clear_guest(_d+(off), nr); \ -}) - -/* Copy sub-field of a structure to guest context via a guest handle. */ -#define copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -/* Copy sub-field of a structure from guest context via a guest handle. */ -#define copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - /* * Pre-validate a guest handle. * Allows use of faster __copy_* functions. @@ -126,39 +51,6 @@ (last)-(first)+1, \ sizeof(*(hnd).p))) =20 -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ -}) - -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -#define __clear_guest_offset(hnd, off, nr) ({ \ - void *_d =3D (hnd).p; \ - __raw_clear_guest(_d+(off), nr); \ -}) - -#define __copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - __raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -#define __copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - __raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - #endif /* __ASM_X86_GUEST_ACCESS_H__ */ /* * Local variables: diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index ef9aaa3efcfe..4957b8d1f2b8 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -11,6 +11,86 @@ #include #include =20 +/* Is the guest handle a NULL reference? */ +#define guest_handle_is_null(hnd) ((hnd).p =3D=3D NULL) + +/* Offset the given guest handle into the array it refers to. */ +#define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) +#define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) + +/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) + * to the specified type of XEN_GUEST_HANDLE_PARAM. */ +#define guest_handle_cast(hnd, type) ({ \ + type *_x =3D (hnd).p; \ + (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ +}) + +/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ +#define guest_handle_to_param(hnd, type) ({ \ + typeof((hnd).p) _x =3D (hnd).p; \ + XEN_GUEST_HANDLE_PARAM(type) _y =3D { _x }; \ + /* type checking: make sure that the pointers inside \ + * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ + * the same type, then return hnd */ \ + (void)(&_x =3D=3D &_y.p); \ + _y; \ +}) + +#define guest_handle_for_field(hnd, type, fld) \ + ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) + +#define guest_handle_from_ptr(ptr, type) \ + ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) +#define const_guest_handle_from_ptr(ptr, type) \ + ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) + +/* + * Copy an array of objects to guest context via a guest handle, + * specifying an offset into the guest array. + */ +#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + /* Check that the handle is not for a const type */ \ + void *__maybe_unused _t =3D (hnd).p; \ + (void)((hnd).p =3D=3D _s); \ + raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \ +}) + +/* + * Clear an array of objects in guest context via a guest handle, + * specifying an offset into the guest array. + */ +#define clear_guest_offset(hnd, off, nr) ({ \ + void *_d =3D (hnd).p; \ + raw_clear_guest(_d+(off), nr); \ +}) + +/* + * Copy an array of objects from guest context via a guest handle, + * specifying an offset into the guest array. + */ +#define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ + const typeof(*(ptr)) *_s =3D (hnd).p; \ + typeof(*(ptr)) *_d =3D (ptr); \ + raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ +}) + +/* Copy sub-field of a structure to guest context via a guest handle. */ +#define copy_field_to_guest(hnd, ptr, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ + void *_d =3D &(hnd).p->field; \ + (void)(&(hnd).p->field =3D=3D _s); \ + raw_copy_to_guest(_d, _s, sizeof(*_s)); \ +}) + +/* Copy sub-field of a structure from guest context via a guest handle. */ +#define copy_field_from_guest(ptr, hnd, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ + typeof(&(ptr)->field) _d =3D &(ptr)->field; \ + raw_copy_from_guest(_d, _s, sizeof(*_d)); \ +}) + #define copy_to_guest(hnd, ptr, nr) \ copy_to_guest_offset(hnd, 0, ptr, nr) =20 @@ -20,6 +100,45 @@ #define clear_guest(hnd, nr) \ clear_guest_offset(hnd, 0, nr) =20 +/* + * The __copy_* functions should only be used after the guest handle has + * been pre-validated via guest_handle_okay() and + * guest_handle_subrange_okay(). + */ + +#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + /* Check that the handle is not for a const type */ \ + void *__maybe_unused _t =3D (hnd).p; \ + (void)((hnd).p =3D=3D _s); \ + __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ +}) + +#define __clear_guest_offset(hnd, off, nr) ({ \ + void *_d =3D (hnd).p; \ + __raw_clear_guest(_d + (off), nr); \ +}) + +#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ + const typeof(*(ptr)) *_s =3D (hnd).p; \ + typeof(*(ptr)) *_d =3D (ptr); \ + __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ +}) + +#define __copy_field_to_guest(hnd, ptr, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ + void *_d =3D &(hnd).p->field; \ + (void)(&(hnd).p->field =3D=3D _s); \ + __raw_copy_to_guest(_d, _s, sizeof(*_s)); \ +}) + +#define __copy_field_from_guest(ptr, hnd, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ + typeof(&(ptr)->field) _d =3D &(ptr)->field; \ + __raw_copy_from_guest(_d, _s, sizeof(*_d)); \ +}) + #define __copy_to_guest(hnd, ptr, nr) \ __copy_to_guest_offset(hnd, 0, ptr, nr) =20 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596132620; cv=none; d=zohomail.com; s=zohoarc; b=KEhRpEEvvFttpwvkyUSGnXbth7OzBq+T07ZO8yWx2YZkvraAjTFFLMI2fMa1Z6xqKGwlTTVJmiRrOIt7XbccHPAbE0NGEUx3g1iCcXZoHPs7j5N1NT3y3YZp0jG8TI8CjrUMCF+dQToNIQfssWsMebj4p4+JZtdSWgn8K78yAMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596132620; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=iYWCfYUjsOmxaTuM6icRxDZYgMO7DF187Z293r7Hn8E=; b=d+uEuWn9aIl/3VaTVgWytBomoRrkXgt64sw1o9M3LftJHzobdLtS5R3EnQ/xHywEhdL1wiow3cpHN8tGMIK5+xuNVNuFDOfdT+8HE0rdbUZYtde02sZV+E5MQ20ARMZd469bkGYYcImv1RzphINmvMx/ruL+2/W2FwdwoFljsrM= 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 1596132620635248.52955288542262; Thu, 30 Jul 2020 11:10:20 -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 1k1D06-0001ef-K2; Thu, 30 Jul 2020 18:09:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D04-0001eU-NN for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:09:52 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id dbb33562-d28f-11ea-8db1-bc764e2007e4; Thu, 30 Jul 2020 18:09:51 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D02-0007cj-5Y; Thu, 30 Jul 2020 18:09:50 +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 1k1CjJ-0004nV-0l; Thu, 30 Jul 2020 17:52:33 +0000 X-Inumbo-ID: dbb33562-d28f-11ea-8db1-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=iYWCfYUjsOmxaTuM6icRxDZYgMO7DF187Z293r7Hn8E=; b=Gyl0rXk/oqEDDVrIffBibnI6nq VBYU1SMoqAkLW3KE23q4IH2ORVnU3dvigW+Gci2UGXRToRPMN6Zbdd37MFGQHWSRoRwuC8vxa89bP g9LL4iNaYdEB7bPti7CuqaPrT7EvLtTMOjJ2Yrd/MCD6Iq3j9o1CukPBca2/Ndw6Cbxs=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 6/7] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h Date: Thu, 30 Jul 2020 18:52:11 +0100 Message-Id: <20200730175213.30679-12-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Stefano Stabellini , julien@xen.org, Wei Liu , Andrew Cooper , Julien Grall , Ian Jackson , George Dunlap , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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 Most of the helpers to access guest memory are implemented the same way on Arm and x86. The only differences are: - guest_handle_{from, to}_param(): while on x86 XEN_GUEST_HANDLE() and XEN_GUEST_HANDLE_PARAM() are the same, they are not on Arm. It is still fine to use the Arm implementation on x86. - __clear_guest_offset(): Interestingly the prototype does not match between the x86 and Arm. However, the Arm one is bogus. So the x86 implementation can be used. - guest_handle{,_subrange}_okay(): They are validly differing because Arm is only supporting auto-translated guest and therefore handles are always valid. In the past, the ia64 and ppc64 port use a different model to access guest parameter. They have been long gone now. Given Xen currently only support 2 archictures, it is too soon to have a directory asm-generic as it is not possible to differentiate it with the existing directory xen/. If/When there is a 3rd port, we can decide to create the new directory if that new port decide to use a different way to access guest parameter. For now, consolidate it in xen/guest_access.h. While it would be possible to adjust the coding style at the same, this is left for a follow-up patch so 'diff' can be used to check the consolidation was done correctly. Signed-off-by: Julien Grall --- Changes in v2: - Expand the commit message explaining why asm-generic is not created. --- xen/include/asm-arm/guest_access.h | 114 --------------------------- xen/include/asm-x86/guest_access.h | 108 -------------------------- xen/include/xen/guest_access.h | 119 +++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 222 deletions(-) diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest= _access.h index b9a89c495527..53766386d3d8 100644 --- a/xen/include/asm-arm/guest_access.h +++ b/xen/include/asm-arm/guest_access.h @@ -23,88 +23,6 @@ int access_guest_memory_by_ipa(struct domain *d, paddr_t= ipa, void *buf, #define __raw_copy_from_guest raw_copy_from_guest #define __raw_clear_guest raw_clear_guest =20 -/* Remainder copied from x86 -- could be common? */ - -/* Is the guest handle a NULL reference? */ -#define guest_handle_is_null(hnd) ((hnd).p =3D=3D NULL) - -/* Offset the given guest handle into the array it refers to. */ -#define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) -#define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) - -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) - * to the specified type of XEN_GUEST_HANDLE_PARAM. */ -#define guest_handle_cast(hnd, type) ({ \ - type *_x =3D (hnd).p; \ - (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ -}) - -/* Convert a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ -#define guest_handle_to_param(hnd, type) ({ \ - typeof((hnd).p) _x =3D (hnd).p; \ - XEN_GUEST_HANDLE_PARAM(type) _y =3D { _x }; \ - /* type checking: make sure that the pointers inside \ - * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ - * the same type, then return hnd */ \ - (void)(&_x =3D=3D &_y.p); \ - _y; \ -}) - -#define guest_handle_for_field(hnd, type, fld) \ - ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) - -#define guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) -#define const_guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) - -/* - * Copy an array of objects to guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \ -}) - -/* - * Clear an array of objects in guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define clear_guest_offset(hnd, off, nr) ({ \ - void *_d =3D (hnd).p; \ - raw_clear_guest(_d+(off), nr); \ -}) - -/* - * Copy an array of objects from guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -/* Copy sub-field of a structure to guest context via a guest handle. */ -#define copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -/* Copy sub-field of a structure from guest context via a guest handle. */ -#define copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - /* * Pre-validate a guest handle. * Allows use of faster __copy_* functions. @@ -113,38 +31,6 @@ int access_guest_memory_by_ipa(struct domain *d, paddr_= t ipa, void *buf, #define guest_handle_okay(hnd, nr) (1) #define guest_handle_subrange_okay(hnd, first, last) (1) =20 -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ -}) - -#define __clear_guest_offset(hnd, off, ptr, nr) ({ \ - __raw_clear_guest(_d+(off), nr); \ -}) - -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -#define __copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - __raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -#define __copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - __raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - #endif /* __ASM_ARM_GUEST_ACCESS_H__ */ /* * Local variables: diff --git a/xen/include/asm-x86/guest_access.h b/xen/include/asm-x86/guest= _access.h index 3ffde205f6a1..08c9fbbc78e1 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -38,81 +38,6 @@ clear_user_hvm((dst), (len)) : \ clear_user((dst), (len))) =20 -/* Is the guest handle a NULL reference? */ -#define guest_handle_is_null(hnd) ((hnd).p =3D=3D NULL) - -/* Offset the given guest handle into the array it refers to. */ -#define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) -#define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) - -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) - * to the specified type of XEN_GUEST_HANDLE_PARAM. */ -#define guest_handle_cast(hnd, type) ({ \ - type *_x =3D (hnd).p; \ - (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ -}) - -/* Convert a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ -#define guest_handle_to_param(hnd, type) ({ \ - /* type checking: make sure that the pointers inside \ - * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ - * the same type, then return hnd */ \ - (void)((typeof(&(hnd).p)) 0 =3D=3D \ - (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \ - (hnd); \ -}) - -#define guest_handle_for_field(hnd, type, fld) \ - ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) - -#define guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) -#define const_guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) - -/* - * Copy an array of objects to guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \ -}) - -/* - * Copy an array of objects from guest context via a guest handle, - * specifying an offset into the guest array. - */ -#define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -#define clear_guest_offset(hnd, off, nr) ({ \ - void *_d =3D (hnd).p; \ - raw_clear_guest(_d+(off), nr); \ -}) - -/* Copy sub-field of a structure to guest context via a guest handle. */ -#define copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -/* Copy sub-field of a structure from guest context via a guest handle. */ -#define copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - /* * Pre-validate a guest handle. * Allows use of faster __copy_* functions. @@ -126,39 +51,6 @@ (last)-(first)+1, \ sizeof(*(hnd).p))) =20 -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ -}) - -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ -}) - -#define __clear_guest_offset(hnd, off, nr) ({ \ - void *_d =3D (hnd).p; \ - __raw_clear_guest(_d+(off), nr); \ -}) - -#define __copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ - void *_d =3D &(hnd).p->field; \ - (void)(&(hnd).p->field =3D=3D _s); \ - __raw_copy_to_guest(_d, _s, sizeof(*_s)); \ -}) - -#define __copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ - typeof(&(ptr)->field) _d =3D &(ptr)->field; \ - __raw_copy_from_guest(_d, _s, sizeof(*_d)); \ -}) - #endif /* __ASM_X86_GUEST_ACCESS_H__ */ /* * Local variables: diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index ef9aaa3efcfe..4957b8d1f2b8 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -11,6 +11,86 @@ #include #include =20 +/* Is the guest handle a NULL reference? */ +#define guest_handle_is_null(hnd) ((hnd).p =3D=3D NULL) + +/* Offset the given guest handle into the array it refers to. */ +#define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) +#define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) + +/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) + * to the specified type of XEN_GUEST_HANDLE_PARAM. */ +#define guest_handle_cast(hnd, type) ({ \ + type *_x =3D (hnd).p; \ + (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ +}) + +/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ +#define guest_handle_to_param(hnd, type) ({ \ + typeof((hnd).p) _x =3D (hnd).p; \ + XEN_GUEST_HANDLE_PARAM(type) _y =3D { _x }; \ + /* type checking: make sure that the pointers inside \ + * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ + * the same type, then return hnd */ \ + (void)(&_x =3D=3D &_y.p); \ + _y; \ +}) + +#define guest_handle_for_field(hnd, type, fld) \ + ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) + +#define guest_handle_from_ptr(ptr, type) \ + ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) +#define const_guest_handle_from_ptr(ptr, type) \ + ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) + +/* + * Copy an array of objects to guest context via a guest handle, + * specifying an offset into the guest array. + */ +#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + /* Check that the handle is not for a const type */ \ + void *__maybe_unused _t =3D (hnd).p; \ + (void)((hnd).p =3D=3D _s); \ + raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \ +}) + +/* + * Clear an array of objects in guest context via a guest handle, + * specifying an offset into the guest array. + */ +#define clear_guest_offset(hnd, off, nr) ({ \ + void *_d =3D (hnd).p; \ + raw_clear_guest(_d+(off), nr); \ +}) + +/* + * Copy an array of objects from guest context via a guest handle, + * specifying an offset into the guest array. + */ +#define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ + const typeof(*(ptr)) *_s =3D (hnd).p; \ + typeof(*(ptr)) *_d =3D (ptr); \ + raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ +}) + +/* Copy sub-field of a structure to guest context via a guest handle. */ +#define copy_field_to_guest(hnd, ptr, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ + void *_d =3D &(hnd).p->field; \ + (void)(&(hnd).p->field =3D=3D _s); \ + raw_copy_to_guest(_d, _s, sizeof(*_s)); \ +}) + +/* Copy sub-field of a structure from guest context via a guest handle. */ +#define copy_field_from_guest(ptr, hnd, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ + typeof(&(ptr)->field) _d =3D &(ptr)->field; \ + raw_copy_from_guest(_d, _s, sizeof(*_d)); \ +}) + #define copy_to_guest(hnd, ptr, nr) \ copy_to_guest_offset(hnd, 0, ptr, nr) =20 @@ -20,6 +100,45 @@ #define clear_guest(hnd, nr) \ clear_guest_offset(hnd, 0, nr) =20 +/* + * The __copy_* functions should only be used after the guest handle has + * been pre-validated via guest_handle_okay() and + * guest_handle_subrange_okay(). + */ + +#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + /* Check that the handle is not for a const type */ \ + void *__maybe_unused _t =3D (hnd).p; \ + (void)((hnd).p =3D=3D _s); \ + __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ +}) + +#define __clear_guest_offset(hnd, off, nr) ({ \ + void *_d =3D (hnd).p; \ + __raw_clear_guest(_d + (off), nr); \ +}) + +#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ + const typeof(*(ptr)) *_s =3D (hnd).p; \ + typeof(*(ptr)) *_d =3D (ptr); \ + __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ +}) + +#define __copy_field_to_guest(hnd, ptr, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(ptr)->field; \ + void *_d =3D &(hnd).p->field; \ + (void)(&(hnd).p->field =3D=3D _s); \ + __raw_copy_to_guest(_d, _s, sizeof(*_s)); \ +}) + +#define __copy_field_from_guest(ptr, hnd, field) ({ \ + const typeof(&(ptr)->field) _s =3D &(hnd).p->field; \ + typeof(&(ptr)->field) _d =3D &(ptr)->field; \ + __raw_copy_from_guest(_d, _s, sizeof(*_d)); \ +}) + #define __copy_to_guest(hnd, ptr, nr) \ __copy_to_guest_offset(hnd, 0, ptr, nr) =20 --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596132619; cv=none; d=zohomail.com; s=zohoarc; b=RsIze7QtJ8I7VQqR7K9VHsBlqmSZ5JNfksCO92h2H9906uQl+fEm7u/3vtPjGaiqEl0rEW4E3uPmiC3t0yz6lyE6fFRUQyKrzGFEJEw+aI+B6sppH/6eBe4fIb5q6VaOaF20zCYc/ipAT74VyyBor1ZVtfycCVotIK/ahjL53Cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596132619; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=HcrdvdMXYTnUwRBlS2DEneqnqQqoRuCUdn6F6d66Mpw=; b=VMnhoyACIWU0CeFr4/Iu078Y/xiMLPw6TEFSQEaMLUs4ftnLOX6u0iB4vj1OrxOwvuOTXknIPnBxxZ1MNpE2I92IIBel/NUmizQSKtUoYWkmKw8rRUDBHot0a37obbxHqeprHD0dZRd/LoKUIMwO7sEqnglZooHnDAIO/cfJNpk= 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 1596132619286233.75563275071556; Thu, 30 Jul 2020 11:10:19 -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 1k1D09-0001fF-1H; Thu, 30 Jul 2020 18:09:57 +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 1k1D08-0001eP-A2 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:09:56 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dc0f8c5d-d28f-11ea-ab01-12813bfff9fa; Thu, 30 Jul 2020 18:09:50 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D02-0007cl-7G; Thu, 30 Jul 2020 18:09:50 +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 1k1CjK-0004nV-II; Thu, 30 Jul 2020 17:52:34 +0000 X-Inumbo-ID: dc0f8c5d-d28f-11ea-ab01-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=HcrdvdMXYTnUwRBlS2DEneqnqQqoRuCUdn6F6d66Mpw=; b=D1cBZ4spwPKtMsnON5Set8IhhG yQrUYCsw9pJV7txoCklBSd1q9DibcLOhEPMENetrg6IitzgsX72WC4dYROj+cXCY7oa1vIN37uWu2 rKDQeWwc7uRoDNjPN/qd324RVWpKaMaDesgI5c57p+GB/YU/UZqeblmPUw9sdvAeZ8tk=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 6/6] xen/guest_access: Fix coding style in xen/guest_access.h Date: Thu, 30 Jul 2020 18:52:12 +0100 Message-Id: <20200730175213.30679-13-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Stefano Stabellini , julien@xen.org, Wei Liu , 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 * Add space before and after operator * Align \ * Format comments No functional changes expected. Signed-off-by: Julien Grall --- xen/include/xen/guest_access.h | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index 4957b8d1f2b8..52fc7a063249 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -18,20 +18,24 @@ #define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) =20 -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) - * to the specified type of XEN_GUEST_HANDLE_PARAM. */ +/* + * Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) + * to the specified type of XEN_GUEST_HANDLE_PARAM. + */ #define guest_handle_cast(hnd, type) ({ \ type *_x =3D (hnd).p; \ - (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ + (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ }) =20 /* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ #define guest_handle_to_param(hnd, type) ({ \ typeof((hnd).p) _x =3D (hnd).p; \ XEN_GUEST_HANDLE_PARAM(type) _y =3D { _x }; \ - /* type checking: make sure that the pointers inside \ + /* \ + * type checking: make sure that the pointers inside \ * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ - * the same type, then return hnd */ \ + * the same type, then return hnd. \ + */ \ (void)(&_x =3D=3D &_y.p); \ _y; \ }) @@ -106,13 +110,13 @@ * guest_handle_subrange_okay(). */ =20 -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ +#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + /* Check that the handle is not for a const type */ \ + void *__maybe_unused _t =3D (hnd).p; \ + (void)((hnd).p =3D=3D _s); \ + __raw_copy_to_guest(_d + (off), _s, sizeof(*_s) * (nr));\ }) =20 #define __clear_guest_offset(hnd, off, nr) ({ \ @@ -120,10 +124,10 @@ __raw_clear_guest(_d + (off), nr); \ }) =20 -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ +#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ + const typeof(*(ptr)) *_s =3D (hnd).p; \ + typeof(*(ptr)) *_d =3D (ptr); \ + __raw_copy_from_guest(_d, _s + (off), sizeof (*_d) * (nr)); \ }) =20 #define __copy_field_to_guest(hnd, ptr, field) ({ \ --=20 2.17.1 From nobody Tue Apr 16 10:19:39 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=1596132619; cv=none; d=zohomail.com; s=zohoarc; b=Po/bGYcNzqnu5mv2KZFeA9Y6AyI9DoYyuiKe+wCy0eGUKTN6GeDAU5o5QnbsnVgcqhp4XXX2foiPyKuidk+zYl2Qn508nG2aiN8aLs9oLW42BK57mMIqMcEmPM/f+xTtl6ppDMm9ETIgCx9fpeGgj5b/+7bJEQqoPg+b3601fyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596132619; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=HcrdvdMXYTnUwRBlS2DEneqnqQqoRuCUdn6F6d66Mpw=; b=BYLNku+lHgCf0iGsG5uTWAw6epQ8RUSqv+UjD8oh3SVaSNzcjUs4J/1VtG0zN/NQoUUuO/csbxngGsNU6EPOey/Lo4IZHBKo9KGj1snPTtzsxsjMzOfKWkmTsxETnKuyUX7WspkTjUltPSHZ+cDIRmNGX+Ci1rxuAT0wHqjqXcQ= 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 1596132619142281.271610572016; Thu, 30 Jul 2020 11:10:19 -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 1k1D05-0001eZ-B8; Thu, 30 Jul 2020 18:09:53 +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 1k1D03-0001eP-Hw for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:09:51 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dc4aeb9e-d28f-11ea-ab01-12813bfff9fa; Thu, 30 Jul 2020 18:09:50 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D02-0007ch-1R; Thu, 30 Jul 2020 18:09:50 +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 1k1CjM-0004nV-3c; Thu, 30 Jul 2020 17:52:36 +0000 X-Inumbo-ID: dc4aeb9e-d28f-11ea-ab01-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=HcrdvdMXYTnUwRBlS2DEneqnqQqoRuCUdn6F6d66Mpw=; b=RDw+IThYQ4uxz96MwiXAhvGrf8 mzOvSStfyzSB45BDMJvDilp9dLxp30WFQ4jsixNFEccVE7difbf7T6mKX7ENovF8NcAuN26rivC+V voHIAT6MBz2EqIOwm0RaoZ/JrEu9jZYvq5vJqlZAGP9sgbQblUx/Oy0aY0k6CF+1046w=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH v2 7/7] xen/guest_access: Fix coding style in xen/guest_access.h Date: Thu, 30 Jul 2020 18:52:13 +0100 Message-Id: <20200730175213.30679-14-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730175213.30679-1-julien@xen.org> References: <20200730175213.30679-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: Stefano Stabellini , julien@xen.org, Wei Liu , 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 * Add space before and after operator * Align \ * Format comments No functional changes expected. Signed-off-by: Julien Grall --- xen/include/xen/guest_access.h | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index 4957b8d1f2b8..52fc7a063249 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -18,20 +18,24 @@ #define guest_handle_add_offset(hnd, nr) ((hnd).p +=3D (nr)) #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -=3D (nr)) =20 -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) - * to the specified type of XEN_GUEST_HANDLE_PARAM. */ +/* + * Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM) + * to the specified type of XEN_GUEST_HANDLE_PARAM. + */ #define guest_handle_cast(hnd, type) ({ \ type *_x =3D (hnd).p; \ - (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ + (XEN_GUEST_HANDLE_PARAM(type)) { _x }; \ }) =20 /* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */ #define guest_handle_to_param(hnd, type) ({ \ typeof((hnd).p) _x =3D (hnd).p; \ XEN_GUEST_HANDLE_PARAM(type) _y =3D { _x }; \ - /* type checking: make sure that the pointers inside \ + /* \ + * type checking: make sure that the pointers inside \ * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of \ - * the same type, then return hnd */ \ + * the same type, then return hnd. \ + */ \ (void)(&_x =3D=3D &_y.p); \ _y; \ }) @@ -106,13 +110,13 @@ * guest_handle_subrange_okay(). */ =20 -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - /* Check that the handle is not for a const type */ \ - void *__maybe_unused _t =3D (hnd).p; \ - (void)((hnd).p =3D=3D _s); \ - __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\ +#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + /* Check that the handle is not for a const type */ \ + void *__maybe_unused _t =3D (hnd).p; \ + (void)((hnd).p =3D=3D _s); \ + __raw_copy_to_guest(_d + (off), _s, sizeof(*_s) * (nr));\ }) =20 #define __clear_guest_offset(hnd, off, nr) ({ \ @@ -120,10 +124,10 @@ __raw_clear_guest(_d + (off), nr); \ }) =20 -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(*(ptr)) *_s =3D (hnd).p; \ - typeof(*(ptr)) *_d =3D (ptr); \ - __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\ +#define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ + const typeof(*(ptr)) *_s =3D (hnd).p; \ + typeof(*(ptr)) *_d =3D (ptr); \ + __raw_copy_from_guest(_d, _s + (off), sizeof (*_d) * (nr)); \ }) =20 #define __copy_field_to_guest(hnd, ptr, field) ({ \ --=20 2.17.1