From patchwork Mon Dec 20 21:05:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 526076 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp4453055imb; Mon, 20 Dec 2021 13:11:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/GdmxgdRIiGZhuNA3rGd9OdXlaJ+k8OU+Cn+bv7z5TjCzXco1hQgL1eHXX0SYtIT/1i/U X-Received: by 2002:a92:d304:: with SMTP id x4mr8761199ila.149.1640034690520; Mon, 20 Dec 2021 13:11:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640034690; cv=none; d=google.com; s=arc-20160816; b=Mb+nvShNCiHD5S+fPoLSxh0JVUv9zHVDA9G1hAHgCQzrn+7hRhEt2BYCaiS9aC8d4e i5wiNCZdA2+AECG+Gaoe8JJiYgYvHLgOcB8y+MsHI6Bq/XQsH+9QvxeH1OqjjXXQYIX1 l7bpr+z7X1eR2aB2Mr1+E1euxlBYPkoJcPyLOZ6mT4q/LAvWr6wvAR57csP9vm6npdE2 4iynZvalx8+2Fmbv7Q5E19muG/VOM0BtjgK5WHaU6/FDdoeTlCa4STrN1e5RmYFvmDzM ND/MzMRi1XkT/S22ZzYghKw967mU9f1CG6s7LhtbRIah3VCvbhXb4j9LsVtaVqsq4dUO YSjg== 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=Cq+EqsUr6Fk7YRDOR1iWeMyRL/11b3e2J0Pnd4eMUrQ=; b=HcC0wt+VIeqY6NoTJshUKFvnEmvBTL3bu/a2WDyZyylZi8PIozpH4YC56j23MYIBxx MEO9pZa8TC7gS6bXAzyg/LoToWTOlTCM0DWxTdxs5mOZgdY48gW9dUwiPfdzgarBt0t6 iUZdU2inFyDpRSjQq2tl24k4h6ITOPrs4uI9jeLVtinXBqXMiC2zlb8OXgIRAjONbFSL lYLUf1b+SNStcbEuWRKYejhuRs9X2J82afPh7dzcMI443lXEg0OmPcy2b3J078NF9DNy S92q3oc7zVAVSPxiAY174Xaxq6p2ciizcopmPOw4AsQSk00Kt9FKPIOtpzyvl8yoXO4P UvPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ga3rCoEM; 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 f8si4481636ilu.171.2021.12.20.13.11.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Dec 2021 13:11:30 -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=ga3rCoEM; 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]:41664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzPwQ-0003TV-0a for patch@linaro.org; Mon, 20 Dec 2021 16:11:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzPqk-0000Cv-7V for qemu-devel@nongnu.org; Mon, 20 Dec 2021 16:05:38 -0500 Received: from [2607:f8b0:4864:20::530] (port=43825 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 1mzPqh-0005tF-Qe for qemu-devel@nongnu.org; Mon, 20 Dec 2021 16:05:37 -0500 Received: by mail-pg1-x530.google.com with SMTP id 8so2861374pgc.10 for ; Mon, 20 Dec 2021 13:05:35 -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=Cq+EqsUr6Fk7YRDOR1iWeMyRL/11b3e2J0Pnd4eMUrQ=; b=ga3rCoEMdutGA7gepfJ20KyKDlpEqPg/VW2r4JNBTycV90TBDaUri5jV7yYBzOu5jE cbspCSG5NBxcLulxIPtfwztz5bcbe7Ynhm2oW+wA34pqDgH9t62zPIJp20x2LYGQLP3X 1AodpqXqXNXxDjN+t204eb0T7MjCKrDvMGLuTPgijCeSj79oeNRry46JMoQbhxBMVDyf R/wMug5DrjXHoHFyFJLMCHCithxuh/6C7FkYW+CsojDIFYRA+cRSf8fvlkYkG32Xeaca Lr8OlvzY3meSd24jrlEZEtj7X9kfiUBMNQQbn+ZVmmKOlAbxoWz4edclwcV2+DykPTRF aAHw== 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=Cq+EqsUr6Fk7YRDOR1iWeMyRL/11b3e2J0Pnd4eMUrQ=; b=Lz8cge6xYPHP6bGjDGx6d5/4Zk2yP5d8ZE3mOD6Nwb44zKwnF9S47Bhd9h4kbpzokr B4AhEX1+IECHGxnc4v+QmSmsXK/PIlsxwmxTcxcm5/mWRlUSA0ltCqqFwCqD3XAU87Vu CADF83PiWlXm05+KPXOFZGFjvkTQpSh89HBgWc12JCa7u4dqhJ/YstKdQ41oJdktqn/2 LyBCCeoaSaiOAtwyDRdyRAbHOUuXSD+KB8XMhAN2K5h+12mYr2nACbFEh4IzSK8sfdZ/ 9R7TEFm3nkrrl6+ONR88MkM+Hc9uZoIywf3rcoHjMLt9N81HioOFcitJIhCOg3tiuqK3 uK1A== X-Gm-Message-State: AOAM533Y7WqyLbt+MOO5uNPbiPEn2zD+JQ7jWMzOkRLddaiZPLIIc341 yxpneXXaryI71JTtqBUvQiAv/a/cXuBkoQ== X-Received: by 2002:a05:6a00:1744:b0:4a4:f4e6:1cc0 with SMTP id j4-20020a056a00174400b004a4f4e61cc0mr17870833pfc.15.1640034334605; Mon, 20 Dec 2021 13:05:34 -0800 (PST) Received: from localhost.localdomain ([156.19.246.20]) by smtp.gmail.com with ESMTPSA id d13sm20091021pfu.213.2021.12.20.13.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 13:05:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 05/24] linux-user/hppa: Use force_sig_fault Date: Mon, 20 Dec 2021 13:05:09 -0800 Message-Id: <20211220210529.150423-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211220210529.150423-1-richard.henderson@linaro.org> References: <20211220210529.150423-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 and missing si_code for SIGBUS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/hppa/cpu_loop.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 375576c8f0..b09caa1111 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -110,7 +110,6 @@ static abi_ulong hppa_lws(CPUHPPAState *env) void cpu_loop(CPUHPPAState *env) { CPUState *cs = env_cpu(env); - target_siginfo_t info; abi_ulong ret; int trapnr; @@ -147,26 +146,15 @@ void cpu_loop(CPUHPPAState *env) case EXCP_ILL: case EXCP_PRIV_OPR: case EXCP_PRIV_REG: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr = env->iaoq_f; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f); break; case EXCP_OVERFLOW: case EXCP_COND: case EXCP_ASSIST: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = 0; - info._sifields._sigfault._addr = env->iaoq_f; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f); 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->iaoq_f); break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */