Skip to contentSkip to conversation

KVM: arm64: Remove pgd_lock

RFC PATCH In review Steven Price 2 participants 2 messages Aug 13, 2018 – Aug 15, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/5 KVM: arm64: Remove pgd_lock

The lock has never been used and the page tables are protected by mmu_lock in struct kvm.

CC Marc Zyngier <[email protected]>
CC Christoffer Dall <[email protected]>
 arch/arm64/include/asm/kvm_host.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/include/asm/kvm_host.h +1 -2
index fe8777b12f86..8150a7f8a50f 100644
@@ -61,8 +61,7 @@ struct kvm_arch {
 	u64    vmid_gen;
 	u32    vmid;
 
-	/* 1-level 2nd stage table and lock */
-	spinlock_t pgd_lock;
+	/* 1-level 2nd stage table, protected by kvm->mmu_lock */
 	pgd_t *pgd;
 
 	/* VTTBR value associated with above pgd and vmid */
Signature · 1 line
2.18.0
reviewer Reviewed-by on v1 1/5
#1 lore raw

Hi Steve

Quoted 16 lines · Steven Price

The lock has never been used and the page tables are protected by mmu_lock in struct kvm.

CC Marc Zyngier <[email protected]>
CC Christoffer Dall <[email protected]>
  arch/arm64/include/asm/kvm_host.h | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/include/asm/kvm_host.h +0 -0
index fe8777b12f86..8150a7f8a50f 100644

arch/arm64/include/asm/kvm_host.h struct kvm_arch { · line 67

Quoted 9 lines
arch/arm64/include/asm/kvm_host.h +1 -2
@@ -61,8 +61,7 @@ struct kvm_arch {
  	u64    vmid_gen;
  	u32    vmid;
 
-	/* 1-level 2nd stage table and lock */
-	spinlock_t pgd_lock;
+	/* 1-level 2nd stage table, protected by kvm->mmu_lock */
  	pgd_t *pgd;
 
  	/* VTTBR value associated with above pgd and vmid */

I have a patch which already does this, though not a dedicated patch [1] in the dynamic IPA series. As such I am fine with this patch being merged if it gets there first, as we are still working out the userspace
API for dynamic IPA.

FWIW,

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-July/591778.html