Skip to contentSkip to conversation

Patch "KVM: x86: Fix device passthrough when SME is active" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Mar 19, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

KVM: x86: Fix device passthrough when SME is active

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
kvm-x86-fix-device-passthrough-when-sme-is-active.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From daaf216c06fba4ee4dc3f62715667da929d68774 Mon Sep 17 00:00:00 2001

From: Tom Lendacky <[email protected]>
Date: Thu, 8 Mar 2018 17:17:31 -0600
Subject: KVM: x86: Fix device passthrough when SME is active

From: Tom Lendacky <[email protected]>

commit daaf216c06fba4ee4dc3f62715667da929d68774 upstream.

When using device passthrough with SME active, the MMIO range that is mapped for the device should not be mapped encrypted. Add a check in set_spte() to insure that a page is not mapped encrypted if that page is a device MMIO page as indicated by kvm_is_mmio_pfn().

---
 arch/x86/kvm/mmu.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kvm/mmu.c +3 -1
@@ -2758,8 +2758,10 @@ static int set_spte(struct kvm_vcpu *vcp
 	else
 		pte_access &= ~ACC_WRITE_MASK;
 
+	if (!kvm_is_mmio_pfn(pfn))
+		spte |= shadow_me_mask;
+
 	spte |= (u64)pfn << PAGE_SHIFT;
-	spte |= shadow_me_mask;
 
 	if (pte_access & ACC_WRITE_MASK) {
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/kvm-x86-fix-device-passthrough-when-sme-is-active.patch queue-4.14/x86-cpufeatures-add-intel-pconfig-cpufeature.patch queue-4.14/x86-cpufeatures-add-intel-total-memory-encryption-cpufeature.patch