mbox series

[v4,0/3] KVM: arm64: Fixes for parallel faults series

Message ID 20221118182222.3932898-1-oliver.upton@linux.dev (mailing list archive)
Headers show
Series KVM: arm64: Fixes for parallel faults series | expand

Message

Oliver Upton Nov. 18, 2022, 6:22 p.m. UTC
Small set of fixes for the parallel faults series. Most importantly,
stop taking the RCU read lock for walking hyp stage-1. For the sake of
consistency, take a pointer to kvm_pgtable_walker in
kvm_dereference_pteref() as well.

Tested on an Ampere Altra system with kvm-arm.mode={nvhe,protected} and
lockdep. Applies on top of the parallel faults series picked up last
week.

v3: https://lore.kernel.org/kvmarm/20221116165655.2649475-1-oliver.upton@linux.dev/

v3 -> v4:
 - Return an error instead of WARN() in hyp for shared walks (Will)

Oliver Upton (3):
  KVM: arm64: Take a pointer to walker data in kvm_dereference_pteref()
  KVM: arm64: Don't acquire RCU read lock for exclusive table walks
  KVM: arm64: Reject shared table walks in the hyp code

 arch/arm64/include/asm/kvm_pgtable.h | 159 +++++++++++++++------------
 arch/arm64/kvm/hyp/pgtable.c         |  13 ++-
 2 files changed, 96 insertions(+), 76 deletions(-)

Comments

Will Deacon Nov. 21, 2022, 6:09 p.m. UTC | #1
On Fri, Nov 18, 2022 at 06:22:19PM +0000, Oliver Upton wrote:
> Small set of fixes for the parallel faults series. Most importantly,
> stop taking the RCU read lock for walking hyp stage-1. For the sake of
> consistency, take a pointer to kvm_pgtable_walker in
> kvm_dereference_pteref() as well.
> 
> Tested on an Ampere Altra system with kvm-arm.mode={nvhe,protected} and
> lockdep. Applies on top of the parallel faults series picked up last
> week.
> 
> v3: https://lore.kernel.org/kvmarm/20221116165655.2649475-1-oliver.upton@linux.dev/
> 
> v3 -> v4:
>  - Return an error instead of WARN() in hyp for shared walks (Will)

For the series:

Acked-by: Will Deacon <will@kernel.org>

Thanks!

Will
Marc Zyngier Nov. 22, 2022, 1:09 p.m. UTC | #2
On Fri, 18 Nov 2022 18:22:19 +0000, Oliver Upton wrote:
> Small set of fixes for the parallel faults series. Most importantly,
> stop taking the RCU read lock for walking hyp stage-1. For the sake of
> consistency, take a pointer to kvm_pgtable_walker in
> kvm_dereference_pteref() as well.
> 
> Tested on an Ampere Altra system with kvm-arm.mode={nvhe,protected} and
> lockdep. Applies on top of the parallel faults series picked up last
> week.
> 
> [...]

Applied to next, thanks!

[1/3] KVM: arm64: Take a pointer to walker data in kvm_dereference_pteref()
      commit: 3a5154c723ba5ceb9ce374a7307e03263c03fd29
[2/3] KVM: arm64: Don't acquire RCU read lock for exclusive table walks
      commit: b7833bf202e3068abb77c642a0843f696e9c8d38
[3/3] KVM: arm64: Reject shared table walks in the hyp code
      commit: 5e806c5812e8012a83496cf96bdba266b3aec428

Cheers,

	M.