Thread (79 messages) 79 messages, 6 authors, 2021-03-23

Re: [PATCH v3 18/41] KVM: PPC: Book3S HV P9: Move xive vcpu context management into kvmhv_p9_guest_entry

flat view

From: Alexey Kardashevskiy <hidden>
Date: 2021-03-22 05:31:12


On 06/03/2021 02:06, Nicholas Piggin wrote:
Move the xive management up so the low level register switching can be
pushed further down in a later patch. XIVE MMIO CI operations can run in
higher level code with machine checks, tracing, etc., available.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>


Reviewed-by: Alexey Kardashevskiy <redacted>

quoted hunk ↗ jump to hunk
---
  arch/powerpc/kvm/book3s_hv.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index b265522fc467..497f216ad724 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -3558,15 +3558,11 @@ static int kvmhv_load_hv_regs_and_go(struct kvm_vcpu *vcpu, u64 time_limit,
  
  	switch_mmu_to_guest_radix(kvm, vcpu, lpcr);
  
-	kvmppc_xive_push_vcpu(vcpu);
-
  	mtspr(SPRN_SRR0, vcpu->arch.shregs.srr0);
  	mtspr(SPRN_SRR1, vcpu->arch.shregs.srr1);
  
  	trap = __kvmhv_vcpu_entry_p9(vcpu);
  
-	kvmppc_xive_pull_vcpu(vcpu);
-
  	/* Advance host PURR/SPURR by the amount used by guest */
  	purr = mfspr(SPRN_PURR);
  	spurr = mfspr(SPRN_SPURR);
@@ -3749,7 +3745,10 @@ static int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit,
  			trap = 0;
  		}
  	} else {
+		kvmppc_xive_push_vcpu(vcpu);
  		trap = kvmhv_load_hv_regs_and_go(vcpu, time_limit, lpcr);
+		kvmppc_xive_pull_vcpu(vcpu);
+
  	}
  
  	vcpu->arch.slb_max = 0;
-- 
Alexey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help