aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/xen/enlighten.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a8f8844b8d32..4f437dedbdf5 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -809,9 +809,40 @@ static void xen_io_delay(void)
809} 809}
810 810
811#ifdef CONFIG_X86_LOCAL_APIC 811#ifdef CONFIG_X86_LOCAL_APIC
812static unsigned long xen_set_apic_id(unsigned int x)
813{
814 WARN_ON(1);
815 return x;
816}
817static unsigned int xen_get_apic_id(unsigned long x)
818{
819 return ((x)>>24) & 0xFFu;
820}
812static u32 xen_apic_read(u32 reg) 821static u32 xen_apic_read(u32 reg)
813{ 822{
814 return 0; 823 struct xen_platform_op op = {
824 .cmd = XENPF_get_cpuinfo,
825 .interface_version = XENPF_INTERFACE_VERSION,
826 .u.pcpu_info.xen_cpuid = 0,
827 };
828 int ret = 0;
829
830 /* Shouldn't need this as APIC is turned off for PV, and we only
831 * get called on the bootup processor. But just in case. */
832 if (!xen_initial_domain() || smp_processor_id())
833 return 0;
834
835 if (reg == APIC_LVR)
836 return 0x10;
837
838 if (reg != APIC_ID)
839 return 0;
840
841 ret = HYPERVISOR_dom0_op(&op);
842 if (ret)
843 return 0;
844
845 return op.u.pcpu_info.apic_id << 24;
815} 846}
816 847
817static void xen_apic_write(u32 reg, u32 val) 848static void xen_apic_write(u32 reg, u32 val)
@@ -849,6 +880,8 @@ static void set_xen_basic_apic_ops(void)
849 apic->icr_write = xen_apic_icr_write; 880 apic->icr_write = xen_apic_icr_write;
850 apic->wait_icr_idle = xen_apic_wait_icr_idle; 881 apic->wait_icr_idle = xen_apic_wait_icr_idle;
851 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; 882 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
883 apic->set_apic_id = xen_set_apic_id;
884 apic->get_apic_id = xen_get_apic_id;
852} 885}
853 886
854#endif 887#endif