aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/lguest/boot.c4
-rw-r--r--arch/x86/xen/enlighten.c41
-rw-r--r--include/asm-x86/paravirt.h14
3 files changed, 49 insertions, 10 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 50dad44fb542..0c45df20e2b3 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -783,11 +783,11 @@ static void lguest_wbinvd(void)
783 * code qualifies for Advanced. It will also never interrupt anything. It 783 * code qualifies for Advanced. It will also never interrupt anything. It
784 * does, however, allow us to get through the Linux boot code. */ 784 * does, however, allow us to get through the Linux boot code. */
785#ifdef CONFIG_X86_LOCAL_APIC 785#ifdef CONFIG_X86_LOCAL_APIC
786static void lguest_apic_write(unsigned long reg, u32 v) 786static void lguest_apic_write(u32 reg, u32 v)
787{ 787{
788} 788}
789 789
790static u32 lguest_apic_read(unsigned long reg) 790static u32 lguest_apic_read(u32 reg)
791{ 791{
792 return 0; 792 return 0;
793} 793}
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index dcd4e51f2f16..54e255667530 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -548,16 +548,45 @@ static void xen_io_delay(void)
548} 548}
549 549
550#ifdef CONFIG_X86_LOCAL_APIC 550#ifdef CONFIG_X86_LOCAL_APIC
551static u32 xen_apic_read(unsigned long reg) 551static u32 xen_apic_read(u32 reg)
552{ 552{
553 return 0; 553 return 0;
554} 554}
555 555
556static void xen_apic_write(unsigned long reg, u32 val) 556static void xen_apic_write(u32 reg, u32 val)
557{ 557{
558 /* Warn to see if there's any stray references */ 558 /* Warn to see if there's any stray references */
559 WARN_ON(1); 559 WARN_ON(1);
560} 560}
561
562#ifdef CONFIG_X86_64
563static u64 xen_apic_icr_read(void)
564{
565 return 0;
566}
567
568static void xen_apic_icr_write(u32 low, u32 id)
569{
570 /* Warn to see if there's any stray references */
571 WARN_ON(1);
572}
573
574static void xen_apic_wait_icr_idle(void)
575{
576 return;
577}
578
579static struct apic_ops xen_basic_apic_ops = {
580 .read = xen_apic_read,
581 .write = xen_apic_write,
582 .write_atomic = xen_apic_write,
583 .icr_read = xen_apic_icr_read,
584 .icr_write = xen_apic_icr_write,
585 .wait_icr_idle = xen_apic_wait_icr_idle,
586 .safe_wait_icr_idle = xen_apic_wait_icr_idle,
587};
588#endif
589
561#endif 590#endif
562 591
563static void xen_flush_tlb(void) 592static void xen_flush_tlb(void)
@@ -1130,9 +1159,11 @@ static const struct pv_irq_ops xen_irq_ops __initdata = {
1130 1159
1131static const struct pv_apic_ops xen_apic_ops __initdata = { 1160static const struct pv_apic_ops xen_apic_ops __initdata = {
1132#ifdef CONFIG_X86_LOCAL_APIC 1161#ifdef CONFIG_X86_LOCAL_APIC
1162#ifndef CONFIG_X86_64
1133 .apic_write = xen_apic_write, 1163 .apic_write = xen_apic_write,
1134 .apic_write_atomic = xen_apic_write, 1164 .apic_write_atomic = xen_apic_write,
1135 .apic_read = xen_apic_read, 1165 .apic_read = xen_apic_read,
1166#endif
1136 .setup_boot_clock = paravirt_nop, 1167 .setup_boot_clock = paravirt_nop,
1137 .setup_secondary_clock = paravirt_nop, 1168 .setup_secondary_clock = paravirt_nop,
1138 .startup_ipi_hook = paravirt_nop, 1169 .startup_ipi_hook = paravirt_nop,
@@ -1291,6 +1322,12 @@ asmlinkage void __init xen_start_kernel(void)
1291 pv_irq_ops = xen_irq_ops; 1322 pv_irq_ops = xen_irq_ops;
1292 pv_apic_ops = xen_apic_ops; 1323 pv_apic_ops = xen_apic_ops;
1293 pv_mmu_ops = xen_mmu_ops; 1324 pv_mmu_ops = xen_mmu_ops;
1325#ifdef CONFIG_X86_64
1326 /*
1327 * for 64bit, set up the basic apic ops aswell.
1328 */
1329 apic_ops = &xen_basic_apic_ops;
1330#endif
1294 1331
1295 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { 1332 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) {
1296 pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; 1333 pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start;
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index 10adac02e6db..5e34d26aa3b5 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -200,13 +200,15 @@ struct pv_irq_ops {
200 200
201struct pv_apic_ops { 201struct pv_apic_ops {
202#ifdef CONFIG_X86_LOCAL_APIC 202#ifdef CONFIG_X86_LOCAL_APIC
203#ifndef CONFIG_X86_64
203 /* 204 /*
204 * Direct APIC operations, principally for VMI. Ideally 205 * Direct APIC operations, principally for VMI. Ideally
205 * these shouldn't be in this interface. 206 * these shouldn't be in this interface.
206 */ 207 */
207 void (*apic_write)(unsigned long reg, u32 v); 208 void (*apic_write)(u32 reg, u32 v);
208 void (*apic_write_atomic)(unsigned long reg, u32 v); 209 void (*apic_write_atomic)(u32 reg, u32 v);
209 u32 (*apic_read)(unsigned long reg); 210 u32 (*apic_read)(u32 reg);
211#endif
210 void (*setup_boot_clock)(void); 212 void (*setup_boot_clock)(void);
211 void (*setup_secondary_clock)(void); 213 void (*setup_secondary_clock)(void);
212 214
@@ -892,17 +894,17 @@ static inline void slow_down_io(void)
892 * Basic functions accessing APICs. 894 * Basic functions accessing APICs.
893 */ 895 */
894#ifndef CONFIG_X86_64 896#ifndef CONFIG_X86_64
895static inline void apic_write(unsigned long reg, u32 v) 897static inline void apic_write(u32 reg, u32 v)
896{ 898{
897 PVOP_VCALL2(pv_apic_ops.apic_write, reg, v); 899 PVOP_VCALL2(pv_apic_ops.apic_write, reg, v);
898} 900}
899 901
900static inline void apic_write_atomic(unsigned long reg, u32 v) 902static inline void apic_write_atomic(u32 reg, u32 v)
901{ 903{
902 PVOP_VCALL2(pv_apic_ops.apic_write_atomic, reg, v); 904 PVOP_VCALL2(pv_apic_ops.apic_write_atomic, reg, v);
903} 905}
904 906
905static inline u32 apic_read(unsigned long reg) 907static inline u32 apic_read(u32 reg)
906{ 908{
907 return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg); 909 return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg);
908} 910}