From patchwork Fri Jan 7 21:32:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 530503 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp723625imp; Fri, 7 Jan 2022 13:47:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz5PE4Xok+tFeZR3Bjv4sbHT0bnbMwVgmVJgBTqKqKyhhEIUh+g24O2N6Emxkb3KRMSt/D X-Received: by 2002:a25:abcb:: with SMTP id v69mr75783329ybi.317.1641592054761; Fri, 07 Jan 2022 13:47:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641592054; cv=none; d=google.com; s=arc-20160816; b=lUweM8fq1tpclekY9/RXkyTTJDl93pK0OiKnSoj5GFFQ/8RWyteiPGis7ZKFyKC2XN 0Ao4dWWuh/5r1LSbGzvYufJSNlJDJ4X+mQkuQmqvpgj6YWRJ7MyYtR8gW09oZ4Mk7MXO ynpk6yQY7Up2gfpSspZAAMjRKowVp+iTFJVPqe4wek6cBGYxtyNAiNoxb+St7457jp90 h+qj1zb94EJ48njzOTq43D6UeXcSoI0P2Rw1sQa1NOze7feDwBRrRupwzBb0FCMvc5Xu /ngZlzVUVqxY9QAYzynrKbeDpu36x1mLNPUh/M/nnaHUjadTu64as1VkOD5F+y5ZNJWW HIOw== 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=CAdPMVXz8RRfjrWL+LNY6mFa7+kd1yHOj+KAK66s3KI=; b=atrU8pH7v8PUG8V2Hjv1MnjR2hC4SNP4BUR+rehpdRV3mWmtvJN53xTLxNjL0T6GIb 9a4CmDfHXT/YYTvXAV5e2aYascHicDh9TowDgTJqyOybu9hQX1LM0c3I3KQ6yiGqAL+B /po2d6aqPzSUo5L763USVebmQApMjOvOOIhKbZfnLKil4qcuXwPSlBa3gF1xfEzCdZD+ 3UfplLHx+Gj0cHH5f+5NpLslBz8aeVTGERCGVLuEkfG/XMMhsJx5/6O4r1yrDVS5pfqe a03tq4rZ/53DnU1NSzZTSf40Fpi97HPnERAsmEoAEvs7NPqdEGkg/D4/ZBpCmsxACJMW PYSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BAuL9NQH; 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=fail (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 r5si5771224ybu.616.2022.01.07.13.47.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jan 2022 13:47:34 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=BAuL9NQH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5x5C-0006Wm-0j for patch@linaro.org; Fri, 07 Jan 2022 16:47:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5wr1-00059v-E7 for qemu-devel@nongnu.org; Fri, 07 Jan 2022 16:32:55 -0500 Received: from [2607:f8b0:4864:20::530] (port=41913 helo=mail-pg1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5wqy-0007oz-89 for qemu-devel@nongnu.org; Fri, 07 Jan 2022 16:32:53 -0500 Received: by mail-pg1-x530.google.com with SMTP id f8so6498967pgf.8 for ; Fri, 07 Jan 2022 13:32:51 -0800 (PST) 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=CAdPMVXz8RRfjrWL+LNY6mFa7+kd1yHOj+KAK66s3KI=; b=BAuL9NQHOZ2ZmdlxiLg89xKvUw0OURYY92RQK1phfatJ6/FE9YmGSJljcAZRyl88hr t0Fxn6M3yHvU4NERzahSVsVUB7WLUfCwZAyHNZJ6JlFLVzISKWvQTc055g1G046urpXt riL/+Ofm1Bn06+jv4TgoFw8b1PaE37QD32m38yws+uZcVcHOtmsmePAWVDLzupP+/2M6 tBCLrcPsGCIDWYe5tnB/bAl3F3XeV+znvTTpmeM43YarEJf34YjOOIGP1ngTbmHzgNwA DOLM6ukNbi6NIvqdF1jJyaFjrFws6Qg8X0kvHfhJic9eT08ZWQ7fOIYokeGAvZR+T2Dl zWBA== 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=CAdPMVXz8RRfjrWL+LNY6mFa7+kd1yHOj+KAK66s3KI=; b=4p3S3eL1pcBgnlx6at1+/0zNaQKMNEzfrOEYi9/U28Y5ydxSVl+Xwlknx12V2iqqYL /fkooJTiqegxJavGRxrIDddBgN9OOi0fdq7Lr0l1Csvc+2y4YwBtRv/+oyusYXiyA9vU Q9J+84aVrRSAGlxk7KApqaTgvx2PJIT+/emrQJkj4N3FwtPhBvUlihAEXaFMkC7lMi9Q zc3NEtm2QIXayVy2GpFtS5qKCRy90Ho1zGxksvOH07KKlIlUFLMNCP3iCly5JX233ybs /EKPDqR26sZaVCjOvURvVpyc6EOsHMsyR80ISPVHSZCMkAlqnmpgVMmArpFIUJCt3fi5 gO9g== X-Gm-Message-State: AOAM532WjnqIrj0+4dJPBrIr9ucNLWRgyX+tZBAyS/0MxcGo71QNLBWU VVsLOS2/Fyhm+mYoWOyMl+v4Mv3L0k6m2g== X-Received: by 2002:a05:6a00:1890:b0:4ba:eac4:3d01 with SMTP id x16-20020a056a00189000b004baeac43d01mr65812653pfh.22.1641591171040; Fri, 07 Jan 2022 13:32:51 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id y11sm6633030pfi.80.2022.01.07.13.32.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 13:32:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 11/24] linux-user/m68k: Use force_sig_fault Date: Fri, 7 Jan 2022 13:32:30 -0800 Message-Id: <20220107213243.212806-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220107213243.212806-1-richard.henderson@linaro.org> References: <20220107213243.212806-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::530 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 , 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/m68k/cpu_loop.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index 3181594414..928a18e3cf 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -29,7 +29,6 @@ void cpu_loop(CPUM68KState *env) CPUState *cs = env_cpu(env); int trapnr; unsigned int n; - target_siginfo_t info; for(;;) { cpu_exec_start(cs); @@ -46,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: { @@ -91,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);