OpenCloudOS-Kernel/arch/x86/xen
Mohit Gambhir cc272163ea x86/xen: Fix APIC id mismatch warning on Intel
This patch fixes the following warning message seen when booting the
kernel as Dom0 with Xen on Intel machines.

[0.003000] [Firmware Bug]: CPU1: APIC id mismatch. Firmware: 0 APIC: 1]

The code generating the warning in validate_apic_and_package_id() matches
cpu_data(cpu).apicid (initialized in init_intel()->
detect_extended_topology() using cpuid) against the apicid returned from
xen_apic_read(). Now, xen_apic_read() makes a hypercall to retrieve apicid
for the boot  cpu but returns 0 otherwise. Hence the warning gets thrown
for all but the boot cpu.

The idea behind xen_apic_read() returning 0 for apicid is that the
guests (even Dom0) should not need to know what physical processor their
vcpus are running on. This is because we currently  do not have topology
information in Xen and also because xen allows more vcpus than physical
processors. However, boot cpu's apicid is required for loading
xen-acpi-processor driver on AMD machines. Look at following patch for
details:

commit 558daa289a ("xen/apic: Return the APIC ID (and version) for CPU
0.")

So to get rid of the warning, this patch modifies
xen_cpu_present_to_apicid() to return cpu_data(cpu).apicid instead of
calling xen_apic_read().

The warning is not seen on AMD machines because init_amd() populates
cpu_data(cpu).apicid by calling hard_smp_processor_id()->xen_apic_read()
as opposed to using apicid from cpuid as is done on Intel machines.

Signed-off-by: Mohit Gambhir <mohit.gambhir@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
2017-01-29 18:59:16 -05:00
..
Kconfig xen: features and fixes for 4.3-rc0 2015-09-08 11:46:48 -07:00
Makefile xen/PMU: Initialization code for Xen PMU 2015-08-20 12:25:20 +01:00
apic.c x86/xen: Fix APIC id mismatch warning on Intel 2017-01-29 18:59:16 -05:00
debugfs.c x86/xen: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:59 +02:00
debugfs.h debugfs: Add support to print u32 array in debugfs 2012-04-17 00:18:36 -04:00
efi.c XEN: EFI: Move x86 specific codes to architecture directory 2016-07-06 10:34:46 +01:00
enlighten.c cpu/hotplug: Cleanup state names 2016-12-25 10:47:44 +01:00
grant-table.c xen/grant-table: Use kmalloc_array() in arch_gnttab_valloc() 2016-08-26 10:44:22 +01:00
irq.c x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op 2016-07-25 13:32:34 +01:00
mmu.c x86/xen: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:59 +02:00
mmu.h xen: make a pile of mmu pvop functions static 2011-05-20 14:25:24 -07:00
multicalls.c x86: Replace __get_cpu_var uses 2014-08-26 13:45:49 -04:00
multicalls.h xen: use this_cpu_xxx replace percpu_xxx funcs 2012-01-24 12:20:24 -05:00
p2m.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
pci-swiotlb-xen.c swiotlb: Convert swiotlb_force from int to enum 2016-12-19 09:05:20 -05:00
platform-pci-unplug.c x86/xen: add missing \n at end of printk warning message 2016-09-30 11:21:45 +01:00
pmu.c xen: Make VPMU init message look less scary 2016-08-24 18:45:38 +01:00
pmu.h xen/PMU: Intercept PMU-related MSR and APIC accesses 2015-08-20 12:25:25 +01:00
setup.c xen/setup: Don't relocate p2m over existing one 2016-12-22 10:04:02 +01:00
smp.c x86/smpboot: Make logical package management more robust 2016-12-13 10:22:39 +01:00
smp.h xen/x86: Move irq allocation from Xen smp_op.cpu_up() 2016-08-24 18:44:40 +01:00
spinlock.c x86/paravirt: Optimize native pv_lock_ops.vcpu_is_preempted() 2016-11-22 12:48:11 +01:00
suspend.c xen: features and fixes for 4.5-rc0 2016-01-12 13:05:36 -08:00
time.c clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00
trace.c xen: use generated hypervisor symbols in arch/x86/xen/trace.c 2015-03-16 14:49:13 +00:00
vdso.h
vga.c xen/vga: add the xen EFI video mode support 2012-09-24 09:28:57 -04:00
xen-asm.S x86/asm/xen: Create stack frames in xen-asm.S 2016-02-24 08:35:42 +01:00
xen-asm.h xen: make direct versions of irq_enable/disable/save/restore to common code 2009-02-04 16:59:04 -08:00
xen-asm_32.S x86/paravirt: Remove the unused irq_enable_sysexit pv op 2015-11-23 10:48:16 +01:00
xen-asm_64.S x86/asm/xen: Set ELF function type for xen_adjust_exception_frame() 2016-02-24 08:35:41 +01:00
xen-head.S Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-24 09:47:32 -07:00
xen-ops.h clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00