From patchwork Fri Jan 7 21:32:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 530512 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp728339imp; Fri, 7 Jan 2022 13:57:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUzabX23mhqd6J73lOSuTKMmYVocMJ0PzGWwzSl5Pyteh1eiqGll3R/Ox12VJdkn7qq7BH X-Received: by 2002:a25:ae85:: with SMTP id b5mr69925795ybj.200.1641592649255; Fri, 07 Jan 2022 13:57:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641592649; cv=none; d=google.com; s=arc-20160816; b=cb4x6fTZ/MB2T02a71kdvSzxIsWxueYixsNlEG6L73EndDcSmihsw8RJrzXUBlOvLj BbHX8ByUdNbES0Ib8OAaxM0o639bs7zlYXjhfH7QlrbCdMKQbOWJxf9h6Gqb1NQv9iU2 Ycd2t7XpJmADQcwuOnP97gVApSYbFxcrztb8a+T5PU2iT1xiBDKFJfYu+iXPTrivvwrd PUnlV16THN8Nx2I43vl2e7OcecI1hynKDtbjTNlrWb8+erumecDb7heaNV3bKj8JseC7 ZNMpPKTZBS2A0XuWNPNBw9R4vXgmkLV4Pu9SZmeaaOSsj/Q/z6zN+3+F/JnI6JnJY19x /6tw== 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=JInWc8HbqwhtPM0FLPOWoh/UvMIPVblznx96Z5wDe6g=; b=e17aSB9OY8G0CSBoMkskqBGFX8KwMJ8NcIpLpn2fIEB1XexdGilzJBbaaVHchmrgat LyuD75Ypv0YHMv1+0GLTn4SpJ60vRG5cYW1w9MTPLIo8yXBL3d/e96XJeAhVMxPLKUsi MYnl2aRbE9FXKI5ixL515++5Wb0yULwbsRtPXpQnBkFLDchGOELCFic+skWX14e+Sc4b rQH56X4YM+VxJhK3huGrfOWwVs+ia6/eMF3LzOlwmWCCtJdvuNmAVwG3rttKsIn6jlWh tpX60lLljbBC/3IRV1thas2kn3TMZiXR1l2oS629oN+spDBivkmkyuSUEAuEMmHa2FJx UZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="qn/ucyFX"; 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 n62si368622ybc.165.2022.01.07.13.57.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jan 2022 13:57:29 -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="qn/ucyFX"; 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]:59692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5xEm-0000cS-PT for patch@linaro.org; Fri, 07 Jan 2022 16:57:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5wr5-0005D8-4D for qemu-devel@nongnu.org; Fri, 07 Jan 2022 16:32:59 -0500 Received: from [2607:f8b0:4864:20::1030] (port=39879 helo=mail-pj1-x1030.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5wr2-0007qd-Ot for qemu-devel@nongnu.org; Fri, 07 Jan 2022 16:32:58 -0500 Received: by mail-pj1-x1030.google.com with SMTP id c14-20020a17090a674e00b001b31e16749cso11741712pjm.4 for ; Fri, 07 Jan 2022 13:32:56 -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=JInWc8HbqwhtPM0FLPOWoh/UvMIPVblznx96Z5wDe6g=; b=qn/ucyFXNiIAF5wI42YerykxIPwzp41FmU2B8y7OufRN1noW8u+fNNrcAHUSn2T+0+ jH402FIBB6uerV3GEQPKvEg7svM+G1uELRn13YeJl4NUcXjFANHs7pMev329SqleuEr9 d99zTugBY5YBqiPvyIUyJSnYlJQpukomPNdRCPW+utZ/jWcCMlcV6DG/4txVNHRRw83n JXJVBgXEAmx9UcbUVkqmObO8cULDIjYw7S0Cmu8yE1W8E+QREFykU9WXv7zMAHEPsFi6 7PHQDvcfiP3MmmzmVmyf2+q1sl4CU/mcEXKY48G9KOiuBdoBz0N/rjkrhSvrWR4AUo8v 7d2g== 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=JInWc8HbqwhtPM0FLPOWoh/UvMIPVblznx96Z5wDe6g=; b=IQ4NnJPUpa63XppCb/pEbZ5BbOpIQBEB6jP9h3Iie8K3NuGBIl32lati+7iqhYoE1u sVnv74n+eOoHKQ7eiBi3bWeR2ZNk4BpOAZ6Hz53Daa4WcrHF8E6Zf/kS5NM2pd+CTUtK pXAZG2hLlL++eDrDkcqJKteXgF6l7eizlig8/aQ9R11EmdKql3xK2gzwrOu2hpUCmBvi /wDBoON5QHPf3w9r8U7pH/Oo/U0U7iX0WI8OWIPuVMnLCn9WDkRK0RLRO7R77RYMQ7V8 JUfJ4qOVETx5pzEGvoZITBzNGdntSVsQd2XEB+JCHoTGlgoJibTbC0qtOfOLpFwanV/+ Njrg== X-Gm-Message-State: AOAM531GIFLz0dK+Dl+d7hDAYZiTJz2a6CUGxWaEFk3v0PovyioWIeCR oJeUO28KlV0JfOnJ8HXZlDCBwZjCTVOu1g== X-Received: by 2002:a17:90b:38c1:: with SMTP id nn1mr17980852pjb.65.1641591175631; Fri, 07 Jan 2022 13:32:55 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 13:32:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 18/24] linux-user/openrisc: Use force_sig_fault Date: Fri, 7 Jan 2022 13:32:37 -0800 Message-Id: <20220107213243.212806-19-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::1030 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: Stafford Horne , 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: Stafford Horne Signed-off-by: Richard Henderson --- linux-user/openrisc/cpu_loop.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index 592901a68b..7683bea064 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -29,7 +29,6 @@ void cpu_loop(CPUOpenRISCState *env) CPUState *cs = env_cpu(env); int trapnr; abi_long ret; - target_siginfo_t info; for (;;) { cpu_exec_start(cs); @@ -55,27 +54,16 @@ void cpu_loop(CPUOpenRISCState *env) } break; case EXCP_ALIGN: - info.si_signo = TARGET_SIGBUS; - info.si_errno = 0; - info.si_code = TARGET_BUS_ADRALN; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN, env->eear); break; case EXCP_ILLEGAL: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; case EXCP_INTERRUPT: /* We processed the pending cpu work above. */ 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);