From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabiano Rosas Date: Wed, 24 Feb 2021 20:36:16 +0000 Subject: Re: [PATCH 12/13] KVM: PPC: Book3S HV: Move radix MMU switching together in the P9 path Message-Id: <878s7dxkxr.fsf@linux.ibm.com> List-Id: References: <20210219063542.1425130-1-npiggin@gmail.com> <20210219063542.1425130-13-npiggin@gmail.com> In-Reply-To: <20210219063542.1425130-13-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Nicholas Piggin , kvm-ppc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Nicholas Piggin Nicholas Piggin writes: > Switching the MMU from radix<->radix mode is tricky particularly as the > MMU can remain enabled and requires a certain sequence of SPR updates. > Move these together into their own functions. > > This also includes the radix TLB check / flush because it's tied in to > MMU switching due to tlbiel getting LPID from LPIDR. > > Signed-off-by: Nicholas Piggin > --- > @@ -4117,7 +4138,7 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit, > { > struct kvm_run *run = vcpu->run; > int trap, r, pcpu; > - int srcu_idx, lpid; > + int srcu_idx; > struct kvmppc_vcore *vc; > struct kvm *kvm = vcpu->kvm; > struct kvm_nested_guest *nested = vcpu->arch.nested; > @@ -4191,13 +4212,6 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit, > vc->vcore_state = VCORE_RUNNING; > trace_kvmppc_run_core(vc, 0); > > - if (cpu_has_feature(CPU_FTR_HVMODE)) { > - lpid = nested ? nested->shadow_lpid : kvm->arch.lpid; > - mtspr(SPRN_LPID, lpid); > - isync(); > - kvmppc_check_need_tlb_flush(kvm, pcpu, nested); > - } > - What about the counterpart to this^ down below? if (cpu_has_feature(CPU_FTR_HVMODE)) { mtspr(SPRN_LPID, kvm->arch.host_lpid); isync(); } > guest_enter_irqoff(); > > srcu_idx = srcu_read_lock(&kvm->srcu);