aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 23:34:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 23:34:37 -0500
commiteda670c626a4f53eb8ac5f20d8c10d3f0b54c583 (patch)
treee8b31fdeddd520b0fc56483f0a33c0501ee3b692 /include/xen
parentb746f9c7941f227ad582b4f0bc981f3adcbc46b2 (diff)
parent18c51e1a3fabb455ff1f5cd610097d89f577b8f7 (diff)
Merge tag 'stable/for-linus-3.13-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull Xen updates from Konrad Rzeszutek Wilk: "This has tons of fixes and two major features which are concentrated around the Xen SWIOTLB library. The short <blurb> is that the tracing facility (just one function) has been added to SWIOTLB to make it easier to track I/O progress. Additionally under Xen and ARM (32 & 64) the Xen-SWIOTLB driver "is used to translate physical to machine and machine to physical addresses of foreign[guest] pages for DMA operations" (Stefano) when booting under hardware without proper IOMMU. There are also bug-fixes, cleanups, compile warning fixes, etc. The commit times for some of the commits is a bit fresh - that is b/c we wanted to make sure we have the Ack's from the ARM folks - which with the string of back-to-back conferences took a bit of time. Rest assured - the code has been stewing in #linux-next for some time. Features: - SWIOTLB has tracing added when doing bounce buffer. - Xen ARM/ARM64 can use Xen-SWIOTLB. This work allows Linux to safely program real devices for DMA operations when running as a guest on Xen on ARM, without IOMMU support. [*1] - xen_raw_printk works with PVHVM guests if needed. Bug-fixes: - Make memory ballooning work under HVM with large MMIO region. - Inform hypervisor of MCFG regions found in ACPI DSDT. - Remove deprecated IRQF_DISABLED. - Remove deprecated __cpuinit. [*1]: "On arm and arm64 all Xen guests, including dom0, run with second stage translation enabled. As a consequence when dom0 programs a device for a DMA operation is going to use (pseudo) physical addresses instead machine addresses. This work introduces two trees to track physical to machine and machine to physical mappings of foreign pages. Local pages are assumed mapped 1:1 (physical address == machine address). It enables the SWIOTLB-Xen driver on ARM and ARM64, so that Linux can translate physical addresses to machine addresses for dma operations when necessary. " (Stefano)" * tag 'stable/for-linus-3.13-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (32 commits) xen/arm: pfn_to_mfn and mfn_to_pfn return the argument if nothing is in the p2m arm,arm64/include/asm/io.h: define struct bio_vec swiotlb-xen: missing include dma-direction.h pci-swiotlb-xen: call pci_request_acs only ifdef CONFIG_PCI arm: make SWIOTLB available xen: delete new instances of added __cpuinit xen/balloon: Set balloon's initial state to number of existing RAM pages xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved for MCFG areas. xen: remove deprecated IRQF_DISABLED x86/xen: remove deprecated IRQF_DISABLED swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs swiotlb-xen: static inline xen_phys_to_bus, xen_bus_to_phys, xen_virt_to_bus and range_straddles_page_boundary grant-table: call set_phys_to_machine after mapping grant refs arm,arm64: do not always merge biovec if we are running on Xen swiotlb: print a warning when the swiotlb is full swiotlb-xen: use xen_dma_map/unmap_page, xen_dma_sync_single_for_cpu/device xen: introduce xen_dma_map/unmap_page and xen_dma_sync_single_for_cpu/device tracing/events: Fix swiotlb tracepoint creation swiotlb-xen: use xen_alloc/free_coherent_pages xen: introduce xen_alloc/free_coherent_pages ...
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/interface/physdev.h11
-rw-r--r--include/xen/swiotlb-xen.h3
-rw-r--r--include/xen/xen-ops.h7
3 files changed, 18 insertions, 3 deletions
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index 7000bb1f6e96..42721d13a106 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -231,6 +231,17 @@ struct physdev_get_free_pirq {
231#define XEN_PCI_DEV_VIRTFN 0x2 231#define XEN_PCI_DEV_VIRTFN 0x2
232#define XEN_PCI_DEV_PXM 0x4 232#define XEN_PCI_DEV_PXM 0x4
233 233
234#define XEN_PCI_MMCFG_RESERVED 0x1
235
236#define PHYSDEVOP_pci_mmcfg_reserved 24
237struct physdev_pci_mmcfg_reserved {
238 uint64_t address;
239 uint16_t segment;
240 uint8_t start_bus;
241 uint8_t end_bus;
242 uint32_t flags;
243};
244
234#define PHYSDEVOP_pci_device_add 25 245#define PHYSDEVOP_pci_device_add 25
235struct physdev_pci_device_add { 246struct physdev_pci_device_add {
236 /* IN */ 247 /* IN */
diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h
index de8bcc641c49..8b2eb93ae8ba 100644
--- a/include/xen/swiotlb-xen.h
+++ b/include/xen/swiotlb-xen.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_SWIOTLB_XEN_H 1#ifndef __LINUX_SWIOTLB_XEN_H
2#define __LINUX_SWIOTLB_XEN_H 2#define __LINUX_SWIOTLB_XEN_H
3 3
4#include <linux/dma-direction.h>
4#include <linux/swiotlb.h> 5#include <linux/swiotlb.h>
5 6
6extern int xen_swiotlb_init(int verbose, bool early); 7extern int xen_swiotlb_init(int verbose, bool early);
@@ -55,4 +56,6 @@ xen_swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
55extern int 56extern int
56xen_swiotlb_dma_supported(struct device *hwdev, u64 mask); 57xen_swiotlb_dma_supported(struct device *hwdev, u64 mask);
57 58
59extern int
60xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask);
58#endif /* __LINUX_SWIOTLB_XEN_H */ 61#endif /* __LINUX_SWIOTLB_XEN_H */
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index d6fe062cad6b..fb2ea8f26552 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -19,10 +19,11 @@ void xen_arch_resume(void);
19int xen_setup_shutdown_event(void); 19int xen_setup_shutdown_event(void);
20 20
21extern unsigned long *xen_contiguous_bitmap; 21extern unsigned long *xen_contiguous_bitmap;
22int xen_create_contiguous_region(unsigned long vstart, unsigned int order, 22int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
23 unsigned int address_bits); 23 unsigned int address_bits,
24 dma_addr_t *dma_handle);
24 25
25void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); 26void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
26 27
27struct vm_area_struct; 28struct vm_area_struct;
28int xen_remap_domain_mfn_range(struct vm_area_struct *vma, 29int xen_remap_domain_mfn_range(struct vm_area_struct *vma,