aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/apic.c')
-rw-r--r--arch/x86/xen/apic.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/xen/apic.c b/arch/x86/xen/apic.c
index abf4901c917b..db52a7fafcc2 100644
--- a/arch/x86/xen/apic.c
+++ b/arch/x86/xen/apic.c
@@ -66,7 +66,7 @@ static u32 xen_apic_read(u32 reg)
66 66
67 ret = HYPERVISOR_platform_op(&op); 67 ret = HYPERVISOR_platform_op(&op);
68 if (ret) 68 if (ret)
69 return 0; 69 op.u.pcpu_info.apic_id = BAD_APICID;
70 70
71 return op.u.pcpu_info.apic_id << 24; 71 return op.u.pcpu_info.apic_id << 24;
72} 72}
@@ -142,6 +142,14 @@ static void xen_silent_inquire(int apicid)
142{ 142{
143} 143}
144 144
145static int xen_cpu_present_to_apicid(int cpu)
146{
147 if (cpu_present(cpu))
148 return xen_get_apic_id(xen_apic_read(APIC_ID));
149 else
150 return BAD_APICID;
151}
152
145static struct apic xen_pv_apic = { 153static struct apic xen_pv_apic = {
146 .name = "Xen PV", 154 .name = "Xen PV",
147 .probe = xen_apic_probe_pv, 155 .probe = xen_apic_probe_pv,
@@ -162,7 +170,7 @@ static struct apic xen_pv_apic = {
162 170
163 .ioapic_phys_id_map = default_ioapic_phys_id_map, /* Used on 32-bit */ 171 .ioapic_phys_id_map = default_ioapic_phys_id_map, /* Used on 32-bit */
164 .setup_apic_routing = NULL, 172 .setup_apic_routing = NULL,
165 .cpu_present_to_apicid = default_cpu_present_to_apicid, 173 .cpu_present_to_apicid = xen_cpu_present_to_apicid,
166 .apicid_to_cpu_present = physid_set_mask_of_physid, /* Used on 32-bit */ 174 .apicid_to_cpu_present = physid_set_mask_of_physid, /* Used on 32-bit */
167 .check_phys_apicid_present = default_check_phys_apicid_present, /* smp_sanity_check needs it */ 175 .check_phys_apicid_present = default_check_phys_apicid_present, /* smp_sanity_check needs it */
168 .phys_pkg_id = xen_phys_pkg_id, /* detect_ht */ 176 .phys_pkg_id = xen_phys_pkg_id, /* detect_ht */