Files
Cyrill Gorcunov 503483d203 kvm tools: Support xAPIC
Since we rely on in-kernel kvm-apic implementation
it's fine to set apic version as xAPIC which allows
kernel to run in bigsmp mode.

Without it the kernel will not support more than 8 cpus,
complaining as

 | [    0.362000] Initializing CPU#8
 | [    0.363000] ------------[ cut here ]------------
 | [    0.363000] WARNING: at arch/x86/kernel/apic/apic.c:1238 setup_local_APIC+0xeb/0x2e1()
 | [    0.364000] Modules linked in:
 | [    0.364000] Pid: 0, comm: kworker/0:1 Not tainted 3.0.0+ #70
 | [    0.364000] Call Trace:
 | [    0.364000]  [<c1060c7e>] warn_slowpath_common+0x63/0x78
 | [    0.365000]  [<c16612a8>] ? setup_local_APIC+0xeb/0x2e1
 | [    0.365000]  [<c1060ca2>] warn_slowpath_null+0xf/0x13
 | [    0.365000]  [<c16612a8>] setup_local_APIC+0xeb/0x2e1
 | [    0.366000]  [<c165c684>] ? fpu_init+0x6b/0x88
 | [    0.366000]  [<c1047fd7>] ? default_get_apic_id+0x17/0x32
 | [    0.366000]  [<c16607d3>] start_secondary+0xab/0x18e
 | [    0.367000] ---[ end trace 4eaa2a86a8e2da22 ]---

Note the kernel needs "apic=bigsmp" parameter passed to
enable physical destination mode.

Reported-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:46 +01:00

18 lines
414 B
C

#ifndef KVM_APIC_H_
#define KVM_APIC_H_
#include <asm/apicdef.h>
/*
* APIC, IOAPIC stuff
*/
#define APIC_BASE_ADDR_STEP 0x00400000
#define IOAPIC_BASE_ADDR_STEP 0x00100000
#define APIC_ADDR(apic) (APIC_DEFAULT_PHYS_BASE + apic * APIC_BASE_ADDR_STEP)
#define IOAPIC_ADDR(ioapic) (IO_APIC_DEFAULT_PHYS_BASE + ioapic * IOAPIC_BASE_ADDR_STEP)
#define KVM_APIC_VERSION 0x14 /* xAPIC */
#endif /* KVM_APIC_H_ */