In particular be sure to initisalise HCR_EL2 on secondary processors.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ ijc -- adjusted due to unapplied "trap guest WFI" by s/HCR_TWI// ]
gic_route_irq_to_guest(d, 46, "lcd");
gic_route_irq_to_guest(d, 47, "eth");
- /* Enable second stage translation */
- WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_VM, HCR_EL2);
- isb();
-
/* The following loads use the domain's p2m */
p2m_load_VTTBR(d);
}
#endif
- WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
- isb();
-
local_abort_enable();
return 0;
BUG_ON(IS_ERR(dom_cow));
}
+void __cpuinit setup_virt_paging(void)
+{
+ /* Setup Stage 2 address translation */
+ /* SH0=00, ORGN0=IRGN0=01
+ * SL0=01 (Level-1)
+ * T0SZ=(1)1000 = -8 (40 bit physical addresses)
+ */
+ WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+}
+
/* Boot-time pagetable setup.
* Changes here may need matching changes in head.S */
void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
set_current((struct vcpu *)0xfffff000); /* debug sanity */
idle_vcpu[0] = current;
- /* Setup Hyp vector base */
- WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
- isb();
-
- /* Setup Stage 2 address translation */
- /* SH0=00, ORGN0=IRGN0=01
- * SL0=01 (Level-1)
- * T0SZ=(1)1000 = -8 (40 bit physical addresses)
- */
- WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+ init_traps();
+
+ setup_virt_paging();
enable_vfp();
*c = boot_cpu_data;
identify_cpu(c);
- /* Setup Hyp vector base */
- WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
+ init_traps();
+
+ setup_virt_paging();
mmu_init_secondary_cpu();
enable_vfp();
#define stack_words_per_line 8
+
+void __cpuinit init_traps(void)
+{
+ /* Setup Hyp vector base */
+ WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
+
+ /* Setup hypervisor traps */
+ WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
+ isb();
+}
+
asmlinkage void __div0(void)
{
printk("Division by zero in hypervisor.\n");
/* Boot-time pagetable setup */
extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
-/* MMU setup for seccondary CPUS (which already have paging enabled) */
+/* MMU setup for secondary CPUS (which already have paging enabled) */
extern void __cpuinit mmu_init_secondary_cpu(void);
+/* Second stage paging setup, to be called on all CPUs */
+extern void __cpuinit setup_virt_paging(void);
/* Set up the xenheap: up to 1GB of contiguous, always-mapped memory.
* Base must be 32MB aligned and size a multiple of 32MB. */
extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
#ifndef __ASSEMBLY__
extern uint32_t hyp_traps_vector[];
+void init_traps(void);
+
void panic_PAR(uint64_t par);
void show_execution_state(struct cpu_user_regs *regs);