Thread (6 messages) flat view 6 messages, 3 authors, 2019-09-05

Re: [PATCH v3] powerpc/64: system call implement the bulk of the logic in C

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2019-09-05 22:32:43

Christophe Leroy's on September 6, 2019 2:29 am:

Le 05/09/2019 à 14:35, Nicholas Piggin a écrit :
quoted
-.Lsyscall_error_cont:
-	ld	r7,_NIP(r1)
  BEGIN_FTR_SECTION
  	stdcx.	r0,0,r1			/* to clear the reservation */
  END_FTR_SECTION_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
-	andi.	r6,r8,MSR_PR
-	ld	r4,_LINK(r1)
  
-	kuap_check_amr r10, r11
+	mtspr	SPRN_SRR0,r4
+	mtspr	SPRN_SRR1,r5
That looks dangerous. Once you have modified SRR0 and SRR1, your 
exception becomes unrecoverable, so this should be done as close as 
possible to the rfi.
Worse than that even, when we set MSR[RI]=0 the exception becomes
unrecoverable, and that happens in the C code!
Here you seem to do many thinks inbetween, 
including restoring some registers from the stack.
The code it replaces has a pretty large non-recoverable window as
well, interrupt entry has large ones particularly for KVM. It's an
unfortunate quirk of the architecture but it's not worth getting
too worried about or sacrificing too much performance for.

I do have some later patches which improves this a lot, but that will
wait until after the interrupt return is also changed to C.

Thanks,
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help