summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Ostrovsky2017-08-24 00:27:04 +0200
committerBoris Ostrovsky2017-08-31 15:45:55 +0200
commitb194da25ca4812f6307204f9166ec623fd08d5d0 (patch)
tree535a0e43da6121afa300bd817f8104b64e384521
parentxen/events: events_fifo: Don't use {get,put}_cpu() in xen_evtchn_fifo_init() (diff)
downloadkernel-qcow2-linux-b194da25ca4812f6307204f9166ec623fd08d5d0.tar.gz
kernel-qcow2-linux-b194da25ca4812f6307204f9166ec623fd08d5d0.tar.xz
kernel-qcow2-linux-b194da25ca4812f6307204f9166ec623fd08d5d0.zip
xen: Don't try to call xen_alloc_p2m_entry() on autotranslating guests
Commit aba831a69632 ("xen: remove tests for pvh mode in pure pv paths") removed XENFEAT_auto_translated_physmap test in xen_alloc_p2m_entry() since it is assumed that the routine is never called by non-PV guests. However, alloc_xenballooned_pages() may make this call on a PVH guest. Prevent this from happening by adding XENFEAT_auto_translated_physmap check there. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Reviewed-by: Juergen Gross <jgross@suse.com> Fixes: aba831a69632 ("xen: remove tests for pvh mode in pure pv paths")
-rw-r--r--drivers/xen/balloon.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index ab609255a0f3..f77e499afddd 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -664,9 +664,11 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages)
*/
BUILD_BUG_ON(XEN_PAGE_SIZE != PAGE_SIZE);
- ret = xen_alloc_p2m_entry(page_to_pfn(page));
- if (ret < 0)
- goto out_undo;
+ if (!xen_feature(XENFEAT_auto_translated_physmap)) {
+ ret = xen_alloc_p2m_entry(page_to_pfn(page));
+ if (ret < 0)
+ goto out_undo;
+ }
#endif
} else {
ret = add_ballooned_pages(nr_pages - pgno);