From nobody Tue Nov 18 09:21:15 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=1608411390; cv=none; d=zohomail.com; s=zohoarc; b=dXo6PffrjRkUJkLd0fBMBV9mO09nVVbKZWLo0fBjfCtV4qxwuhstwkryf9NNUpP0BKOXsuvN8vzhJbgyL0fDFcLAJa667cYK4SqcgzhTeHy2lmp7BrekdvYLS1YgluYZXJa7ZL4K5QSOU33lCe/MOSYJ085nCSMv1g+fgadTr4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608411390; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Bb/F9Ea4b0CvodFIdBceU7QoqC3If5T57HfLRiPeMI8=; b=GIoNVlALXHCEdBkaNosr1jQ94INAOy6ORG7ojej0ec+ETcAsV4oBSc0Js8pPGrWPGWCIixiiUbkYHL2fR3q7F4yS8E2GIshUaBhrJBn76ReO+tFbpnjIDfQnCax4sh6F8fWBrh7lVdhnBBIjlxQjmCWi6c0un/XwobqZUnT8MO4= 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 1608411390267872.0387839291051; Sat, 19 Dec 2020 12:56:30 -0800 (PST) Received: from localhost ([::1]:44620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqjHA-00014u-LC for importer@patchew.org; Sat, 19 Dec 2020 15:56:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqj5e-0007TN-0P for qemu-devel@nongnu.org; Sat, 19 Dec 2020 15:44:34 -0500 Received: from 50-253-99-174-static.hfc.comcastbusiness.net ([50.253.99.174]:16413 helo=dune.bsdimp.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqj5c-000454-If for qemu-devel@nongnu.org; Sat, 19 Dec 2020 15:44:33 -0500 Received: from dune.bsdimp.com (localhost [127.0.0.1]) by dune.bsdimp.com (8.15.2/8.15.2) with ESMTPS id 0BIKqsrj086432 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 18 Dec 2020 13:52:54 -0700 (MST) (envelope-from imp@dune.bsdimp.com) Received: (from imp@localhost) by dune.bsdimp.com (8.15.2/8.15.2/Submit) id 0BIKqs44086431; Fri, 18 Dec 2020 13:52:54 -0700 (MST) (envelope-from imp) From: imp@freebsd.org To: qemu-devel@nongnu.org Subject: [PATCH 2/4] tcg: Additional Trap type for FreeBSD Date: Fri, 18 Dec 2020 13:52:48 -0700 Message-Id: <20201218205250.86382-3-imp@freebsd.org> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20201218205250.86382-1-imp@freebsd.org> References: <20201218205250.86382-1-imp@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: none client-ip=50.253.99.174; envelope-from=imp@dune.bsdimp.com; helo=dune.bsdimp.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, KHOP_HELO_FCRDNS=0.267, NO_DNS_FOR_FROM=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: Juergen Lock , Sean Bruno , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Sean Bruno FreeBSD can generate a trap 0xc as well as 0xe when writing to a read-only page. Signed-off-by: Juergen Lock [imp rewored commit message for clarity] Signed-off-by: Warner Losh --- accel/tcg/user-exec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 4ebe25461a..1f5befa9f9 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -343,7 +343,13 @@ int cpu_signal_handler(int host_signum, void *pinfo, =20 pc =3D PC_sig(uc); return handle_cpu_signal(pc, info, - TRAP_sig(uc) =3D=3D 0xe ? (ERROR_sig(uc) >> 1= ) & 1 : 0, +#if defined(__FreeBSD__) || defined(__DragonFly__) + (TRAP_sig(uc) =3D=3D 0xe || + TRAP_sig(uc) =3D=3D 0xc) ? +#else + TRAP_sig(uc) =3D=3D 0xe ? +#endif + (ERROR_sig(uc) >> 1) & 1 : 0, &MASK_sig(uc)); } =20 --=20 2.22.1