[RFC PATCH 2/9] KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVM

Nicholas Piggin npiggin at gmail.com
Fri Feb 19 18:56:38 AEDT 2021


Excerpts from Daniel Axtens's message of February 19, 2021 4:03 pm:
> 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?

Yeah my thinking was it's okay this way because we've got all the 
context there, whereas prior to this patch those were branched to from 
far away places so the names helped more.

If the discontiguity or nesting was any larger then yes I would say 
naming the labels is probably a good idea (e.g., maybe_skip / no_skip).

> 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!

Thanks,
Nick


More information about the Linuxppc-dev mailing list