From patchwork Sun Sep 19 01:57:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514266 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp889587jao; Sat, 18 Sep 2021 19:04:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXhYSvaM/KLZIH2mFgtpzzw+fEXhAKUF/VgO+k0ORqtvasuEKCRpgjc/KA2xa0GpMKlPVx X-Received: by 2002:a05:6902:1543:: with SMTP id r3mr23623316ybu.409.1632017090058; Sat, 18 Sep 2021 19:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632017090; cv=none; d=google.com; s=arc-20160816; b=X47tB5XcyUpZyEtynAuD3FBToprlxaAvGW4r9m82LGwdUwhn45zAffJSnx/beE7Wx5 hmP88OEKi0MwDHJ043G/kD4qXXmaR1EtGro0EDQt/vKWLL616RUxwLkGTko6rVzCtvIT V9Tloc0Y8IsMj5tHdB0bjHy6tsBEJ47gC6ftyovuNFgBiDNP/RXNB9eT7a3pIJ6KiAUL Eeq3f5zLp+mD4AHUT58LHz1kUracIVb2Jfn6mcKM4mlCktqs5wn29pfWMrbu4/x1QhQh +ir9oruGlZCGl/bg33GwfRy9EZyQQD27vE+X/lVUgkItqKv7yhVygeK9LF1ZCLzjA5Od 8fEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cTnSUy3sozc2mrt87w0e44ZRvgLTpypGGVhRf1mPH3Q=; b=NZrzZXnvPMo7aAsrCmhab6TqxccLzRCmek4X8qAj+JDYZwQ5fM3G0PtTrmpdHlHqa6 P8cRq/OpUHIVUsA8yhm6WmKIPHpsrv81CImC+85YUEEKh6V4W1YHw6Xe7w9U6nMMTLpC HF/JgwvPmTyeMR+iv3tNq9DCEDryCHmm2pOV+pTDZRGrfZYzEBcr6A4bmyDhjZmemPrb 3QleqdVasJyUiwUfgZFo5WGOl0ZK9tvuFJeXL73HPwkp+ITOawOyMUO/kZjL9NzLnncu +q1hdXSp9bUguyHmItJKECR7j1ssL0epehKCjhFRbqeahhynVRi1js4dRD4rphg092KU G/wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cropjl5U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o5si11532907ybm.401.2021.09.18.19.04.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Sep 2021 19:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cropjl5U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRmCH-0006Qz-G9 for patch@linaro.org; Sat, 18 Sep 2021 22:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRm5F-0003pP-Te for qemu-devel@nongnu.org; Sat, 18 Sep 2021 21:57:33 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:37428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRm5D-0005AG-2m for qemu-devel@nongnu.org; Sat, 18 Sep 2021 21:57:33 -0400 Received: by mail-pj1-x1035.google.com with SMTP id me5-20020a17090b17c500b0019af76b7bb4so12050691pjb.2 for ; Sat, 18 Sep 2021 18:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cTnSUy3sozc2mrt87w0e44ZRvgLTpypGGVhRf1mPH3Q=; b=Cropjl5UZYwxNZ/LNy6aKuP6ivtc+G/ncGZXx90wBIw/xmVZ0RXrZ4l1zPVJBJ9fqG 8TvIXrnoYY/5ePtBr3bnAzBJvd6B7bweeuhU4g1oul++QKPukvsOlM5klmUjXR0U1k6r GWF9do5ITjkvbMAe/1dxOO3xjFkjkvZkNXeubMfVjePg7UL8gl4NsLTJYtw+R8cwFCb6 JzuChVmwmSy4rP4GETTf4Dfc/Qpy/VSi18AKPOA3a+DT1Xc/BMEwROkAZhVga+/UJJlt hMw1+qv5NA4xeWsS98BujlBWCqaJt2IDSd52+F+gsXFen6Lfwh4WUdA0ZrWR8UP8YWBg jguQ== 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=cTnSUy3sozc2mrt87w0e44ZRvgLTpypGGVhRf1mPH3Q=; b=H781jg3EJXezpWkabg+IYrKdsB25i0rev+//2M1JkoYiasMoqAZqUBSnekh0a3UgiK +XR9qSOOyPZsPjtcj9Vw7wGGIR+xjTOkq38XhjD2dsH/4UqPrmomgZTBzt5G8eG/iaia rAn5tl7u8owUaD1lVVZ3IhM+BVnTxISejirJVXj9Htq52aNwgAYhMmyqdurYMMw2DERa Rv4NMiDnq/RkIgjPjvZGJVw/DMQ4KG+y3n7ENuJCXz3TRJg8yvWVOGw3x0WjFlofHDDA Fgx8EIc4SigyHpb0xcMFQZUMhmc8Gva4xCs6FaqSC2P/EItYYCCj4xukLtr0bZCbfw9l WGRA== X-Gm-Message-State: AOAM532ndvvrdO00Xik7ZFypK5FfSoE4d/oh4jVaxG7U78tvxrNRtWrw Q+8oFcEp4alB2yVf692ujDwGjGH2WFjOVA== X-Received: by 2002:a17:902:8ec5:b0:13a:2789:cbb0 with SMTP id x5-20020a1709028ec500b0013a2789cbb0mr16527374plo.60.1632016649662; Sat, 18 Sep 2021 18:57:29 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id k14sm6747899pgg.92.2021.09.18.18.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 18:57:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 12/25] linux-user/m68k: Use force_sig_fault Date: Sat, 18 Sep 2021 18:57:05 -0700 Message-Id: <20210919015718.466207-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210919015718.466207-1-richard.henderson@linaro.org> References: <20210919015718.466207-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Signed-off-by: Richard Henderson --- linux-user/m68k/cpu_loop.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) -- 2.25.1 diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index 7d106aa86e..cf79a17f93 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -21,13 +21,14 @@ #include "qemu-common.h" #include "qemu.h" #include "cpu_loop-common.h" +#include "signal-common.h" + void cpu_loop(CPUM68KState *env) { CPUState *cs = env_cpu(env); int trapnr; unsigned int n; - target_siginfo_t info; for(;;) { cpu_exec_start(cs); @@ -44,25 +45,13 @@ void cpu_loop(CPUM68KState *env) case EXCP_ILLEGAL: case EXCP_LINEA: case EXCP_LINEF: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->pc); break; case EXCP_CHK: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_INTOVF; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTOVF, env->pc); break; case EXCP_DIV0: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_INTDIV; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->pc); break; case EXCP_TRAP0: { @@ -89,10 +78,7 @@ void cpu_loop(CPUM68KState *env) /* just indicate that signals should be handled asap */ break; case EXCP_DEBUG: - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs);