From nobody Mon Apr 29 14:10:11 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=1586005873; cv=none; d=zohomail.com; s=zohoarc; b=IsWcEpJb4LqOq4iq9aPdGwqvAkfMUL4XC9in6sFTi4T/HxBzvHbhvbyfABns7p4epNOOHPJVQS+w5HvpNVJBrZnsEhZxpHXxYIkNpjxwlhZhLJLCf+pDu9/BjUi0T2T/Pln8bk9TEpne76JibYX/Vv0i5UCHeoqDxa1DLjjzDfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005873; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=4VwITlkqRN4GqzEgtdlKqEdC4RiRaC+guw213SFaL9U=; b=gp0UpyJxQXNpCYZ2aut8gT/YQPzTW0ruWXPplzJDpikY3ahNF6gxxdn+YIPqDeA6AHa2ZEv5K6V22ptOPde1+/FfeaJbtcLCODCGfxrEUsVMzw9WxCN2f5Ks/34MgBORiPAj/RmG+U62gbGMITfyEKkJhdU+mNuk/s491SeJNJw= 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 1586005873619737.5206184115782; Sat, 4 Apr 2020 06:11:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZD-0005kF-NO; Sat, 04 Apr 2020 13:10: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.89) (envelope-from ) id 1jKiZC-0005k8-97 for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:30 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a85a84d2-7675-11ea-be20-12813bfff9fa; Sat, 04 Apr 2020 13:10:29 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZA-0008FW-Po; Sat, 04 Apr 2020 13:10:28 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZA-0007rM-Gd; Sat, 04 Apr 2020 13:10:28 +0000 X-Inumbo-ID: a85a84d2-7675-11ea-be20-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=4VwITlkqRN4GqzEgtdlKqEdC4RiRaC+guw213SFaL9U=; b=snZrxGQbIXL9cpzFkiSijBvmUG TvkFKypJEF94cqef1WB9f6dhMJUnZVnxIwQjF+d+MxGMmBP6mX1+j7AjyI1t1U+WNNkND3DxS9lZu DWKG6ZHcWt2tXyjT3KUpCGn5Qrn235G1jhBx8pjRqxStOg/vCMAGClk0AMlt1y8whKS8=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 1/7] xen/guest_access: Add missing emacs magics Date: Sat, 4 Apr 2020 14:10:11 +0100 Message-Id: <20200404131017.27330-2-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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 missing emacs magics for xen/guest_access.h and asm-x86/guest_access.h. Signed-off-by: Julien Grall Acked-by: Jan Beulich --- 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 0b58f2baee..9ee275d01f 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -175,3 +175,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 09989df819..ef9aaa3efc 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 Mon Apr 29 14:10:11 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=1586005874; cv=none; d=zohomail.com; s=zohoarc; b=RvyONGjm6o8Xgh9WLDvv5vyowLogyVOc+L/W/3kUBRY79jKTUtLrftPxPDQ675NjTkVCjOjSc6xTB1lb0cemNiNmeendLUYtyjqPvxNiBxaDUoRlsyMgYpxNVk3fUdPaSXtH3jNXNfQokosRD4T5eQH8aXKqnTVU0JDV2f2WovA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005874; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=OCcHpjmQmhgOeKrDB+npwO03tYkJM3G16mLTFLIt6vs=; b=CWzrK9Fx1vKZy9ZHHyxkMRIDBo0LdKxAzH7iOtAntprdb4GEnP+TlA3b/CNqOhl8gNXp6GuXU3oF8aXlRWw1CDLhGJiLgffe+J6/2SuaktNQK8xwuw5f43tntfxT8A/LysfaC0mpTSC8PYdgelkDvtyn5SYXomkZ2WuqmvMU/zM= 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 1586005874285859.4255383604627; Sat, 4 Apr 2020 06:11:14 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZN-0005oY-VK; Sat, 04 Apr 2020 13:10: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.89) (envelope-from ) id 1jKiZM-0005nk-9I for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:40 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a8b10442-7675-11ea-be20-12813bfff9fa; Sat, 04 Apr 2020 13:10:30 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZB-0008Fa-R9; Sat, 04 Apr 2020 13:10:29 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZB-0007rM-IJ; Sat, 04 Apr 2020 13:10:29 +0000 X-Inumbo-ID: a8b10442-7675-11ea-be20-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=OCcHpjmQmhgOeKrDB+npwO03tYkJM3G16mLTFLIt6vs=; b=f/JfCmsrAcCypyBAiMdT1pYYlh yWlrNssjI//3TehSSFHdVMD5v6CeVPaM3FsHVQ2kxFLYrxdiBEQ12S4Pv4EcYt2ml/pxVScbHPioP UAS5CcC/aGD3YNPcYpbVk2RUKqJgdgruCYbtUiNG6SvMZutW5Cwq07onWvRiJD/01qBA=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 2/7] xen/arm: kernel: Re-order the includes Date: Sat, 4 Apr 2020 14:10:12 +0100 Message-Id: <20200404131017.27330-3-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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 8eff074836..f95fa392af 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 Mon Apr 29 14:10:11 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=1586005873; cv=none; d=zohomail.com; s=zohoarc; b=JUEabFzVdLKmHGueFjDJSoz8Q9GkGwJKuyE7GjUKm3x57zy5/UVUtTYWFvXEzAfEgMS1TfJ3tTs58loBH6FnEMEO9y2pUm6fjuioKjnQwVjJgwa5Ir97xjGzqOLQXOYuJ6oP5RaX/EYfYOO+lSYVBkNdgUGCwmYpUV9JRmu7c+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005873; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=IbfxDvUU3r+UopRQDKG0coR2ogjCp6rmXPtnRoSVZOs=; b=SQIWH/9H5G9mzzq9MRuEs24e6vgS8U8bRPRF8+FSVZ6J6xuO+UVdu7Zg8OUoGNFin21M7Yx//mF1q2qBJEKLEMUJoXqa6Qtf2Lqs0flcvPlsXGQe6lY8AY+9CVuENG5qPa4LH5ZFZy8QOFrWyIrCKIfSvMvhiAOmV2EMi4VZRJo= 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 1586005873002222.42011876372067; Sat, 4 Apr 2020 06:11:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZE-0005kS-Vr; Sat, 04 Apr 2020 13:10:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZD-0005kH-Pl for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:31 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a96112d8-7675-11ea-9e09-bc764e2007e4; Sat, 04 Apr 2020 13:10:31 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZC-0008Fn-So; Sat, 04 Apr 2020 13:10:30 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZC-0007rM-Jx; Sat, 04 Apr 2020 13:10:30 +0000 X-Inumbo-ID: a96112d8-7675-11ea-9e09-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=IbfxDvUU3r+UopRQDKG0coR2ogjCp6rmXPtnRoSVZOs=; b=MEVkTDcoXfkDtJsYM62DK5Npnf b6aXYCgdZW1mTq6uwWOcRIjKviemkf5SYW+E2L1Fguuvg5CwHjudNHIgdmmO8K69NG77lRwnDCFyf g9HkB5K6SwZGBl9cY2D4vBuut2kBYAunJwVyLXfWg577EvmtNho+g8q9qvmrXoeG45sA=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 3/7] xen/arm: decode: Re-order the includes Date: Sat, 4 Apr 2020 14:10:13 +0100 Message-Id: <20200404131017.27330-4-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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 8b1e15d118..144793c8ce 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 f95fa392af..032923853f 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 Mon Apr 29 14:10:11 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=1586005874; cv=none; d=zohomail.com; s=zohoarc; b=EMaQOlM0VgE4kCgSvjkufiVKjrq7CcqGQYAbCUjt20hDH2c/W/nkWD0RYl7eATIliwYB9W7Pw5VnKHP3HkL+0mq7XKFitel5ohy8BQ070n6trRPxySj/vqe9IazBJ1vZB6nDTFa/QfWFhcBY21G0i4A+zxWVgXQ/vN2khStbU3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005874; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=+tO8vmyclMR2riCnUA1LGwK2u7jI5ubOgyvQNM5VRyc=; b=QVFPY+ioGJcZ/GcaYtSCYdemqec4YjG43P61KUZgilxnVy8AskgNh1y47pr/ojstUHHHG3otA+XE+uI23nVhQay0EAN/BjSRbJQPWEJ1axtIab+7CB7c5Lk1C3MfB30yvE5FcXkjbaX6bXMZbEd8jgf+ppQmAyv2SUX9sDAtLQM= 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 1586005874375461.0815684530445; Sat, 4 Apr 2020 06:11:14 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZS-0005s6-HH; Sat, 04 Apr 2020 13:10: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.89) (envelope-from ) id 1jKiZR-0005rB-9S for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:45 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a9f79992-7675-11ea-be20-12813bfff9fa; Sat, 04 Apr 2020 13:10:32 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZD-0008Fw-UH; Sat, 04 Apr 2020 13:10:31 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZD-0007rM-La; Sat, 04 Apr 2020 13:10:31 +0000 X-Inumbo-ID: a9f79992-7675-11ea-be20-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=+tO8vmyclMR2riCnUA1LGwK2u7jI5ubOgyvQNM5VRyc=; b=0HRt2MmEAEkY8+v/JkVp5wObIA H4TmInyiNODwo2V9hmAd/TwLKeZw7sJa3Wf7mV7F/X5mhAT0QCCCmVxELf5JLEQ1H7skBlfp4pYO0 h4NVVQRnSjABlYi+TIiVgOp834+aST6jJbEHfeUQgvBw/CkGxIxI1TCJ84rnXu4oxvXM=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 4/7] xen/arm: guestcopy: Re-order the includes Date: Sat, 4 Apr 2020 14:10:14 +0100 Message-Id: <20200404131017.27330-5-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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 7a0f3e9d5f..c8023e2bca 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 Mon Apr 29 14:10:11 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=1586005879; cv=none; d=zohomail.com; s=zohoarc; b=LhVf6q2Ec/8Gw/iSEG/7ls/RVvLcsRP30gH9Nb8esWRpHUK4wVMQzVns671HSTqHftpKduFf97lMbkxNPbTOefzb9FLzS/b4E5fX+Xlchwib+ZGW8d0zCra6B5ZOqZdDw4f1w9Smq515MuB6LEw+GDJq1TwxbdmDvSyT8SBEo1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005879; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=3TNR7ldYljZZcx1x7OLW4LGPIWLoF2a6IJjm2LPtFSs=; b=QFjWERdFsiDBVFuz0h5lEm1H/5kgyoABQ6y1HqVKX4N0rz70ctz6tK5SlNFa+bmHEg0kN9jhf9t65VwjC7i6fPoP/wsDNTU7jm0upf5VGh+t44p+B2fAIuNXlEe10UDHFvviU797YmgUAEeuwI9x6w5sw+dfSQPVvp2KtinxIqM= 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 1586005879817743.8499556007503; Sat, 4 Apr 2020 06:11:19 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZX-0005vN-R9; Sat, 04 Apr 2020 13:10:51 +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.89) (envelope-from ) id 1jKiZW-0005uY-9g for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:50 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id abf13c0a-7675-11ea-be20-12813bfff9fa; Sat, 04 Apr 2020 13:10:36 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZG-0008G9-1N; Sat, 04 Apr 2020 13:10:34 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZF-0007rM-Oh; Sat, 04 Apr 2020 13:10:33 +0000 X-Inumbo-ID: abf13c0a-7675-11ea-be20-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=3TNR7ldYljZZcx1x7OLW4LGPIWLoF2a6IJjm2LPtFSs=; b=LOBkKd6QLC9U68DkJii93KqBIO XI4MvnFuoczBqtJCCRyQ6w19PwxWS9q4mnVoAC8oX7kO1jaSEyFz0AcT3Nd6zgRpB3hB2zsBjrSAd Eh2hL93k2Ow1FD4PIVCk0TCuiGhtTd+HzV+3Qom7lgHHB5FB7MbIama2TeVsJ7p3HKg8=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 5/7] xen: include xen/guest_access.h rather than asm/guest_access.h Date: Sat, 4 Apr 2020 14:10:15 +0100 Message-Id: <20200404131017.27330-6-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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 --- 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/include/asm-x86/guest_access.h | 22 ++++++++++++---------- xen/lib/x86/private.h | 2 +- 12 files changed, 23 insertions(+), 21 deletions(-) diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c index 144793c8ce..792c2e92a7 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 2190d908eb..b062c232b6 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 a1cdd7f4af..b4496c4c86 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 c8023e2bca..32681606d8 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 6e153c698d..58d939b85f 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 888f504a94..9e14a451eb 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 977c1bc54f..dc7183a546 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 1c398fdb6e..98e9c91ea3 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 0f468727d0..629cc0d3e6 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 4046d50347..93d56868f1 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/include/asm-x86/guest_access.h b/xen/include/asm-x86/guest= _access.h index 9ee275d01f..5c3dfc47b6 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -54,22 +54,24 @@ =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 \ * 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); \ + (void)(&_x =3D=3D &_y.p); \ + _y; \ }) =20 /* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */ -#define guest_handle_from_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_from_param(hnd, type) ({ \ + typeof((hnd).p) _x =3D (hnd).p; \ + XEN_GUEST_HANDLE(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; \ }) =20 #define guest_handle_for_field(hnd, type, fld) \ diff --git a/xen/lib/x86/private.h b/xen/lib/x86/private.h index b793181464..2d53bd3ced 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 Mon Apr 29 14:10:11 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=1586005873; cv=none; d=zohomail.com; s=zohoarc; b=hTZu3UWhKIF2cf3lqQ3P6ErpCsoMKPRvwyoBz2XpLbXOQmn39OADfrZ0/ZTTqY1QdIzOg+Qumd2sTjbS0Hjts4X/5kA6mz/jQ2QYDsq+4/5bC49SwVFZRX04donpCgUB9bw2nvA7i0MaASCB7kXVjxqQglVGsBtp6BxzC23rpq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005873; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=2KVd9Es5qkvi4krAUOXQh+SiaZpifjYJb0HSi4zdhJ4=; b=Oubg0cyKdKc78zr9XAOfmTEd8xaoYQaC4jCiEP1vt22y9GQ38SLvE9e7Il7Hz1gTaJCtwzUpDvFxnmcuXKqP7Kq+ksG1iK3VI+ruOgSrnaNANwtijirwbjWQgRXXsqeGUXzU3uV5xi5heaYh3sy4Bg8m2e9P93BpyTSTBrpPX+4= 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 158600587316862.557526290767214; Sat, 4 Apr 2020 06:11:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZK-0005mZ-I4; Sat, 04 Apr 2020 13:10:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZJ-0005mM-SN for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:37 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ac7c9e60-7675-11ea-9e09-bc764e2007e4; Sat, 04 Apr 2020 13:10:36 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZH-0008GB-TI; Sat, 04 Apr 2020 13:10:35 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZH-0007rM-GY; Sat, 04 Apr 2020 13:10:35 +0000 X-Inumbo-ID: ac7c9e60-7675-11ea-9e09-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=2KVd9Es5qkvi4krAUOXQh+SiaZpifjYJb0HSi4zdhJ4=; b=QtNq3JJ3b6BYsCZc02bpUPJ5WF +YY/18cBJ3E3gBQ+KbEIvJIILWYh9M7TeCfk7mQhFqHc5Kx9Mv7cCzV6KiV+1LJU5OPB64K6anWaS qIFhN3X9jV19yPmmNBMKqNz9dsVrmLa9XH8Ttrs2EURqPeZyVkAVqDCvkkkh+/G/YYA8=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 6/7] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h Date: Sat, 4 Apr 2020 14:10:16 +0100 Message-Id: <20200404131017.27330-7-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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. 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 --- xen/include/asm-arm/guest_access.h | 131 ---------------------------- xen/include/asm-x86/guest_access.h | 125 -------------------------- xen/include/xen/guest_access.h | 135 +++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 256 deletions(-) diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest= _access.h index 93d56868f1..53766386d3 100644 --- a/xen/include/asm-arm/guest_access.h +++ b/xen/include/asm-arm/guest_access.h @@ -23,102 +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 }; \ -}) - -/* 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; \ -}) - - -/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */ -#define guest_handle_from_param(hnd, type) ({ \ - typeof((hnd).p) _x =3D (hnd).p; \ - XEN_GUEST_HANDLE(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. - * - * The variable _t is only here to catch at build time whether we are - * copying back to a const guest handle. - */ -#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - void *__maybe_unused _t =3D (hnd).p; \ - ((void)((hnd).p =3D=3D (ptr))); \ - 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 &(ptr)->field)); \ - 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. @@ -127,41 +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 -/* - * The variable _t is only here to catch at build time whether we are - * copying back to a const guest handle. - */ -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - void *__maybe_unused _t =3D (hnd).p; \ - ((void)((hnd).p =3D=3D (ptr))); \ - __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 &(ptr)->field)); \ - __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 5c3dfc47b6..08c9fbbc78 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -38,95 +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 }; \ -}) - -/* 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; \ -}) - -/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */ -#define guest_handle_from_param(hnd, type) ({ \ - typeof((hnd).p) _x =3D (hnd).p; \ - XEN_GUEST_HANDLE(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. - * - * The variable _t is only here to catch at build time whether we are - * copying back to a const guest handle. - */ -#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - void *__maybe_unused _t =3D (hnd).p; \ - ((void)((hnd).p =3D=3D (ptr))); \ - 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 &(ptr)->field)); \ - 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. @@ -140,42 +51,6 @@ (last)-(first)+1, \ sizeof(*(hnd).p))) =20 -/* - * The variable _t is only here to catch at build time whether we are - * copying back to a const guest handle. - */ -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - void *__maybe_unused _t =3D (hnd).p; \ - ((void)((hnd).p =3D=3D (ptr))); \ - __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 &(ptr)->field)); \ - __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 ef9aaa3efc..f724f995c3 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -11,6 +11,99 @@ #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; \ +}) + +/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */ +#define guest_handle_from_param(hnd, type) ({ \ + typeof((hnd).p) _x =3D (hnd).p; \ + XEN_GUEST_HANDLE(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. + * + * The variable _t is only here to catch at build time whether we are + * copying back to a const guest handle. + */ +#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + void *__maybe_unused _t =3D (hnd).p; \ + ((void)((hnd).p =3D=3D (ptr))); \ + 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 &(ptr)->field)); \ + 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 +113,48 @@ #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(). + */ + +/* + * The variable _t is only here to catch at build time whether we are + * copying back to a const guest handle. + */ +#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ + const typeof(*(ptr)) *_s =3D (ptr); \ + char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ + void *__maybe_unused _t =3D (hnd).p; \ + ((void)((hnd).p =3D=3D (ptr))); \ + __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 &(ptr)->field)); \ + __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 Mon Apr 29 14:10:11 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=1586005872; cv=none; d=zohomail.com; s=zohoarc; b=n0NZ4x6dEaKhRgDLYCRHh42/diVdy9xk+ithcTS3hb2qm5W6SwKl0knmFzXyH16RVOdGCY5Iz3Rr+buMsg+5f15KL4ODDorymM9lwLn0QpHGjpFbSxYu0VFFa++jJejlT7YbWcghtZhZTsVGixnEDpMBetxNKJ1sxK7e616rT4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586005872; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=96KKJCpdFR7vcoVbtVCMECvOok+zumfKbz+sn1zOelQ=; b=OHasc8bSmXyszPfhx4IgQVbkGORCGw01aZtLIoma5l11sZusSjWCGQZOssZVFTonIOrodwKmJX5JgCBZFEnapifC2lR9YvlUFYRwA6wugek/Lwkvz/CFWDY1OvqGCyM6HH7a3Ork86FoHeoI9Nm1hdNoW1wg7+dkoiKEVDCGmG8= 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 1586005872903298.88000150391497; Sat, 4 Apr 2020 06:11:12 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZP-0005pQ-8U; Sat, 04 Apr 2020 13:10:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZN-0005oN-Pd for xen-devel@lists.xenproject.org; Sat, 04 Apr 2020 13:10:41 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ad8c47ce-7675-11ea-83d8-bc764e2007e4; Sat, 04 Apr 2020 13:10:38 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jKiZJ-0008GL-Dm; Sat, 04 Apr 2020 13:10:37 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jKiZJ-0007rM-4v; Sat, 04 Apr 2020 13:10:37 +0000 X-Inumbo-ID: ad8c47ce-7675-11ea-83d8-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=96KKJCpdFR7vcoVbtVCMECvOok+zumfKbz+sn1zOelQ=; b=Bx9n5y4PjUGHo9AVvHd2x09TNy TzNfGgA1U4JsvJ0O5lI95rOe59MG2dt7/T6KkhncRsXe7kXnJoEUo5FclmYSB1CDHd4AAZil3WNIX sIKH/nJQa9hxaOzdGEbR0i1bMo/tRHBXwR1yhUD9VL0Za4XDcSOs2rh69HPsMFd3nBJk=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH 7/7] xen/guest_access: Fix coding style in xen/guest_access.h Date: Sat, 4 Apr 2020 14:10:17 +0100 Message-Id: <20200404131017.27330-8-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200404131017.27330-1-julien@xen.org> References: <20200404131017.27330-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 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 | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index f724f995c3..24f03a84ff 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; \ }) @@ -40,9 +44,11 @@ #define guest_handle_from_param(hnd, type) ({ \ typeof((hnd).p) _x =3D (hnd).p; \ XEN_GUEST_HANDLE(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; \ }) @@ -123,12 +129,12 @@ * The variable _t is only here to catch at build time whether we are * copying back to a const guest handle. */ -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(*(ptr)) *_s =3D (ptr); \ - char (*_d)[sizeof(*_s)] =3D (void *)(hnd).p; \ - void *__maybe_unused _t =3D (hnd).p; \ - ((void)((hnd).p =3D=3D (ptr))); \ - __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; \ + void *__maybe_unused _t =3D (hnd).p; \ + ((void)((hnd).p =3D=3D (ptr))); \ + __raw_copy_to_guest(_d + (off), _s, sizeof(*_s) * (nr));\ }) =20 #define __clear_guest_offset(hnd, off, nr) ({ \ @@ -136,10 +142,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