From patchwork Sat Sep 18 18:45:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514237 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp674528jao; Sat, 18 Sep 2021 12:04:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTp02ldNnpAF+S5H20UO2n4/PRYljmHiW+AQ2XZauRwBxCrwPrSDS7gOvuuj0AFRuDo+t8 X-Received: by 2002:a05:6e02:1d87:: with SMTP id h7mr12396139ila.92.1631991849935; Sat, 18 Sep 2021 12:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631991849; cv=none; d=google.com; s=arc-20160816; b=UySShRvo4il6goMp8yJHGNJ+jzZ+EXpxdpy4Aqb+cYjblDxCv85/Da7nRrPpDT7AVb jmDqDuKCrrKf3sR50jCV8aweMjF0Lou828rYW8qcAn+koaCZptt+ME0a3lH25dRh9Xdo di4bDCCxFarIcjJZf7MgacyXs5ybVgKj4x6qxY8VMSMVqM2mNhI2rHM47/ljFuEMeJqL BkVYlnc9IOx0DQpeSPQQj6OLuFfeR1QzosZcUTXyDzpRDRt001MXfcKBRZ/ExqXgB/4R i08dhP/NzWDKD4tReoMkzYG/pF2YGUrLgzOkdpdn35SLPI4X9m9FAZwiTWfPA06gCPot 1gzA== 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=MPeEJcgZH7TojaDG8K8aivb2xJIScpaxZoFZXE7a5sY=; b=nqxQXGZwU/qOUdz0mrTgMrHRqwFo3s9TF+fc48bp31z1DHybaywOui9bQuBEv6t17Q ixcbSwEPFyU1Q9OJHaoQj8rRryWBoX7MI857nWClva74sJcGczYCx/DxeUovQ3bQdFKg Rc76jYiEvFW7uLTORv8r7sB7JtXJENcES8ngkvvYpg+sWwgsPmMBT/UnEI1wR8Q/ISH4 YWgwo2r6tHxgPLtXrd+KC8gZ23n8IJFOjeEB9W5B0p1QeUl5c//yc3yvOJx6zYgUsOhi 10OJZtvB++BgeqQ7CmShtVazEBUhGuZ3HQIebPKsol/HAuDVd0YH7t056R4/M57x1yrn /1CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S4JY2mSt; 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 a13si6992803ilv.48.2021.09.18.12.04.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Sep 2021 12:04:09 -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=S4JY2mSt; 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]:50592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRfdB-0000LQ-Dn for patch@linaro.org; Sat, 18 Sep 2021 15:04:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRfLm-0005Ia-Dh for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:46:10 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:47089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRfLb-0006ww-5H for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:46:10 -0400 Received: by mail-pg1-x52c.google.com with SMTP id m21so3884870pgu.13 for ; Sat, 18 Sep 2021 11:45:56 -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=MPeEJcgZH7TojaDG8K8aivb2xJIScpaxZoFZXE7a5sY=; b=S4JY2mStgSg8363Sq0kvbXKwnb2NR5+QabwRXj+5WKssNRzbI6i67hkzp6rDgWwvvc nzLXluddeGG+Y341TyCdea0z7DrY67mMI+ALF15VTgoYmb6az90n0u5GYoDC0lNMGH07 mbm7Cq4kp2Z82bCxfbVx2cjO9hoKyHdSSZPckA0CCuBZAQN+zh8MNFNdAhHPbHwJ42Uw 8RAB4POzXDyJvTpyt5uVD/yPzLwqxQn9rzTwfTIJc+F4S+Jv2T8HCvqR56++wj7i0gej T5a89iD8FvkqnQ69n9o+zUz5Vrb88fpaVb2qZbx5C+P4UkWZgHBHJ9Yn994NBGIrjtqf H0Dw== 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=MPeEJcgZH7TojaDG8K8aivb2xJIScpaxZoFZXE7a5sY=; b=RGQ+Skg5mmfJwN3mDCMyJROUSym8FGKHALObH7vrrTVunq2K1/JHBZi4q+CzK+Nvqk xetaohYe7AAroKGvyDcnNts0ToEo87kCTt6DvZ94wc+aqDYj90n9JKFrf08CvG3Qvayu wVphmljKU/+vaZaHt3GsEZDf/17boUR7X7lexBD/mtEMuqR28Vhc2W8y6oSJOgcaK53w DLb9LYgmFC31LChyJjb0lm/zFi4a+f+052I2aWbA2WCNP9SyRZC422SrrwgqTZ6TAlxc lA5pXZ20NE4xvLBByujqnYZjaCQma3jswfDv2lyvjNG3L1ny9/ptetilDKdeV4UfdVq7 XKNw== X-Gm-Message-State: AOAM533kixa2dr1bhzKefqTbASNBLqayH294eyaC4lLJiDRj9GysuIsh zuIf9B/SgVXiSfBRv+f7+EF8WY6vcmjZvA== X-Received: by 2002:a63:4d20:: with SMTP id a32mr15733094pgb.247.1631990755291; Sat, 18 Sep 2021 11:45:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y26sm9555858pfe.69.2021.09.18.11.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 11:45:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 32/41] linux-user/openrisc: Adjust signal for EXCP_RANGE, EXCP_FPE Date: Sat, 18 Sep 2021 11:45:18 -0700 Message-Id: <20210918184527.408540-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210918184527.408540-1-richard.henderson@linaro.org> References: <20210918184527.408540-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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" The kernel vectors both of these through unhandled_exception, which results in force_sig(SIGSEGV). This isn't very useful for userland when enabling overflow traps or fpu traps, but c'est la vie. Signed-off-by: Richard Henderson --- linux-user/openrisc/cpu_loop.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index b33fa77718..314e7fba1e 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -21,6 +21,7 @@ #include "qemu-common.h" #include "qemu.h" #include "cpu_loop-common.h" +#include "signal-common.h" void cpu_loop(CPUOpenRISCState *env) { @@ -54,13 +55,17 @@ void cpu_loop(CPUOpenRISCState *env) break; case EXCP_DPF: case EXCP_IPF: - case EXCP_RANGE: info.si_signo = TARGET_SIGSEGV; info.si_errno = 0; info.si_code = TARGET_SEGV_MAPERR; info._sifields._sigfault._addr = env->pc; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; + case EXCP_RANGE: + case EXCP_FPE: + /* ??? The kernel vectors both of these to unhandled_exception. */ + force_sig(TARGET_SIGSEGV); + break; case EXCP_ALIGN: info.si_signo = TARGET_SIGBUS; info.si_errno = 0; @@ -75,13 +80,6 @@ void cpu_loop(CPUOpenRISCState *env) info._sifields._sigfault._addr = env->pc; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; - case EXCP_FPE: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = 0; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case EXCP_INTERRUPT: /* We processed the pending cpu work above. */ break;