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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230815004813.555115-18-vgupta@kernel.org>
Date:   Mon, 14 Aug 2023 17:48:10 -0700
From:   Vineet Gupta <vgupta@...nel.org>
To:     linux-snps-arc@...ts.infradead.org
Cc:     linux-kernel@...r.kernel.org,
        Shahab Vahedi <Shahab.Vahedi@...opsys.com>,
        Alexey Brodkin <abrodkin@...opsys.com>,
        Vineet Gupta <vgupta@...nel.org>
Subject: [PATCH 17/20] ARC: entry: replace 8 byte OR with 4 byte BSET

FAKE_RET_FROM_EXCEPTION drops down to pure kernel mode. It currently has
an 8 byte instruction which can be replaced with 4 byte BSET

This is applicable to both ARCv2 and ARCv3 entr code.

ARCv2 current
------------
00000804 <EV_Trap>:
...
 874:   216a 1280               lr      r9,[status32]
 878:   2146 1809               bic     r9,r9,0x20
 87c:   2105 1f89 8000 0000     or      r9,r9,0x80000000
                  ^^^^^^^^^
 884:   2029 8240               kflag   r9

ARCv2 after
----------
000007e0 <EV_Trap>:
...
 850:   216a 1280               lr      r9,[status32]
 854:   2150 1149               bclr    r9,r9,0x5
 858:   214f 17c9               bset    r9,r9,0x1f
 85c:   2029 8240               kflag   r9

Signed-off-by: Vineet Gupta <vgupta@...nel.org>
---
 arch/arc/include/asm/entry-arcv2.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arc/include/asm/entry-arcv2.h b/arch/arc/include/asm/entry-arcv2.h
index 11b48ab39154..f7c9b3915d10 100644
--- a/arch/arc/include/asm/entry-arcv2.h
+++ b/arch/arc/include/asm/entry-arcv2.h
@@ -274,8 +274,8 @@
 
 .macro FAKE_RET_FROM_EXCPN
 	lr      r9, [status32]
-	bic     r9, r9, STATUS_AE_MASK
-	or      r9, r9, STATUS_IE_MASK
+	bclr    r9, r9, STATUS_AE_BIT
+	bset    r9, r9, STATUS_IE_BIT
 	kflag   r9
 .endm
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ