lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210305031257.14936-1-deng.hongjie@h3c.com>
Date:   Fri, 5 Mar 2021 11:12:57 +0800
From:   HongJieDeng <deng.hongjie@....com>
To:     <tsbogend@...ha.franken.de>
CC:     <paulburton@...nel.org>, <chenhc@...ote.com>,
        <linux-mips@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <liulichao@...ngson.cn>, <denghongjie@....com>,
        Hongjie Deng <deng.hongjie@....com>
Subject: [PATCH] MIPS: Support large stack.

From: Hongjie Deng <deng.hongjie@....com>

We need more stack space, xori/ori no longer apply when
 _THREAD_MASK exceeds 16 bits

Signed-off-by: Hongjie Deng <deng.hongjie@....com>
---
 arch/mips/include/asm/stackframe.h | 8 ++++++++
 arch/mips/kernel/genex.S           | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h
index aa430a6..6ebc39f 100644
--- a/arch/mips/include/asm/stackframe.h
+++ b/arch/mips/include/asm/stackframe.h
@@ -278,8 +278,16 @@
 		sll	k0, 3		/* extract cu0 bit */
 		bltz	k0, 9f
 
+#if    _THREAD_MASK  < (1 << 16 - 1)
 		ori	$28, sp, _THREAD_MASK
 		xori	$28, _THREAD_MASK
+#else
+		li      $28,   _THREAD_MASK
+		or  $28,  sp,  $28
+		li  $24, _THREAD_MASK
+		xor   $28, $28, $24
+#endif
+
 #ifdef CONFIG_CPU_CAVIUM_OCTEON
 		.set    mips64
 		pref    0, 0($28)       /* Prefetch the current pointer */
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index bcce32a..5ea4fe4 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -662,8 +662,14 @@ isrdhwr:
 #endif
 	MTC0	k0, CP0_EPC
 	/* I hope three instructions between MTC0 and ERET are enough... */
+#if    _THREAD_MASK  < (1 << 16 - 1)
 	ori	k1, _THREAD_MASK
 	xori	k1, _THREAD_MASK
+#else
+	li  $24 ,_THREAD_MASK
+	or   k1, k1, $24
+	xor   k1, k1, $24
+#endif
 	LONG_L	v1, TI_TP_VALUE(k1)
 	.set	push
 	.set	arch=r4000
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ