From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06ECBC433F5 for ; Fri, 15 Oct 2021 18:28:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8252060F36 for ; Fri, 15 Oct 2021 18:28:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8252060F36 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:38282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbRwQ-0004Hx-JB for qemu-devel@archiver.kernel.org; Fri, 15 Oct 2021 14:28:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbRul-0002rG-0b for qemu-devel@nongnu.org; Fri, 15 Oct 2021 14:26:44 -0400 Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]:36474) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbRui-0001Gs-3L for qemu-devel@nongnu.org; Fri, 15 Oct 2021 14:26:42 -0400 Received: by mail-vk1-xa34.google.com with SMTP id f126so5597283vke.3 for ; Fri, 15 Oct 2021 11:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ePxZ7RjeKcoPje9VGfLYJM8NxopE3VKkckPCB13r+/Q=; b=18Pncwfm5mqlEvIhrVp+25O0zu3j+hFZ5KhIa2DRFQgrqNbSwMnSYapk9iwlJIgTjK Xn9TNNdSP3+7HFVFKbCzGgSzqrTavEopxlfoCehogqp5DX5PZIVf13BnhkBuuJ8yu8p4 BreSJFgRGquMoPKVC05cTVWSUdY8138bFSO09ELjl9M48fJLTuyxGclAtpTLzL/h+bQu ORySvwaocR56Wz496fVS/HtfQOq2Ot5OR/BDYJMrJ19CG1ev2y31ltRw91w+MPVquQLa IU1CwPt37ZsI6Z3Fm1BwMWv4zyLhFEwlmHE3Mr4Xnpw4xWaOUqD//FT5I7WXroV1siCv 8j5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ePxZ7RjeKcoPje9VGfLYJM8NxopE3VKkckPCB13r+/Q=; b=WZ+KdKUXQp0NxH27Hq/eynCZRU9qTAtfqlR5SPVe/w3z7uaQLXULgnxsyFdvgwD7K8 Dak91zd5opjBHAskcDDJWNrlUVOsdiJrnEtZHab56nTjhq5gcrQlHQB/TN8ApgDyEOEB U0VfYlYMyLqfZFid7QcR3ND7UBMNAkIlDbpfD77YVAhMWzxhvIxv4ANGW7gf8sUrqWza pz32IdF//SRMTVgMoPgr+JZfwZMq/BWscgSoNGcXfrDUVVGn75gezjFLv7MIvuLGOkuC LQv1qM8w2koHziZWa3VqdBeP12muRHOhkqkcMgYuxZIpmwTzKoRzMscMxfKNQkKTsfnz AVUQ== X-Gm-Message-State: AOAM532BQ0Ncdg1GZsO6x9wuXOyjHT7OlSNkEeFbOMlNSRCQLG6LzAFy Syv/D0mw21qoimGz0KmwZB2ukWO4aAVHVMD/1xDXQg== X-Google-Smtp-Source: ABdhPJzGRHdn5YvantrsDGKBdUpCel2A8+Dgl6Ohn5Ru5ndxa/bVF2O65dQwnoYqaTZbw7mvchlzYkkA6Bw6byozQw8= X-Received: by 2002:a1f:2006:: with SMTP id g6mr14008375vkg.22.1634322398754; Fri, 15 Oct 2021 11:26:38 -0700 (PDT) MIME-Version: 1.0 References: <20211015041053.2769193-1-richard.henderson@linaro.org> <20211015041053.2769193-8-richard.henderson@linaro.org> In-Reply-To: <20211015041053.2769193-8-richard.henderson@linaro.org> From: Warner Losh Date: Fri, 15 Oct 2021 12:26:28 -0600 Message-ID: Subject: Re: [PATCH v5 07/67] linux-user/host/x86: Populate host_signal.h To: Richard Henderson Content-Type: multipart/alternative; boundary="00000000000006d04805ce685676" Received-SPF: none client-ip=2607:f8b0:4864:20::a34; envelope-from=wlosh@bsdimp.com; helo=mail-vk1-xa34.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers , Laurent Vivier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000006d04805ce685676 Content-Type: text/plain; charset="UTF-8" On Thu, Oct 14, 2021 at 10:11 PM Richard Henderson < richard.henderson@linaro.org> wrote: > Split host_signal_pc and host_signal_write out of user-exec.c. > Drop the *BSD code, to be re-created under bsd-user/ later. > > Signed-off-by: Richard Henderson > --- > linux-user/host/i386/host-signal.h | 25 ++++- > linux-user/host/x32/host-signal.h | 2 +- > linux-user/host/x86_64/host-signal.h | 25 ++++- > accel/tcg/user-exec.c | 136 +-------------------------- > 4 files changed, 50 insertions(+), 138 deletions(-) > Reviewed-by: Warner Losh Though I've not pulled this into bsd-user to see how it affects me, so I may come to regret this :) Warner > diff --git a/linux-user/host/i386/host-signal.h > b/linux-user/host/i386/host-signal.h > index f4b4d65031..ccbbee5082 100644 > --- a/linux-user/host/i386/host-signal.h > +++ b/linux-user/host/i386/host-signal.h > @@ -1 +1,24 @@ > -#define HOST_SIGNAL_PLACEHOLDER > +/* > + * host-signal.h: signal info dependent on the host architecture > + * > + * Copyright (C) 2021 Linaro Limited > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or > later. > + * See the COPYING file in the top-level directory. > + */ > + > +#ifndef I386_HOST_SIGNAL_H > +#define I386_HOST_SIGNAL_H > + > +static inline uintptr_t host_signal_pc(ucontext_t *uc) > +{ > + return uc->uc_mcontext.gregs[REG_EIP]; > +} > + > +static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) > +{ > + return uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe > + && (uc->uc_mcontext.gregs[REG_ERR] & 0x2); > +} > + > +#endif > diff --git a/linux-user/host/x32/host-signal.h > b/linux-user/host/x32/host-signal.h > index f4b4d65031..26800591d3 100644 > --- a/linux-user/host/x32/host-signal.h > +++ b/linux-user/host/x32/host-signal.h > @@ -1 +1 @@ > -#define HOST_SIGNAL_PLACEHOLDER > +#include "../x86_64/host-signal.h" > diff --git a/linux-user/host/x86_64/host-signal.h > b/linux-user/host/x86_64/host-signal.h > index f4b4d65031..883d2fcf65 100644 > --- a/linux-user/host/x86_64/host-signal.h > +++ b/linux-user/host/x86_64/host-signal.h > @@ -1 +1,24 @@ > -#define HOST_SIGNAL_PLACEHOLDER > +/* > + * host-signal.h: signal info dependent on the host architecture > + * > + * Copyright (C) 2021 Linaro Limited > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or > later. > + * See the COPYING file in the top-level directory. > + */ > + > +#ifndef X86_64_HOST_SIGNAL_H > +#define X86_64_HOST_SIGNAL_H > + > +static inline uintptr_t host_signal_pc(ucontext_t *uc) > +{ > + return uc->uc_mcontext.gregs[REG_RIP]; > +} > + > +static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) > +{ > + return uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe > + && (uc->uc_mcontext.gregs[REG_ERR] & 0x2); > +} > + > +#endif > diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c > index 744af19397..474cb9cf82 100644 > --- a/accel/tcg/user-exec.c > +++ b/accel/tcg/user-exec.c > @@ -29,19 +29,6 @@ > #include "trace/trace-root.h" > #include "internal.h" > > -#undef EAX > -#undef ECX > -#undef EDX > -#undef EBX > -#undef ESP > -#undef EBP > -#undef ESI > -#undef EDI > -#undef EIP > -#ifdef __linux__ > -#include > -#endif > - > __thread uintptr_t helper_retaddr; > > //#define DEBUG_SIGNAL > @@ -268,123 +255,7 @@ void *probe_access(CPUArchState *env, target_ulong > addr, int size, > return size ? g2h(env_cpu(env), addr) : NULL; > } > > -#if defined(__i386__) > - > -#if defined(__NetBSD__) > -#include > -#include > - > -#define EIP_sig(context) ((context)->uc_mcontext.__gregs[_REG_EIP]) > -#define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) > -#define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) > -#define MASK_sig(context) ((context)->uc_sigmask) > -#define PAGE_FAULT_TRAP T_PAGEFLT > -#elif defined(__FreeBSD__) || defined(__DragonFly__) > -#include > -#include > - > -#define EIP_sig(context) (*((unsigned long > *)&(context)->uc_mcontext.mc_eip)) > -#define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) > -#define ERROR_sig(context) ((context)->uc_mcontext.mc_err) > -#define MASK_sig(context) ((context)->uc_sigmask) > -#define PAGE_FAULT_TRAP T_PAGEFLT > -#elif defined(__OpenBSD__) > -#include > -#define EIP_sig(context) ((context)->sc_eip) > -#define TRAP_sig(context) ((context)->sc_trapno) > -#define ERROR_sig(context) ((context)->sc_err) > -#define MASK_sig(context) ((context)->sc_mask) > -#define PAGE_FAULT_TRAP T_PAGEFLT > -#else > -#define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP]) > -#define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) > -#define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) > -#define MASK_sig(context) ((context)->uc_sigmask) > -#define PAGE_FAULT_TRAP 0xe > -#endif > - > -int cpu_signal_handler(int host_signum, void *pinfo, > - void *puc) > -{ > - siginfo_t *info = pinfo; > -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) > - ucontext_t *uc = puc; > -#elif defined(__OpenBSD__) > - struct sigcontext *uc = puc; > -#else > - ucontext_t *uc = puc; > -#endif > - unsigned long pc; > - int trapno; > - > -#ifndef REG_EIP > -/* for glibc 2.1 */ > -#define REG_EIP EIP > -#define REG_ERR ERR > -#define REG_TRAPNO TRAPNO > -#endif > - pc = EIP_sig(uc); > - trapno = TRAP_sig(uc); > - return handle_cpu_signal(pc, info, > - trapno == PAGE_FAULT_TRAP ? > - (ERROR_sig(uc) >> 1) & 1 : 0, > - &MASK_sig(uc)); > -} > - > -#elif defined(__x86_64__) > - > -#ifdef __NetBSD__ > -#include > -#define PC_sig(context) _UC_MACHINE_PC(context) > -#define TRAP_sig(context) > ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) > -#define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) > -#define MASK_sig(context) ((context)->uc_sigmask) > -#define PAGE_FAULT_TRAP T_PAGEFLT > -#elif defined(__OpenBSD__) > -#include > -#define PC_sig(context) ((context)->sc_rip) > -#define TRAP_sig(context) ((context)->sc_trapno) > -#define ERROR_sig(context) ((context)->sc_err) > -#define MASK_sig(context) ((context)->sc_mask) > -#define PAGE_FAULT_TRAP T_PAGEFLT > -#elif defined(__FreeBSD__) || defined(__DragonFly__) > -#include > -#include > - > -#define PC_sig(context) (*((unsigned long > *)&(context)->uc_mcontext.mc_rip)) > -#define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) > -#define ERROR_sig(context) ((context)->uc_mcontext.mc_err) > -#define MASK_sig(context) ((context)->uc_sigmask) > -#define PAGE_FAULT_TRAP T_PAGEFLT > -#else > -#define PC_sig(context) ((context)->uc_mcontext.gregs[REG_RIP]) > -#define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) > -#define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) > -#define MASK_sig(context) ((context)->uc_sigmask) > -#define PAGE_FAULT_TRAP 0xe > -#endif > - > -int cpu_signal_handler(int host_signum, void *pinfo, > - void *puc) > -{ > - siginfo_t *info = pinfo; > - unsigned long pc; > -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) > - ucontext_t *uc = puc; > -#elif defined(__OpenBSD__) > - struct sigcontext *uc = puc; > -#else > - ucontext_t *uc = puc; > -#endif > - > - pc = PC_sig(uc); > - return handle_cpu_signal(pc, info, > - TRAP_sig(uc) == PAGE_FAULT_TRAP ? > - (ERROR_sig(uc) >> 1) & 1 : 0, > - &MASK_sig(uc)); > -} > - > -#elif defined(_ARCH_PPC) > +#if defined(_ARCH_PPC) > > /*********************************************************************** > * signal context platform-specific definitions > @@ -895,11 +766,6 @@ int cpu_signal_handler(int host_signum, void *pinfo, > > return handle_cpu_signal(pc, info, is_write, &uc->uc_sigmask); > } > - > -#else > - > -#error host CPU specific signal handler needed > - > #endif > > /* The softmmu versions of these helpers are in cputlb.c. */ > -- > 2.25.1 > > --00000000000006d04805ce685676 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Oct 14, 2021 at 10:11 PM Rich= ard Henderson <richard.h= enderson@linaro.org> wrote:
Split host_signal_pc and host_signal_write out of user-e= xec.c.
Drop the *BSD code, to be re-created under bsd-user/ later.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
=C2=A0linux-user/host/i386/host-signal.h=C2=A0 =C2=A0|=C2=A0 25 ++++-
=C2=A0linux-user/host/x32/host-signal.h=C2=A0 =C2=A0 |=C2=A0 =C2=A02 +-
=C2=A0linux-user/host/x86_64/host-signal.h |=C2=A0 25 ++++-
=C2=A0accel/tcg/user-exec.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 | 136 +--------------------------
=C2=A04 files changed, 50 insertions(+), 138 deletions(-)
<= div>
Reviewed-by: Warner Losh <imp@bsdimp.com>

Though I&= #39;ve not=C2=A0pulled this into bsd-user to see how it affects me,
so I may come to regret=C2=A0this :)

Warner
=C2=A0
diff --git a/linux-user/host/i386/host-signal.h b/linux-user/host/i386/host= -signal.h
index f4b4d65031..ccbbee5082 100644
--- a/linux-user/host/i386/host-signal.h
+++ b/linux-user/host/i386/host-signal.h
@@ -1 +1,24 @@
-#define HOST_SIGNAL_PLACEHOLDER
+/*
+ * host-signal.h: signal info dependent on the host architecture
+ *
+ * Copyright (C) 2021 Linaro Limited
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or late= r.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef I386_HOST_SIGNAL_H
+#define I386_HOST_SIGNAL_H
+
+static inline uintptr_t host_signal_pc(ucontext_t *uc)
+{
+=C2=A0 =C2=A0 return uc->uc_mcontext.gregs[REG_EIP];
+}
+
+static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
+{
+=C2=A0 =C2=A0 return uc->uc_mcontext.gregs[REG_TRAPNO] =3D=3D 0xe
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 && (uc->uc_mcontext.gregs[REG_ERR] = & 0x2);
+}
+
+#endif
diff --git a/linux-user/host/x32/host-signal.h b/linux-user/host/x32/host-s= ignal.h
index f4b4d65031..26800591d3 100644
--- a/linux-user/host/x32/host-signal.h
+++ b/linux-user/host/x32/host-signal.h
@@ -1 +1 @@
-#define HOST_SIGNAL_PLACEHOLDER
+#include "../x86_64/host-signal.h"
diff --git a/linux-user/host/x86_64/host-signal.h b/linux-user/host/x86_64/= host-signal.h
index f4b4d65031..883d2fcf65 100644
--- a/linux-user/host/x86_64/host-signal.h
+++ b/linux-user/host/x86_64/host-signal.h
@@ -1 +1,24 @@
-#define HOST_SIGNAL_PLACEHOLDER
+/*
+ * host-signal.h: signal info dependent on the host architecture
+ *
+ * Copyright (C) 2021 Linaro Limited
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or late= r.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef X86_64_HOST_SIGNAL_H
+#define X86_64_HOST_SIGNAL_H
+
+static inline uintptr_t host_signal_pc(ucontext_t *uc)
+{
+=C2=A0 =C2=A0 return uc->uc_mcontext.gregs[REG_RIP];
+}
+
+static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc)
+{
+=C2=A0 =C2=A0 return uc->uc_mcontext.gregs[REG_TRAPNO] =3D=3D 0xe
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 && (uc->uc_mcontext.gregs[REG_ERR] = & 0x2);
+}
+
+#endif
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index 744af19397..474cb9cf82 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -29,19 +29,6 @@
=C2=A0#include "trace/trace-root.h"
=C2=A0#include "internal.h"

-#undef EAX
-#undef ECX
-#undef EDX
-#undef EBX
-#undef ESP
-#undef EBP
-#undef ESI
-#undef EDI
-#undef EIP
-#ifdef __linux__
-#include <sys/ucontext.h>
-#endif
-
=C2=A0__thread uintptr_t helper_retaddr;

=C2=A0//#define DEBUG_SIGNAL
@@ -268,123 +255,7 @@ void *probe_access(CPUArchState *env, target_ulong ad= dr, int size,
=C2=A0 =C2=A0 =C2=A0return size ? g2h(env_cpu(env), addr) : NULL;
=C2=A0}

-#if defined(__i386__)
-
-#if defined(__NetBSD__)
-#include <ucontext.h>
-#include <machine/trap.h>
-
-#define EIP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_mcontext.__g= regs[_REG_EIP])
-#define TRAP_sig(context)=C2=A0 =C2=A0 ((context)->uc_mcontext.__gregs[= _REG_TRAPNO])
-#define ERROR_sig(context)=C2=A0 =C2=A0((context)->uc_mcontext.__gregs[= _REG_ERR])
-#define MASK_sig(context)=C2=A0 =C2=A0 ((context)->uc_sigmask)
-#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 T_PAGEFLT
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
-#include <ucontext.h>
-#include <machine/trap.h>
-
-#define EIP_sig(context)=C2=A0 (*((unsigned long *)&(context)->uc_m= context.mc_eip))
-#define TRAP_sig(context)=C2=A0 =C2=A0 ((context)->uc_mcontext.mc_trapn= o)
-#define ERROR_sig(context)=C2=A0 =C2=A0((context)->uc_mcontext.mc_err)<= br> -#define MASK_sig(context)=C2=A0 =C2=A0 ((context)->uc_sigmask)
-#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 T_PAGEFLT
-#elif defined(__OpenBSD__)
-#include <machine/trap.h>
-#define EIP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->sc_eip)
-#define TRAP_sig(context)=C2=A0 =C2=A0 ((context)->sc_trapno)
-#define ERROR_sig(context)=C2=A0 =C2=A0((context)->sc_err)
-#define MASK_sig(context)=C2=A0 =C2=A0 ((context)->sc_mask)
-#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 T_PAGEFLT
-#else
-#define EIP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_mcontext.gre= gs[REG_EIP])
-#define TRAP_sig(context)=C2=A0 =C2=A0 ((context)->uc_mcontext.gregs[RE= G_TRAPNO])
-#define ERROR_sig(context)=C2=A0 =C2=A0((context)->uc_mcontext.gregs[RE= G_ERR])
-#define MASK_sig(context)=C2=A0 =C2=A0 ((context)->uc_sigmask)
-#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 0xe
-#endif
-
-int cpu_signal_handler(int host_signum, void *pinfo,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0void *puc)
-{
-=C2=A0 =C2=A0 siginfo_t *info =3D pinfo;
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)<= br> -=C2=A0 =C2=A0 ucontext_t *uc =3D puc;
-#elif defined(__OpenBSD__)
-=C2=A0 =C2=A0 struct sigcontext *uc =3D puc;
-#else
-=C2=A0 =C2=A0 ucontext_t *uc =3D puc;
-#endif
-=C2=A0 =C2=A0 unsigned long pc;
-=C2=A0 =C2=A0 int trapno;
-
-#ifndef REG_EIP
-/* for glibc 2.1 */
-#define REG_EIP=C2=A0 =C2=A0 EIP
-#define REG_ERR=C2=A0 =C2=A0 ERR
-#define REG_TRAPNO TRAPNO
-#endif
-=C2=A0 =C2=A0 pc =3D EIP_sig(uc);
-=C2=A0 =C2=A0 trapno =3D TRAP_sig(uc);
-=C2=A0 =C2=A0 return handle_cpu_signal(pc, info,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0trapno =3D=3D PAGE_FAULT_TRAP ?
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ERROR_sig(uc) >> 1) & 1 : 0,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&MASK_sig(uc));
-}
-
-#elif defined(__x86_64__)
-
-#ifdef __NetBSD__
-#include <machine/trap.h>
-#define PC_sig(context)=C2=A0 =C2=A0 =C2=A0 =C2=A0_UC_MACHINE_PC(context)<= br> -#define TRAP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_mcontext.__= gregs[_REG_TRAPNO])
-#define ERROR_sig(context)=C2=A0 =C2=A0 ((context)->uc_mcontext.__gregs= [_REG_ERR])
-#define MASK_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_sigmask) -#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 =C2=A0T_PAGEFLT
-#elif defined(__OpenBSD__)
-#include <machine/trap.h>
-#define PC_sig(context)=C2=A0 =C2=A0 =C2=A0 =C2=A0((context)->sc_rip) -#define TRAP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->sc_trapno)
-#define ERROR_sig(context)=C2=A0 =C2=A0 ((context)->sc_err)
-#define MASK_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->sc_mask)
-#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 =C2=A0T_PAGEFLT
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
-#include <ucontext.h>
-#include <machine/trap.h>
-
-#define PC_sig(context)=C2=A0 (*((unsigned long *)&(context)->uc_mc= ontext.mc_rip))
-#define TRAP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_mcontext.mc= _trapno)
-#define ERROR_sig(context)=C2=A0 =C2=A0 ((context)->uc_mcontext.mc_err)=
-#define MASK_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_sigmask) -#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 =C2=A0T_PAGEFLT
-#else
-#define PC_sig(context)=C2=A0 =C2=A0 =C2=A0 =C2=A0((context)->uc_mconte= xt.gregs[REG_RIP])
-#define TRAP_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_mcontext.gr= egs[REG_TRAPNO])
-#define ERROR_sig(context)=C2=A0 =C2=A0 ((context)->uc_mcontext.gregs[R= EG_ERR])
-#define MASK_sig(context)=C2=A0 =C2=A0 =C2=A0((context)->uc_sigmask) -#define PAGE_FAULT_TRAP=C2=A0 =C2=A0 =C2=A0 =C2=A00xe
-#endif
-
-int cpu_signal_handler(int host_signum, void *pinfo,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0void *puc)
-{
-=C2=A0 =C2=A0 siginfo_t *info =3D pinfo;
-=C2=A0 =C2=A0 unsigned long pc;
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)<= br> -=C2=A0 =C2=A0 ucontext_t *uc =3D puc;
-#elif defined(__OpenBSD__)
-=C2=A0 =C2=A0 struct sigcontext *uc =3D puc;
-#else
-=C2=A0 =C2=A0 ucontext_t *uc =3D puc;
-#endif
-
-=C2=A0 =C2=A0 pc =3D PC_sig(uc);
-=C2=A0 =C2=A0 return handle_cpu_signal(pc, info,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TRAP_sig(uc) =3D=3D PAGE_FAULT_TRAP ?
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ERROR_sig(uc) >> 1) & 1 : 0,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&MASK_sig(uc));
-}
-
-#elif defined(_ARCH_PPC)
+#if defined(_ARCH_PPC)

=C2=A0/********************************************************************= ***
=C2=A0 * signal context platform-specific definitions
@@ -895,11 +766,6 @@ int cpu_signal_handler(int host_signum, void *pinfo,
=C2=A0 =C2=A0 =C2=A0return handle_cpu_signal(pc, info, is_write, &uc-&g= t;uc_sigmask);
=C2=A0}
-
-#else
-
-#error host CPU specific signal handler needed
-
=C2=A0#endif

=C2=A0/* The softmmu versions of these helpers are in cputlb.c.=C2=A0 */ --
2.25.1

--00000000000006d04805ce685676--