From: Nicholas Piggin Date: Tue, 23 Mar 2021 09:48:57 +0000 Subject: Re: [PATCH v4 22/46] KVM: PPC: Book3S HV P9: Stop handling hcalls in real-mode in the P9 path Message-Id: <1616492251.gsmvgdqq5o.astroid@bobo.none> List-Id: References: <20210323010305.1045293-1-npiggin@gmail.com> <20210323010305.1045293-23-npiggin@gmail.com> <6901d698-f3d8-024b-3aa1-47b157bbd57d@ozlabs.ru> <1616490842.v369xyk7do.astroid@bobo.none> <994fb056-4445-4301-faca-b53394fb6b35@ozlabs.ru> In-Reply-To: <994fb056-4445-4301-faca-b53394fb6b35@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexey Kardashevskiy , kvm-ppc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Excerpts from Alexey Kardashevskiy's message of March 23, 2021 7:24 pm: > > > On 23/03/2021 20:16, Nicholas Piggin wrote: >> Excerpts from Alexey Kardashevskiy's message of March 23, 2021 7:02 pm: >>> >>> >>> On 23/03/2021 12:02, Nicholas Piggin wrote: >>>> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S >>>> index c11597f815e4..2d0d14ed1d92 100644 >>>> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S >>>> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S >>>> @@ -1397,9 +1397,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) >>>> mr r4,r9 >>>> bge fast_guest_return >>>> 2: >>>> + /* If we came in through the P9 short path, no real mode hcalls */ >>>> + lwz r0, STACK_SLOT_SHORT_PATH(r1) >>>> + cmpwi r0, 0 >>>> + bne no_try_real >>> >>> >>> btw is mmu on at this point? or it gets enabled by rfid at the end of >>> guest_exit_short_path? >> >> Hash guest it's off. Radix guest it can be on or off depending on the >> interrupt type and MSR and LPCR[AIL] values. > > What I meant was - what do we expect here on p9? mmu on? ^w^w^w^w^w^w^w^w^w P9 radix can be on or off. If the guest had MSR[IR] or MSR[DR] clear, or if the guest is running AIL=0 mode, or if this is a machine check, system reset, or HMI interrupt then the MMU will be off here. > I just realized - it is radix so there is no problem with vmalloc > addresses in real mode as these do not use top 2 bits as on hash and the > exact mmu state is less important here. Cheers. We still can't use vmalloc addresses in real mode on radix because they don't translate with the page tables. Thanks, Nick