diff options
-rw-r--r-- | arch/x86/xen/enlighten.c | 42 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 7 | ||||
-rw-r--r-- | drivers/video/xen-fbfront.c | 27 | ||||
-rw-r--r-- | drivers/xen/Kconfig | 22 |
4 files changed, 73 insertions, 25 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index a8f8844b8d32..95dccce8e979 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <asm/stackprotector.h> | 63 | #include <asm/stackprotector.h> |
64 | #include <asm/hypervisor.h> | 64 | #include <asm/hypervisor.h> |
65 | #include <asm/mwait.h> | 65 | #include <asm/mwait.h> |
66 | #include <asm/pci_x86.h> | ||
66 | 67 | ||
67 | #ifdef CONFIG_ACPI | 68 | #ifdef CONFIG_ACPI |
68 | #include <linux/acpi.h> | 69 | #include <linux/acpi.h> |
@@ -809,9 +810,40 @@ static void xen_io_delay(void) | |||
809 | } | 810 | } |
810 | 811 | ||
811 | #ifdef CONFIG_X86_LOCAL_APIC | 812 | #ifdef CONFIG_X86_LOCAL_APIC |
813 | static unsigned long xen_set_apic_id(unsigned int x) | ||
814 | { | ||
815 | WARN_ON(1); | ||
816 | return x; | ||
817 | } | ||
818 | static unsigned int xen_get_apic_id(unsigned long x) | ||
819 | { | ||
820 | return ((x)>>24) & 0xFFu; | ||
821 | } | ||
812 | static u32 xen_apic_read(u32 reg) | 822 | static u32 xen_apic_read(u32 reg) |
813 | { | 823 | { |
814 | return 0; | 824 | struct xen_platform_op op = { |
825 | .cmd = XENPF_get_cpuinfo, | ||
826 | .interface_version = XENPF_INTERFACE_VERSION, | ||
827 | .u.pcpu_info.xen_cpuid = 0, | ||
828 | }; | ||
829 | int ret = 0; | ||
830 | |||
831 | /* Shouldn't need this as APIC is turned off for PV, and we only | ||
832 | * get called on the bootup processor. But just in case. */ | ||
833 | if (!xen_initial_domain() || smp_processor_id()) | ||
834 | return 0; | ||
835 | |||
836 | if (reg == APIC_LVR) | ||
837 | return 0x10; | ||
838 | |||
839 | if (reg != APIC_ID) | ||
840 | return 0; | ||
841 | |||
842 | ret = HYPERVISOR_dom0_op(&op); | ||
843 | if (ret) | ||
844 | return 0; | ||
845 | |||
846 | return op.u.pcpu_info.apic_id << 24; | ||
815 | } | 847 | } |
816 | 848 | ||
817 | static void xen_apic_write(u32 reg, u32 val) | 849 | static void xen_apic_write(u32 reg, u32 val) |
@@ -849,6 +881,8 @@ static void set_xen_basic_apic_ops(void) | |||
849 | apic->icr_write = xen_apic_icr_write; | 881 | apic->icr_write = xen_apic_icr_write; |
850 | apic->wait_icr_idle = xen_apic_wait_icr_idle; | 882 | apic->wait_icr_idle = xen_apic_wait_icr_idle; |
851 | apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; | 883 | apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; |
884 | apic->set_apic_id = xen_set_apic_id; | ||
885 | apic->get_apic_id = xen_get_apic_id; | ||
852 | } | 886 | } |
853 | 887 | ||
854 | #endif | 888 | #endif |
@@ -1365,8 +1399,10 @@ asmlinkage void __init xen_start_kernel(void) | |||
1365 | /* Make sure ACS will be enabled */ | 1399 | /* Make sure ACS will be enabled */ |
1366 | pci_request_acs(); | 1400 | pci_request_acs(); |
1367 | } | 1401 | } |
1368 | 1402 | #ifdef CONFIG_PCI | |
1369 | 1403 | /* PCI BIOS service won't work from a PV guest. */ | |
1404 | pci_probe &= ~PCI_PROBE_BIOS; | ||
1405 | #endif | ||
1370 | xen_raw_console_write("about to get started...\n"); | 1406 | xen_raw_console_write("about to get started...\n"); |
1371 | 1407 | ||
1372 | xen_setup_runstate_info(0); | 1408 | xen_setup_runstate_info(0); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index b8e279479a6b..69f5857660ac 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) | |||
353 | { | 353 | { |
354 | if (val & _PAGE_PRESENT) { | 354 | if (val & _PAGE_PRESENT) { |
355 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 355 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
356 | unsigned long pfn = mfn_to_pfn(mfn); | ||
357 | |||
356 | pteval_t flags = val & PTE_FLAGS_MASK; | 358 | pteval_t flags = val & PTE_FLAGS_MASK; |
357 | val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; | 359 | if (unlikely(pfn == ~0)) |
360 | val = flags & ~_PAGE_PRESENT; | ||
361 | else | ||
362 | val = ((pteval_t)pfn << PAGE_SHIFT) | flags; | ||
358 | } | 363 | } |
359 | 364 | ||
360 | return val; | 365 | return val; |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index cb4529c40d74..b7f5173ff9e9 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -365,7 +365,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
365 | struct fb_info *fb_info; | 365 | struct fb_info *fb_info; |
366 | int fb_size; | 366 | int fb_size; |
367 | int val; | 367 | int val; |
368 | int ret; | 368 | int ret = 0; |
369 | 369 | ||
370 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 370 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
371 | if (info == NULL) { | 371 | if (info == NULL) { |
@@ -458,26 +458,31 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
458 | xenfb_init_shared_page(info, fb_info); | 458 | xenfb_init_shared_page(info, fb_info); |
459 | 459 | ||
460 | ret = xenfb_connect_backend(dev, info); | 460 | ret = xenfb_connect_backend(dev, info); |
461 | if (ret < 0) | 461 | if (ret < 0) { |
462 | goto error; | 462 | xenbus_dev_fatal(dev, ret, "xenfb_connect_backend"); |
463 | goto error_fb; | ||
464 | } | ||
463 | 465 | ||
464 | ret = register_framebuffer(fb_info); | 466 | ret = register_framebuffer(fb_info); |
465 | if (ret) { | 467 | if (ret) { |
466 | fb_deferred_io_cleanup(fb_info); | ||
467 | fb_dealloc_cmap(&fb_info->cmap); | ||
468 | framebuffer_release(fb_info); | ||
469 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); | 468 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); |
470 | goto error; | 469 | goto error_fb; |
471 | } | 470 | } |
472 | info->fb_info = fb_info; | 471 | info->fb_info = fb_info; |
473 | 472 | ||
474 | xenfb_make_preferred_console(); | 473 | xenfb_make_preferred_console(); |
475 | return 0; | 474 | return 0; |
476 | 475 | ||
477 | error_nomem: | 476 | error_fb: |
478 | ret = -ENOMEM; | 477 | fb_deferred_io_cleanup(fb_info); |
479 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | 478 | fb_dealloc_cmap(&fb_info->cmap); |
480 | error: | 479 | framebuffer_release(fb_info); |
480 | error_nomem: | ||
481 | if (!ret) { | ||
482 | ret = -ENOMEM; | ||
483 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | ||
484 | } | ||
485 | error: | ||
481 | xenfb_remove(dev); | 486 | xenfb_remove(dev); |
482 | return ret; | 487 | return ret; |
483 | } | 488 | } |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 94243136f6bf..ea20c51d24c7 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -183,15 +183,17 @@ config XEN_ACPI_PROCESSOR | |||
183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ | 183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ |
184 | default m | 184 | default m |
185 | help | 185 | help |
186 | This ACPI processor uploads Power Management information to the Xen hypervisor. | 186 | This ACPI processor uploads Power Management information to the Xen |
187 | 187 | hypervisor. | |
188 | To do that the driver parses the Power Management data and uploads said | 188 | |
189 | information to the Xen hypervisor. Then the Xen hypervisor can select the | 189 | To do that the driver parses the Power Management data and uploads |
190 | proper Cx and Pxx states. It also registers itslef as the SMM so that | 190 | said information to the Xen hypervisor. Then the Xen hypervisor can |
191 | other drivers (such as ACPI cpufreq scaling driver) will not load. | 191 | select the proper Cx and Pxx states. It also registers itslef as the |
192 | 192 | SMM so that other drivers (such as ACPI cpufreq scaling driver) will | |
193 | To compile this driver as a module, choose M here: the | 193 | not load. |
194 | module will be called xen_acpi_processor If you do not know what to choose, | 194 | |
195 | select M here. If the CPUFREQ drivers are built in, select Y here. | 195 | To compile this driver as a module, choose M here: the module will be |
196 | called xen_acpi_processor If you do not know what to choose, select | ||
197 | M here. If the CPUFREQ drivers are built in, select Y here. | ||
196 | 198 | ||
197 | endmenu | 199 | endmenu |