aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5525163a039..46c8069ae98 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -77,8 +77,8 @@ EXPORT_SYMBOL_GPL(xen_domain_type);
77 77
78unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START; 78unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START;
79EXPORT_SYMBOL(machine_to_phys_mapping); 79EXPORT_SYMBOL(machine_to_phys_mapping);
80unsigned int machine_to_phys_order; 80unsigned long machine_to_phys_nr;
81EXPORT_SYMBOL(machine_to_phys_order); 81EXPORT_SYMBOL(machine_to_phys_nr);
82 82
83struct start_info *xen_start_info; 83struct start_info *xen_start_info;
84EXPORT_SYMBOL_GPL(xen_start_info); 84EXPORT_SYMBOL_GPL(xen_start_info);
@@ -341,6 +341,8 @@ static void xen_set_ldt(const void *addr, unsigned entries)
341 struct mmuext_op *op; 341 struct mmuext_op *op;
342 struct multicall_space mcs = xen_mc_entry(sizeof(*op)); 342 struct multicall_space mcs = xen_mc_entry(sizeof(*op));
343 343
344 trace_xen_cpu_set_ldt(addr, entries);
345
344 op = mcs.args; 346 op = mcs.args;
345 op->cmd = MMUEXT_SET_LDT; 347 op->cmd = MMUEXT_SET_LDT;
346 op->arg1.linear_addr = (unsigned long)addr; 348 op->arg1.linear_addr = (unsigned long)addr;
@@ -496,6 +498,8 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
496 xmaddr_t mach_lp = arbitrary_virt_to_machine(&dt[entrynum]); 498 xmaddr_t mach_lp = arbitrary_virt_to_machine(&dt[entrynum]);
497 u64 entry = *(u64 *)ptr; 499 u64 entry = *(u64 *)ptr;
498 500
501 trace_xen_cpu_write_ldt_entry(dt, entrynum, entry);
502
499 preempt_disable(); 503 preempt_disable();
500 504
501 xen_mc_flush(); 505 xen_mc_flush();
@@ -565,6 +569,8 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
565 unsigned long p = (unsigned long)&dt[entrynum]; 569 unsigned long p = (unsigned long)&dt[entrynum];
566 unsigned long start, end; 570 unsigned long start, end;
567 571
572 trace_xen_cpu_write_idt_entry(dt, entrynum, g);
573
568 preempt_disable(); 574 preempt_disable();
569 575
570 start = __this_cpu_read(idt_desc.address); 576 start = __this_cpu_read(idt_desc.address);
@@ -619,6 +625,8 @@ static void xen_load_idt(const struct desc_ptr *desc)
619 static DEFINE_SPINLOCK(lock); 625 static DEFINE_SPINLOCK(lock);
620 static struct trap_info traps[257]; 626 static struct trap_info traps[257];
621 627
628 trace_xen_cpu_load_idt(desc);
629
622 spin_lock(&lock); 630 spin_lock(&lock);
623 631
624 __get_cpu_var(idt_desc) = *desc; 632 __get_cpu_var(idt_desc) = *desc;
@@ -637,6 +645,8 @@ static void xen_load_idt(const struct desc_ptr *desc)
637static void xen_write_gdt_entry(struct desc_struct *dt, int entry, 645static void xen_write_gdt_entry(struct desc_struct *dt, int entry,
638 const void *desc, int type) 646 const void *desc, int type)
639{ 647{
648 trace_xen_cpu_write_gdt_entry(dt, entry, desc, type);
649
640 preempt_disable(); 650 preempt_disable();
641 651
642 switch (type) { 652 switch (type) {
@@ -665,6 +675,8 @@ static void xen_write_gdt_entry(struct desc_struct *dt, int entry,
665static void __init xen_write_gdt_entry_boot(struct desc_struct *dt, int entry, 675static void __init xen_write_gdt_entry_boot(struct desc_struct *dt, int entry,
666 const void *desc, int type) 676 const void *desc, int type)
667{ 677{
678 trace_xen_cpu_write_gdt_entry(dt, entry, desc, type);
679
668 switch (type) { 680 switch (type) {
669 case DESC_LDT: 681 case DESC_LDT:
670 case DESC_TSS: 682 case DESC_TSS:
@@ -684,7 +696,9 @@ static void __init xen_write_gdt_entry_boot(struct desc_struct *dt, int entry,
684static void xen_load_sp0(struct tss_struct *tss, 696static void xen_load_sp0(struct tss_struct *tss,
685 struct thread_struct *thread) 697 struct thread_struct *thread)
686{ 698{
687 struct multicall_space mcs = xen_mc_entry(0); 699 struct multicall_space mcs;
700
701 mcs = xen_mc_entry(0);
688 MULTI_stack_switch(mcs.mc, __KERNEL_DS, thread->sp0); 702 MULTI_stack_switch(mcs.mc, __KERNEL_DS, thread->sp0);
689 xen_mc_issue(PARAVIRT_LAZY_CPU); 703 xen_mc_issue(PARAVIRT_LAZY_CPU);
690} 704}
@@ -937,6 +951,10 @@ static const struct pv_info xen_info __initconst = {
937 .paravirt_enabled = 1, 951 .paravirt_enabled = 1,
938 .shared_kernel_pmd = 0, 952 .shared_kernel_pmd = 0,
939 953
954#ifdef CONFIG_X86_64
955 .extra_user_64bit_cs = FLAT_USER_CS64,
956#endif
957
940 .name = "Xen", 958 .name = "Xen",
941}; 959};
942 960
@@ -1248,6 +1266,14 @@ asmlinkage void __init xen_start_kernel(void)
1248 if (pci_xen) 1266 if (pci_xen)
1249 x86_init.pci.arch_init = pci_xen_init; 1267 x86_init.pci.arch_init = pci_xen_init;
1250 } else { 1268 } else {
1269 const struct dom0_vga_console_info *info =
1270 (void *)((char *)xen_start_info +
1271 xen_start_info->console.dom0.info_off);
1272
1273 xen_init_vga(info, xen_start_info->console.dom0.info_size);
1274 xen_start_info->console.domU.mfn = 0;
1275 xen_start_info->console.domU.evtchn = 0;
1276
1251 /* Make sure ACS will be enabled */ 1277 /* Make sure ACS will be enabled */
1252 pci_request_acs(); 1278 pci_request_acs();
1253 } 1279 }
@@ -1329,7 +1355,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
1329 int cpu = (long)hcpu; 1355 int cpu = (long)hcpu;
1330 switch (action) { 1356 switch (action) {
1331 case CPU_UP_PREPARE: 1357 case CPU_UP_PREPARE:
1332 per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; 1358 xen_vcpu_setup(cpu);
1333 if (xen_have_vector_callback) 1359 if (xen_have_vector_callback)
1334 xen_init_lock_cpu(cpu); 1360 xen_init_lock_cpu(cpu);
1335 break; 1361 break;
@@ -1359,7 +1385,6 @@ static void __init xen_hvm_guest_init(void)
1359 xen_hvm_smp_init(); 1385 xen_hvm_smp_init();
1360 register_cpu_notifier(&xen_hvm_cpu_notifier); 1386 register_cpu_notifier(&xen_hvm_cpu_notifier);
1361 xen_unplug_emulated_devices(); 1387 xen_unplug_emulated_devices();
1362 have_vcpu_info_placement = 0;
1363 x86_init.irqs.intr_init = xen_init_IRQ; 1388 x86_init.irqs.intr_init = xen_init_IRQ;
1364 xen_hvm_init_time_ops(); 1389 xen_hvm_init_time_ops();
1365 xen_hvm_init_mmu_ops(); 1390 xen_hvm_init_mmu_ops();