[PATCH 03/27] um: Drop support for hosts without SYSEMU_SINGLESTEP support

Benjamin Berg benjamin at sipsolutions.net
Sun Jun 20 05:05:58 PDT 2021


On Sat, 2021-06-19 at 22:17 +0200, Richard Weinberger wrote:
> On Thu, Mar 4, 2021 at 12:03 AM Benjamin Berg
> <benjamin at sipsolutions.net> wrote:
> > 
> > These features have existed since Linux 2.6.14 and can be considered
> > widely available at this point.
> 
> [...]
> 
> > -#ifndef PTRACE_SYSEMU
> > -#define PTRACE_SYSEMU 31
> > -#endif
> > -#ifndef PTRACE_SYSEMU_SINGLESTEP
> > -#define PTRACE_SYSEMU_SINGLESTEP 32
> > -#endif
> 
> Where did you test this? On my OpenSUSE 15.2 machine this change
> causes a build failure.

I have been testing this on Fedora, currently F34 (x86_64).

> arch/um/os-Linux/start_up.c: In function ‘check_sysemu’:
> arch/um/os-Linux/start_up.c:153:14: error: ‘PTRACE_SYSEMU_SINGLESTEP’
> undeclared (first use in this function); did you mean
> ‘PTRACE_SINGLESTEP’?
>    if (ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
>               ^~~~~~~~~~~~~~~~~~~~~~~~
>               PTRACE_SINGLESTEP
> 
> I think we need to carefully include the right asm headers.

Hmm, possibly. For me the definition is coming from the glibc headers
right now:

# 26 "arch/um/os-Linux/start_up.c" 2
# 1 "./arch/um/include/shared/ptrace_user.h" 1
# 9 "./arch/um/include/shared/ptrace_user.h"
# 1 "/usr/include/sys/ptrace.h" 1 3 4
# 26 "/usr/include/sys/ptrace.h" 3 4

sys/ptrace.h is in turn is provided by glibc-headers-x86-2.33-
16.fc34.noarch.

Not sure what the right thing here is. One could include
"linux/ptrace.h", but those are #defines, while the glibc header uses
an enum. I think it'll work if one first includes the glibc header for
the function definition and only then the kernel header. But, that
seems odd to me right now, and I am not why 

Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-um/attachments/20210620/1bb92ec0/attachment.sig>


More information about the linux-um mailing list