diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-08 14:07:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-08 14:07:29 -0400 |
commit | 4ed6cedeefe8bbcad7c446db939450a6c902c16d (patch) | |
tree | 3f5f7b598aba7a15fbc1ab5ebf24d616ba49043f /arch | |
parent | e9b19cd43f3f55a7f1d1c9a033feda8dabce3be6 (diff) | |
parent | 1fd14432294a86d46db55d8e96f5a26e97592c95 (diff) |
Merge tag 'stable/for-linus-3.4-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
Pull xen fixes from Konrad Rzeszutek Wilk:
- fix to Kconfig to make it fit within 80 line characters,
- two bootup fixes (AMD 8-core and with PCI BIOS),
- cleanup code in a Xen PV fb driver,
- and a crash fix when trying to see non-existent PTE's
* tag 'stable/for-linus-3.4-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen/Kconfig: fix Kconfig layout
xen/pci: don't use PCI BIOS service for configuration space accesses
xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs
xen/apic: Return the APIC ID (and version) for CPU 0.
drivers/video/xen-fbfront.c: add missing cleanup code
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/enlighten.c | 42 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 7 |
2 files changed, 45 insertions, 4 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; |