Add fix for grant-table in PVH/HVM in 4.14

This commit is contained in:
Simon Gaiser 2018-01-05 20:55:55 +01:00
parent 9a50618f32
commit 90b55c46ad
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From c71b9388cef5106ad8aa4f8db3d03388e74e5b89 Mon Sep 17 00:00:00 2001
From: Simon Gaiser <simon@invisiblethingslab.com>
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

View File

@ -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