From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arianna Avanzini Subject: Re: [RFC PATCH 1/3] arch, arm32: add definition of paddr_bits Date: Fri, 07 Mar 2014 01:36:37 +0100 Message-ID: <53191495.3050202@gmail.com> References: <1393721365-22458-1-git-send-email-avanzini.arianna@gmail.com> <1393721365-22458-2-git-send-email-avanzini.arianna@gmail.com> <5312E835.4080700@linaro.org> Reply-To: Arianna Avanzini Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5312E835.4080700@linaro.org> 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 , xen-devel@lists.xen.org Cc: paolo.valente@unimore.it, Ian Campbell , stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, Tim Deegan , julien.grall@citrix.com, etrudeau@broadcom.com, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org On 03/02/2014 09:13 AM, Julien Grall wrote: > Hello Arianna, > Hello, > On 02/03/14 08:49, Arianna Avanzini wrote: >> Currently, the paddr_bits variable, which keeps the machine word size, >> is not defined for the arm32 architecture. This commits adds its >> definition for arm32 in a new header in the architecture-specific >> directory. >> This change is instrumental to the implementation of the >> XEN_DOMCTL_memory_mapping hypercall, added in the following >> commit. > > paddr_bits doesn't keep the machine word size but the size of the physical address. > > On ARM, this value is fixed and defined as PADDR_BITS in > xen/include/asm-arm/page.h. I don't think we need to introduce a variable for > this purpose. x86 defines paddr_bits because the value can change on some > processor. > Thank you for explaining that. I've tried to fix as suggested. >> diff --git a/xen/arch/arm/arm32/cpu.h b/xen/arch/arm/arm32/cpu.h >> new file mode 100644 >> index 0000000..1091051 >> --- /dev/null >> +++ b/xen/arch/arm/arm32/cpu.h >> @@ -0,0 +1,7 @@ >> +#ifndef __ARM_ARM32_CPU_H >> +#define __ARM_ARM32_CPU_H >> + >> +/* ARM-v7 features LPAE (machine word size is 40 bit) */ >> +unsigned int paddr_bits = 40; >> + > > Global variable must not be defined in headers. If someone decides to include > this header in 2 differents C files, the variable will be defined twice. > Therefore the linker-step will fail. > > You should define it in a c-file. > OK, thank you again. > Regards, > -- /* * Arianna Avanzini * avanzini.arianna@gmail.com * 73628@studenti.unimore.it */