xen: arm: rework early bring up
Subsystems (2)
v2 cover xen: arm: rework early bring up
The following reworks early bring up on ARM to use a separate set of boot pagetables. This simplifies things by avoiding the need to bring up all CPUs in lock step, which in turn allows us to do secondary CPU bringup in C code.
Unfortunately the main bulk of this change is a single large patch which is hard to decompose any further since it is basically pulling on the thread and then knitting a new jumper from it.
With these changes Xen now absolutely requires that the bootloader calls the hypervisor in HYP mode, the previous workarounds have been removed. For use on models a bootwrapper is now required. See
git://xenbits.xen.org/people/ianc/boot-wrapper.git xen-arm32
git://xenbits.xen.org/people/ianc/boot-wrapper-aarch64.git xen-arm64
I have implemented support for CPU bringup on the fastmodel vexpress platforms (v7and v8) here, I suppose it should work OK on a real vexpress too but I've not tried it.
I'm hoping that those of you with access to other platforms will implement the required cpu_up platform hook, it should be pretty simple in each case, I think.
It should now also be possible to implement PSCI, but I have not done so.
Changes since v1/RFC:
* Split a bit of the megapatch into a precursor "xen: arm:
implement arch/platform SMP and CPU initialisation framework". It's not much but it does make the big patch slightly more manageable.
* Reimplement a bring up gate in start secondary. On some platforms (vexpress, probably others) it is hard to wake up just a single CPU so this ensures that only one CPU goes through bring up at a time (a requirement due to only having one set of boot pagetables). This all happens at the relocated physical address though and so is much simpler than the old gates
* Lots of cleanup to the ASM code based on Tim & Juliens review.
* Use symbolic names for MPIDR bits.
PATCH v2 1/9 xen: arm: Load xen under 4GB on 32-bit
We need to be able to use a 1:1 mapping during bring up.
--- xen/arch/arm/setup.c | 8 ++++++++ 1 file changed, 8 insertions(+)
xen/arch/arm/setup.c +8 -0
@@ -258,6 +258,14 @@ static paddr_t __init get_xen_paddr(void)if ( !e )continue ; +#ifdef CONFIG_ARM_32 +/* Xen must be under 4GB */ +if ( e >0x100000000ULL ) + e =0x100000000ULL ; +if ( e < bank->start ) +continue ; +#endif + s = e - min_size;if ( s > paddr )
Signature · 1 line
1.7.10.4
PATCH v2 2/9 xen: arm: Log the raw MIDR on boot.
In reply to Ian Campbell---
v2: Fixed overlong line
--- xen/arch/arm/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
xen/arch/arm/setup.c +3 -2
@@ -83,8 +83,9 @@ static void __init processor_id(void)printk ("Huh, cpu architecture %x, expected 0xf (defined by cpuid)\n" , c->midr.architecture); -printk ("Processor: \"%s\", variant: 0x%x, part 0x%03x, rev 0x%x\n" , - implementer, c->midr.variant, c->midr.part_number, c->midr.revision); +printk ("Processor: %08" PRIx32": \"%s\", variant: 0x%x, part 0x%03x, rev 0x%x\n" , + c->midr.bits, implementer, + c->midr.variant, c->midr.part_number, c->midr.revision);#if defined(CONFIG_ARM_64 )printk ("64-bit Execution:\n" );
Signature · 1 line
1.7.10.4
PATCH v2 3/9 xen: arm: make sure we stay within the memory bank during mm setup
In reply to Ian CampbellOtherwise if there is a module in another bank we can run off the end.
Rename *n to *end to make it clearer what is happening.
---
v2: Improve commend. s/*n/*end/
--- xen/arch/arm/setup.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
xen/arch/arm/setup.c +10 -3
@@ -207,9 +207,11 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e,* Return the end of the non-module region starting at s. In other * words return s the start of the next modules after s. * -* Also returns the end of that module in *n. +* On input *end is the end of the region wihch should be considered +* and is updated to reflect the end of the module, clipped to the end +* of the region if it would run over. */ -static paddr_t __init next_module (paddr_t s,paddr_t *n) +static paddr_t __init next_module (paddr_t s,paddr_t *end) {struct dt_module_info *mi = &early_info.modules;paddr_t lowest = ~(paddr_t )0 ;
@@ -224,8 +226,10 @@ static paddr_t __init next_module(paddr_t s, paddr_t *n)continue ;if ( mod_s > lowest )continue ; +if ( mod_s > *end ) +continue ; lowest = mod_s; - *n = mod_e; + *end =min (*end, mod_e); }return lowest; }
@@ -454,6 +458,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) e = n = bank_end; } +if ( e > bank_end ) + e = bank_end; +setup_xenheap_mappings (s>>PAGE_SHIFT , (e-s)>>PAGE_SHIFT ); xenheap_mfn_end = e;
Signature · 1 line
1.7.10.4
Re: [PATCH v2 3/9] xen: arm: make sure we stay within the memory bank during mm setup
Quoted 16 lines · Ian Campbell
Otherwise if there is a module in another bank we can run off the end.
Rename *n to *end to make it clearer what is happening.
Signed-off-by Ian Campbell <[email protected]>---
v2: Improve commend. s/*n/*end/--- xen/arch/arm/setup.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)xen/arch/arm/setup.c +0
-0
xen/arch/arm/setup.c static paddr_t __init consider_modules(paddr_t s, paddr_t e, · line 210
Quoted 5 lines
xen/arch/arm/setup.c +1
-1@@ -207,9 +207,11 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e,* Return the end of the non-module region starting at s. In other * words return s the start of the next modules after s. * -* Also returns the end of that module in *n. +* On input *end is the end of the region wihch should be considered
s/wihch/which
Except this minor typo:
Quoted 31 lines
xen/arch/arm/setup.c +9
-2+* and is updated to reflect the end of the module, clipped to the end +* of the region if it would run over. */ -static paddr_t __init next_module (paddr_t s,paddr_t *n) +static paddr_t __init next_module (paddr_t s,paddr_t *end) {struct dt_module_info *mi = &early_info.modules;paddr_t lowest = ~(paddr_t )0 ;@@ -224,8 +226,10 @@ static paddr_t __init next_module(paddr_t s, paddr_t *n)continue ;if ( mod_s > lowest )continue ; +if ( mod_s > *end ) +continue ; lowest = mod_s; - *n = mod_e; + *end =min (*end, mod_e); }return lowest; }@@ -454,6 +458,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) e = n = bank_end; } +if ( e > bank_end ) + e = bank_end; +setup_xenheap_mappings (s>>PAGE_SHIFT , (e-s)>>PAGE_SHIFT ); xenheap_mfn_end = e;
Signature · 1 line
Julien Grall
Re: [PATCH v2 3/9] xen: arm: make sure we stay within the memory bank during mm setup
In reply to Ian CampbellQuoted 7 lines · Ian Campbell
Otherwise if there is a module in another bank we can run off the end.
Rename *n to *end to make it clearer what is happening.
Signed-off-by Ian Campbell <[email protected]>+ * On input *end is the end of the region wihch should be considered
which
Quoted 1 line
+ * and is updated to reflect the end of the module, clipped to the end
and _it_ is...
Quoted 2 lines
+ * of the region if it would run over.
*/
(and Acked-by: Tim Deegan <[email protected]>)
PATCH v2 4/9 xen: arm: add two new device tree helpers
In reply to Ian Campbell - dt_property_read_u64
- dt_find_node_by_type
---
v2: fix some typos
rebase and update for change to some underlying functions (added dt_ prefix)
--- xen/common/device_tree.c | 29 +++++++++++++++++++++++++++++ xen/include/xen/device_tree.h | 17 +++++++++++++++++ 2 files changed, 46 insertions(+)
xen/common/device_tree.c +29 -0
@@ -541,6 +541,21 @@ bool_t dt_property_read_u32(const struct dt_device_node *np,return 1 ; } + +bool_t dt_property_read_u64 (const struct dt_device_node *np, +const char *name,u64 *out_value) +{ +u32 len; +const __be32 *val; + + val =dt_get_property (np, name, &len); +if ( !val || len <sizeof (*out_value) ) +return 0 ; + + *out_value =dt_read_number (val,2 ); + +return 1 ; +}int dt_property_read_string (const struct dt_device_node *np,const char *propname,const char **out_string) {
@@ -606,6 +621,20 @@ struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,return np; } +struct dt_device_node *dt_find_node_by_type (struct dt_device_node *from, +const char *type) +{ +struct dt_device_node *np; +struct dt_device_node *dt; + + dt = from ? from->allnext : dt_host; +dt_for_each_device_node (dt, np) +if ( np->type && (dt_node_cmp (np->type, type) ==0 ) ) +break ; + +return np; +} +struct dt_device_node *dt_find_node_by_path (const char *path) {struct dt_device_node *np;
xen/include/xen/device_tree.h +17 -0
@@ -351,6 +351,17 @@ const void *dt_get_property(const struct dt_device_node *np,bool_t dt_property_read_u32 (const struct dt_device_node *np,const char *name,u32 *out_value);/** +* dt_property_read_u64 - Helper to read a u64 property. +* @np: node to get the value +* @name: name of the property +* @out_value: pointer to return value +* +* Return true if get the desired value. +*/ +bool_t dt_property_read_u64 (const struct dt_device_node *np, +const char *name,u64 *out_value); + +/** * dt_property_read_string - Find and read a string from a property * @np: Device node from which the property value is to be read * @propname: Name of the property to be searched
@@ -399,6 +410,12 @@ struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node, const char *name);/** +* dt_find_node_by_type - Find a node by its "type" property +*/ +struct dt_device_node *dt_find_node_by_type (struct dt_device_node *from, +const char *type); + +/** * df_find_node_by_alias - Find a node matching an alias * @alias: The alias to match *
Signature · 1 line
1.7.10.4
PATCH v2 5/9 xen: arm: implement arch/platform SMP and CPU initialisation framework
In reply to Ian CampbellIncludes an implementation for vexpress using the sysflags interface and support for the ARMv8 "spin-table" method.
Unused until the next patch, split out to simplify review.
--- xen/arch/arm/arm32/Makefile | 1 + xen/arch/arm/arm32/head.S | 2 +- xen/arch/arm/arm32/smpboot.c | 29 ++++++++++++ xen/arch/arm/arm64/Makefile | 1 + xen/arch/arm/arm64/head.S | 1 + xen/arch/arm/arm64/smpboot.c | 89 +++++++++++++++++++++++++++++++++++++ xen/arch/arm/platform.c | 18 ++++++++ xen/arch/arm/platforms/vexpress.c | 39 ++++++++++++++++ xen/include/asm-arm/platform.h | 9 ++++ xen/include/asm-arm/smp.h | 9 ++++ 10 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/arm32/smpboot.c create mode 100644 xen/arch/arm/arm64/smpboot.c
xen/arch/arm/arm32/Makefile +1 -0
@@ -7,5 +7,6 @@ obj-y += proc-v7.o obj-y += traps.o obj-y += domain.o obj-y += vfp.o +obj-y += smpboot.o obj-$(EARLY_PRINTK) += debug.o
xen/arch/arm/arm32/head.S +1 -1
@@ -59,7 +59,7 @@ * or the initial pagetable code below will need adjustment. */ .global start start: - +GLOBAL(init_secondary) /* currently unused */ /* zImage magic header, see: * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309 */
xen/arch/arm/arm32/smpboot.c new file +29 -0
@@ -0,0 +1,29 @@ +#include <xen/device_tree.h> +#include <xen/init.h> +#include <xen/smp.h> +#include <asm/platform.h> + +int __init arch_smp_init (void ) +{ +return platform_smp_init (); +} + +int __init arch_cpu_init (int cpu,struct dt_device_node *dn) +{ +/* TODO handle PSCI init */ +return 0 ; +} + +int __init arch_cpu_up (int cpu) +{ +return platform_cpu_up (cpu); +} + +/* +* Local variables: +* mode: C +* c-file-style: "BSD" +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/
xen/arch/arm/arm64/Makefile +1 -0
@@ -6,5 +6,6 @@ obj-y += mode_switch.o obj-y += traps.o obj-y += domain.o obj-y += vfp.o +obj-y += smpboot.o obj-$(EARLY_PRINTK) += debug.o
xen/arch/arm/arm64/head.S +1 -0
@@ -65,6 +65,7 @@ .global start start: +GLOBAL(init_secondary) /* currently unused */ /* * DO NOT MODIFY. Image header expected by Linux boot-loaders. */
xen/arch/arm/arm64/smpboot.c new file +89 -0
89 lines not on this page · raw message
xen/arch/arm/platform.c +18 -0
@@ -105,6 +105,24 @@ int __init platform_specific_mapping(struct domain *d)return res; } +#ifdef CONFIG_ARM_32 +int __init platform_cpu_up (int cpu) +{ +if ( platform && platform->cpu_up ) +return platform->cpu_up (cpu); + +return -EAGAIN ; +} + +int __init platform_smp_init (void ) +{ +if ( platform && platform->smp_init ) +return platform->smp_init (); + +return 0 ; +} +#endif +void platform_reset (void ) {if ( platform && platform->reset )
xen/arch/arm/platforms/vexpress.c +39 -0
@@ -21,6 +21,7 @@#include <asm/platform.h> #include <xen/mm.h> #include <xen/vmap.h> +#include <asm/gic.h> #define DCC_SHIFT 26#define FUNCTION_SHIFT 20
@@ -119,6 +120,40 @@ static void vexpress_reset(void)iounmap (sp810); } +#ifdef CONFIG_ARM_32 + +static int vexpress_smp_init (void ) +{ +void __iomem *sysflags; + + sysflags =ioremap_nocache (V2M_SYS_MMIO_BASE ,PAGE_SIZE ); +if ( !sysflags ) + { +dprintk (XENLOG_ERR ,"Unable to map vexpress MMIO\n" ); +return -EFAULT ; + } + +printk ("Set SYS_FLAGS to %" PRIpaddr" (%p)\n" , +__pa (init_secondary), init_secondary); +iowritel (sysflags +V2M_SYS_FLAGSCLR , ~0 ); +iowritel (sysflags +V2M_SYS_FLAGSSET , +__pa (init_secondary)); + +iounmap (sysflags); + +return 0 ; +} + +static int vexpress_cpu_up (int cpu) +{ +/* Nothing to do here, the generic sev() will suffice to kick CPUs +* out of either the firmware or our own smp_up_cpu gate, +* depending on where they have ended up. */ + +return 0 ; +} +#endif +static const char *const vexpress_dt_compat[]__initdata = {"arm,vexpress" ,
@@ -143,6 +178,10 @@ static const struct dt_device_match vexpress_blacklist_dev[] __initconst =PLATFORM_START (vexpress,"VERSATILE EXPRESS" ) .compatible = vexpress_dt_compat, +#ifdef CONFIG_ARM_32 + .smp_init = vexpress_smp_init, + .cpu_up = vexpress_cpu_up, +#endif .reset = vexpress_reset, .blacklist_dev = vexpress_blacklist_dev,PLATFORM_END
xen/include/asm-arm/platform.h +9 -0
@@ -15,6 +15,11 @@ struct platform_desc {/* Platform initialization */ int (*init)(void );int (*init_time)(void ); +#ifdef CONFIG_ARM_32 +/* SMP */ +int (*smp_init)(void ); +int (*cpu_up)(int cpu); +#endif /* Specific mapping for dom0 */ int (*specific_mapping)(struct domain *d);/* Platform reset */
@@ -43,6 +48,10 @@ struct platform_desc {int __init platform_init (void );int __init platform_init_time (void );int __init platform_specific_mapping (struct domain *d); +#ifdef CONFIG_ARM_32 +int platform_smp_init (void ); +int platform_cpu_up (int cpu); +#endif void platform_reset (void );void platform_poweroff (void );bool_t platform_has_quirk (uint32_t quirk);
xen/include/asm-arm/smp.h +9 -0
@@ -4,6 +4,7 @@#ifndef __ASSEMBLY__#include <xen/config.h> #include <xen/cpumask.h> +#include <xen/device_tree.h> #include <asm/current.h> #endif
@@ -22,9 +23,17 @@ extern void stop_cpu(void);extern void make_cpus_ready (unsigned int max_cpus,unsigned long boot_phys_offset); +extern int arch_smp_init (void ); +extern int arch_cpu_init (int cpu,struct dt_device_node *dn); +extern int arch_cpu_up (int cpu); + +/* Secondary CPU entry point */ +extern void init_secondary (void ); +extern void smp_clear_cpu_maps (void );extern int smp_get_max_cpus (void );#endif +/* * Local variables: * mode: C
Signature · 1 line
1.7.10.4
Re: [PATCH v2 5/9] xen: arm: implement arch/platform SMP and CPU initialisation framework
Quoted 6 lines · Ian Campbell
Includes an implementation for vexpress using the sysflags interface and support for the ARMv8 "spin-table" method.
Unused until the next patch, split out to simplify review.
Signed-off-by Ian Campbell <[email protected]>
Re: [PATCH v2 5/9] xen: arm: implement arch/platform SMP and CPU initialisation framework
In reply to Ian CampbellQuoted 7 lines · Ian Campbell
xen/arch/arm/platforms/vexpress.c +7
-0+ +static int vexpress_smp_init (void ) +{ +void __iomem *sysflags; + + sysflags =ioremap_nocache (V2M_SYS_MMIO_BASE ,PAGE_SIZE ); +if ( !sysflags )
xen/arch/arm/platforms/vexpress.c static void vexpress_reset(void) · line 140
Quoted 10 lines
xen/arch/arm/platforms/vexpress.c +10
-0+ { +dprintk (XENLOG_ERR ,"Unable to map vexpress MMIO\n" ); +return -EFAULT ; + } + +printk ("Set SYS_FLAGS to %" PRIpaddr" (%p)\n" , +__pa (init_secondary), init_secondary); +iowritel (sysflags +V2M_SYS_FLAGSCLR , ~0 ); +iowritel (sysflags +V2M_SYS_FLAGSSET , +__pa (init_secondary));
You need to replace iowritel by writel.
Otherwise:
Signature · 1 line
Julien Grall
Re: [PATCH v2 5/9] xen: arm: implement arch/platform SMP and CPU initialisation framework
Quoted 12 lines · Julien Grall
Quoted 11 lines · Ian Campbell
xen/arch/arm/platforms/vexpress.c +11
-0+ +static int vexpress_smp_init (void ) +{ +void __iomem *sysflags; + + sysflags =ioremap_nocache (V2M_SYS_MMIO_BASE ,PAGE_SIZE ); +if ( !sysflags ) + { +dprintk (XENLOG_ERR ,"Unable to map vexpress MMIO\n" ); +return -EFAULT ; + }
Quoted 8 lines
xen/arch/arm/platforms/vexpress.c static void vexpress_reset(void) · line 140
Quoted 6 lines
xen/arch/arm/platforms/vexpress.c +6
-0+ +printk ("Set SYS_FLAGS to %" PRIpaddr" (%p)\n" , +__pa (init_secondary), init_secondary); +iowritel (sysflags +V2M_SYS_FLAGSCLR , ~0 ); +iowritel (sysflags +V2M_SYS_FLAGSSET , +__pa (init_secondary));You need to replace iowritel by writel.
Yeah, need to rebase from the looks of things.
Quoted 2 lines
Otherwise:
Acked-by Julien Grall <[email protected]>
Thanks.
PATCH v2 6/9 xen: arm: rewrite start of day page table and cpu bring up
In reply to Ian CampbellThis is unfortunately a rather large monolithic patch.
Rather than bringing up all CPUs in lockstep as we setup paging and relocate Xen instead create a simplified set of dedicated boot time pagetables.
This allows secondary CPUs to remain powered down or in the firmware until we actually want to enable them. The bringup is now done later on in C and can be driven by DT etc. I have included code for the vexpress platform, but other platforms will need to be added.
The mechanism for deciding how to bring up a CPU differs between arm32 and arm64. On arm32 it is essentially a per-platform property, with the exception of PSCI which can be implemented globally (but isn't here). On arm64 there is a per-cpu property in the device tree.
Secondary CPUs are brought up directly into the relocated Xen image, instead of relying on being able to launch on the unrelocated Xen and hoping that it hasn't been clobbered.
As part of this change drop support for switching from secure mode to NS HYP as well as the early CPU kick. Xen now requires that it is launched in NS HYP mode and that firmware configure things such that secondary CPUs can be woken up by a primarly CPU in HYP mode. This may require fixes to bootloaders or the use of a boot wrapper.
The changes done here (re)exposed an issue with relocating Xen and the compiler spilling values to the stack between the copy and the actual switch to the relocaed copy of Xen in setup_pagetables. Therefore switch to doing the copy and switch in a single asm function where we can control precisely what gets spilled to the stack etc.
Since we now have a separate set of boot pagetables it is much easier to build the real Xen pagetables inplace before relocating rather than the more complex approach of rewriting the pagetables in the relocated copy before switching.
This will also enable Xen to be loaded above the 4GB boundary on 64-bit.
Still TODO:
- integrate with Julien's "Dissociate logical and hardware CPU ID"
- cpu initialisation for other platforms
---
v2: Lots of review feedback from Julien and Tim
Reintroduce a smp_up_cpu gate. We cannot reliably wake a single CPU so we add our own gate. However it is purely in the relocated image.
--- xen/arch/arm/arm32/Makefile | 1 - xen/arch/arm/arm32/head.S | 390 ++++++++++++++++++----------- xen/arch/arm/arm32/mode_switch.S | 158 ------------ xen/arch/arm/arm64/Makefile | 1 - xen/arch/arm/arm64/head.S | 395 ++++++++++++++++++++---------- xen/arch/arm/arm64/mode_switch.S | 89 ------- xen/arch/arm/mm.c | 192 +++++++++------ xen/arch/arm/setup.c | 1 - xen/arch/arm/smpboot.c | 70 +++--- xen/include/asm-arm/mm.h | 3 +- xen/include/asm-arm/platforms/exynos5.h | 14 -- xen/include/asm-arm/platforms/vexpress.h | 11 - xen/include/asm-arm/smp.h | 6 - 13 files changed, 665 insertions(+), 666 deletions(-) delete mode 100644 xen/arch/arm/arm32/mode_switch.S delete mode 100644 xen/arch/arm/arm64/mode_switch.S
xen/arch/arm/arm32/Makefile +0 -1
@@ -1,7 +1,6 @@ subdir-y += lib obj-y += entry.o -obj-y += mode_switch.o obj-y += proc-v7.o obj-y += traps.o
xen/arch/arm/arm32/head.S +246 -144
495 lines not on this page · raw message
xen/arch/arm/arm32/mode_switch.S deleted +0 -158
158 lines not on this page · raw message
xen/arch/arm/arm64/Makefile +0 -1
@@ -1,7 +1,6 @@ subdir-y += lib obj-y += entry.o -obj-y += mode_switch.o obj-y += traps.o obj-y += domain.o
xen/arch/arm/arm64/head.S +271 -124
503 lines not on this page · raw message
xen/arch/arm/arm64/mode_switch.S deleted +0 -89
89 lines not on this page · raw message
xen/arch/arm/mm.c +112 -80
314 lines not on this page · raw message
xen/arch/arm/setup.c +0 -1
@@ -555,7 +555,6 @@ void __init start_xen(unsigned long boot_phys_offset,init_xen_time ();gic_init (); -make_cpus_ready (cpus, boot_phys_offset);set_current ((struct vcpu *)0xfffff000 );/* debug sanity */ idle_vcpu[0 ] = current;
xen/arch/arm/smpboot.c +34 -36
113 lines not on this page · raw message
xen/include/asm-arm/mm.h +2 -1
@@ -155,7 +155,8 @@ extern unsigned long total_pages;/* Boot-time pagetable setup */ extern void setup_pagetables (unsigned long boot_phys_offset,paddr_t xen_paddr); -/* Allocate and initialise pagetables for a secondary CPU */ +/* Allocate and initialise pagetables for a secondary CPU. Sets init_ttbr to the +* new page table */ extern int __cpuinit init_secondary_pagetables (int cpu);/* Switch secondary CPUS to its own pagetables and finalise MMU setup */ extern void __cpuinit mmu_init_secondary_cpu (void );
xen/include/asm-arm/platforms/exynos5.h +0 -14
@@ -14,20 +14,6 @@#define S5P_PA_SYSRAM 0x02020000 -/* Constants below is only used in assembly because the DTS is not yet parsed */ -#ifdef __ASSEMBLY__ - -/* GIC Base Address */ -#define EXYNOS5_GIC_BASE_ADDRESS 0x10480000 - -/* Timer's frequency */ -#define EXYNOS5_TIMER_FREQUENCY (24 * 1000 * 1000)/* 24 MHz */ - -/* Arndale machine ID */ -#define MACH_TYPE_SMDK5250 3774 - -#endif /* __ASSEMBLY__ */ -#endif /* __ASM_ARM_PLATFORMS_EXYNOS5_H */ /* * Local variables:
xen/include/asm-arm/platforms/vexpress.h +0 -11
@@ -32,17 +32,6 @@int vexpress_syscfg (int write,int function,int device,uint32_t *data);#endif -/* Constants below is only used in assembly because the DTS is not yet parsed */ -#ifdef __ASSEMBLY__ - -/* GIC base address */ -#define V2M_GIC_BASE_ADDRESS 0x2c000000 - -/* Timer's frequency */ -#define V2M_TIMER_FREQUENCY 0x5f5e100/* 100 Mhz */ - -#endif /* __ASSEMBLY__ */ -#endif /* __ASM_ARM_PLATFORMS_VEXPRESS_H */ /* * Local variables:
xen/include/asm-arm/smp.h +0 -6
@@ -17,12 +17,6 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);extern void stop_cpu (void ); -/* Bring the non-boot CPUs up to paging and ready to enter C. -* Must be called after Xen is relocated but before the original copy of -* .text gets overwritten. */ -extern void -make_cpus_ready (unsigned int max_cpus,unsigned long boot_phys_offset); -extern int arch_smp_init (void );extern int arch_cpu_init (int cpu,struct dt_device_node *dn);extern int arch_cpu_up (int cpu);
Signature · 1 line
1.7.10.4
Re: [PATCH v2 6/9] xen: arm: rewrite start of day page table and cpu bring up
Review
Quoted 7 lines · Ian Campbell
+ /* Non-boot CPUs wait here until
__cpu_upis ready for them
*/(quoted diff) +5
-0+ teq r12, #0 + beq 1f + + ldr r0, =smp_up_cpu + add r0, r0, r10 /* Apply physical offset */
Discussing this with Tim IRL we think it might be a good idea to have a dsb here (and in the 64-bit variant) just in case the initial read gets hoisted, otherwise we would hit the wfe and noone would wake us.
Updated patch follows.
Review
Quoted 5 lines
+2: ldr r1, [r0]
(quoted diff) +4
-0+ cmp r1, r7 + beq 1f + wfe + b 2b
8<---------------------------------------------------------
Quoted 1 line
From
cd92dd41a1bb8de3cf145f90f89e645a5c9049bfMon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Thu, 29 Aug 2013 16:25:00 +0100
Subject: [PATCH] xen: arm: rewrite start of day page table and cpu bring up
This is unfortunately a rather large monolithic patch.
Rather than bringing up all CPUs in lockstep as we setup paging and relocate Xen instead create a simplified set of dedicated boot time pagetables.
This allows secondary CPUs to remain powered down or in the firmware until we actually want to enable them. The bringup is now done later on in C and can be driven by DT etc. I have included code for the vexpress platform, but other platforms will need to be added.
The mechanism for deciding how to bring up a CPU differs between arm32 and arm64. On arm32 it is essentially a per-platform property, with the exception of PSCI which can be implemented globally (but isn't here). On arm64 there is a per-cpu property in the device tree.
Secondary CPUs are brought up directly into the relocated Xen image, instead of relying on being able to launch on the unrelocated Xen and hoping that it hasn't been clobbered.
As part of this change drop support for switching from secure mode to NS HYP as well as the early CPU kick. Xen now requires that it is launched in NS HYP mode and that firmware configure things such that secondary CPUs can be woken up by a primarly CPU in HYP mode. This may require fixes to bootloaders or the use of a boot wrapper.
The changes done here (re)exposed an issue with relocating Xen and the compiler spilling values to the stack between the copy and the actual switch to the relocaed copy of Xen in setup_pagetables. Therefore switch to doing the copy and switch in a single asm function where we can control precisely what gets spilled to the stack etc.
Since we now have a separate set of boot pagetables it is much easier to build the real Xen pagetables inplace before relocating rather than the more complex approach of rewriting the pagetables in the relocated copy before switching.
This will also enable Xen to be loaded above the 4GB boundary on 64-bit.
Still TODO:
- integrate with Julien's "Dissociate logical and hardware CPU ID"
- cpu initialisation for other platforms
---
v3: add a dsb before the smp_up_cpu wait loop.
v2: Lots of review feedback from Julien and Tim
Reintroduce a smp_up_cpu gate. We cannot reliably wake a single CPU so we add our own gate. However it is purely in the relocated image.
--- xen/arch/arm/arm32/Makefile | 1 - xen/arch/arm/arm32/head.S | 391 ++++++++++++++++++----------- xen/arch/arm/arm32/mode_switch.S | 158 ------------ xen/arch/arm/arm64/Makefile | 1 - xen/arch/arm/arm64/head.S | 396 ++++++++++++++++++++---------- xen/arch/arm/arm64/mode_switch.S | 89 ------- xen/arch/arm/mm.c | 192 +++++++++------ xen/arch/arm/setup.c | 1 - xen/arch/arm/smpboot.c | 70 +++--- xen/include/asm-arm/mm.h | 3 +- xen/include/asm-arm/platforms/exynos5.h | 14 -- xen/include/asm-arm/platforms/vexpress.h | 11 - xen/include/asm-arm/smp.h | 6 - 13 files changed, 667 insertions(+), 666 deletions(-) delete mode 100644 xen/arch/arm/arm32/mode_switch.S delete mode 100644 xen/arch/arm/arm64/mode_switch.S
xen/arch/arm/arm32/Makefile +0 -1
@@ -1,7 +1,6 @@ subdir-y += lib obj-y += entry.o -obj-y += mode_switch.o obj-y += proc-v7.o obj-y += traps.o
xen/arch/arm/arm32/head.S +247 -144
496 lines not on this page · raw message
xen/arch/arm/arm32/mode_switch.S deleted +0 -158
158 lines not on this page · raw message
xen/arch/arm/arm64/Makefile +0 -1
@@ -1,7 +1,6 @@ subdir-y += lib obj-y += entry.o -obj-y += mode_switch.o obj-y += traps.o obj-y += domain.o
xen/arch/arm/arm64/head.S +272 -124
504 lines not on this page · raw message
xen/arch/arm/arm64/mode_switch.S deleted +0 -89
89 lines not on this page · raw message
xen/arch/arm/mm.c +112 -80
314 lines not on this page · raw message
xen/arch/arm/setup.c +0 -1
@@ -555,7 +555,6 @@ void __init start_xen(unsigned long boot_phys_offset,init_xen_time ();gic_init (); -make_cpus_ready (cpus, boot_phys_offset);set_current ((struct vcpu *)0xfffff000 );/* debug sanity */ idle_vcpu[0 ] = current;
xen/arch/arm/smpboot.c +34 -36
113 lines not on this page · raw message
xen/include/asm-arm/mm.h +2 -1
@@ -155,7 +155,8 @@ extern unsigned long total_pages;/* Boot-time pagetable setup */ extern void setup_pagetables (unsigned long boot_phys_offset,paddr_t xen_paddr); -/* Allocate and initialise pagetables for a secondary CPU */ +/* Allocate and initialise pagetables for a secondary CPU. Sets init_ttbr to the +* new page table */ extern int __cpuinit init_secondary_pagetables (int cpu);/* Switch secondary CPUS to its own pagetables and finalise MMU setup */ extern void __cpuinit mmu_init_secondary_cpu (void );
xen/include/asm-arm/platforms/exynos5.h +0 -14
@@ -14,20 +14,6 @@#define S5P_PA_SYSRAM 0x02020000 -/* Constants below is only used in assembly because the DTS is not yet parsed */ -#ifdef __ASSEMBLY__ - -/* GIC Base Address */ -#define EXYNOS5_GIC_BASE_ADDRESS 0x10480000 - -/* Timer's frequency */ -#define EXYNOS5_TIMER_FREQUENCY (24 * 1000 * 1000)/* 24 MHz */ - -/* Arndale machine ID */ -#define MACH_TYPE_SMDK5250 3774 - -#endif /* __ASSEMBLY__ */ -#endif /* __ASM_ARM_PLATFORMS_EXYNOS5_H */ /* * Local variables:
xen/include/asm-arm/platforms/vexpress.h +0 -11
@@ -32,17 +32,6 @@int vexpress_syscfg (int write,int function,int device,uint32_t *data);#endif -/* Constants below is only used in assembly because the DTS is not yet parsed */ -#ifdef __ASSEMBLY__ - -/* GIC base address */ -#define V2M_GIC_BASE_ADDRESS 0x2c000000 - -/* Timer's frequency */ -#define V2M_TIMER_FREQUENCY 0x5f5e100/* 100 Mhz */ - -#endif /* __ASSEMBLY__ */ -#endif /* __ASM_ARM_PLATFORMS_VEXPRESS_H */ /* * Local variables:
xen/include/asm-arm/smp.h +0 -6
@@ -17,12 +17,6 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);extern void stop_cpu (void ); -/* Bring the non-boot CPUs up to paging and ready to enter C. -* Must be called after Xen is relocated but before the original copy of -* .text gets overwritten. */ -extern void -make_cpus_ready (unsigned int max_cpus,unsigned long boot_phys_offset); -extern int arch_smp_init (void );extern int arch_cpu_init (int cpu,struct dt_device_node *dn);extern int arch_cpu_up (int cpu);
Signature · 1 line
1.7.10.4
Tim Deegan
Acked-byRe: [PATCH v2 6/9] xen: arm: rewrite start of day page table and cpu bring up
Quoted 40 lines · Ian Campbell
From
cd92dd41a1bb8de3cf145f90f89e645a5c9049bfMon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Thu, 29 Aug 2013 16:25:00 +0100
Subject: [PATCH] xen: arm: rewrite start of day page table and cpu bring upThis is unfortunately a rather large monolithic patch.
Rather than bringing up all CPUs in lockstep as we setup paging and relocate Xen instead create a simplified set of dedicated boot time pagetables.
This allows secondary CPUs to remain powered down or in the firmware until we actually want to enable them. The bringup is now done later on in C and can be driven by DT etc. I have included code for the vexpress platform, but other platforms will need to be added.
The mechanism for deciding how to bring up a CPU differs between arm32 and arm64. On arm32 it is essentially a per-platform property, with the exception of PSCI which can be implemented globally (but isn't here). On arm64 there is a per-cpu property in the device tree.
Secondary CPUs are brought up directly into the relocated Xen image, instead of relying on being able to launch on the unrelocated Xen and hoping that it hasn't been clobbered.
As part of this change drop support for switching from secure mode to NS HYP as well as the early CPU kick. Xen now requires that it is launched in NS HYP mode and that firmware configure things such that secondary CPUs can be woken up by a primarly CPU in HYP mode. This may require fixes to bootloaders or the use of a boot wrapper.
The changes done here (re)exposed an issue with relocating Xen and the compiler spilling values to the stack between the copy and the actual switch to the relocaed copy of Xen in
setup_pagetables. Therefore switch to doing the copy and switch in a single asm function where we can control precisely what gets spilled to the stack etc.Since we now have a separate set of boot pagetables it is much easier to build the real Xen pagetables inplace before relocating rather than the more complex approach of rewriting the pagetables in the relocated copy before switching.
Quoted 7 lines
This will also enable Xen to be loaded above the 4GB boundary on 64-bit.
Still TODO:
- integrate with Julien's "Dissociate logical and hardware CPU ID"
- cpu initialisation for other platformsSigned-off-by Ian Campbell <[email protected]>
PATCH v2 7/9 xen: arm: use symbolic names for MPIDR bits.
In reply to Ian Campbellarm32 already uses MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP} (and bitwise equivalents) and use them.
--- xen/arch/arm/arm32/head.S | 4 ++-- xen/arch/arm/arm64/head.S | 6 +++--- xen/include/asm-arm/processor.h | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-)
xen/arch/arm/arm32/head.S +2 -2
@@ -127,9 +127,9 @@ common_start: * find that multiprocessor extensions are * present and the system is SMP */ mrc CP32(r1, MPIDR) - tst r1, #(1<<31) /* Multiprocessor extension supported? */ + tst r1, #MPIDR_SMP /* Multiprocessor extension supported? */ beq 1f - tst r1, #(1<<30) /* Uniprocessor system? */ + tst r1, #MPIDR_UP /* Uniprocessor system? */ bne 1f bic r7, r1, #(~MPIDR_HWID_MASK) /* Mask out flags to get CPU ID */ 1:
xen/arch/arm/arm64/head.S +3 -3
@@ -145,10 +145,10 @@ common_start: * find that multiprocessor extensions are * present and the system is SMP */ mrs x0, mpidr_el1 - tbz x0, 31, 1f /* Multiprocessor extension not supported? */ - tbnz x0, 30, 1f /* Uniprocessor system? */ + tbz x0, _MPIDR_SMP, 1f /* Multiprocessor extension not supported? */ + tbnz x0, _MPIDR_UP, 1f /* Uniprocessor system? */ - mov x13, #(0xff << 24) + mov x13, #(~MPIDR_HWID_MASK) bic x24, x0, x13 /* Mask out flags to get CPU ID */ 1:
xen/include/asm-arm/processor.h +4 -2
@@ -8,8 +8,10 @@#define MIDR_MASK 0xff0ffff0/* MPIDR Multiprocessor Affinity Register */ -#define MPIDR_UP (1 << 30) -#define MPIDR_SMP (1 << 31) +#define _MPIDR_UP (30) +#define MPIDR_UP (1 << _MPIDR_UP) +#define _MPIDR_SMP (31) +#define MPIDR_SMP (1 << _MPIDR_SMP)#define MPIDR_AFF0_SHIFT (0)#define MPIDR_AFF0_MASK (0xff << MPIDR_AFF0_SHIFT)#define MPIDR_HWID_MASK 0xffffff
Signature · 1 line
1.7.10.4
Re: [PATCH v2 7/9] xen: arm: use symbolic names for MPIDR bits.
xen/include/asm-arm/processor.h line 14
Quoted 9 lines · Ian Campbell
arm32 already uses
MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP} (and bitwise equivalents) and use them.
/* MPIDR Multiprocessor Affinity Register */xen/include/asm-arm/processor.h +4
-2-#define MPIDR_UP (1 << 30) -#define MPIDR_SMP (1 << 31) +#define _MPIDR_UP (30) +#define MPIDR_UP (1 << _MPIDR_UP) +#define _MPIDR_SMP (31) +#define MPIDR_SMP (1 << _MPIDR_SMP)
Not that you're introducing this, but this should be 1u or 1ul; 1<<31 is undefined. :(
Tim.
Re: [PATCH v2 7/9] xen: arm: use symbolic names for MPIDR bits.
Quoted 13 lines · Tim Deegan
Review
Quoted 9 lines · Ian Campbell
arm32 already uses
MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP} (and bitwise equivalents) and use them.
/* MPIDR Multiprocessor Affinity Register */(quoted diff) +4
-2-#define MPIDR_UP (1 << 30) -#define MPIDR_SMP (1 << 31) +#define _MPIDR_UP (30) +#define MPIDR_UP (1 << _MPIDR_UP) +#define _MPIDR_SMP (31) +#define MPIDR_SMP (1 << _MPIDR_SMP)Not that you're introducing this, but this should be 1u or 1ul; 1<<31 is undefined. :(
Urk.... Needs to be _AC(1,UL) actually...
8<------------------
Quoted 1 line
From
f5c14316dfa000e42d4af224afd8d0060ba18712Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Fri, 20 Sep 2013 17:51:20 +0100
Subject: [PATCH] xen: arm: use symbolic names for MPIDR bits.
arm32 already uses MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP} (and bitwise equivalents) and use them.
---
v3: Needs to be unsigned, 1<<31 is undefined on arm32 otherwise
--- xen/arch/arm/arm32/head.S | 4 ++-- xen/arch/arm/arm64/head.S | 6 +++--- xen/include/asm-arm/processor.h | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-)
xen/arch/arm/arm32/head.S +2 -2
@@ -127,9 +127,9 @@ common_start: * find that multiprocessor extensions are * present and the system is SMP */ mrc CP32(r1, MPIDR) - tst r1, #(1<<31) /* Multiprocessor extension supported? */ + tst r1, #MPIDR_SMP /* Multiprocessor extension supported? */ beq 1f - tst r1, #(1<<30) /* Uniprocessor system? */ + tst r1, #MPIDR_UP /* Uniprocessor system? */ bne 1f bic r7, r1, #(~MPIDR_HWID_MASK) /* Mask out flags to get CPU ID */ 1:
xen/arch/arm/arm64/head.S +3 -3
@@ -145,10 +145,10 @@ common_start: * find that multiprocessor extensions are * present and the system is SMP */ mrs x0, mpidr_el1 - tbz x0, 31, 1f /* Multiprocessor extension not supported? */ - tbnz x0, 30, 1f /* Uniprocessor system? */ + tbz x0, _MPIDR_SMP, 1f /* Multiprocessor extension not supported? */ + tbnz x0, _MPIDR_UP, 1f /* Uniprocessor system? */ - mov x13, #(0xff << 24) + mov x13, #(~MPIDR_HWID_MASK) bic x24, x0, x13 /* Mask out flags to get CPU ID */ 1:
xen/include/asm-arm/processor.h +6 -4
@@ -8,11 +8,13 @@#define MIDR_MASK 0xff0ffff0/* MPIDR Multiprocessor Affinity Register */ -#define MPIDR_UP (1 << 30) -#define MPIDR_SMP (1 << 31) +#define _MPIDR_UP (30) +#define MPIDR_UP (_AC(1,UL) << _MPIDR_UP) +#define _MPIDR_SMP (31) +#define MPIDR_SMP (_AC(1,UL) << _MPIDR_SMP)#define MPIDR_AFF0_SHIFT (0) -#define MPIDR_AFF0_MASK (0xff << MPIDR_AFF0_SHIFT) -#define MPIDR_HWID_MASK 0xffffff +#define MPIDR_AFF0_MASK (_AC(0xff,UL) << MPIDR_AFF0_SHIFT) +#define MPIDR_HWID_MASK _AC(0xffffff,UL)/* TTBCR Translation Table Base Control Register */ #define TTBCR_EAE 0x80000000
Signature · 1 line
1.7.10.4
Tim Deegan
Acked-byRe: [PATCH v2 7/9] xen: arm: use symbolic names for MPIDR bits.
Quoted 9 lines · Ian Campbell
From
f5c14316dfa000e42d4af224afd8d0060ba18712Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Fri, 20 Sep 2013 17:51:20 +0100
Subject: [PATCH] xen: arm: use symbolic names for MPIDR bits.arm32 already uses
MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP} (and bitwise equivalents) and use them.Signed-off-by Ian Campbell <[email protected]>
PATCH v2 8/9 xen: arm: configure TCR_EL2 for 40 bit physical address space
In reply to Ian Campbell--- xen/arch/arm/arm64/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/arm/arm64/head.S +2 -2
@@ -215,12 +215,12 @@ skip_bss: msr mair_el2, x0 /* Set up the HTCR: - * PASize -- 4G + * PASize -- 40 bits / 1TB * Top byte is used * PT walks use Outer-Shareable accesses, * PT walks are write-back, write-allocate in both cache levels, * Full 64-bit address space goes through this table. */ - ldr x0, =0x80802500 + ldr x0, =0x80822500 msr tcr_el2, x0 /* Set up the SCTLR_EL2:
Signature · 1 line
1.7.10.4
PATCH v2 9/9 xen: arm: split cpu0's domheap mapping PTs out from xen_second
In reply to Ian CampbellNow that bringup has been rewritten we don't need these 4 contiguous pages for the 1:1 map. So split them out and only allocate them for 32 bit
--- xen/arch/arm/mm.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-)
xen/arch/arm/mm.c +17 -18
@@ -94,8 +94,11 @@ static DEFINE_PER_CPU(lpae_t *, xen_pgtable);* the second level pagetables which map the domheap region * DOMHEAP_VIRT_START...DOMHEAP_VIRT_END in 2MB chunks. */ static DEFINE_PER_CPU(lpae_t *, xen_dommap); -/* Root of the trie for cpu0 */ +/* Root of the trie for cpu0, other CPU's PTs are dynamically allocated */ lpae_t cpu0_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096))); +/* cpu0's domheap page tables */ +lpae_t cpu0_dommap[LPAE_ENTRIES*DOMHEAP_SECOND_PAGES] + __attribute__((__aligned__(4096*DOMHEAP_SECOND_PAGES)));#endif #ifdef CONFIG_ARM_64
@@ -115,19 +118,8 @@ static __initdata int xenheap_first_first_slot = -1;* The second-level table is 2 contiguous pages long, and covers all * addresses from 0 to 0x7fffffff. Offsets into it are calculated * with second_linear_offset(), not second_table_offset(). -* -* On 32bit addresses 0x80000000 to 0xffffffff are covered by the -* per-cpu xen_domheap mappings described above. We allocate 4 pages -* here for use in the boot page tables and the second two pages -* become the boot CPUs xen_dommap pages. -* -* On 64bit addresses 0x80000000 to 0xffffffff are unused. However we -* allocate 4 pages here for use while relocating Xen, which currently -* expects a second level page to exist for all addresses in the first -* 4GB. We need to keep these extra mappings in place for seconary CPU -* bring up too. For now we just leave them forever. */ -lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4))); +lpae_t xen_second[LPAE_ENTRIES*2] __attribute__((__aligned__(4096*2)));/* First level page table used for fixmap */ lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));/* First level page table used to map Xen itself with the XN bit set
@@ -428,13 +420,22 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)#endif /* Initialise first level entries, to point to second level entries */ -for ( i =0 ; i <4 ; i++) +for ( i =0 ; i <2 ; i++) { p[i] =pte_of_xenaddr ((uintptr_t )(xen_second+i*LPAE_ENTRIES )); p[i].pt.table =1 ; p[i].pt.xn =0 ; } +#ifdef CONFIG_ARM_32 +for ( i =0 ; i <DOMHEAP_SECOND_PAGES ; i++ ) + { + p[first_table_offset (DOMHEAP_VIRT_START +i*FIRST_SIZE )] + =pte_of_xenaddr ((uintptr_t )(cpu0_dommap+i*LPAE_ENTRIES )); + p[first_table_offset (DOMHEAP_VIRT_START +i*FIRST_SIZE )].pt.table =1 ; + } +#endif +/* Initialise xen second level entries ... */ /* ... Xen's text etc */
@@ -503,11 +504,9 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)#ifdef CONFIG_ARM_32 per_cpu (xen_pgtable,0 ) = cpu0_pgtable; -per_cpu (xen_dommap,0 ) = xen_second + -second_linear_offset (DOMHEAP_VIRT_START ); +per_cpu (xen_dommap,0 ) = cpu0_dommap; -/* Some of these slots may have been used during start of day and/or -* relocation. Make sure they are clear now. */ +/* Make sure it is clear */ memset (this_cpu (xen_dommap),0 ,DOMHEAP_SECOND_PAGES *PAGE_SIZE );flush_xen_dcache_va_range (this_cpu (xen_dommap),DOMHEAP_SECOND_PAGES *PAGE_SIZE );
Signature · 1 line
1.7.10.4