diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 21:38:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 21:38:11 -0400 |
commit | f08b9c2f8af0d61faa1170aeae4fbca1eff6a504 (patch) | |
tree | 367b04b7750b66c8412bd377e549aa0fb5b3df02 /arch/x86/xen | |
parent | d79ee93de909dfb252279b9a95978bbda9a814a9 (diff) | |
parent | 0ab711ae6ab0db7696b43c74f9ba9de4d7fc1deb (diff) |
Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/apic changes from Ingo Molnar:
"Most of the changes are about helping virtualized guest kernels
achieve better performance."
Fix up trivial conflicts with the iommu updates to arch/x86/kernel/apic/io_apic.c
* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/apic: Implement EIO micro-optimization
x86/apic: Add apic->eoi_write() callback
x86/apic: Use symbolic APIC_EOI_ACK
x86/apic: Fix typo EIO_ACK -> EOI_ACK and document it
x86/xen/apic: Add missing #include <xen/xen.h>
x86/apic: Only compile local function if used with !CONFIG_GENERIC_PENDING_IRQ
x86/apic: Fix UP boot crash
x86: Conditionally update time when ack-ing pending irqs
xen/apic: implement io apic read with hypercall
Revert "xen/x86: Workaround 'x86/ioapic: Add register level checks to detect bogus io-apic entries'"
xen/x86: Implement x86_apic_ops
x86/apic: Replace io_apic_ops with x86_io_apic_ops.
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/xen/apic.c | 33 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 4 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 4 |
5 files changed, 41 insertions, 4 deletions
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile index add2c2d729ce..96ab2c09cb68 100644 --- a/arch/x86/xen/Makefile +++ b/arch/x86/xen/Makefile | |||
@@ -20,5 +20,5 @@ obj-$(CONFIG_EVENT_TRACING) += trace.o | |||
20 | obj-$(CONFIG_SMP) += smp.o | 20 | obj-$(CONFIG_SMP) += smp.o |
21 | obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o | 21 | obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o |
22 | obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o | 22 | obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o |
23 | obj-$(CONFIG_XEN_DOM0) += vga.o | 23 | obj-$(CONFIG_XEN_DOM0) += apic.o vga.o |
24 | obj-$(CONFIG_SWIOTLB_XEN) += pci-swiotlb-xen.o | 24 | obj-$(CONFIG_SWIOTLB_XEN) += pci-swiotlb-xen.o |
diff --git a/arch/x86/xen/apic.c b/arch/x86/xen/apic.c new file mode 100644 index 000000000000..ec57bd3818a4 --- /dev/null +++ b/arch/x86/xen/apic.c | |||
@@ -0,0 +1,33 @@ | |||
1 | #include <linux/init.h> | ||
2 | |||
3 | #include <asm/x86_init.h> | ||
4 | #include <asm/apic.h> | ||
5 | #include <asm/xen/hypercall.h> | ||
6 | |||
7 | #include <xen/xen.h> | ||
8 | #include <xen/interface/physdev.h> | ||
9 | |||
10 | unsigned int xen_io_apic_read(unsigned apic, unsigned reg) | ||
11 | { | ||
12 | struct physdev_apic apic_op; | ||
13 | int ret; | ||
14 | |||
15 | apic_op.apic_physbase = mpc_ioapic_addr(apic); | ||
16 | apic_op.reg = reg; | ||
17 | ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op); | ||
18 | if (!ret) | ||
19 | return apic_op.value; | ||
20 | |||
21 | /* fallback to return an emulated IO_APIC values */ | ||
22 | if (reg == 0x1) | ||
23 | return 0x00170020; | ||
24 | else if (reg == 0x0) | ||
25 | return apic << 24; | ||
26 | |||
27 | return 0xfd; | ||
28 | } | ||
29 | |||
30 | void __init xen_init_apic(void) | ||
31 | { | ||
32 | x86_io_apic_ops.read = xen_io_apic_read; | ||
33 | } | ||
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 95dccce8e979..c0f5facdb10c 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1396,6 +1396,8 @@ asmlinkage void __init xen_start_kernel(void) | |||
1396 | xen_start_info->console.domU.mfn = 0; | 1396 | xen_start_info->console.domU.mfn = 0; |
1397 | xen_start_info->console.domU.evtchn = 0; | 1397 | xen_start_info->console.domU.evtchn = 0; |
1398 | 1398 | ||
1399 | xen_init_apic(); | ||
1400 | |||
1399 | /* Make sure ACS will be enabled */ | 1401 | /* Make sure ACS will be enabled */ |
1400 | pci_request_acs(); | 1402 | pci_request_acs(); |
1401 | } | 1403 | } |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 69f5857660ac..3506cd4f9a43 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1864,7 +1864,6 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd, | |||
1864 | #endif /* CONFIG_X86_64 */ | 1864 | #endif /* CONFIG_X86_64 */ |
1865 | 1865 | ||
1866 | static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss; | 1866 | static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss; |
1867 | static unsigned char fake_ioapic_mapping[PAGE_SIZE] __page_aligned_bss; | ||
1868 | 1867 | ||
1869 | static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) | 1868 | static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) |
1870 | { | 1869 | { |
@@ -1905,7 +1904,7 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) | |||
1905 | * We just don't map the IO APIC - all access is via | 1904 | * We just don't map the IO APIC - all access is via |
1906 | * hypercalls. Keep the address in the pte for reference. | 1905 | * hypercalls. Keep the address in the pte for reference. |
1907 | */ | 1906 | */ |
1908 | pte = pfn_pte(PFN_DOWN(__pa(fake_ioapic_mapping)), PAGE_KERNEL); | 1907 | pte = pfn_pte(PFN_DOWN(__pa(dummy_mapping)), PAGE_KERNEL); |
1909 | break; | 1908 | break; |
1910 | #endif | 1909 | #endif |
1911 | 1910 | ||
@@ -2070,7 +2069,6 @@ void __init xen_init_mmu_ops(void) | |||
2070 | pv_mmu_ops = xen_mmu_ops; | 2069 | pv_mmu_ops = xen_mmu_ops; |
2071 | 2070 | ||
2072 | memset(dummy_mapping, 0xff, PAGE_SIZE); | 2071 | memset(dummy_mapping, 0xff, PAGE_SIZE); |
2073 | memset(fake_ioapic_mapping, 0xfd, PAGE_SIZE); | ||
2074 | } | 2072 | } |
2075 | 2073 | ||
2076 | /* Protected by xen_reservation_lock. */ | 2074 | /* Protected by xen_reservation_lock. */ |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index b095739ccd4c..45c0c0667bd9 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -92,11 +92,15 @@ struct dom0_vga_console_info; | |||
92 | 92 | ||
93 | #ifdef CONFIG_XEN_DOM0 | 93 | #ifdef CONFIG_XEN_DOM0 |
94 | void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size); | 94 | void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size); |
95 | void __init xen_init_apic(void); | ||
95 | #else | 96 | #else |
96 | static inline void __init xen_init_vga(const struct dom0_vga_console_info *info, | 97 | static inline void __init xen_init_vga(const struct dom0_vga_console_info *info, |
97 | size_t size) | 98 | size_t size) |
98 | { | 99 | { |
99 | } | 100 | } |
101 | static inline void __init xen_init_apic(void) | ||
102 | { | ||
103 | } | ||
100 | #endif | 104 | #endif |
101 | 105 | ||
102 | /* Declare an asm function, along with symbols needed to make it | 106 | /* Declare an asm function, along with symbols needed to make it |