Re: [PATCH v3 14/16] powerpc/32: implement fast entry for syscalls on BOOKE

From: Christophe Leroy
Date: Mon Jun 03 2019 - 05:20:40 EST




On 05/28/2019 05:03 PM, Christophe Leroy wrote:
Michael Ellerman <mpe@xxxxxxxxxxxxxx> a ÃcritÂ:

Christophe Leroy <christophe.leroy@xxxxxx> writes:
Le 23/05/2019 Ã 09:00, Christophe Leroy a ÃcritÂ:

[...]

arch/powerpc/kernel/head_fsl_booke.o: In function `SystemCall':
arch/powerpc/kernel/head_fsl_booke.S:416: undefined reference to
`kvmppc_handler_BOOKE_INTERRUPT_SYSCALL_SPRN_SRR1'
Makefile:1052: recipe for target 'vmlinux' failed

+.macro SYSCALL_ENTRY trapno intno
+ÂÂÂ mfsprÂÂÂ r10, SPRN_SPRG_THREAD
+#ifdef CONFIG_KVM_BOOKE_HV
+BEGIN_FTR_SECTION
+ÂÂÂ mtsprÂÂÂ SPRN_SPRG_WSCRATCH0, r10
+ÂÂÂ stwÂÂÂ r11, THREAD_NORMSAVE(0)(r10)
+ÂÂÂ stwÂÂÂ r13, THREAD_NORMSAVE(2)(r10)
+ÂÂÂ mfcrÂÂÂ r13ÂÂÂÂÂÂÂÂÂÂÂ /* save CR in r13 for nowÂÂÂÂÂÂ */
+ÂÂÂ mfsprÂÂÂ r11, SPRN_SRR1
+ÂÂÂ mtocrfÂÂÂ 0x80, r11ÂÂÂ /* check MSR[GS] without clobbering reg */
+ÂÂÂ bfÂÂÂ 3, 1975f
+ÂÂÂ bÂÂÂ kvmppc_handler_BOOKE_INTERRUPT_\intno\()_SPRN_SRR1

It seems to me that the "_SPRN_SRR1" on the end of this line
isn't meant to be there... However, it still fails to link with that
removed.

It looks like I missed the macro expansion.

The called function should be kvmppc_handler_8_0x01B

Seems like kisskb doesn't build any config like this.

I thought we did, ie:

http://kisskb.ellerman.id.au/kisskb/buildresult/13817941/

That's a ppc64 config it seems. The problem was on booke32.

Christophe


But clearly something is missing to trigger the bug.

I was able to trigger the bug with mpc85xx_defconfig + CONFIG_VIRTUALIZATION + CONFIG_PPC_E500MC

The bug pops up when CONFIG_KVM_BOOKE_HV is set.

Christophe


cheers