[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH 1/3] arch, arm32: add definition of paddr_bits

Hello Arianna,

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
This change is instrumental to the implementation of the
XEN_DOMCTL_memory_mapping hypercall, added in the following

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.

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.


Julien Grall

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.