From nobody Fri Nov 14 18:03:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1589710596; cv=none; d=zohomail.com; s=zohoarc; b=cpkGsjvX6arHBqys8hbUA1kLv/n9Mj/JhR26LJFV/PRNbX/ojpzkgGu+KZFZUCLifETV+TTgpHnOhzLYFrLXVUuW1hgaJ8DGrPFv4kxiN8aH7D5oWImdwuFEdOE8XO0c/EemJBjgPIlW1ORxsXq0lUlDxJ9XHyJwCGmLB4FyK6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589710596; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=Oe1L9PV42DK3uH7xHqAhoVnIdyTqW10vMK4wnjp0Qxc=; b=BrZiCNKPlFngWwH+Rv5Uc1tAHgY7vyvfZzBv5g7NVdMgNfUQ9xHdLqoi/EJnr5DQlkH71Rpu+41rael84GlbVZNrrOGXWTNbZh8s8SYtLfIWNePwxunsPUTufCcRvMqtnbqsZLg8df9JoEWN3432bxjCqnDt577P7x075arcrww= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589710596252956.6888036624831; Sun, 17 May 2020 03:16:36 -0700 (PDT) Received: from localhost ([::1]:48286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaGLS-0008B0-Dw for importer@patchew.org; Sun, 17 May 2020 06:16:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaGJ4-00073T-9V for qemu-devel@nongnu.org; Sun, 17 May 2020 06:14:06 -0400 Received: from mail.netbsd.org ([199.233.217.200]:61061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaGJ3-0006PP-6q for qemu-devel@nongnu.org; Sun, 17 May 2020 06:14:05 -0400 Received: by mail.netbsd.org (Postfix, from userid 1220) id 9395E84C8B; Sun, 17 May 2020 10:14:02 +0000 (UTC) From: Nick Hudson To: qemu-devel@nongnu.org Subject: [PATCH] Provide a NetBSD specific aarch64 cpu_signal_handler Date: Sun, 17 May 2020 11:13:39 +0100 Message-Id: <20200517101339.5278-1-skrll@netbsd.org> X-Mailer: git-send-email 2.17.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=199.233.217.200; envelope-from=skrll@netbsd.org; helo=mail.netbsd.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 06:14:03 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Nick Hudson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix qemu build on NetBSD/evbarm-aarch64 by providing a NetBSD specific cpu_signal_handler. Signed-off-by: Nick Hudson --- accel/tcg/user-exec.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 4be78eb9b3..dd128adc00 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -523,6 +523,31 @@ int cpu_signal_handler(int host_signum, void *pinfo, =20 #elif defined(__aarch64__) =20 +#if defined(__NetBSD__) + +#include +#include + +int cpu_signal_handler(int host_signum, void *pinfo, void *puc) +{ + ucontext_t *uc =3D puc; + siginfo_t *si =3D pinfo; + unsigned long pc; + int is_write; + uint32_t esr; + + pc =3D uc->uc_mcontext.__gregs[_REG_PC]; + esr =3D si->si_trap; + + /* siginfo_t::si_trap is the ESR value, for data aborts ESR.EC + * is 0b10010x: then bit 6 is the WnR bit + */ + is_write =3D extract32(esr, 27, 5) =3D=3D 0x12 && extract32(esr, 6, 1)= =3D=3D 1; + return handle_cpu_signal(pc, si, is_write, &uc->uc_sigmask); +} + +#else + #ifndef ESR_MAGIC /* Pre-3.16 kernel headers don't have these, so provide fallback definitio= ns */ #define ESR_MAGIC 0x45535201 @@ -585,6 +610,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, vo= id *puc) } return handle_cpu_signal(pc, info, is_write, &uc->uc_sigmask); } +#endif =20 #elif defined(__s390__) =20 --=20 2.17.1