From patchwork Wed Oct 13 02:45:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515679 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp6081726ime; Tue, 12 Oct 2021 19:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQbpNERE4Mt0PPh5OE8E3cBhopgKz254nDCqlqqVbj6sphIcf/+gCN/3QYyDmEZmBHrMX/ X-Received: by 2002:a37:d82:: with SMTP id 124mr22754188qkn.299.1634093530534; Tue, 12 Oct 2021 19:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634093530; cv=none; d=google.com; s=arc-20160816; b=EL97COxzeiUdc3/brjpShKWx5Z5gJ8gbUds5DpSXr6nNYx3d5R+jShkg+pSS56iFjb vtr/wrMDOCSxY5Y1SjT+F9iChHo6yr8Xx4FKeB3gbBEmo24O5xB/Id3TKfqi95smv3oY 4xhA5YUE+RrlAITgHEkvGb8dm8P45z4Wf0cLm3coItQXd62bYwCnOcfEh5NhA7k6iVkL t95LoRfcrbxYTUG/ivmoELDDgPLv5wo3Sk2Z+HDqB57ReleAmOEzACIlL+5w5t+slgXq V8l8W/NWYTqYxniaSoivisBuC2kCGR6jscHZdM6XPm1KcKmkjD0V1YKStpwUSH1iGcB9 PEyg== 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=KU5GqqnHBwJE2oQY4NvVS8KLTvZHsylgeTI1DbvIUb8=; b=1H/nbJswW1xGNzdMb1bu1QdGWEmwe744RS09zcyd7dvVZXs17LIHdwCZhSY/ltIK1J HuuSRhMWAlJkl9M2J3vHmPGrKHxcT98zO814L03Sqpk91Kd42OFtACG4WDLmi8QkquSe Mb+L0ggl+SpJ0NmxSdnWwH2NFfU+WqiOSibm2Qp4GRkUN6wNSk0UgrTU9ylMH3daVg2p 0VxcXWIAPzhh2CI+8FZzVANkhyq4f92+k4QN/7A++CiCWKUiDeEW/WnfdPnJVYSX6jpe WJ+mqc0UDWEy9BibuahUrIzFqi5ZjSLXUSuVvYTgwXfmOKov+dl1g2YwWm4x87ZuJFJ1 F6Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="VZ9bp/XN"; 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 j3si10424144qtj.349.2021.10.12.19.52.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Oct 2021 19:52:10 -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=@linaro.org header.s=google header.b="VZ9bp/XN"; 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]:57888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maUNG-0007e5-1d for patch@linaro.org; Tue, 12 Oct 2021 22:52:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maUHg-0004R9-GA for qemu-devel@nongnu.org; Tue, 12 Oct 2021 22:46:24 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:33682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maUHe-0004ro-Sd for qemu-devel@nongnu.org; Tue, 12 Oct 2021 22:46:24 -0400 Received: by mail-pf1-x42f.google.com with SMTP id t184so297755pfd.0 for ; Tue, 12 Oct 2021 19:46:22 -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=KU5GqqnHBwJE2oQY4NvVS8KLTvZHsylgeTI1DbvIUb8=; b=VZ9bp/XN4RwXODAQd3FeXT2cCu3aSR3txc5F+hcP/KyzkvDOuqtKgbB095rPAUUl1O UqbyZjawnHXtbe3yGcARvIYMgVAjA0w1+mjhIvvQfLdgIiV0mt6NT/RwbYzybdvUNjcP tQI5miaN1GvzMUUMv+twRZxnyRw3P68eIvEyl2BgpakGiMWZk8PQovW98BifeEkhGlj5 pavJjQXHTEOnwNlR0mdnEz/TjHfx1cgAJgDBUsVN8qNklB6Np+8OVjolAcf+YtSUDHqe aNXfDzXhU0RosG7i7q2evJ7+flHayuovwniFdDsWQTbesjpCu+Tv/dFy8oSQB2DcR+f5 hDbw== 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=KU5GqqnHBwJE2oQY4NvVS8KLTvZHsylgeTI1DbvIUb8=; b=7mHAjJF83jiciuFb1b4iPd+SEqw4xJHnJC/vuRCCbv+Gg2nx1i+xtg/jpBZ3E9SJpt ub8GBStIUBPCzHaHO4UVJyNahNtnu0DAxTqj9qxqJ9m1EYGZI+WBQ/bOwAJkE7mdQztJ IX+Xa0n97hRQMh+/b0pfteg2Yxrl9HqpNkFiflluQ5QLxEUWKA3dbNE01fKnS6ExeoaO 4MfVY+xrpjP0XW77aj6iQr5ZIyHgC9A5BYGIe/5tygx4uX6rP78qk+SLt75ndoN6Rg8S t86iG4VeLKYP/n7LlpqPsIpseSWNNU5Eg/8/mBY8m986WOtGOMHyX0Ud1VKtcqftjI+q 9r4w== X-Gm-Message-State: AOAM533bN2McSYpWxreByOLsLYIZ9hEbyz5WmHZ6y8zDDXMXcrQA5Rls kQN1SoS25kR8joG2M9u5+9IfrA9juLKe5Q== X-Received: by 2002:a63:d806:: with SMTP id b6mr25896744pgh.395.1634093181514; Tue, 12 Oct 2021 19:46:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id qe17sm4855014pjb.39.2021.10.12.19.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 19:46:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 12/48] target/sh4: Set fault address in superh_cpu_do_unaligned_access Date: Tue, 12 Oct 2021 19:45:31 -0700 Message-Id: <20211013024607.731881-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211013024607.731881-1-richard.henderson@linaro.org> References: <20211013024607.731881-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We ought to have been recording the virtual address for reporting to the guest trap handler. Cc: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sh4/op_helper.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.25.1 diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index c0cbb95382..d6d70c339f 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -29,6 +29,9 @@ void superh_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) { + CPUSH4State *env = cs->env_ptr; + + env->tea = addr; switch (access_type) { case MMU_INST_FETCH: case MMU_DATA_LOAD: @@ -37,6 +40,8 @@ void superh_cpu_do_unaligned_access(CPUState *cs, vaddr addr, case MMU_DATA_STORE: cs->exception_index = 0x100; break; + default: + g_assert_not_reached(); } cpu_loop_exit_restore(cs, retaddr); }