]> Pileus Git - ~andy/linux/blobdiff - arch/x86/xen/enlighten.c
xen/bootup: allow read_tscp call for Xen PV guests.
[~andy/linux] / arch / x86 / xen / enlighten.c
index 9642d4a3860239f3203a2ff12dba5543a26ccf4f..668bbfee0ccebb80113e6f8d31100b987f3cc248 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/memblock.h>
 
 #include <xen/xen.h>
+#include <xen/events.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/version.h>
 #include <xen/interface/physdev.h>
@@ -80,6 +81,8 @@
 #include "smp.h"
 #include "multicalls.h"
 
+#include <xen/events.h>
+
 EXPORT_SYMBOL_GPL(hypercall_page);
 
 DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
@@ -1161,6 +1164,8 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = {
        .read_tsc = native_read_tsc,
        .read_pmc = native_read_pmc,
 
+       .read_tscp = native_read_tscp,
+
        .iret = xen_iret,
        .irq_enable_sysexit = xen_sysexit,
 #ifdef CONFIG_X86_64
@@ -1288,7 +1293,6 @@ asmlinkage void __init xen_start_kernel(void)
 {
        struct physdev_set_iopl set_iopl;
        int rc;
-       pgd_t *pgd;
 
        if (!xen_start_info)
                return;
@@ -1380,8 +1384,6 @@ asmlinkage void __init xen_start_kernel(void)
        acpi_numa = -1;
 #endif
 
-       pgd = (pgd_t *)xen_start_info->pt_base;
-
        /* Don't do the full vcpu_info placement stuff until we have a
           possible map and a non-dummy shared_info. */
        per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
@@ -1390,7 +1392,7 @@ asmlinkage void __init xen_start_kernel(void)
        early_boot_irqs_disabled = true;
 
        xen_raw_console_write("mapping kernel into physical memory\n");
-       pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages);
+       xen_setup_kernel_pagetable((pgd_t *)xen_start_info->pt_base, xen_start_info->nr_pages);
 
        /* Allocate and initialize top and mid mfn levels for p2m structure */
        xen_build_mfn_list_list();
@@ -1441,11 +1443,19 @@ asmlinkage void __init xen_start_kernel(void)
                const struct dom0_vga_console_info *info =
                        (void *)((char *)xen_start_info +
                                 xen_start_info->console.dom0.info_off);
+               struct xen_platform_op op = {
+                       .cmd = XENPF_firmware_info,
+                       .interface_version = XENPF_INTERFACE_VERSION,
+                       .u.firmware_info.type = XEN_FW_KBD_SHIFT_FLAGS,
+               };
 
                xen_init_vga(info, xen_start_info->console.dom0.info_size);
                xen_start_info->console.domU.mfn = 0;
                xen_start_info->console.domU.evtchn = 0;
 
+               if (HYPERVISOR_dom0_op(&op) == 0)
+                       boot_params.kbd_status = op.u.firmware_info.u.kbd_shift_flags;
+
                xen_init_apic();
 
                /* Make sure ACS will be enabled */