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: <4621EB3971C7BB9D+20250322045034.297491-1-wangyuli@uniontech.com>
Date: Sat, 22 Mar 2025 12:50:34 +0800
From: WangYuli <wangyuli@...ontech.com>
To: tsbogend@...ha.franken.de
Cc: wangyuli@...ontech.com,
	linux-kernel@...r.kernel.org,
	linux-mips@...r.kernel.org,
	zhanjun@...ontech.com,
	niecheng1@...ontech.com,
	guanwentao@...ontech.com,
	"Maciej W. Rozycki" <macro@...am.me.uk>,
	Huacai Chen <chenhuacai@...nel.org>,
	WANG Xuerui <kernel@...0n.name>,
	Felix Yan <felixonmars@...hlinux.org>,
	Mingcong Bai <jeffbai@...c.io>
Subject: [RFC PATCH] MIPS: KGDB: Remove the useless "nop"

The nop instruction surrounding "breakinst:\tbreak\n\t" appears to
serve no real purpose.

Its introduction can be traced back to commit 51c6022fdb ("[PATCH]
MIPS update") within the Linux history tree [1]. This commit was
substantial, comprising 41010 lines, and provides no justification
for the insertion of this nop instruction.

Based on the MIPS architecture specification, delay slots are only
present after jump instructions or MIPS1 load instructions.
Consequently, the nop here is not intended to satisfy a delay slot
requirement.

Thus, this instruction is suspicious and should probably be removed.

[1]. https://web.git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git

Cc: Maciej W. Rozycki <macro@...am.me.uk>
Cc: Huacai Chen <chenhuacai@...nel.org>
Cc: WANG Xuerui <kernel@...0n.name>
Cc: Felix Yan <felixonmars@...hlinux.org>
Cc: Mingcong Bai <jeffbai@...c.io>
Signed-off-by: WangYuli <wangyuli@...ontech.com>
---
NOTE:
  This patch is submitted as an RFC due to my incomplete knowledge
of the extensive history of MIPS.
  The nop instruction in question may indeed have a valid reason for
its existence, but its origins are likely too far in the past to
easily ascertain.
  I would be grateful if anyone with relevant historical information
could take the time to elaborate on the background, such as specific
models or microarchitectures that might be impacted by this change.
  Thank you all very much for your assistance.
---
 arch/mips/kernel/kgdb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index 09a2d7bb9eef..d6ccc7d2d34f 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -201,9 +201,7 @@ void arch_kgdb_breakpoint(void)
 	__asm__ __volatile__(
 		".globl breakinst\n\t"
 		".set\tnoreorder\n\t"
-		"nop\n"
 		"breakinst:\tbreak\n\t"
-		"nop\n\t"
 		".set\treorder");
 }
 
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ