Re: [PATCH] parisc: Use LINUX_GATEWAY_SPACE constant in entry.S

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-10-25 2:31 AM, Helge Deller wrote:
Use the predefined LINUX_GATEWAY_SPACE constant in the various important
code sections which deal with the gateway page.

Signed-off-by: Helge Deller <deller@xxxxxx>

diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 1c60408a64ad..9f3673351924 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -394,11 +394,13 @@
  	*/
  	.macro		space_check	spc,tmp,fault
  	mfsp		%sr7,\tmp
-	or,COND(<>)	%r0,\spc,%r0	/* user may execute gateway page
+	or,COND(<>)	LINUX_GATEWAY_SPACE,\spc,%r0
+					/* user may execute gateway page
  					 * as kernel, so defeat the space
  					 * check if it is */
  	copy		\spc,\tmp
-	or,COND(=)	%r0,\tmp,%r0	/* nullify if executing as kernel */
+	or,COND(=)	LINUX_GATEWAY_SPACE,\tmp,%r0
+					/* nullify if executing as kernel */
  	cmpb,COND(<>),n	\tmp,\spc,\fault
  	.endm
The above is somewhat misleading as the "or" instruction doesn't support an immediate operand.  It only works because LINUX_GATEWAY_SPACE is 0 and that picks register r0 for
the inclusive or.
@@ -910,9 +912,9 @@ intr_check_sig:
  	 * Only do signals if we are returning to user space
  	 */
  	LDREG	PT_IASQ0(%r16), %r20
-	cmpib,COND(=),n 0,%r20,intr_restore /* backward */
+	cmpib,COND(=),n LINUX_GATEWAY_SPACE, %r20, intr_restore /* backward */
  	LDREG	PT_IASQ1(%r16), %r20
-	cmpib,COND(=),n 0,%r20,intr_restore /* backward */
+	cmpib,COND(=),n LINUX_GATEWAY_SPACE, %r20, intr_restore /* backward */
/* NOTE: We need to enable interrupts if we have to deliver
  	 * signals. We used to do this earlier but it caused kernel


Dave

--
John David Anglin  dave.anglin@xxxxxxxx




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux