aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-12-21 01:18:49 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-01-07 10:03:50 -0500
commitd9b8ca8474fd4fdd43ba6d97a4fee8b49b978067 (patch)
tree465e7e44d174ce1ad6211a4fbc7d018c01dc4627 /arch/x86/xen
parent2904ed8dd5a748c52caf4d8b09d3d9834b5932fa (diff)
xen: HVM X2APIC support
This patch is similiar to Gleb Natapov's patch for KVM, which enable the hypervisor to emulate x2apic feature for the guest. By this way, the emulation of lapic would be simpler with x2apic interface(MSR), and faster. [v2: Re-organized 'xen_hvm_need_lapic' per Ian Campbell suggestion] Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/enlighten.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 44dcad43989d..5b8986fe3371 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1256,25 +1256,6 @@ asmlinkage void __init xen_start_kernel(void)
1256#endif 1256#endif
1257} 1257}
1258 1258
1259static uint32_t xen_cpuid_base(void)
1260{
1261 uint32_t base, eax, ebx, ecx, edx;
1262 char signature[13];
1263
1264 for (base = 0x40000000; base < 0x40010000; base += 0x100) {
1265 cpuid(base, &eax, &ebx, &ecx, &edx);
1266 *(uint32_t *)(signature + 0) = ebx;
1267 *(uint32_t *)(signature + 4) = ecx;
1268 *(uint32_t *)(signature + 8) = edx;
1269 signature[12] = 0;
1270
1271 if (!strcmp("XenVMMXenVMM", signature) && ((eax - base) >= 2))
1272 return base;
1273 }
1274
1275 return 0;
1276}
1277
1278static int init_hvm_pv_info(int *major, int *minor) 1259static int init_hvm_pv_info(int *major, int *minor)
1279{ 1260{
1280 uint32_t eax, ebx, ecx, edx, pages, msr, base; 1261 uint32_t eax, ebx, ecx, edx, pages, msr, base;
@@ -1384,6 +1365,18 @@ static bool __init xen_hvm_platform(void)
1384 return true; 1365 return true;
1385} 1366}
1386 1367
1368bool xen_hvm_need_lapic(void)
1369{
1370 if (xen_pv_domain())
1371 return false;
1372 if (!xen_hvm_domain())
1373 return false;
1374 if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)
1375 return false;
1376 return true;
1377}
1378EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);
1379
1387const __refconst struct hypervisor_x86 x86_hyper_xen_hvm = { 1380const __refconst struct hypervisor_x86 x86_hyper_xen_hvm = {
1388 .name = "Xen HVM", 1381 .name = "Xen HVM",
1389 .detect = xen_hvm_platform, 1382 .detect = xen_hvm_platform,