aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 11:38:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 11:38:18 -0500
commit14164b46fc994bcf82963ace00372cf808a31af1 (patch)
treee2a26a3a42a55bc3d2887cf9793d03843e1fa272 /arch/x86
parente2a0f813e0d53014b78aae76f0359c8a41f05eeb (diff)
parentf93576e1ac34fd7a93d6f3432e71295bbe6a27ce (diff)
Merge tag 'stable/for-linus-3.14-rc0-late-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull Xen bugfixes from Konrad Rzeszutek Wilk: "Bug-fixes for the new features that were added during this cycle. There are also two fixes for long-standing issues for which we have a solution: grant-table operations extra work that was not needed causing performance issues and the self balloon code was too aggressive causing OOMs. Details: - Xen ARM couldn't use the new FIFO events - Xen ARM couldn't use the SWIOTLB if compiled as 32-bit with 64-bit PCIe devices. - Grant table were doing needless M2P operations. - Ratchet down the self-balloon code so it won't OOM. - Fix misplaced kfree in Xen PVH error code paths" * tag 'stable/for-linus-3.14-rc0-late-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/pvh: Fix misplaced kfree from xlated_setup_gnttab_pages drivers: xen: deaggressive selfballoon driver xen/grant-table: Avoid m2p_override during mapping xen/gnttab: Use phys_addr_t to describe the grant frame base address xen: swiotlb: handle sizeof(dma_addr_t) != sizeof(phys_addr_t) arm/xen: Initialize event channels earlier
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/xen/page.h5
-rw-r--r--arch/x86/xen/grant-table.c3
-rw-r--r--arch/x86/xen/p2m.c17
3 files changed, 7 insertions, 18 deletions
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index 3e276eb23d1b..787e1bb5aafc 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -52,7 +52,8 @@ extern unsigned long set_phys_range_identity(unsigned long pfn_s,
52extern int m2p_add_override(unsigned long mfn, struct page *page, 52extern int m2p_add_override(unsigned long mfn, struct page *page,
53 struct gnttab_map_grant_ref *kmap_op); 53 struct gnttab_map_grant_ref *kmap_op);
54extern int m2p_remove_override(struct page *page, 54extern int m2p_remove_override(struct page *page,
55 struct gnttab_map_grant_ref *kmap_op); 55 struct gnttab_map_grant_ref *kmap_op,
56 unsigned long mfn);
56extern struct page *m2p_find_override(unsigned long mfn); 57extern struct page *m2p_find_override(unsigned long mfn);
57extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); 58extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
58 59
@@ -121,7 +122,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
121 pfn = m2p_find_override_pfn(mfn, ~0); 122 pfn = m2p_find_override_pfn(mfn, ~0);
122 } 123 }
123 124
124 /* 125 /*
125 * pfn is ~0 if there are no entries in the m2p for mfn or if the 126 * pfn is ~0 if there are no entries in the m2p for mfn or if the
126 * entry doesn't map back to the mfn and m2p_override doesn't have a 127 * entry doesn't map back to the mfn and m2p_override doesn't have a
127 * valid entry for it. 128 * valid entry for it.
diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c
index 103c93f874b2..c98583588580 100644
--- a/arch/x86/xen/grant-table.c
+++ b/arch/x86/xen/grant-table.c
@@ -162,14 +162,15 @@ static int __init xlated_setup_gnttab_pages(void)
162 rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames, 162 rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames,
163 &xen_auto_xlat_grant_frames.vaddr); 163 &xen_auto_xlat_grant_frames.vaddr);
164 164
165 kfree(pages);
166 if (rc) { 165 if (rc) {
167 pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__, 166 pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__,
168 nr_grant_frames, rc); 167 nr_grant_frames, rc);
169 free_xenballooned_pages(nr_grant_frames, pages); 168 free_xenballooned_pages(nr_grant_frames, pages);
169 kfree(pages);
170 kfree(pfns); 170 kfree(pfns);
171 return rc; 171 return rc;
172 } 172 }
173 kfree(pages);
173 174
174 xen_auto_xlat_grant_frames.pfn = pfns; 175 xen_auto_xlat_grant_frames.pfn = pfns;
175 xen_auto_xlat_grant_frames.count = nr_grant_frames; 176 xen_auto_xlat_grant_frames.count = nr_grant_frames;
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 696c694986d0..8009acbe41e4 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -899,13 +899,6 @@ int m2p_add_override(unsigned long mfn, struct page *page,
899 "m2p_add_override: pfn %lx not mapped", pfn)) 899 "m2p_add_override: pfn %lx not mapped", pfn))
900 return -EINVAL; 900 return -EINVAL;
901 } 901 }
902 WARN_ON(PagePrivate(page));
903 SetPagePrivate(page);
904 set_page_private(page, mfn);
905 page->index = pfn_to_mfn(pfn);
906
907 if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn))))
908 return -ENOMEM;
909 902
910 if (kmap_op != NULL) { 903 if (kmap_op != NULL) {
911 if (!PageHighMem(page)) { 904 if (!PageHighMem(page)) {
@@ -944,19 +937,16 @@ int m2p_add_override(unsigned long mfn, struct page *page,
944} 937}
945EXPORT_SYMBOL_GPL(m2p_add_override); 938EXPORT_SYMBOL_GPL(m2p_add_override);
946int m2p_remove_override(struct page *page, 939int m2p_remove_override(struct page *page,
947 struct gnttab_map_grant_ref *kmap_op) 940 struct gnttab_map_grant_ref *kmap_op,
941 unsigned long mfn)
948{ 942{
949 unsigned long flags; 943 unsigned long flags;
950 unsigned long mfn;
951 unsigned long pfn; 944 unsigned long pfn;
952 unsigned long uninitialized_var(address); 945 unsigned long uninitialized_var(address);
953 unsigned level; 946 unsigned level;
954 pte_t *ptep = NULL; 947 pte_t *ptep = NULL;
955 948
956 pfn = page_to_pfn(page); 949 pfn = page_to_pfn(page);
957 mfn = get_phys_to_machine(pfn);
958 if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT))
959 return -EINVAL;
960 950
961 if (!PageHighMem(page)) { 951 if (!PageHighMem(page)) {
962 address = (unsigned long)__va(pfn << PAGE_SHIFT); 952 address = (unsigned long)__va(pfn << PAGE_SHIFT);
@@ -970,10 +960,7 @@ int m2p_remove_override(struct page *page,
970 spin_lock_irqsave(&m2p_override_lock, flags); 960 spin_lock_irqsave(&m2p_override_lock, flags);
971 list_del(&page->lru); 961 list_del(&page->lru);
972 spin_unlock_irqrestore(&m2p_override_lock, flags); 962 spin_unlock_irqrestore(&m2p_override_lock, flags);
973 WARN_ON(!PagePrivate(page));
974 ClearPagePrivate(page);
975 963
976 set_phys_to_machine(pfn, page->index);
977 if (kmap_op != NULL) { 964 if (kmap_op != NULL) {
978 if (!PageHighMem(page)) { 965 if (!PageHighMem(page)) {
979 struct multicall_space mcs; 966 struct multicall_space mcs;