From nobody Mon Dec 15 01:32:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 1643660980141442.4001977320064; Mon, 31 Jan 2022 12:29:40 -0800 (PST) Received: from localhost ([::1]:36310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEdIw-0006DD-Ka for importer@patchew.org; Mon, 31 Jan 2022 15:29:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEcnd-0004rw-B4 for qemu-devel@nongnu.org; Mon, 31 Jan 2022 14:57:17 -0500 Received: from [2607:f8b0:4864:20::d2f] (port=41770 helo=mail-io1-xd2f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEcna-0002e0-D4 for qemu-devel@nongnu.org; Mon, 31 Jan 2022 14:57:16 -0500 Received: by mail-io1-xd2f.google.com with SMTP id q204so18390593iod.8 for ; Mon, 31 Jan 2022 11:56:45 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id j2sm1972989ilu.82.2022.01.31.11.56.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 11:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p0pz1mYsxMG+ZM0MzZl75FORMdT6nHp51WXALYPrt0k=; b=yKHIpUPvuC7CfZhUIVaY+eAB2DPGRXxwDGIQ2VklII+h4uSgW/BglKx0OpJlM7TCQJ X6Xj1do+Zksnouy5Mu48Gx2X44sTmxILp/kvTj+CONSF6UbQeegCILvJ6W/Tbnox4y5o xEg2rthXwoAmJlMUuK1y9oBvGIlqEWyIcTomiFKHULZtLaMDvYs1UxApIlj3dZ/X8Hiz uadT8Dbzum4cny1079jjtk419/hiXBCNuggS/TiV6yt28Bgxau+qqYM2mt7iHol2t5Oo or0UBlBsUOIRblNtp4SycxSCksLcIMBNZsYy/6yw3NFvy5lebaS6VpFWkypGyJS8eBQu kz0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p0pz1mYsxMG+ZM0MzZl75FORMdT6nHp51WXALYPrt0k=; b=fzJW2PZBjsIEWXiMtCxTIfnsFpW5M279L1xdH+3bc809WJDxxnAqWYXW3JoqkvcNVI E3p4lwAFA/aNgf/g2J1eNvuaL+PNmgen1ho67ihKINwZ6cF6dp/17NTFnjd140wgi0pf tPBxy0Y5NRpR+eXd3YZPCPwRRMBPRYLhf2h59b2nj+6VVaGDZhEVHZg6L0tFJf+FwmyL 4M6KPyOgvb003+zi9VHq3LhxrsTjr236vb0QajxbewFcddnB82wdhRDOt9GGqiSmWW2x 9rszJ58llCKVRspGssf7d3WNu1JBX8wMPal4m1kCDEYxiOAhJQXIIhA6VPN75LH07fYR F8gA== X-Gm-Message-State: AOAM530BxZKyP3J0Y0vdxf4yR+arJ4tHkwnVZyGSQjcYYv6E8cXAg8Ok hJJEwQOTxhKPOEKMhk3tq6O3Na15GbfAGg== X-Google-Smtp-Source: ABdhPJykNUcrpp7ibap7u7oVHWxyUdHqYyeYXAafgwch5ITwO6xih5FRJywOya+JIKKncQrHdTeHxw== X-Received: by 2002:a05:6638:389a:: with SMTP id b26mr10820116jav.158.1643659004227; Mon, 31 Jan 2022 11:56:44 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 14/40] bsd-user/arm/target_arch_cpu.h: Use force_sig_fault for EXCP_UDEF Date: Mon, 31 Jan 2022 12:56:10 -0700 Message-Id: <20220131195636.31991-15-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220131195636.31991-1-imp@bsdimp.com> References: <20220131195636.31991-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2f (failed) 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=2607:f8b0:4864:20::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Kyle Evans , Richard Henderson , def@FreeBSD.org, jrtc27@FreeBSD.org, Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643660983674100003 Content-Type: text/plain; charset="utf-8" Use force_sig_fault to implement unknown opcode. This just uninlines that function, so simplify things by using it. Fold in EXCP_NOCP and EXCP_INVSTATE, as is done in linux-user. Make a note about slight differences with FreeBSD in case any of them turn out to be important later. Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 905f13aa1b9..9d790176420 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -51,18 +51,19 @@ static inline void target_cpu_loop(CPUARMState *env) process_queued_cpu_work(cs); switch (trapnr) { case EXCP_UDEF: - { - /* See arm/arm/undefined.c undefinedinstruction(); */ - info.si_addr =3D env->regs[15]; - - /* illegal instruction */ - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPC; - queue_signal(env, info.si_signo, &info); - - /* TODO: What about instruction emulation? */ - } + case EXCP_NOCP: + case EXCP_INVSTATE: + /* + * See arm/arm/undefined.c undefinedinstruction(); + * + * A number of details aren't emulated (they likely don't matt= er): + * o Misaligned PC generates ILL_ILLADR (these can't come from= qemu) + * o Thumb-2 instructions generate ILLADR + * o Both modes implement coprocessor instructions, which we d= on't + * do here. FreeBSD just implements them for the VFP coproce= ssor + * and special kernel breakpoints, trace points, dtrace, etc. + */ + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->regs[15= ]); break; case EXCP_SWI: { --=20 2.33.1