From nobody Fri Apr 26 00:19:12 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=1596133136; cv=none; d=zohomail.com; s=zohoarc; b=UIu4bj+OebRT0D+h6+7EM5U3zRMDi9N7Up+APRAbk9Avki/seTvBY3QamZFI+tScHdumujuVmUtY5uo3B8wGrqMW8FFJ5tfC3nN22VQqnSL02RpMGN+FxIT0WmLUnBPWN1j+G6lD5hyp1VcL4gm6ZsYJfv/rb9IrDoRmI88XwWY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133136; 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=fJ+BCqWxMF1eTn2zffxe784LpWtZXgkgoLzwnqLhzPrYF8nR6Be+3/EQVNBwvSFgmUJBztJwgBKu3PUtlvLGLnSKMJLBfTyi/erNztUNGJbZ7Rt4bPD7rEp6v6UUHcvF1xVWyGDQCtks/rsyBtw5Kp6BNlhN+stbuu+pt/2joIE= 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 1596133136970685.6491781123718; Thu, 30 Jul 2020 11:18: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 1k1D8W-0002pf-7c; Thu, 30 Jul 2020 18:18:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8U-0002pV-LK for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:18:34 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1423ce86-d291-11ea-8db3-bc764e2007e4; Thu, 30 Jul 2020 18:18:33 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8T-0007p0-3b; Thu, 30 Jul 2020 18:18:33 +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 1k1D8S-0006Uf-Q2; Thu, 30 Jul 2020 18:18:33 +0000 X-Inumbo-ID: 1423ce86-d291-11ea-8db3-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=YMp6yPrLfWKrTtFlQljFXWPvFCrq7jJMWfWyLnEct0g=; b=uE0pJtyWHqtPs7wVr0qkuSn8Rl gdYFO9uCCvn20fWlhFQT/bVKL8Mw27xfQRp8o65w1xxXk+gcYRLEmVLXofjTGmwRePRJAFze89ip6 6M8lJO7nUzmynUrMu0GZhhYp6Rv8Ub0/Do3SkAddsGvUYwg50GvoojExthBpMlPdaimM=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 1/7] xen/guest_access: Add emacs magics Date: Thu, 30 Jul 2020 19:18:21 +0100 Message-Id: <20200730181827.1670-2-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Fri Apr 26 00:19:12 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=1596133138; cv=none; d=zohomail.com; s=zohoarc; b=azqxSeOdon7ZBl0WBkZDbl1YZWCCgP2aBm7kwYyP+GEda7zgp2Dwv1owifnxwgxG3bXkFI0NJaUaxkkTiL20yEXXanq43AFydC5mKTPf/ipLUVgRAfG4WcRhxxp0YMG5XCcn7mlFT4q+mHi7ZGeggIq9hBVg75LmzL/SOCC/4Hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133138; 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=Yme0anTExePigu/EnPxL6xRMurzMEFSAGcEgOtC8f02TC5Cx13WSyRD1XiSX2xuW05XqJPZPCeiikDM569mhCkBAVhgReI++NpzV6IqDVygx1+lpn7A9ObKCCpMCypRGh2Aslb5kRJCphw90wIUAznFp7evSTwRsMifrsk1R5sw= 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 159613313816452.059678934281806; Thu, 30 Jul 2020 11:18:58 -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 1k1D8a-0002qi-P0; Thu, 30 Jul 2020 18:18:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8Z-0002pV-Gv for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:18:39 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 148584be-d291-11ea-8db3-bc764e2007e4; Thu, 30 Jul 2020 18:18:34 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8U-0007p6-2z; Thu, 30 Jul 2020 18:18:34 +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 1k1D8T-0006Uf-Qd; Thu, 30 Jul 2020 18:18:34 +0000 X-Inumbo-ID: 148584be-d291-11ea-8db3-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=ShgvcGkxdE4OnoXDwV1go3UlHBZgZS/RIoOwLBZvFGA=; b=E+IGhPDl7danxh4SjSMTZ/xLmg AFaMOSYRRWeUpDl2o2vXYQMkdOsxv+Sj0sjJBx6ibdDy614jf4APgOvpj9SWysnsv/iWfK+CjOe2J KTC50qvJWhRmiQ3RXayIcqjjvDu79tRw3DBF7+5ktqSjjFY050jpItqPN0KwVj2Otq8M=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 2/7] xen/arm: kernel: Re-order the includes Date: Thu, 30 Jul 2020 19:18:22 +0100 Message-Id: <20200730181827.1670-3-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Acked-by: Stefano Stabellini Reviewed-by: Bertrand Marquis --- 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 Fri Apr 26 00:19:12 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=1596133138; cv=none; d=zohomail.com; s=zohoarc; b=CH58fohVGkcQ7zWBA9KroPhbaB3qymFWqkJizaY0XgyHaUcDOlM3080LdtjgmXvfzNGR8c3kife8faRmNy3ytO4XKDjDJ3Bp66efCzrValvNIUdoRfCr1vGvOOvFPUoTlt+m2WGuxN/FiGIvZcPaQj/9zUVHrg9jnzDW5YZvF5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133138; 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=NLxAaEHBMfMP/BJfKMWrNeTFIAvtxFAiimZK9pYZvbaeDvet2Fw6mbKiZ7wi6y478EY/aDAHA+wiioVvjKJbzEfF4r2b52KWt2SiW9Z1S2JLd62K64Hr5toNp2hET0l0DtMO4fZQriZe2cJ6YNbGkrGOgPtUAkE+TCi3G/BRm5w= 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 1596133138290283.28007475274615; Thu, 30 Jul 2020 11:18:58 -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 1k1D8b-0002qz-1U; Thu, 30 Jul 2020 18:18: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 1k1D8a-0002pa-77 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:18:40 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 14495f5d-d291-11ea-ab02-12813bfff9fa; Thu, 30 Jul 2020 18:18:35 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8V-0007pH-4K; Thu, 30 Jul 2020 18:18:35 +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 1k1D8U-0006Uf-RB; Thu, 30 Jul 2020 18:18:35 +0000 X-Inumbo-ID: 14495f5d-d291-11ea-ab02-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=pn7ZXaZcjQAibeYNZWFfcFsK2Z RTSjmcqOxWTHli9tTa3+olKdMLzo2aivKM04fwEspEyayvKOMG9QvFZ+w1SDINnz9QmHd+T8SdW4C 5+kgLWol6p1elZYd5Hs0TKPKwoqJGy92WldClCZP7MzHBpPUGuXOxZA14eJ/qQYgooZU=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 3/7] xen/arm: decode: Re-order the includes Date: Thu, 30 Jul 2020 19:18:23 +0100 Message-Id: <20200730181827.1670-4-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Acked-by: Stefano Stabellini --- 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 Fri Apr 26 00:19:12 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=1596133142; cv=none; d=zohomail.com; s=zohoarc; b=AfbX8RhSGNAzXp0b37j972uKvVJjEmE9fWZsdxlCo3ibP+zWqLfodXTWGsl5YO9ToGt5Zsa9gVV1Yl+UxhB2jkjIOh6A57cOnRQ/8C8aBgl/eKs+hXQsFRz3Tg670HFLXJHhJTHJcDqVazndi8Cc4QQq72wy+lfxNDKSkEKpGc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133142; 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=VK3QDNyVpkEH9BCGVhcgLvdEAmTDkKwPOFQqkFG2ixTPhe8ovwyNBNkVPkysdgHvUJasC8PYKnw9FRFbs3Z/pEWBo44lblo9IVuiGu25PuyS92VjM2EED9D1yEZTIjhsEr+FCDce09a6fwZl9C0al1FoRsuIoY44dmKlTtpx8+s= 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 1596133142205198.16364168037614; Thu, 30 Jul 2020 11:19:02 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8g-0002th-F9; Thu, 30 Jul 2020 18:18:46 +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 1k1D8f-0002pa-7L for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:18:45 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 15c69868-d291-11ea-ab02-12813bfff9fa; Thu, 30 Jul 2020 18:18:36 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8W-0007pO-3l; Thu, 30 Jul 2020 18:18:36 +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 1k1D8V-0006Uf-Rk; Thu, 30 Jul 2020 18:18:36 +0000 X-Inumbo-ID: 15c69868-d291-11ea-ab02-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=5U3bDfJsH8AdjuVkDCDJxPYg+B pqIIILZqvSLWzG9t2M0gISSISjm/klOOptR7xOcu6YoC2cRO+ijoTlXkj5OyZqUDaC61dHuVPQ1S+ g5h70zzTgjCJf8yRdgjePcr7UfLiv3lnC2C5Zw6xxg+mEs18bT/sux0gNQZw0otb5bzY=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 4/7] xen/arm: guestcopy: Re-order the includes Date: Thu, 30 Jul 2020 19:18:24 +0100 Message-Id: <20200730181827.1670-5-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Acked-by: Stefano Stabellini Reviewed-by: Bertrand Marquis --- 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 Fri Apr 26 00:19:12 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=1596133148; cv=none; d=zohomail.com; s=zohoarc; b=mlHldHVkOzXL5okMmXlWmX+oxtrvtq1ZZX8unxOD3dTfnVwdpxx6UfQnTufjqWLrayoUGDwyoYoDzytmSFd20zHE7rXudM7DmscVGCi2RbJ1yrwcmlpmYqAgTWMiMLkFPKRqlzGss/x08bNKidFNIpJm5ILFF9eudXYaz0bE6lQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133148; 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=dKcj74iBe6jWlhY2hZSNEzRrIeU6q256J0yFXdfHyiDawZwvPZTAjP/2uJ2e+0W7uH0sJv+R9GkaLDaliSrme+G6HRwIvJtQ3ZqToSh2VNMlLMq8kNbXZuSTqH4DIYAu8d7E4xv4tpCiQfV8FJ7ePz15WtOSlVqPy5erkDBSA/I= 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 1596133148564509.5794253938251; Thu, 30 Jul 2020 11:19:08 -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 1k1D8k-0002wC-Oq; Thu, 30 Jul 2020 18:18: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 1k1D8k-0002pa-7O for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:18:50 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 17dfd4ca-d291-11ea-ab02-12813bfff9fa; Thu, 30 Jul 2020 18:18:40 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8Y-0007pZ-5t; Thu, 30 Jul 2020 18:18:38 +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 1k1D8X-0006Uf-Sf; Thu, 30 Jul 2020 18:18:38 +0000 X-Inumbo-ID: 17dfd4ca-d291-11ea-ab02-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=f4Z31qjwinMf/nJEBCCCADAjdO ctkAW08gja6ojbJWhfpou75A2MCzNtmDwghISiC8X4o2jNvj0SdkmGH2GQvXEJWMxRv/WtfDIwLWV YkG32n022oYn3DMSFQbThrLxY3FbMH2ue3JWlQLXJOGsOLjtgUSToWOUT3n1quxSs0DM=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 5/7] xen: include xen/guest_access.h rather than asm/guest_access.h Date: Thu, 30 Jul 2020 19:18:25 +0100 Message-Id: <20200730181827.1670-6-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Acked-by: Jan Beulich Acked-by: Paul Durrant Acked-by: Stefano Stabellini Reviewed-by: Bertrand Marquis --- 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 Fri Apr 26 00:19:12 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=1596133154; cv=none; d=zohomail.com; s=zohoarc; b=NHMJhN1Uj2uCx8tC2+JXI13XOqerJghSPGAPra4SiJtg5TR/G2zWLUPoNa3kR4x//C8al6Y0+1Ak/dsKy0tsk1hYtk9QQQI9SR1CHpNTkbTitaAnde6H/FDV4Lwq9Ag83nUKMMcRCFAhvDNXFAi0A6K51OVRN1E4eQm+gbJdemY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133154; 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=RKqAvUnt0z8m3XrZpQJcmD07DCW8rXkGMZA7uBpi4T/wMRkXTIcZx/Lr+RKaIPDVxoLzGnJN4h0XQC18/g4Nn/MVhOnJ01v2ThJ7jeuE2HEoCPl/PzPuqRc/NQLPEBKBHeEOou6fA23hj1QzjoSQEZy7X7PDVwH3rd5429h5ozw= 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 1596133154807464.9309407916377; Thu, 30 Jul 2020 11:19:14 -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 1k1D8q-0002zE-2A; Thu, 30 Jul 2020 18:18:56 +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 1k1D8p-0002pa-7U for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:18:55 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 180bcc10-d291-11ea-ab02-12813bfff9fa; Thu, 30 Jul 2020 18:18:40 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8Z-0007pd-V6; Thu, 30 Jul 2020 18:18:39 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1D8Z-0006Uf-Ic; Thu, 30 Jul 2020 18:18:39 +0000 X-Inumbo-ID: 180bcc10-d291-11ea-ab02-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=iYWCfYUjsOmxaTuM6icRxDZYgMO7DF187Z293r7Hn8E=; b=5wqskYdYAkiLkrpXm4p+L07UPL BxbyB6xLswpW0FYwHGJ+C10kQqjavS580kMSscP3oTDpO1M/IqO3H2I0RdUw63W3etGrVQ9+3EMjq AsKEnCsnqbo1kzVCXL3a+Tv6O/3VT44V/zpdRm0k+h5eSmenRqC9HuECpkViloXztAlE=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 6/7] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h Date: Thu, 30 Jul 2020 19:18:26 +0100 Message-Id: <20200730181827.1670-7-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- 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 Fri Apr 26 00:19:12 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=1596133155; cv=none; d=zohomail.com; s=zohoarc; b=T0JJmuQjoEIBmqdJF6eM2knq943zZXeTvMl6wK+sGIeGODt9fvuY7VjV7lFhdq85hmD7bJFIPTWZJnJoBMMGo0r4dE3Jk07uCpt4xNm8JDRJ1+n5YfkfCw58yEb+KuvMyadUNmnxuLBwtq4jZzdgWHSz9z2hClWI4KD5WJkzDGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596133155; 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=Jfd0Ymv66HUSdSLs3cpkrd3o6yctkrFMnlfyNHmmeW6ehPlCff1hoRNH7SyHrtMApB+ngsNHfOP/4OMgDS6PvivCId3vBGJFFMjQsaZbV0nB7ZS35j0e9vPsM0ts4K4HpZymrJc25+hRUcgs8vXr6P5ML8y5LFnLfT3WLYfDqiQ= 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 1596133155858133.11946213159194; Thu, 30 Jul 2020 11:19:15 -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 1k1D8v-00033P-FY; Thu, 30 Jul 2020 18:19:01 +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 1k1D8u-0002pa-7j for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 18:19:00 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 17dfd4cb-d291-11ea-ab02-12813bfff9fa; Thu, 30 Jul 2020 18:18:42 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1D8b-0007pl-Di; Thu, 30 Jul 2020 18:18:41 +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 1k1D8b-0006Uf-5N; Thu, 30 Jul 2020 18:18:41 +0000 X-Inumbo-ID: 17dfd4cb-d291-11ea-ab02-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=LaV146ZSoDMplKdOESbxSLKpU1 VQ9LHyys0ORBcoNKhCoTrPEDdHNa98vKTkXrBTAp/4WLKrOn40YWbWCqnOdik7wuDt4pGlmIGJH5C HWwSGkYIkn8PmOW3X9DUD4wFizQPbTvqFplohi0FK/dZffjRiUjN2ZLE+RmZscE3uE5Q=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [RESEND][PATCH v2 7/7] xen/guest_access: Fix coding style in xen/guest_access.h Date: Thu, 30 Jul 2020 19:18:27 +0100 Message-Id: <20200730181827.1670-8-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730181827.1670-1-julien@xen.org> References: <20200730181827.1670-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 Acked-by: Stefano Stabellini Reviewed-by: Bertrand Marquis --- 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