From: "Jan Beulich" Subject: Re: [PATCH v5 1/6] xen: Add convenient macro boot_cpu Date: Tue, 06 May 2014 17:04:40 +0100 Message-ID: <53692438020000780000F8BA@mail.emea.novell.com> 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> <536906C1.6050109@linaro.org> 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 1WhhrI-0007B0-SF for xen-devel@lists.xenproject.org; Tue, 06 May 2014 16:04:45 +0000 In-Reply-To: <536906C1.6050109@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall 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 06.05.14 at 17:58, wrote: > 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). Either is fine with me, but putting this in common code isn't. Jan