From patchwork Sun Jul 3 00:12:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 586791 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2703044mab; Sat, 2 Jul 2022 17:19:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sOoXADdFYlLUhTpeP6CxKt0H3mYv2WR2EzHWuQrQmemHYOzW3hrQOEbrFWOU1ms4MaijJH X-Received: by 2002:a81:909:0:b0:317:684a:3f83 with SMTP id 9-20020a810909000000b00317684a3f83mr25903223ywj.139.1656807565485; Sat, 02 Jul 2022 17:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656807565; cv=none; d=google.com; s=arc-20160816; b=M4Wo9T5V3Lxoi8FUR+7knv4Tv/VN9A4bgIJ9uRS+kyhFsvTUNmJ24ktw/f72ntzvG+ Cw3CTmNCQYW1IVhZyQkKPDDY7zXR1TET0DA1MKK9HlEvqWyLRNgI602s4W79KDQtiV8x AqehgGxv4Fv2ohXKMR5MkY91q4PUfdE7T94gsl/mip/xPaSeDNb2ZeTBC8HFHS/QIDHG lKifT/fSisahZ7k6nof3RNgMTVIncHfpyktuCy/gAAj9OCrGxyQs3tSjVvstUzQxoUYp t3etPx2JEDjbdj0rW6UkjHP/6+A7BKBywX3ItmfYksHbkXVn7BJDvLA6HbgTFGqiNvxj Or7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=foxXdZusDryFqwMtXUjdPue7AebkEcQobI56aA4EfhM=; b=B1lzW+LCkJn7r4yVOX/O6VfDGCLTcSc6IFsXEWhf9HWzIKZAyMrC6+skGvbQL26LNB b3ru0firss+mcEsyVjntCiUZej3ABpcym7PZpdJIuMo81WKPm4hNzePJedPfnU36X55R dnTXaaFpFLz4aPnTDag0cjC+aaMoRWW0oxec8xYyB9oRRNA0dkQEuXAJglHs2qnlCYgh 6b4tGl0LQY7rwS80cdKyHHoXCkLFxY1en97sYj/OyQmDkBDeC/4fOIVPTsNNoCiw4z5V gAXaWzOr0HAi8TmyQITACABvpSYEtMC4+yeFHqUF4ICoBPHceFV3xQx0UTWHrIJX5RpH ER9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=H1qVyptc; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=sflzhH3t; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=opensource.wdc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l197-20020a8170ce000000b0031c7f17e2easi4368041ywc.117.2022.07.02.17.19.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Jul 2022 17:19:25 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=H1qVyptc; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=sflzhH3t; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=opensource.wdc.com Received: from localhost ([::1]:60218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7nKe-00024Q-W0 for patch@linaro.org; Sat, 02 Jul 2022 20:19:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7nEN-0008An-BX for qemu-devel@nongnu.org; Sat, 02 Jul 2022 20:12:55 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:46146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7nEJ-0001p4-3P for qemu-devel@nongnu.org; Sat, 02 Jul 2022 20:12:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1656807170; x=1688343170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XOGoS+LaSNx9ztfN+554+3MJdJHKkwrfOy2g668jrT8=; b=H1qVyptcUusfzZMQ1HJnfwGIuZyJfJEwJxnICU9BQNIsoga2kB3pm5Wq Q7dgdOX0T4Xgh9+vadcbngidx/Jh5H7zvSlKTd2xZi7rPdvRRj0pTilXT X4KaehbEMOE94DHB+C80J5kPfEkMwTvse0ApwIBw+cbYakNY2Szu9j2It 5MigeliB4kXiacED8dUisZVpYu64R9MaeI5VbO207lWtrHg16xISCrfk4 tSUQ+nocRXa2dbizCA3A3TP9DeNIXIb/naussY1qsRxOSx2fMH6m5uEkL CN4dHq9B5OqXj9crmSRG90qJkSajBhymz0G5jgz9jH1QZIXzc8ksD9dUW A==; X-IronPort-AV: E=Sophos;i="5.92,241,1650902400"; d="scan'208";a="204667216" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2022 08:12:45 +0800 IronPort-SDR: XnW3QGYg4u5FUyo96/cqSMeWjBbhZfS0MoBAQ0qAk4bFRxbAGQUXNsMSeXYJBuTfUCbt2lMG6a 5UOK2OlRm6JAVgoNBDLuzTgZU3FPApDtrHb4FBqJHyXG5MxEJZYYDLTZ3LOfiO2PyOS0UirTXd cNon0Q9Gp20chBUqK5sPPX2sgL2mWP4CP/a0Ei8rrsznTk9gYffo/TYDnCH4sMjpuG4l9lAhyp blqTidmeRG906veTEtfgR77kwIehSNvyWXX/mW/TMs3lbA9ODd22q/qBgEXoXfiLkxA+wO4+6a NCRc9e6uTmAtOvSzf5wbB+At Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 Jul 2022 16:30:07 -0700 IronPort-SDR: uUF6PoEQrXIMe8V4hvBcR27OweAzopIxutf7LpNm9rdo9kvMNifvHKzHwodq8E1Vpkko0azWRf Td/3/cDS3uMpsty0YW7qDtcupU/ahYqepnLgIB0H/PA7wGteU24MkBHaIM++BfayziXFrKOAdy 9aueoWMgu7ttS0bdd2kj8tIo9qBlvdWTXtyJ1MJByz59i/bZn+Fb0AscWQbenbzIgaeWaLuyaR vr2xZ4RHaw4L8GUdnqVy9Q76Hfeuo2FbRNzCLX8hIZKZoDA1l3BtkuaRflmjfwLxVFdQxwsNpY ilA= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 Jul 2022 17:12:45 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4Lb8XF3qycz1Rwnx for ; Sat, 2 Jul 2022 17:12:45 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:subject:to :from; s=dkim; t=1656807165; x=1659399166; bh=XOGoS+LaSNx9ztfN+5 54+3MJdJHKkwrfOy2g668jrT8=; b=sflzhH3t7LMGZBhP29ka1yeSpfjCGZgM1u ZZ0dEmgjYjF0+B1XM+09C9bKz5teb0eMrW7D31dhH/cFMHXa2QnmpxwxpILhk7iV sDtUgoBWWegodfZyGC2gdkOMOB8WC0a8E/afJMpQbLeL5+4LuazsWOJ2rNx37EKa 8ks4k6PDITNgBsazoMbNtzpB4Y1FwT1PQIOMOfHZ04HoouJXgoqELLVroRhlLciR dTOOB6IzCjltd1PkHW+navU8p8anp89KLx8dKymvB20m/f7bz8iR96nfgu0bwzf5 xbK+TrcywGpGWICcXuHShtLaMHL6hhmONCeNJMbPd7fi6ue7CFNw== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id cH9kQCcHDNrQ for ; Sat, 2 Jul 2022 17:12:45 -0700 (PDT) Received: from toolbox.alistair23.me (unknown [10.225.167.123]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4Lb8XD0GRWz1RtVk; Sat, 2 Jul 2022 17:12:43 -0700 (PDT) From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Richard Henderson , Alistair Francis Subject: [PULL v2 03/19] target/riscv: Remove generate_exception_mtval Date: Sun, 3 Jul 2022 10:12:18 +1000 Message-Id: <20220703001234.439716-4-alistair.francis@opensource.wdc.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220703001234.439716-1-alistair.francis@opensource.wdc.com> References: <20220703001234.439716-1-alistair.francis@opensource.wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=216.71.153.144; envelope-from=prvs=176813b30=alistair.francis@opensource.wdc.com; helo=esa5.hgst.iphmx.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The function doesn't set mtval, it sets badaddr. Move the set of badaddr directly into gen_exception_inst_addr_mis and use generate_exception. Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Message-Id: <20220604231004.49990-3-richard.henderson@linaro.org> Signed-off-by: Alistair Francis --- target/riscv/translate.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index a10f3f939c..7205a29603 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -230,14 +230,6 @@ static void generate_exception(DisasContext *ctx, int excp) ctx->base.is_jmp = DISAS_NORETURN; } -static void generate_exception_mtval(DisasContext *ctx, int excp) -{ - gen_set_pc_imm(ctx, ctx->base.pc_next); - tcg_gen_st_tl(cpu_pc, cpu_env, offsetof(CPURISCVState, badaddr)); - gen_helper_raise_exception(cpu_env, tcg_constant_i32(excp)); - ctx->base.is_jmp = DISAS_NORETURN; -} - static void gen_exception_illegal(DisasContext *ctx) { tcg_gen_st_i32(tcg_constant_i32(ctx->opcode), cpu_env, @@ -247,7 +239,8 @@ static void gen_exception_illegal(DisasContext *ctx) static void gen_exception_inst_addr_mis(DisasContext *ctx) { - generate_exception_mtval(ctx, RISCV_EXCP_INST_ADDR_MIS); + tcg_gen_st_tl(cpu_pc, cpu_env, offsetof(CPURISCVState, badaddr)); + generate_exception(ctx, RISCV_EXCP_INST_ADDR_MIS); } static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)