From patchwork Fri Jul 26 21:08:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11061835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CED4112C for ; Fri, 26 Jul 2019 21:10:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2F3E28A4F for ; Fri, 26 Jul 2019 21:10:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6D9428ABF; Fri, 26 Jul 2019 21:10:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0DCE828A4F for ; Fri, 26 Jul 2019 21:10:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hr7Sd-0001Ps-07; Fri, 26 Jul 2019 21:09:07 +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 1hr7Sb-0001PR-5E for xen-devel@lists.xenproject.org; Fri, 26 Jul 2019 21:09:05 +0000 X-Inumbo-ID: 9816f932-afe9-11e9-a62d-0305b2eb3a58 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9816f932-afe9-11e9-a62d-0305b2eb3a58; Fri, 26 Jul 2019 21:09:02 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: nLfSvIWUAeJeqc1qom8x964S9G6ziYAPUQMteMYxkJvsO962ISb1O5dYE7j8kuv9eY6ZHl2PlB DjRNJ4upQFSB1A3QlsZnWgoaQGKa+APZxB6WeSQHnt3Xp9pNMDT+XL8Y8QZPtLWFirXDPqxCAf rv65aSKh/TVuW7ahkuaizAlzDFYlBiea45Zy5NCyv4gsWyBVMv6jSd0SwtPSYcSmclvkRQaxuz xXolUZzSLJkitTPXjhHxKsONGvBDBvZUbsm0wgLOtp0r/Dt41u5Yrc7mkisFE07B5gSfHT8u+z LhY= X-SBRS: 2.7 X-MesageID: 3511835 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,312,1559534400"; d="scan'208";a="3511835" From: Andrew Cooper To: Xen-devel Date: Fri, 26 Jul 2019 22:08:54 +0100 Message-ID: <20190726210854.6408-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190726210854.6408-1-andrew.cooper3@citrix.com> References: <20190726210854.6408-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 4/4] xen/percpu: Make DECLARE_PER_CPU() and __DEFINE_PER_CPU() common 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 , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP These macros are identical across the architectures, and shouldn't be separate from the DEFINE_PER_CPU*() infrastructure. This converts the final asm/percpu.h includes, which were all using DECLARE_PER_CPU(), to include xen/percpu.h instead. Signed-off-by: Andrew Cooper Acked-by: Julien Grall Reviewed-by: Roger Pau Monné --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk --- xen/arch/x86/cpu/mcheck/mce.h | 3 ++- xen/include/asm-arm/percpu.h | 5 ----- xen/include/asm-x86/cpuid.h | 2 +- xen/include/asm-x86/irq.h | 2 +- xen/include/asm-x86/percpu.h | 5 ----- xen/include/xen/percpu.h | 6 ++++++ xen/xsm/flask/include/avc.h | 3 ++- 7 files changed, 12 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h index f2cebccdd1..7dcea7b454 100644 --- a/xen/arch/x86/cpu/mcheck/mce.h +++ b/xen/arch/x86/cpu/mcheck/mce.h @@ -3,12 +3,13 @@ #define _MCE_H #include +#include #include #include + #include #include #include -#include #include "x86_mca.h" #include "mctelem.h" diff --git a/xen/include/asm-arm/percpu.h b/xen/include/asm-arm/percpu.h index 5ce81a1707..f1a8768080 100644 --- a/xen/include/asm-arm/percpu.h +++ b/xen/include/asm-arm/percpu.h @@ -10,9 +10,6 @@ extern char __per_cpu_start[], __per_cpu_data_end[]; extern unsigned long __per_cpu_offset[NR_CPUS]; void percpu_init_areas(void); -#define __DEFINE_PER_CPU(attr, type, name) \ - attr __typeof__(type) per_cpu_ ## name - #define per_cpu(var, cpu) \ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) #define this_cpu(var) \ @@ -23,8 +20,6 @@ void percpu_init_areas(void); #define this_cpu_ptr(var) \ (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2))) -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name - #endif #endif /* __ARM_PERCPU_H__ */ diff --git a/xen/include/asm-x86/cpuid.h b/xen/include/asm-x86/cpuid.h index 548108f948..1b00e832d6 100644 --- a/xen/include/asm-x86/cpuid.h +++ b/xen/include/asm-x86/cpuid.h @@ -2,11 +2,11 @@ #define __X86_CPUID_H__ #include -#include #ifndef __ASSEMBLY__ #include #include +#include #include #include diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h index bc0c0c15d2..d3124f7b5d 100644 --- a/xen/include/asm-x86/irq.h +++ b/xen/include/asm-x86/irq.h @@ -6,10 +6,10 @@ #include #include #include +#include #include #include #include -#include extern unsigned int nr_irqs_gsi; extern unsigned int nr_irqs; diff --git a/xen/include/asm-x86/percpu.h b/xen/include/asm-x86/percpu.h index 5b6cef04c4..2b0c29a233 100644 --- a/xen/include/asm-x86/percpu.h +++ b/xen/include/asm-x86/percpu.h @@ -7,17 +7,12 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; void percpu_init_areas(void); #endif -#define __DEFINE_PER_CPU(attr, type, name) \ - attr __typeof__(type) per_cpu_ ## name - /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) \ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) #define this_cpu(var) \ (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset)) -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name - #define this_cpu_ptr(var) \ (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset)) diff --git a/xen/include/xen/percpu.h b/xen/include/xen/percpu.h index 71a31cc361..48a43f769d 100644 --- a/xen/include/xen/percpu.h +++ b/xen/include/xen/percpu.h @@ -3,6 +3,12 @@ #include +#define DECLARE_PER_CPU(type, name) \ + extern __typeof__(type) per_cpu__ ## name + +#define __DEFINE_PER_CPU(attr, type, name) \ + attr __typeof__(type) per_cpu_ ## name + /* * Separate out the type, so (int[3], foo) works. * diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h index 93386bd7a1..c14bd07a2b 100644 --- a/xen/xsm/flask/include/avc.h +++ b/xen/xsm/flask/include/avc.h @@ -11,8 +11,9 @@ #include #include +#include #include -#include + #include "flask.h" #include "av_permissions.h" #include "security.h"