From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v5 1/6] xen: Add convenient macro boot_cpu Date: Tue, 06 May 2014 16:54:04 +0100 Message-ID: <5369059C.7060506@linaro.org> References: <1399045930-17364-1-git-send-email-julien.grall@linaro.org> <1399045930-17364-2-git-send-email-julien.grall@linaro.org> <5363C07F.8040603@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Whhh4-0005XY-Vz for xen-devel@lists.xenproject.org; Tue, 06 May 2014 15:54:11 +0000 Received: by mail-ee0-f46.google.com with SMTP id t10so2909693eei.33 for ; Tue, 06 May 2014 08:54:06 -0700 (PDT) In-Reply-To: <5363C07F.8040603@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , ian.campbell@citrix.com, tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Hi Andrew, On 05/02/2014 04:57 PM, Andrew Cooper wrote: > On 02/05/14 16:52, Julien Grall wrote: >> The macro boot_cpu will be used to get CPU variable from the boot CPU. >> >> Signed-off-by: Julien Grall >> Suggested-by: Ian Campbell >> Cc: Ian Jackson >> Cc: Jan Beulich >> Cc: Keir Fraser >> --- >> xen/include/xen/percpu.h | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/xen/include/xen/percpu.h b/xen/include/xen/percpu.h >> index abe0b11..0e848bf 100644 >> --- a/xen/include/xen/percpu.h >> +++ b/xen/include/xen/percpu.h >> @@ -16,6 +16,9 @@ >> /* Preferred on Xen. Also see arch-defined per_cpu(). */ >> #define this_cpu(var) __get_cpu_var(var) >> >> +/* Access variable on boot CPU */ >> +#define boot_cpu(var) per_cpu(var, 0) >> + > > What is this actually used for? I use it to retrieve PPIs (per-processor interrupt) type and initialize PPIs for the new CPUs. > In x86 with arbitrary cpu hotplug, we are trying to move away from the > false assumption than cpu0 is the boot cpu. Actual boot data is stored > sideways as boot_$FOO variables, and not accessed with the per-cpu > mechanism. My solution won't work for hotplug. As it's not supported for ARM right now, I think we can live with it. I can either drop the macro or make ARM specific for now. Regards, -- Julien Grall