diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 20:11:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 20:11:17 -0400 |
commit | 18cb657ca1bafe635f368346a1676fb04c512edf (patch) | |
tree | b0eb6a4ceddf98e7bf820be7ff24bf131ff56b0c /arch/x86/include | |
parent | 2301b65b86df8b80e6779ce9885ad62a5c4adc38 (diff) | |
parent | e28c31a96b1570f17731b18e8efabb7308d0c22c (diff) |
Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
and branch 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm
* 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm:
xen: register xen pci notifier
xen: initialize cpu masks for pv guests in xen_smp_init
xen: add a missing #include to arch/x86/pci/xen.c
xen: mask the MTRR feature from the cpuid
xen: make hvc_xen console work for dom0.
xen: add the direct mapping area for ISA bus access
xen: Initialize xenbus for dom0.
xen: use vcpu_ops to setup cpu masks
xen: map a dummy page for local apic and ioapic in xen_set_fixmap
xen: remap MSIs into pirqs when running as initial domain
xen: remap GSIs as pirqs when running as initial domain
xen: introduce XEN_DOM0 as a silent option
xen: map MSIs into pirqs
xen: support GSI -> pirq remapping in PV on HVM guests
xen: add xen hvm acpi_register_gsi variant
acpi: use indirect call to register gsi in different modes
xen: implement xen_hvm_register_pirq
xen: get the maximum number of pirqs from xen
xen: support pirq != irq
* 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (27 commits)
X86/PCI: Remove the dependency on isapnp_disable.
xen: Update Makefile with CONFIG_BLOCK dependency for biomerge.c
MAINTAINERS: Add myself to the Xen Hypervisor Interface and remove Chris Wright.
x86: xen: Sanitse irq handling (part two)
swiotlb-xen: On x86-32 builts, select SWIOTLB instead of depending on it.
MAINTAINERS: Add myself for Xen PCI and Xen SWIOTLB maintainer.
xen/pci: Request ACS when Xen-SWIOTLB is activated.
xen-pcifront: Xen PCI frontend driver.
xenbus: prevent warnings on unhandled enumeration values
xenbus: Xen paravirtualised PCI hotplug support.
xen/x86/PCI: Add support for the Xen PCI subsystem
x86: Introduce x86_msi_ops
msi: Introduce default_[teardown|setup]_msi_irqs with fallback.
x86/PCI: Export pci_walk_bus function.
x86/PCI: make sure _PAGE_IOMAP it set on pci mappings
x86/PCI: Clean up pci_cache_line_size
xen: fix shared irq device passthrough
xen: Provide a variant of xen_poll_irq with timeout.
xen: Find an unbound irq number in reverse order (high to low).
xen: statically initialize cpu_evtchn_mask_p
...
Fix up trivial conflicts in drivers/pci/Makefile
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/acpi.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/io.h | 13 | ||||
-rw-r--r-- | arch/x86/include/asm/io_apic.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/pci.h | 33 | ||||
-rw-r--r-- | arch/x86/include/asm/pci_x86.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/x86_init.h | 9 | ||||
-rw-r--r-- | arch/x86/include/asm/xen/pci.h | 65 |
7 files changed, 123 insertions, 2 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 92091de11113..55d106b5e31b 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -93,6 +93,9 @@ extern u8 acpi_sci_flags; | |||
93 | extern int acpi_sci_override_gsi; | 93 | extern int acpi_sci_override_gsi; |
94 | void acpi_pic_sci_set_trigger(unsigned int, u16); | 94 | void acpi_pic_sci_set_trigger(unsigned int, u16); |
95 | 95 | ||
96 | extern int (*__acpi_register_gsi)(struct device *dev, u32 gsi, | ||
97 | int trigger, int polarity); | ||
98 | |||
96 | static inline void disable_acpi(void) | 99 | static inline void disable_acpi(void) |
97 | { | 100 | { |
98 | acpi_disabled = 1; | 101 | acpi_disabled = 1; |
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index f0203f4791a8..072273082528 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
@@ -41,6 +41,8 @@ | |||
41 | #include <asm-generic/int-ll64.h> | 41 | #include <asm-generic/int-ll64.h> |
42 | #include <asm/page.h> | 42 | #include <asm/page.h> |
43 | 43 | ||
44 | #include <xen/xen.h> | ||
45 | |||
44 | #define build_mmio_read(name, size, type, reg, barrier) \ | 46 | #define build_mmio_read(name, size, type, reg, barrier) \ |
45 | static inline type name(const volatile void __iomem *addr) \ | 47 | static inline type name(const volatile void __iomem *addr) \ |
46 | { type ret; asm volatile("mov" size " %1,%0":reg (ret) \ | 48 | { type ret; asm volatile("mov" size " %1,%0":reg (ret) \ |
@@ -351,6 +353,17 @@ extern void early_iounmap(void __iomem *addr, unsigned long size); | |||
351 | extern void fixup_early_ioremap(void); | 353 | extern void fixup_early_ioremap(void); |
352 | extern bool is_early_ioremap_ptep(pte_t *ptep); | 354 | extern bool is_early_ioremap_ptep(pte_t *ptep); |
353 | 355 | ||
356 | #ifdef CONFIG_XEN | ||
357 | struct bio_vec; | ||
358 | |||
359 | extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, | ||
360 | const struct bio_vec *vec2); | ||
361 | |||
362 | #define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ | ||
363 | (__BIOVEC_PHYS_MERGEABLE(vec1, vec2) && \ | ||
364 | (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2))) | ||
365 | #endif /* CONFIG_XEN */ | ||
366 | |||
354 | #define IO_SPACE_LIMIT 0xffff | 367 | #define IO_SPACE_LIMIT 0xffff |
355 | 368 | ||
356 | #endif /* _ASM_X86_IO_H */ | 369 | #endif /* _ASM_X86_IO_H */ |
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index c8be4566c3d2..a6b28d017c2f 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -169,6 +169,7 @@ extern void mask_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); | |||
169 | extern int restore_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); | 169 | extern int restore_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); |
170 | 170 | ||
171 | extern void probe_nr_irqs_gsi(void); | 171 | extern void probe_nr_irqs_gsi(void); |
172 | extern int get_nr_irqs_gsi(void); | ||
172 | 173 | ||
173 | extern void setup_ioapic_ids_from_mpc(void); | 174 | extern void setup_ioapic_ids_from_mpc(void); |
174 | 175 | ||
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index d395540ff894..ca0437c714b2 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/string.h> | 7 | #include <linux/string.h> |
8 | #include <asm/scatterlist.h> | 8 | #include <asm/scatterlist.h> |
9 | #include <asm/io.h> | 9 | #include <asm/io.h> |
10 | #include <asm/x86_init.h> | ||
10 | 11 | ||
11 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
12 | 13 | ||
@@ -94,8 +95,36 @@ static inline void early_quirks(void) { } | |||
94 | 95 | ||
95 | extern void pci_iommu_alloc(void); | 96 | extern void pci_iommu_alloc(void); |
96 | 97 | ||
97 | /* MSI arch hook */ | 98 | #ifdef CONFIG_PCI_MSI |
98 | #define arch_setup_msi_irqs arch_setup_msi_irqs | 99 | /* MSI arch specific hooks */ |
100 | static inline int x86_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | ||
101 | { | ||
102 | return x86_msi.setup_msi_irqs(dev, nvec, type); | ||
103 | } | ||
104 | |||
105 | static inline void x86_teardown_msi_irqs(struct pci_dev *dev) | ||
106 | { | ||
107 | x86_msi.teardown_msi_irqs(dev); | ||
108 | } | ||
109 | |||
110 | static inline void x86_teardown_msi_irq(unsigned int irq) | ||
111 | { | ||
112 | x86_msi.teardown_msi_irq(irq); | ||
113 | } | ||
114 | #define arch_setup_msi_irqs x86_setup_msi_irqs | ||
115 | #define arch_teardown_msi_irqs x86_teardown_msi_irqs | ||
116 | #define arch_teardown_msi_irq x86_teardown_msi_irq | ||
117 | /* implemented in arch/x86/kernel/apic/io_apic. */ | ||
118 | int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | ||
119 | void native_teardown_msi_irq(unsigned int irq); | ||
120 | /* default to the implementation in drivers/lib/msi.c */ | ||
121 | #define HAVE_DEFAULT_MSI_TEARDOWN_IRQS | ||
122 | void default_teardown_msi_irqs(struct pci_dev *dev); | ||
123 | #else | ||
124 | #define native_setup_msi_irqs NULL | ||
125 | #define native_teardown_msi_irq NULL | ||
126 | #define default_teardown_msi_irqs NULL | ||
127 | #endif | ||
99 | 128 | ||
100 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) | 129 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
101 | 130 | ||
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h index 49c7219826f9..704526734bef 100644 --- a/arch/x86/include/asm/pci_x86.h +++ b/arch/x86/include/asm/pci_x86.h | |||
@@ -47,6 +47,7 @@ enum pci_bf_sort_state { | |||
47 | extern unsigned int pcibios_max_latency; | 47 | extern unsigned int pcibios_max_latency; |
48 | 48 | ||
49 | void pcibios_resource_survey(void); | 49 | void pcibios_resource_survey(void); |
50 | void pcibios_set_cache_line_size(void); | ||
50 | 51 | ||
51 | /* pci-pc.c */ | 52 | /* pci-pc.c */ |
52 | 53 | ||
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index baa579c8e038..64642ad019fb 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -154,9 +154,18 @@ struct x86_platform_ops { | |||
154 | int (*i8042_detect)(void); | 154 | int (*i8042_detect)(void); |
155 | }; | 155 | }; |
156 | 156 | ||
157 | struct pci_dev; | ||
158 | |||
159 | struct x86_msi_ops { | ||
160 | int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type); | ||
161 | void (*teardown_msi_irq)(unsigned int irq); | ||
162 | void (*teardown_msi_irqs)(struct pci_dev *dev); | ||
163 | }; | ||
164 | |||
157 | extern struct x86_init_ops x86_init; | 165 | extern struct x86_init_ops x86_init; |
158 | extern struct x86_cpuinit_ops x86_cpuinit; | 166 | extern struct x86_cpuinit_ops x86_cpuinit; |
159 | extern struct x86_platform_ops x86_platform; | 167 | extern struct x86_platform_ops x86_platform; |
168 | extern struct x86_msi_ops x86_msi; | ||
160 | 169 | ||
161 | extern void x86_init_noop(void); | 170 | extern void x86_init_noop(void); |
162 | extern void x86_init_uint_noop(unsigned int unused); | 171 | extern void x86_init_uint_noop(unsigned int unused); |
diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h new file mode 100644 index 000000000000..2329b3eaf8d3 --- /dev/null +++ b/arch/x86/include/asm/xen/pci.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef _ASM_X86_XEN_PCI_H | ||
2 | #define _ASM_X86_XEN_PCI_H | ||
3 | |||
4 | #if defined(CONFIG_PCI_XEN) | ||
5 | extern int __init pci_xen_init(void); | ||
6 | extern int __init pci_xen_hvm_init(void); | ||
7 | #define pci_xen 1 | ||
8 | #else | ||
9 | #define pci_xen 0 | ||
10 | #define pci_xen_init (0) | ||
11 | static inline int pci_xen_hvm_init(void) | ||
12 | { | ||
13 | return -1; | ||
14 | } | ||
15 | #endif | ||
16 | #if defined(CONFIG_XEN_DOM0) | ||
17 | void __init xen_setup_pirqs(void); | ||
18 | #else | ||
19 | static inline void __init xen_setup_pirqs(void) | ||
20 | { | ||
21 | } | ||
22 | #endif | ||
23 | |||
24 | #if defined(CONFIG_PCI_MSI) | ||
25 | #if defined(CONFIG_PCI_XEN) | ||
26 | /* The drivers/pci/xen-pcifront.c sets this structure to | ||
27 | * its own functions. | ||
28 | */ | ||
29 | struct xen_pci_frontend_ops { | ||
30 | int (*enable_msi)(struct pci_dev *dev, int **vectors); | ||
31 | void (*disable_msi)(struct pci_dev *dev); | ||
32 | int (*enable_msix)(struct pci_dev *dev, int **vectors, int nvec); | ||
33 | void (*disable_msix)(struct pci_dev *dev); | ||
34 | }; | ||
35 | |||
36 | extern struct xen_pci_frontend_ops *xen_pci_frontend; | ||
37 | |||
38 | static inline int xen_pci_frontend_enable_msi(struct pci_dev *dev, | ||
39 | int **vectors) | ||
40 | { | ||
41 | if (xen_pci_frontend && xen_pci_frontend->enable_msi) | ||
42 | return xen_pci_frontend->enable_msi(dev, vectors); | ||
43 | return -ENODEV; | ||
44 | } | ||
45 | static inline void xen_pci_frontend_disable_msi(struct pci_dev *dev) | ||
46 | { | ||
47 | if (xen_pci_frontend && xen_pci_frontend->disable_msi) | ||
48 | xen_pci_frontend->disable_msi(dev); | ||
49 | } | ||
50 | static inline int xen_pci_frontend_enable_msix(struct pci_dev *dev, | ||
51 | int **vectors, int nvec) | ||
52 | { | ||
53 | if (xen_pci_frontend && xen_pci_frontend->enable_msix) | ||
54 | return xen_pci_frontend->enable_msix(dev, vectors, nvec); | ||
55 | return -ENODEV; | ||
56 | } | ||
57 | static inline void xen_pci_frontend_disable_msix(struct pci_dev *dev) | ||
58 | { | ||
59 | if (xen_pci_frontend && xen_pci_frontend->disable_msix) | ||
60 | xen_pci_frontend->disable_msix(dev); | ||
61 | } | ||
62 | #endif /* CONFIG_PCI_XEN */ | ||
63 | #endif /* CONFIG_PCI_MSI */ | ||
64 | |||
65 | #endif /* _ASM_X86_XEN_PCI_H */ | ||