aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-07-17 05:59:15 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-07-19 15:52:04 -0400
commit4ff2d06255461390ad685843d0d7364aaa6642d2 (patch)
tree13b95a8bfe8e372249dbac4df81dd287f2f2ca57 /arch/x86/xen/enlighten.c
parent4648da7cb4079e263eaf4dcd3b10fdb2409d4ad6 (diff)
xen: simplify init_hvm_pv_info
init_hvm_pv_info is called only in PVonHVM context, move it into ifdef. init_hvm_pv_info does not fail, make it a void function. remove arguments from init_hvm_pv_info because they are not used by the caller. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index affa94b29d08..f1814fc2cb77 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1471,32 +1471,6 @@ asmlinkage void __init xen_start_kernel(void)
1471#endif 1471#endif
1472} 1472}
1473 1473
1474static int init_hvm_pv_info(int *major, int *minor)
1475{
1476 uint32_t eax, ebx, ecx, edx, pages, msr, base;
1477 u64 pfn;
1478
1479 base = xen_cpuid_base();
1480 cpuid(base + 1, &eax, &ebx, &ecx, &edx);
1481
1482 *major = eax >> 16;
1483 *minor = eax & 0xffff;
1484 printk(KERN_INFO "Xen version %d.%d.\n", *major, *minor);
1485
1486 cpuid(base + 2, &pages, &msr, &ecx, &edx);
1487
1488 pfn = __pa(hypercall_page);
1489 wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
1490
1491 xen_setup_features();
1492
1493 pv_info.name = "Xen HVM";
1494
1495 xen_domain_type = XEN_HVM_DOMAIN;
1496
1497 return 0;
1498}
1499
1500void __ref xen_hvm_init_shared_info(void) 1474void __ref xen_hvm_init_shared_info(void)
1501{ 1475{
1502 int cpu; 1476 int cpu;
@@ -1529,6 +1503,31 @@ void __ref xen_hvm_init_shared_info(void)
1529} 1503}
1530 1504
1531#ifdef CONFIG_XEN_PVHVM 1505#ifdef CONFIG_XEN_PVHVM
1506static void __init init_hvm_pv_info(void)
1507{
1508 int major, minor;
1509 uint32_t eax, ebx, ecx, edx, pages, msr, base;
1510 u64 pfn;
1511
1512 base = xen_cpuid_base();
1513 cpuid(base + 1, &eax, &ebx, &ecx, &edx);
1514
1515 major = eax >> 16;
1516 minor = eax & 0xffff;
1517 printk(KERN_INFO "Xen version %d.%d.\n", major, minor);
1518
1519 cpuid(base + 2, &pages, &msr, &ecx, &edx);
1520
1521 pfn = __pa(hypercall_page);
1522 wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
1523
1524 xen_setup_features();
1525
1526 pv_info.name = "Xen HVM";
1527
1528 xen_domain_type = XEN_HVM_DOMAIN;
1529}
1530
1532static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, 1531static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
1533 unsigned long action, void *hcpu) 1532 unsigned long action, void *hcpu)
1534{ 1533{
@@ -1551,12 +1550,7 @@ static struct notifier_block xen_hvm_cpu_notifier __cpuinitdata = {
1551 1550
1552static void __init xen_hvm_guest_init(void) 1551static void __init xen_hvm_guest_init(void)
1553{ 1552{
1554 int r; 1553 init_hvm_pv_info();
1555 int major, minor;
1556
1557 r = init_hvm_pv_info(&major, &minor);
1558 if (r < 0)
1559 return;
1560 1554
1561 xen_hvm_init_shared_info(); 1555 xen_hvm_init_shared_info();
1562 1556