* [PATCH 1/3] um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP
@ 2018-06-15 14:42 Richard Weinberger
2018-06-15 14:42 ` [PATCH 2/3] um: Remove update_debugregs() Richard Weinberger
2018-06-15 14:42 ` [PATCH 3/3] um: Give start_idle_thread() a return code Richard Weinberger
0 siblings, 2 replies; 3+ messages in thread
From: Richard Weinberger @ 2018-06-15 14:42 UTC (permalink / raw)
To: linux-um; +Cc: linux-kernel, Richard Weinberger, stable, Ritesh Raj Sarraf
32bit UML used to define PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP
own its own because many years ago not all libcs had these request codes
in their UAPI.
These days PTRACE_SYSEMU/_SINGLESTEP is well known and part of glibc
and our own define becomes problematic.
With change c48831d0eebf ("linux/x86: sync sys/ptrace.h with Linux 4.14
[BZ #22433]") glibc turned PTRACE_SYSEMU/_SINGLESTEP into a enum and
UML failed to build.
Let's drop our define and rely on the fact that every libc has
PTRACE_SYSEMU/_SINGLESTEP.
Cc: <stable@vger.kernel.org>
Cc: Ritesh Raj Sarraf <rrs@researchut.com>
Reported-and-tested-by: Ritesh Raj Sarraf <rrs@researchut.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
arch/x86/um/shared/sysdep/ptrace_32.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/arch/x86/um/shared/sysdep/ptrace_32.h b/arch/x86/um/shared/sysdep/ptrace_32.h
index b94a108de1dc..ae00d22bce02 100644
--- a/arch/x86/um/shared/sysdep/ptrace_32.h
+++ b/arch/x86/um/shared/sysdep/ptrace_32.h
@@ -10,20 +10,10 @@
static inline void update_debugregs(int seq) {}
-/* syscall emulation path in ptrace */
-
-#ifndef PTRACE_SYSEMU
-#define PTRACE_SYSEMU 31
-#endif
-
void set_using_sysemu(int value);
int get_using_sysemu(void);
extern int sysemu_supported;
-#ifndef PTRACE_SYSEMU_SINGLESTEP
-#define PTRACE_SYSEMU_SINGLESTEP 32
-#endif
-
#define UPT_SYSCALL_ARG1(r) UPT_BX(r)
#define UPT_SYSCALL_ARG2(r) UPT_CX(r)
#define UPT_SYSCALL_ARG3(r) UPT_DX(r)
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] um: Remove update_debugregs()
2018-06-15 14:42 [PATCH 1/3] um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP Richard Weinberger
@ 2018-06-15 14:42 ` Richard Weinberger
2018-06-15 14:42 ` [PATCH 3/3] um: Give start_idle_thread() a return code Richard Weinberger
1 sibling, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2018-06-15 14:42 UTC (permalink / raw)
To: linux-um; +Cc: linux-kernel, Richard Weinberger
This function is nowhere used, let's get rid of it.
Signed-off-by: Richard Weinberger <richard@nod.at>
---
arch/x86/um/shared/sysdep/ptrace_32.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/um/shared/sysdep/ptrace_32.h b/arch/x86/um/shared/sysdep/ptrace_32.h
index ae00d22bce02..db8478a83a09 100644
--- a/arch/x86/um/shared/sysdep/ptrace_32.h
+++ b/arch/x86/um/shared/sysdep/ptrace_32.h
@@ -8,8 +8,6 @@
#define MAX_FP_NR HOST_FPX_SIZE
-static inline void update_debugregs(int seq) {}
-
void set_using_sysemu(int value);
int get_using_sysemu(void);
extern int sysemu_supported;
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] um: Give start_idle_thread() a return code
2018-06-15 14:42 [PATCH 1/3] um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP Richard Weinberger
2018-06-15 14:42 ` [PATCH 2/3] um: Remove update_debugregs() Richard Weinberger
@ 2018-06-15 14:42 ` Richard Weinberger
1 sibling, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2018-06-15 14:42 UTC (permalink / raw)
To: linux-um; +Cc: Richard Weinberger, linux-kernel
Fixes:
arch/um/os-Linux/skas/process.c:613:1: warning: control reaches end of
non-void function [-Wreturn-type]
longjmp() never returns but gcc still warns that the end of the function
can be reached.
Add a return code and debug aid to detect this impossible case.
Signed-off-by: Richard Weinberger <richard@nod.at>
---
arch/um/os-Linux/skas/process.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index c94c3bd70ccd..df4a985716eb 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -610,6 +610,11 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf)
fatal_sigsegv();
}
longjmp(*switch_buf, 1);
+
+ /* unreachable */
+ printk(UM_KERN_ERR "impossible long jump!");
+ fatal_sigsegv();
+ return 0;
}
void initial_thread_cb_skas(void (*proc)(void *), void *arg)
--
2.13.6
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-15 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-15 14:42 [PATCH 1/3] um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP Richard Weinberger
2018-06-15 14:42 ` [PATCH 2/3] um: Remove update_debugregs() Richard Weinberger
2018-06-15 14:42 ` [PATCH 3/3] um: Give start_idle_thread() a return code Richard Weinberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).