From 90b55c46ad73bf9d87b422962cc841d2ce6470a6 Mon Sep 17 00:00:00 2001 From: Simon Gaiser Date: Fri, 5 Jan 2018 20:55:55 +0100 Subject: [PATCH] Add fix for grant-table in PVH/HVM in 4.14 --- ...r-_foreign_p2m_mapping-on-autotransl.patch | 40 +++++++++++++++++++ series.conf | 3 ++ 2 files changed, 43 insertions(+) create mode 100644 patches.xen/xen-Fix-set-clear-_foreign_p2m_mapping-on-autotransl.patch diff --git a/patches.xen/xen-Fix-set-clear-_foreign_p2m_mapping-on-autotransl.patch b/patches.xen/xen-Fix-set-clear-_foreign_p2m_mapping-on-autotransl.patch new file mode 100644 index 0000000..a70783d --- /dev/null +++ b/patches.xen/xen-Fix-set-clear-_foreign_p2m_mapping-on-autotransl.patch @@ -0,0 +1,40 @@ +From c71b9388cef5106ad8aa4f8db3d03388e74e5b89 Mon Sep 17 00:00:00 2001 +From: Simon Gaiser +Date: Fri, 5 Jan 2018 18:28:39 +0100 +Subject: [PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating + guests + +Commit 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths") +removed the check for autotranslation from {set,clear}_foreign_p2m_mapping +but those are called by grant-table.c also on PVH/HVM guests. +--- + arch/x86/xen/p2m.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c +index 6083ba462f35..15812e553b95 100644 +--- a/arch/x86/xen/p2m.c ++++ b/arch/x86/xen/p2m.c +@@ -694,6 +694,9 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, + int i, ret = 0; + pte_t *pte; + ++ if (xen_feature(XENFEAT_auto_translated_physmap)) ++ return 0; ++ + if (kmap_ops) { + ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, + kmap_ops, count); +@@ -736,6 +739,9 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, + { + int i, ret = 0; + ++ if (xen_feature(XENFEAT_auto_translated_physmap)) ++ return 0; ++ + for (i = 0; i < count; i++) { + unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i])); + unsigned long pfn = page_to_pfn(pages[i]); +-- +2.15.1 + diff --git a/series.conf b/series.conf index 400d801..d5c0500 100644 --- a/series.conf +++ b/series.conf @@ -24,3 +24,6 @@ patches.xen/pci_op-cleanup.patch # Fix for MSI support with stubdoms patches.xen/xen-pciback-add-attribute-to-allow-MSI-enable-flag-w.patch + +# Fix for grant-table in PVH/HVM in 4.14 +patches.xen/xen-Fix-set-clear-_foreign_p2m_mapping-on-autotransl.patch