From: Daniel Axtens Date: Fri, 19 Feb 2021 06:03:01 +0000 Subject: Re: [RFC PATCH 2/9] KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVM Message-Id: <87lfbka92i.fsf@linkitivity.dja.id.au> List-Id: References: <20210202030313.3509446-1-npiggin@gmail.com> <20210202030313.3509446-3-npiggin@gmail.com> In-Reply-To: <20210202030313.3509446-3-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 Hi Nick, > +maybe_skip: > + cmpwi r12,0x200 > + beq 1f > + cmpwi r12,0x300 > + beq 1f > + cmpwi r12,0x380 > + beq 1f > +#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > + /* XXX: cbe stuff? instruction breakpoint? */ > + cmpwi r12,0xe02 > + beq 2f > +#endif > + b no_skip > +1: mfspr r9,SPRN_SRR0 > + addi r9,r9,4 > + mtspr SPRN_SRR0,r9 > + ld r12,HSTATE_SCRATCH0(r13) > + ld r9,HSTATE_SCRATCH2(r13) > + GET_SCRATCH0(r13) > + RFI_TO_KERNEL > +#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > +2: mfspr r9,SPRN_HSRR0 > + addi r9,r9,4 > + mtspr SPRN_HSRR0,r9 > + ld r12,HSTATE_SCRATCH0(r13) > + ld r9,HSTATE_SCRATCH2(r13) > + GET_SCRATCH0(r13) > + HRFI_TO_KERNEL > +#endif If I understand correctly, label 1 is the kvmppc_skip_interrupt and label 2 is the kvmppc_skip_Hinterrupt. Would it be easier to understand if we used symbolic labels, or do you think the RFI_TO_KERNEL vs HRFI_TO_KERNEL and other changes are sufficient? Apart from that, I haven't checked the precise copy-paste to make sure nothing has changed by accident, but I am able to follow the general idea of the patch and am vigorously in favour of anything that simplifies our exception/interrupt paths! Kind regards, Daniel > -- > 2.23.0