get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1707774/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1707774,
    "url": "http://patchwork.ozlabs.org/api/patches/1707774/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/20221122100759.208290-4-benjamin@sipsolutions.net/",
    "project": {
        "id": 60,
        "url": "http://patchwork.ozlabs.org/api/projects/60/?format=api",
        "name": "User-mode Linux Development",
        "link_name": "linux-um",
        "list_id": "linux-um.lists.infradead.org",
        "list_email": "linux-um@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20221122100759.208290-4-benjamin@sipsolutions.net>",
    "list_archive_url": null,
    "date": "2022-11-22T10:07:34",
    "name": "[v2,03/28] um: Drop support for hosts without SYSEMU_SINGLESTEP support",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "4d5242754d66fbf5b4f4273e46697aa112ac1c6c",
    "submitter": {
        "id": 67525,
        "url": "http://patchwork.ozlabs.org/api/people/67525/?format=api",
        "name": "Benjamin Berg",
        "email": "benjamin@sipsolutions.net"
    },
    "delegate": {
        "id": 54851,
        "url": "http://patchwork.ozlabs.org/api/users/54851/?format=api",
        "username": "rw",
        "first_name": "Richard",
        "last_name": "Weinberger",
        "email": "richard@nod.at"
    },
    "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/20221122100759.208290-4-benjamin@sipsolutions.net/mbox/",
    "series": [
        {
            "id": 329466,
            "url": "http://patchwork.ozlabs.org/api/series/329466/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=329466",
            "date": "2022-11-22T10:07:37",
            "name": "Implement SECCOMP based userland",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/329466/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1707774/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1707774/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=<UNKNOWN>)",
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Q5J2NoV4;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=desiato.20200630 header.b=BfdRkhb/;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=sipsolutions.net header.i=@sipsolutions.net\n header.a=rsa-sha256 header.s=mail header.b=pOjdNKAJ;\n\tdkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4NGgRf5vkfz23nm\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 22 Nov 2022 21:27:10 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQUV-007nxM-Sx; Tue, 22 Nov 2022 10:26:59 +0000",
            "from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05])\n\tby bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQTM-007nM8-LC\n\tfor linux-um@bombadil.infradead.org; Tue, 22 Nov 2022 10:25:48 +0000",
            "from s3.sipsolutions.net ([2a01:4f8:191:4433::2]\n helo=sipsolutions.net)\n\tby desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQF1-003P1q-BY\n\tfor linux-um@lists.infradead.org; Tue, 22 Nov 2022 10:11:06 +0000",
            "by sipsolutions.net with esmtpsa\n (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim 4.96)\n\t(envelope-from <benjamin@sipsolutions.net>)\n\tid 1oxQEm-006IGn-2t;\n\tTue, 22 Nov 2022 11:10:44 +0100"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=+6rIR8tNlefrM0y1PKLpaD8n8KzfkaI0EDEqqlrNQDA=; b=Q5J2NoV4+LsPKs\n\tQ4+reFkv/RFTJ4qeIRf7KziQ2qTNQskm2zHuhjuYpmebf17Pu1r5FssZyycvyDxlu6CJSqY9+Fey6\n\tGSdWS0pM++wojKuaR84fw4Y/bEzBOO2gD9DTVUhwoc3yIiAZNwlT6k8Nb0mavku9yGxw9XoXGquLX\n\tX8rKE4KQLIJadh2E+4IypPlMxuFKUMiGNwtfcc5X6exxDP42+8iZumsxIEqq1IbJh6dW4jvm+1I9p\n\txlFoJgZZhVY3YFgY+mkVH+XZHJj710F/9w/z9AYnPCyj7UWVyI94hGaYrfSsj9bItCfdkl+BY9Bqi\n\ta7GIHDPSYc7qtqVCkXtA==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version\n\t:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:\n\tContent-Type:Content-ID:Content-Description;\n\tbh=xGAXwswBRGmb1xcjgs4zTcGm8Ouw9gDgCNNLh9CPQ6c=; b=BfdRkhb/DmvO3TBF9wPPn8Z3Ad\n\t/gouO0DwRje6Q8ZH5f6SDWN4aFn1cDQ1P8vNsofXeWndgcbQTXKGJXEjcDGflfjbU3L/LkaGYJggc\n\tIv2QpPWJKkscFjC0SB5pYQBjrOgL/D5gpfUBqVyfTj7gi0PGXnH8F0cHorYT0aiWrye8tl/+KZH7G\n\tReSGVCPnGERr6OIsJOIm+CH9WVyzHPYzWbogTpxSOiwkSrCqrjzw27+WMQCpiBxOT6lTfKsJC6aUH\n\tVrIxmn82LrFpdr7SUrJLN7iR2Snq6cjdbHRR0XYA5pNhNiniLin9amSPvFYVpqxlYC5ZHdCDCvfNc\n\t2lVFrMGQ==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender\n\t:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To:\n\tResent-Cc:Resent-Message-ID; bh=xGAXwswBRGmb1xcjgs4zTcGm8Ouw9gDgCNNLh9CPQ6c=;\n\tt=1669111858; x=1670321458; b=pOjdNKAJxuHKGRgMMGFy6d76m/eEbZEAMi3AGH1LRflDJ/O\n\twwzF4GOQpeE2DPIqoSgaxNJkmC/pJtXGKLP2xjKo3OA4zTEI/g5RIDR/1eQkSuIpUrtQ6PHCXVAYV\n\tbWzwTFSkbSgFLPOW3Wh+scHX7V0eqBikxe0IuO/JmaHQWP1TOip5sD7kMVZBRk91CBoACTtaY39OQ\n\tJQT3Kkd7bkScDZhw8LXTyWebPRjT7S8taG7ZpOUZ2EKvhb5dFC+umOZYQ4hZvAVAyAvPDLe52KDYS\n\tRtCQu6516nq10m9uEZtSnthfIcdmhevRpMH3UtOncyTFLZMh6Jgyjx4vXY4Cp2Hg==;"
        ],
        "From": "benjamin@sipsolutions.net",
        "To": "linux-um@lists.infradead.org",
        "Cc": "Benjamin Berg <benjamin@sipsolutions.net>",
        "Subject": "[PATCH v2 03/28] um: Drop support for hosts without SYSEMU_SINGLESTEP\n support",
        "Date": "Tue, 22 Nov 2022 11:07:34 +0100",
        "Message-Id": "<20221122100759.208290-4-benjamin@sipsolutions.net>",
        "X-Mailer": "git-send-email 2.38.1",
        "In-Reply-To": "<20221122100759.208290-1-benjamin@sipsolutions.net>",
        "References": "<20221122100759.208290-1-benjamin@sipsolutions.net>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20221122_101100_483991_60B0789E ",
        "X-CRM114-Status": "GOOD (  30.91  )",
        "X-Spam-Score": "-0.2 (/)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"desiato.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  From: Benjamin Berg <benjamin@sipsolutions.net> These\n features\n    have existed since Linux 2.6.14 and can be considered widely available at\n    this point. Also drop the backward compatibility code for\n PTRACE_SETOPTIONS.    \n Content analysis details:   (-0.2 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n                             author's domain\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily\n                             valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature",
        "X-BeenThere": "linux-um@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<linux-um.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>",
        "List-Post": "<mailto:linux-um@lists.infradead.org>",
        "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>",
        "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "From: Benjamin Berg <benjamin@sipsolutions.net>\n\nThese features have existed since Linux 2.6.14 and can be considered\nwidely available at this point. Also drop the backward compatibility\ncode for PTRACE_SETOPTIONS.\n\nSigned-off-by: Benjamin Berg <benjamin@sipsolutions.net>\n\n----\n\nv2:\n * Continue to define PTRACE_SYSEMU_SINGLESTEP as glibc only added it in\n   version 2.27.\n---\n arch/um/include/asm/processor-generic.h |  1 -\n arch/um/include/shared/kern_util.h      |  3 +-\n arch/um/include/shared/ptrace_user.h    | 41 ---------------\n arch/um/kernel/process.c                | 12 +----\n arch/um/kernel/ptrace.c                 |  2 -\n arch/um/kernel/signal.c                 | 12 -----\n arch/um/os-Linux/skas/process.c         | 60 ++++-----------------\n arch/um/os-Linux/start_up.c             | 70 +++----------------------\n arch/x86/um/ptrace_32.c                 | 24 ---------\n arch/x86/um/ptrace_64.c                 | 26 ---------\n arch/x86/um/shared/sysdep/ptrace_32.h   |  4 --\n arch/x86/um/shared/sysdep/ptrace_user.h | 12 ++---\n 12 files changed, 24 insertions(+), 243 deletions(-)",
    "diff": "diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h\nindex d0fc1862da95..db60a89911d5 100644\n--- a/arch/um/include/asm/processor-generic.h\n+++ b/arch/um/include/asm/processor-generic.h\n@@ -22,7 +22,6 @@ struct mm_struct;\n struct thread_struct {\n \tstruct pt_regs regs;\n \tstruct pt_regs *segv_regs;\n-\tint singlestep_syscall;\n \tvoid *fault_addr;\n \tjmp_buf *fault_catcher;\n \tstruct task_struct *prev_sched;\ndiff --git a/arch/um/include/shared/kern_util.h b/arch/um/include/shared/kern_util.h\nindex d8b8b4f07e42..11b4f3d7c18a 100644\n--- a/arch/um/include/shared/kern_util.h\n+++ b/arch/um/include/shared/kern_util.h\n@@ -34,7 +34,6 @@ extern int handle_page_fault(unsigned long address, unsigned long ip,\n \n extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs);\n extern void initial_thread_cb(void (*proc)(void *), void *arg);\n-extern int is_syscall(unsigned long addr);\n \n extern void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);\n \n@@ -58,7 +57,7 @@ extern char *uml_strdup(const char *string);\n extern unsigned long to_irq_stack(unsigned long *mask_out);\n extern unsigned long from_irq_stack(int nested);\n \n-extern int singlestepping(void *t);\n+extern int singlestepping(void);\n \n extern void segv_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);\n extern void bus_handler(int sig, struct siginfo *si, struct uml_pt_regs *regs);\ndiff --git a/arch/um/include/shared/ptrace_user.h b/arch/um/include/shared/ptrace_user.h\nindex 95455e8996e7..8a705d8f96ce 100644\n--- a/arch/um/include/shared/ptrace_user.h\n+++ b/arch/um/include/shared/ptrace_user.h\n@@ -12,45 +12,4 @@\n extern int ptrace_getregs(long pid, unsigned long *regs_out);\n extern int ptrace_setregs(long pid, unsigned long *regs_in);\n \n-/* syscall emulation path in ptrace */\n-\n-#ifndef PTRACE_SYSEMU\n-#define PTRACE_SYSEMU 31\n-#endif\n-#ifndef PTRACE_SYSEMU_SINGLESTEP\n-#define PTRACE_SYSEMU_SINGLESTEP 32\n-#endif\n-\n-/* On architectures, that started to support PTRACE_O_TRACESYSGOOD\n- * in linux 2.4, there are two different definitions of\n- * PTRACE_SETOPTIONS: linux 2.4 uses 21 while linux 2.6 uses 0x4200.\n- * For binary compatibility, 2.6 also supports the old \"21\", named\n- * PTRACE_OLDSETOPTION. On these architectures, UML always must use\n- * \"21\", to ensure the kernel runs on 2.4 and 2.6 host without\n- * recompilation. So, we use PTRACE_OLDSETOPTIONS in UML.\n- * We also want to be able to build the kernel on 2.4, which doesn't\n- * have PTRACE_OLDSETOPTIONS. So, if it is missing, we declare\n- * PTRACE_OLDSETOPTIONS to be the same as PTRACE_SETOPTIONS.\n- *\n- * On architectures, that start to support PTRACE_O_TRACESYSGOOD on\n- * linux 2.6, PTRACE_OLDSETOPTIONS never is defined, and also isn't\n- * supported by the host kernel. In that case, our trick lets us use\n- * the new 0x4200 with the name PTRACE_OLDSETOPTIONS.\n- */\n-#ifndef PTRACE_OLDSETOPTIONS\n-#define PTRACE_OLDSETOPTIONS PTRACE_SETOPTIONS\n-#endif\n-\n-void set_using_sysemu(int value);\n-int get_using_sysemu(void);\n-extern int sysemu_supported;\n-\n-#define SELECT_PTRACE_OPERATION(sysemu_mode, singlestep_mode) \\\n-\t(((int[3][3] ) { \\\n-\t\t{ PTRACE_SYSCALL, PTRACE_SYSCALL, PTRACE_SINGLESTEP }, \\\n-\t\t{ PTRACE_SYSEMU, PTRACE_SYSEMU, PTRACE_SINGLESTEP }, \\\n-\t\t{ PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, \\\n-\t\t  PTRACE_SYSEMU_SINGLESTEP } }) \\\n-\t\t[sysemu_mode][singlestep_mode])\n-\n #endif\ndiff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c\nindex 80b90b1276a1..1cc1eab64e24 100644\n--- a/arch/um/kernel/process.c\n+++ b/arch/um/kernel/process.c\n@@ -332,17 +332,9 @@ int __init make_proc_sysemu(void)\n \n late_initcall(make_proc_sysemu);\n \n-int singlestepping(void * t)\n+int singlestepping(void)\n {\n-\tstruct task_struct *task = t ? t : current;\n-\n-\tif (!test_thread_flag(TIF_SINGLESTEP))\n-\t\treturn 0;\n-\n-\tif (task->thread.singlestep_syscall)\n-\t\treturn 1;\n-\n-\treturn 2;\n+\treturn test_thread_flag(TIF_SINGLESTEP);\n }\n \n /*\ndiff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c\nindex 5154b27de580..6600a2782796 100644\n--- a/arch/um/kernel/ptrace.c\n+++ b/arch/um/kernel/ptrace.c\n@@ -12,7 +12,6 @@\n void user_enable_single_step(struct task_struct *child)\n {\n \tset_tsk_thread_flag(child, TIF_SINGLESTEP);\n-\tchild->thread.singlestep_syscall = 0;\n \n #ifdef SUBARCH_SET_SINGLESTEPPING\n \tSUBARCH_SET_SINGLESTEPPING(child, 1);\n@@ -22,7 +21,6 @@ void user_enable_single_step(struct task_struct *child)\n void user_disable_single_step(struct task_struct *child)\n {\n \tclear_tsk_thread_flag(child, TIF_SINGLESTEP);\n-\tchild->thread.singlestep_syscall = 0;\n \n #ifdef SUBARCH_SET_SINGLESTEPPING\n \tSUBARCH_SET_SINGLESTEPPING(child, 0);\ndiff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c\nindex ae4658f576ab..a56b44522766 100644\n--- a/arch/um/kernel/signal.c\n+++ b/arch/um/kernel/signal.c\n@@ -120,18 +120,6 @@ void do_signal(struct pt_regs *regs)\n \t\t}\n \t}\n \n-\t/*\n-\t * This closes a way to execute a system call on the host.  If\n-\t * you set a breakpoint on a system call instruction and singlestep\n-\t * from it, the tracing thread used to PTRACE_SINGLESTEP the process\n-\t * rather than PTRACE_SYSCALL it, allowing the system call to execute\n-\t * on the host.  The tracing thread will check this flag and\n-\t * PTRACE_SYSCALL if necessary.\n-\t */\n-\tif (test_thread_flag(TIF_SINGLESTEP))\n-\t\tcurrent->thread.singlestep_syscall =\n-\t\t\tis_syscall(PT_REGS_IP(&current->thread.regs));\n-\n \t/*\n \t * if there's no signal to deliver, we just put the saved sigmask\n \t * back\ndiff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c\nindex b1ea53285af1..11278c30a82d 100644\n--- a/arch/um/os-Linux/skas/process.c\n+++ b/arch/um/os-Linux/skas/process.c\n@@ -177,48 +177,11 @@ static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp\n \tsegv(regs->faultinfo, 0, 1, NULL);\n }\n \n-/*\n- * To use the same value of using_sysemu as the caller, ask it that value\n- * (in local_using_sysemu\n- */\n-static void handle_trap(int pid, struct uml_pt_regs *regs,\n-\t\t\tint local_using_sysemu)\n+static void handle_trap(int pid, struct uml_pt_regs *regs)\n {\n-\tint err, status;\n-\n \tif ((UPT_IP(regs) >= STUB_START) && (UPT_IP(regs) < STUB_END))\n \t\tfatal_sigsegv();\n \n-\tif (!local_using_sysemu)\n-\t{\n-\t\terr = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET,\n-\t\t\t     __NR_getpid);\n-\t\tif (err < 0) {\n-\t\t\tprintk(UM_KERN_ERR \"%s - nullifying syscall failed, errno = %d\\n\",\n-\t\t\t       __func__, errno);\n-\t\t\tfatal_sigsegv();\n-\t\t}\n-\n-\t\terr = ptrace(PTRACE_SYSCALL, pid, 0, 0);\n-\t\tif (err < 0) {\n-\t\t\tprintk(UM_KERN_ERR \"%s - continuing to end of syscall failed, errno = %d\\n\",\n-\t\t\t       __func__, errno);\n-\t\t\tfatal_sigsegv();\n-\t\t}\n-\n-\t\tCATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));\n-\t\tif ((err < 0) || !WIFSTOPPED(status) ||\n-\t\t    (WSTOPSIG(status) != SIGTRAP + 0x80)) {\n-\t\t\terr = ptrace_dump_regs(pid);\n-\t\t\tif (err)\n-\t\t\t\tprintk(UM_KERN_ERR \"Failed to get registers from process, errno = %d\\n\",\n-\t\t\t\t       -err);\n-\t\t\tprintk(UM_KERN_ERR \"%s - failed to wait at end of syscall, errno = %d, status = %d\\n\",\n-\t\t\t       __func__, errno, status);\n-\t\t\tfatal_sigsegv();\n-\t\t}\n-\t}\n-\n \thandle_syscall(regs);\n }\n \n@@ -355,10 +318,10 @@ int start_userspace(unsigned long stub_stack)\n \t\tgoto out_kill;\n \t}\n \n-\tif (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL,\n+\tif (ptrace(PTRACE_SETOPTIONS, pid, NULL,\n \t\t   (void *) PTRACE_O_TRACESYSGOOD) < 0) {\n \t\terr = -errno;\n-\t\tprintk(UM_KERN_ERR \"%s : PTRACE_OLDSETOPTIONS failed, errno = %d\\n\",\n+\t\tprintk(UM_KERN_ERR \"%s : PTRACE_SETOPTIONS failed, errno = %d\\n\",\n \t\t       __func__, errno);\n \t\tgoto out_kill;\n \t}\n@@ -380,8 +343,6 @@ int start_userspace(unsigned long stub_stack)\n void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs)\n {\n \tint err, status, op, pid = userspace_pid[0];\n-\t/* To prevent races if using_sysemu changes under us.*/\n-\tint local_using_sysemu;\n \tsiginfo_t si;\n \n \t/* Handle any immediate reschedules or signals */\n@@ -411,11 +372,10 @@ void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs)\n \t\t\tfatal_sigsegv();\n \t\t}\n \n-\t\t/* Now we set local_using_sysemu to be used for one loop */\n-\t\tlocal_using_sysemu = get_using_sysemu();\n-\n-\t\top = SELECT_PTRACE_OPERATION(local_using_sysemu,\n-\t\t\t\t\t     singlestepping(NULL));\n+\t\tif (singlestepping())\n+\t\t\top = PTRACE_SYSEMU_SINGLESTEP;\n+\t\telse\n+\t\t\top = PTRACE_SYSEMU;\n \n \t\tif (ptrace(op, pid, 0, 0)) {\n \t\t\tprintk(UM_KERN_ERR \"%s - ptrace continue failed, op = %d, errno = %d\\n\",\n@@ -474,7 +434,7 @@ void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs)\n \t\t\t\telse handle_segv(pid, regs, aux_fp_regs);\n \t\t\t\tbreak;\n \t\t\tcase SIGTRAP + 0x80:\n-\t\t\t        handle_trap(pid, regs, local_using_sysemu);\n+\t\t\t\thandle_trap(pid, regs);\n \t\t\t\tbreak;\n \t\t\tcase SIGTRAP:\n \t\t\t\trelay_signal(SIGTRAP, (struct siginfo *)&si, regs);\n@@ -597,10 +557,10 @@ int copy_context_skas0(unsigned long new_stack, int pid)\n \t\tgoto out_kill;\n \t}\n \n-\tif (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL,\n+\tif (ptrace(PTRACE_SETOPTIONS, pid, NULL,\n \t\t   (void *)PTRACE_O_TRACESYSGOOD) < 0) {\n \t\terr = -errno;\n-\t\tprintk(UM_KERN_ERR \"%s : PTRACE_OLDSETOPTIONS failed, errno = %d\\n\",\n+\t\tprintk(UM_KERN_ERR \"%s : PTRACE_SETOPTIONS failed, errno = %d\\n\",\n \t\t       __func__, errno);\n \t\tgoto out_kill;\n \t}\ndiff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c\nindex e3ee4db58b40..561c08e0cc9c 100644\n--- a/arch/um/os-Linux/start_up.c\n+++ b/arch/um/os-Linux/start_up.c\n@@ -143,71 +143,16 @@ static int stop_ptraced_child(int pid, int exitcode, int mustexit)\n \treturn ret;\n }\n \n-/* Changed only during early boot */\n-static int force_sysemu_disabled = 0;\n-\n-static int __init nosysemu_cmd_param(char *str, int* add)\n-{\n-\tforce_sysemu_disabled = 1;\n-\treturn 0;\n-}\n-\n-__uml_setup(\"nosysemu\", nosysemu_cmd_param,\n-\"nosysemu\\n\"\n-\"    Turns off syscall emulation patch for ptrace (SYSEMU).\\n\"\n-\"    SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\\n\"\n-\"    behaviour of ptrace() and helps reduce host context switch rates.\\n\"\n-\"    To make it work, you need a kernel patch for your host, too.\\n\"\n-\"    See http://perso.wanadoo.fr/laurent.vivier/UML/ for further \\n\"\n-\"    information.\\n\\n\");\n-\n static void __init check_sysemu(void)\n {\n-\tunsigned long regs[MAX_REG_NR];\n \tint pid, n, status, count=0;\n \n-\tos_info(\"Checking syscall emulation patch for ptrace...\");\n-\tsysemu_supported = 0;\n-\tpid = start_ptraced_child();\n-\n-\tif (ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)\n-\t\tgoto fail;\n-\n-\tCATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));\n-\tif (n < 0)\n-\t\tfatal_perror(\"check_sysemu : wait failed\");\n-\tif (!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP))\n-\t\tfatal(\"check_sysemu : expected SIGTRAP, got status = %d\\n\",\n-\t\t      status);\n-\n-\tif (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)\n-\t\tfatal_perror(\"check_sysemu : PTRACE_GETREGS failed\");\n-\tif (PT_SYSCALL_NR(regs) != __NR_getpid) {\n-\t\tnon_fatal(\"check_sysemu got system call number %d, \"\n-\t\t\t  \"expected %d...\", PT_SYSCALL_NR(regs), __NR_getpid);\n-\t\tgoto fail;\n-\t}\n-\n-\tn = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, os_getpid());\n-\tif (n < 0) {\n-\t\tnon_fatal(\"check_sysemu : failed to modify system call \"\n-\t\t\t  \"return\");\n-\t\tgoto fail;\n-\t}\n-\n-\tif (stop_ptraced_child(pid, 0, 0) < 0)\n-\t\tgoto fail_stopped;\n-\n-\tsysemu_supported = 1;\n-\tos_info(\"OK\\n\");\n-\tset_using_sysemu(!force_sysemu_disabled);\n-\n-\tos_info(\"Checking advanced syscall emulation patch for ptrace...\");\n+\tos_info(\"Checking syscall emulation for ptrace...\");\n \tpid = start_ptraced_child();\n \n-\tif ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0,\n+\tif ((ptrace(PTRACE_SETOPTIONS, pid, 0,\n \t\t   (void *) PTRACE_O_TRACESYSGOOD) < 0))\n-\t\tfatal_perror(\"check_sysemu: PTRACE_OLDSETOPTIONS failed\");\n+\t\tfatal_perror(\"check_sysemu: PTRACE_SETOPTIONS failed\");\n \n \twhile (1) {\n \t\tcount++;\n@@ -243,17 +188,14 @@ static void __init check_sysemu(void)\n \tif (stop_ptraced_child(pid, 0, 0) < 0)\n \t\tgoto fail_stopped;\n \n-\tsysemu_supported = 2;\n \tos_info(\"OK\\n\");\n \n-\tif (!force_sysemu_disabled)\n-\t\tset_using_sysemu(sysemu_supported);\n \treturn;\n \n fail:\n \tstop_ptraced_child(pid, 1, 0);\n fail_stopped:\n-\tnon_fatal(\"missing\\n\");\n+\tfatal(\"missing\\n\");\n }\n \n static void __init check_ptrace(void)\n@@ -263,9 +205,9 @@ static void __init check_ptrace(void)\n \tos_info(\"Checking that ptrace can change system call numbers...\");\n \tpid = start_ptraced_child();\n \n-\tif ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0,\n+\tif ((ptrace(PTRACE_SETOPTIONS, pid, 0,\n \t\t   (void *) PTRACE_O_TRACESYSGOOD) < 0))\n-\t\tfatal_perror(\"check_ptrace: PTRACE_OLDSETOPTIONS failed\");\n+\t\tfatal_perror(\"check_ptrace: PTRACE_SETOPTIONS failed\");\n \n \twhile (1) {\n \t\tif (ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0)\ndiff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c\nindex 0bc4b73a9cde..7f1abde2c84b 100644\n--- a/arch/x86/um/ptrace_32.c\n+++ b/arch/x86/um/ptrace_32.c\n@@ -25,30 +25,6 @@ void arch_switch_to(struct task_struct *to)\n \t\tprintk(KERN_WARNING \"arch_switch_tls failed, errno = EINVAL\\n\");\n }\n \n-int is_syscall(unsigned long addr)\n-{\n-\tunsigned short instr;\n-\tint n;\n-\n-\tn = copy_from_user(&instr, (void __user *) addr, sizeof(instr));\n-\tif (n) {\n-\t\t/* access_process_vm() grants access to vsyscall and stub,\n-\t\t * while copy_from_user doesn't. Maybe access_process_vm is\n-\t\t * slow, but that doesn't matter, since it will be called only\n-\t\t * in case of singlestepping, if copy_from_user failed.\n-\t\t */\n-\t\tn = access_process_vm(current, addr, &instr, sizeof(instr),\n-\t\t\t\tFOLL_FORCE);\n-\t\tif (n != sizeof(instr)) {\n-\t\t\tprintk(KERN_ERR \"is_syscall : failed to read \"\n-\t\t\t       \"instruction from 0x%lx\\n\", addr);\n-\t\t\treturn 1;\n-\t\t}\n-\t}\n-\t/* int 0x80 or sysenter */\n-\treturn (instr == 0x80cd) || (instr == 0x340f);\n-}\n-\n /* determines which flags the user has access to. */\n /* 1 = access 0 = no access */\n #define FLAG_MASK 0x00044dd5\ndiff --git a/arch/x86/um/ptrace_64.c b/arch/x86/um/ptrace_64.c\nindex 289d0159b041..aa68d83d3f44 100644\n--- a/arch/x86/um/ptrace_64.c\n+++ b/arch/x86/um/ptrace_64.c\n@@ -188,32 +188,6 @@ int peek_user(struct task_struct *child, long addr, long data)\n \treturn put_user(tmp, (unsigned long *) data);\n }\n \n-/* XXX Mostly copied from sys-i386 */\n-int is_syscall(unsigned long addr)\n-{\n-\tunsigned short instr;\n-\tint n;\n-\n-\tn = copy_from_user(&instr, (void __user *) addr, sizeof(instr));\n-\tif (n) {\n-\t\t/*\n-\t\t * access_process_vm() grants access to vsyscall and stub,\n-\t\t * while copy_from_user doesn't. Maybe access_process_vm is\n-\t\t * slow, but that doesn't matter, since it will be called only\n-\t\t * in case of singlestepping, if copy_from_user failed.\n-\t\t */\n-\t\tn = access_process_vm(current, addr, &instr, sizeof(instr),\n-\t\t\t\tFOLL_FORCE);\n-\t\tif (n != sizeof(instr)) {\n-\t\t\tprintk(\"is_syscall : failed to read instruction from \"\n-\t\t\t       \"0x%lx\\n\", addr);\n-\t\t\treturn 1;\n-\t\t}\n-\t}\n-\t/* sysenter */\n-\treturn instr == 0x050f;\n-}\n-\n static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)\n {\n \tint err, n, cpu = ((struct thread_info *) child->stack)->cpu;\ndiff --git a/arch/x86/um/shared/sysdep/ptrace_32.h b/arch/x86/um/shared/sysdep/ptrace_32.h\nindex db8478a83a09..0c4989842fbe 100644\n--- a/arch/x86/um/shared/sysdep/ptrace_32.h\n+++ b/arch/x86/um/shared/sysdep/ptrace_32.h\n@@ -8,10 +8,6 @@\n \n #define MAX_FP_NR HOST_FPX_SIZE\n \n-void set_using_sysemu(int value);\n-int get_using_sysemu(void);\n-extern int sysemu_supported;\n-\n #define UPT_SYSCALL_ARG1(r) UPT_BX(r)\n #define UPT_SYSCALL_ARG2(r) UPT_CX(r)\n #define UPT_SYSCALL_ARG3(r) UPT_DX(r)\ndiff --git a/arch/x86/um/shared/sysdep/ptrace_user.h b/arch/x86/um/shared/sysdep/ptrace_user.h\nindex 44782bbad41e..1d1a824fa652 100644\n--- a/arch/x86/um/shared/sysdep/ptrace_user.h\n+++ b/arch/x86/um/shared/sysdep/ptrace_user.h\n@@ -15,14 +15,12 @@\n #define FP_SIZE ((HOST_FPX_SIZE > HOST_FP_SIZE) ? HOST_FPX_SIZE : HOST_FP_SIZE)\n #else\n #define FP_SIZE HOST_FP_SIZE\n+#endif\n \n /*\n- * x86_64 FC3 doesn't define this in /usr/include/linux/ptrace.h even though\n- * it's defined in the kernel's include/linux/ptrace.h. Additionally, use the\n- * 2.4 name and value for 2.4 host compatibility.\n+ * glibc before 2.27 does not include PTRACE_SYSEMU_SINGLESTEP in its enum,\n+ * ensure we have a definition by (re-)defining it here.\n  */\n-#ifndef PTRACE_OLDSETOPTIONS\n-#define PTRACE_OLDSETOPTIONS 21\n-#endif\n-\n+#ifndef PTRACE_SYSEMU_SINGLESTEP\n+#define PTRACE_SYSEMU_SINGLESTEP 32\n #endif\n",
    "prefixes": [
        "v2",
        "03/28"
    ]
}