[RFC PATCH] MIPS: KGDB: Remove the useless "nop"

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

 



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@xxxxxxxxxxx>
Cc: Huacai Chen <chenhuacai@xxxxxxxxxx>
Cc: WANG Xuerui <kernel@xxxxxxxxxx>
Cc: Felix Yan <felixonmars@xxxxxxxxxxxxx>
Cc: Mingcong Bai <jeffbai@xxxxxxx>
Signed-off-by: WangYuli <wangyuli@xxxxxxxxxxxxx>
---
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





[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux