From patchwork Mon May 17 18:13:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 440172 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1326770jac; Mon, 17 May 2021 11:15:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCkbI2VPs7cQjht3Rn1kdOAapYndq7RmA8b5Sc+ElUHZiF1KW0mxk+uaOV4E1gMTw4zPv3 X-Received: by 2002:a6b:7714:: with SMTP id n20mr993497iom.126.1621275329344; Mon, 17 May 2021 11:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621275329; cv=none; d=google.com; s=arc-20160816; b=rnPBpznQsZvPG5+SrYO1unt9kgWlRaIsAloksnnANGTQq5rh6ZUBKcBHl8QJxDnJUQ CvZliC3+aYtR9WemMfTSlYhc6l3yskANm3Nv3kbjc5Cih2iInl8XA6135J5Fgso2uHg2 p6N6X3CzCU26RdNj/g2Z81/CRIbtYhpvZOxX/bi43OR/EvWlbgxlitnW4gK5Tc0WsmZo i7oUJ676qA5BowdEBqzDTLKu6NugLTe5b2RkvhNSXMYg61gAuTvRV1EqbbyjtkTVaQVn lXASXnVgAIxqq0MwbiAxdxq0pgdPZUODBbxhnUpp1GYjZYizfd7z2kfYZv3Z0og5kpZ/ Dffg== 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; bh=Gwtu2bwOjeV8nx3q69g5zVj7qdW0SsuFeyNbW1BIYQo=; b=dDQ400sgUUH9VUVYJIqF2Ofl1xmlOHIxpLOfgwMVadZHUuRT2+r+XP2APZgsAIvc/9 EfBBbzeyZRuR7Zr9XNz455mMIOmGPHHuucdxozayAGg7YDq9GaJHsNqT8hhgTZ9Xg+3M 7FXeJu/iZd/WrOfGSFJJ2EpZ4hFm935dhg412saAT8Iy5W3eA1jqoQUTf6m4o4SbJbZx vSg6riz3iAsN/BlM1o7lVBbjYvXGyLuLz4FuEjrcpfWjn9zr7LtFpGpOjTErQqYONYyZ Lov86iH6a/Evm7jMNAXXt3N/21gZerje/+SIhz6ZNPPDmMAm26fS/6FrJdfMijacCRJZ p+2g== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x7si6350089ior.77.2021.05.17.11.15.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 11:15:29 -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; 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" Received: from localhost ([::1]:52566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lihm4-0005wT-JA for patch@linaro.org; Mon, 17 May 2021 14:15:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlC-0005u8-DF for qemu-devel@nongnu.org; Mon, 17 May 2021 14:14:35 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:40453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihl9-0004Kj-Am for qemu-devel@nongnu.org; Mon, 17 May 2021 14:14:34 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MyJx6-1lYjSS1ujU-00yhMJ; Mon, 17 May 2021 20:14:28 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 05/59] linux-user/arm: Do not fill in si_code for fpa11 exceptions Date: Mon, 17 May 2021 20:13:30 +0200 Message-Id: <20210517181424.8093-6-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517181424.8093-1-laurent@vivier.eu> References: <20210517181424.8093-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:rg9AVIG0sjYD3n7Givh8BQA4Ai+VHIKD10s4ZcYPPoq/biiojII d9NsXUQ1WYqxecHnDgrCwC1D0p2WNAWlpFo2Hof6jZd42grydQD6rYDAHl6N3nUcLqPqWG/ c/lUECeJ7jFdx+cLXMtzKYekWxCIcKdgckpGqxWS4wyES9Yn17WWacqb6uMkL1ebIY/tMdG p5xuUXnASqw6C4WYvVViA== X-UI-Out-Filterresults: notjunk:1; V03:K0:a9gGb7MCQMY=:s7h7DidPhQs0V7J+EYSA4T UawweaEm9L2q6RaC5p8FHMVUXryK1zuzaanYwgyxBXuFvoDTxlJHj73zTC5Vlj4T7y7kdon8r BNw+mbxABlDnptQD9SLpOKjlMOSxqUXrgIy2rN7xndMMlZ0e5/sU/1xplvS60KTRLSq23UA+t 36EWGjfX1X1OmN2o944Nhh3eP8jYasXkPg/mk62EouFl8J3YLgPtn6DSXx3R9pJ38VvwiKpAu i/Qy9vLWQ4XdfNLYJfPZEYp2frUBz0uAOfjr7XIGENwBDFQjj/N7R/zQoVQIy+o8s63IDX9Uz YEbG7goe/nwhx2oG+WEX/gFeUhkwBgZkSosWAkl5Ckj+M8p+FVaSoXSAZ3ZCpkiVRXMONIKTW 4Qy3wg38uNlHtnlG8tJb712giYgAtDYQ3YivnxvyfZC3Jm9VVuek+9hPvrHtJmPwhoiC9v4t2 N4BrjG6Lso3przSMZAYuef/wZfaHRhTAr5mg9Ud1FjSYrCDw9zloxQ5uVvvIRr4D4xoVnKPjS AxZ9u1kSiJtWX6TWXOXjZE= Received-SPF: none client-ip=212.227.126.134; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson There is no such decoding in linux/arch/arm/nwfpe/fpmodule.c. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20210423165413.338259-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/arm/cpu_loop.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) -- 2.31.1 diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index e2a1496b9fe7..5f61d25717c3 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -262,29 +262,15 @@ static bool emulate_arm_fpa11(CPUARMState *env, uint32_t opcode) /* Exception enabled? */ FPSR fpsr = ts->fpa.fpsr; if (fpsr & (arm_fpe << 16)) { - target_siginfo_t info; + target_siginfo_t info = { }; + /* + * The kernel's nwfpe emulator does not pass a real si_code. + * It merely uses send_sig(SIGFPE, current, 1). + */ info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - - /* ordered by priority, least first */ - if (arm_fpe & BIT_IXC) { - info.si_code = TARGET_FPE_FLTRES; - } - if (arm_fpe & BIT_UFC) { - info.si_code = TARGET_FPE_FLTUND; - } - if (arm_fpe & BIT_OFC) { - info.si_code = TARGET_FPE_FLTOVF; - } - if (arm_fpe & BIT_DZC) { - info.si_code = TARGET_FPE_FLTDIV; - } - if (arm_fpe & BIT_IOC) { - info.si_code = TARGET_FPE_FLTINV; - } + info.si_code = TARGET_SI_KERNEL; - info._sifields._sigfault._addr = env->regs[15]; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); } else { env->regs[15] += 4;