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:58:57 +0100 Message-ID: <536906C1.6050109@linaro.org> References: <1399045930-17364-1-git-send-email-julien.grall@linaro.org> <1399045930-17364-2-git-send-email-julien.grall@linaro.org> <536760F7020000780000EDD1@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Whhll-00061b-0L for xen-devel@lists.xenproject.org; Tue, 06 May 2014 15:59:02 +0000 Received: by mail-ee0-f47.google.com with SMTP id c13so868624eek.20 for ; Tue, 06 May 2014 08:58:59 -0700 (PDT) In-Reply-To: <536760F7020000780000EDD1@mail.emea.novell.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: Jan Beulich Cc: Keir Fraser , ian.campbell@citrix.com, tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 05/05/2014 08:59 AM, Jan Beulich wrote: >>>> On 02.05.14 at 17:52, wrote: >> --- 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) >> + >> /* Linux compatibility. */ >> #define get_cpu_var(var) this_cpu(var) >> #define put_cpu_var(var) > > I can only second Andrew's comment - without it becoming clear when > and why this would be used, this isn't going to be acceptable (and if > it really was correct and worthwhile, this small a change wouldn't need > separating out from the code that's intended to actually make use of it). It's used in the next patch (ie #2). I thought it was better to move out this small change rather than introducing it in the patch. This macro is here for a shortcut of per_cpu(myvar, 0). We have few usage on ARM, most of them are during boot. There is another when a secondary CPUs is booting. We need to retrieve the PPIs type (level/edge...) from the boot CPU. As said in the answer to Andrew, I can either move this macro in an ARM specific header or open code per_cpu(...,0). Regards, -- Julien Grall