[PATCH] arch/x86/ptrace: remove misleading comments about pt_regs

Daniil Tatianin posted 1 patch 3 months ago
arch/x86/include/asm/ptrace.h          | 8 ++------
arch/x86/include/uapi/asm/ptrace-abi.h | 7 ++-----
arch/x86/include/uapi/asm/ptrace.h     | 7 ++-----
3 files changed, 6 insertions(+), 16 deletions(-)
[PATCH] arch/x86/ptrace: remove misleading comments about pt_regs
Posted by Daniil Tatianin 3 months ago
This comment hasn't been true for at least 10 years, ever since commit
ff467594f2a4 ("x86/asm/entry/64: Save all regs on interrupt entry").

Remove to prevent reader confusion.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
---
 arch/x86/include/asm/ptrace.h          | 8 ++------
 arch/x86/include/uapi/asm/ptrace-abi.h | 7 ++-----
 arch/x86/include/uapi/asm/ptrace.h     | 7 ++-----
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 50f75467f73d..dcc6f8beae2c 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -101,11 +101,7 @@ struct fred_ss {
 };
 
 struct pt_regs {
-	/*
-	 * C ABI says these regs are callee-preserved. They aren't saved on
-	 * kernel entry unless syscall needs a complete, fully filled
-	 * "struct pt_regs".
-	 */
+	/* C ABI says these regs are callee-preserved. */
 	unsigned long r15;
 	unsigned long r14;
 	unsigned long r13;
@@ -113,7 +109,7 @@ struct pt_regs {
 	unsigned long bp;
 	unsigned long bx;
 
-	/* These regs are callee-clobbered. Always saved on kernel entry. */
+	/* These regs are callee-clobbered. */
 	unsigned long r11;
 	unsigned long r10;
 	unsigned long r9;
diff --git a/arch/x86/include/uapi/asm/ptrace-abi.h b/arch/x86/include/uapi/asm/ptrace-abi.h
index 5823584dea13..b06535b1226b 100644
--- a/arch/x86/include/uapi/asm/ptrace-abi.h
+++ b/arch/x86/include/uapi/asm/ptrace-abi.h
@@ -26,17 +26,14 @@
 #else /* __i386__ */
 
 #if defined(__ASSEMBLER__) || defined(__FRAME_OFFSETS)
-/*
- * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
- * unless syscall needs a complete, fully filled "struct pt_regs".
- */
+/* C ABI says these regs are callee-preserved. */
 #define R15 0
 #define R14 8
 #define R13 16
 #define R12 24
 #define RBP 32
 #define RBX 40
-/* These regs are callee-clobbered. Always saved on kernel entry. */
+/* These regs are callee-clobbered. */
 #define R11 48
 #define R10 56
 #define R9 64
diff --git a/arch/x86/include/uapi/asm/ptrace.h b/arch/x86/include/uapi/asm/ptrace.h
index e0b5b4f6226b..c48e56bc6fa0 100644
--- a/arch/x86/include/uapi/asm/ptrace.h
+++ b/arch/x86/include/uapi/asm/ptrace.h
@@ -42,17 +42,14 @@ struct pt_regs {
 #ifndef __KERNEL__
 
 struct pt_regs {
-/*
- * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
- * unless syscall needs a complete, fully filled "struct pt_regs".
- */
+/* C ABI says these regs are callee-preserved. */
 	unsigned long r15;
 	unsigned long r14;
 	unsigned long r13;
 	unsigned long r12;
 	unsigned long rbp;
 	unsigned long rbx;
-/* These regs are callee-clobbered. Always saved on kernel entry. */
+/* These regs are callee-clobbered. */
 	unsigned long r11;
 	unsigned long r10;
 	unsigned long r9;
-- 
2.34.1