Skip to contentSkip to conversation

KVM: arm64: Fix detection of shared VMAs on guest fault

PATCH In review Marc Zyngier 2 participants 2 messages Jul 13, 2021

Subsystems (3)
lore
Share & tools
lore

Marc Zyngier

author maintainer
#0 lore raw

PATCH 1/1 KVM: arm64: Fix detection of shared VMAs on guest fault

When merging the KVM MTE support, the blob that was interposed between the chair and the keyboard experienced a neuronal accident (also known as a brain fart), turning a check for VM_SHARED into VM_PFNMAP as it was reshuffling some of the code.

The blob having now come back to its senses, let's restore the initial check that the original author got right the first place.

Fixes ea7fc1bb1cd1 ("KVM: arm64: Introduce MTE VM feature")
Cc Steven Price <[email protected]>
Cc Catalin Marinas <[email protected]>
---
 arch/arm64/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/mmu.c +1 -1
index 3155c9e778f0..0625bf2353c2 100644
@@ -947,7 +947,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		vma_shift = get_vma_page_shift(vma, hva);
 	}
 
-	shared = (vma->vm_flags & VM_PFNMAP);
+	shared = (vma->vm_flags & VM_SHARED);
 
 	switch (vma_shift) {
 #ifndef __PAGETABLE_PMD_FOLDED
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Marc Zyngier

When merging the KVM MTE support, the blob that was interposed between the chair and the keyboard experienced a neuronal accident (also known as a brain fart), turning a check for VM_SHARED into VM_PFNMAP as it was reshuffling some of the code.

Quoted 7 lines

The blob having now come back to its senses, let's restore the initial check that the original author got right the first place.

Fixes ea7fc1bb1cd1 ("KVM: arm64: Introduce MTE VM feature")
Cc Steven Price <[email protected]>
Cc Catalin Marinas <[email protected]>

Somehow this blob missed it too while reviewing the changes you'd made.

Thanks,

Steve

Quoted 18 lines
---
 arch/arm64/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/mmu.c +1 -1
index 3155c9e778f0..0625bf2353c2 100644
@@ -947,7 +947,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		vma_shift = get_vma_page_shift(vma, hva);
 	}
 
-	shared = (vma->vm_flags & VM_PFNMAP);
+	shared = (vma->vm_flags & VM_SHARED);
 
 	switch (vma_shift) {
 #ifndef __PAGETABLE_PMD_FOLDED