From patchwork Fri Oct 15 04:10:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515830 Delivered-To: patch@linaro.org Received: by 2002:ac0:da11:0:0:0:0:0 with SMTP id d17csp149613imi; Thu, 14 Oct 2021 21:44:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjCpC+CUcb8pon2+Z+VYHs607Nvv/ZxwR0rr4nOv32LoJKOc55JoYB9y9OnVvqxzvjNo1J X-Received: by 2002:a25:bb93:: with SMTP id y19mr10800877ybg.266.1634273097571; Thu, 14 Oct 2021 21:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634273097; cv=none; d=google.com; s=arc-20160816; b=eOcCy7sfs90DkRowecK5CT+SekiSJ5xNWvCiDQLbQwRrnIRo6w/+uMO9nt+GfBBOgd YViVLhL5qdd+6evhRTFtyTo4cBw6ASoug7H4F2VPC6Yhu3guFXGMAAyFy6JchWvBagMZ TA7J0ZKpu+DM87b67VTo+0iRNJC1eKcm+HrUteoRdRThm4HatJ2C0fb+Vipcis+B6w9V 8jEsfFoq7sLgTZYLB5yh1nRIgviT+OCvVb2dkJpz804FOCtUWsvYKZZ5vBEjuxWhXNd6 dNuFly0AUvyLewYEbQQcYwAwRZTei6L9mcshJkw5FPnthBYPa7bokA3GecEI+vuSDGMB zspg== 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=RvgWb8b5hAhcQV7hHzqs1G0BQlHgy7VTXtoN5AFT5xflW36NIfpxatZUJWX9yWC1vs 49PP1lPoYLhktLRyWDgHqLMGTSKp87W2vMwxl4286XzPyH3gYhPdwnGZE/LUwnIP2OpV gPT0QdBvj6WxrQYaD+XMbSl9rj3rZ+jZQlWiA75fc/O+HHzmPbqb/42HZ1A3ObPwlgw0 mzzqdxUG/FRUY6Xw0GNmoDofesWuOKW+jqy/kzZ9dNWsZOUqYFkV/UcnCZnAcJS+V4/e i4i2oYydUjN/IK5hP4LIXBVjHT0naO+qiKfQhai+7caTKNZ86k31410DJiQENGBon4JE RiSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=caXEo8Xf; 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 m17si2856909ybm.60.2021.10.14.21.44.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Oct 2021 21:44:57 -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=caXEo8Xf; 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]:45104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbF5U-0003ez-P8 for patch@linaro.org; Fri, 15 Oct 2021 00:44:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbEcC-0006rR-VQ for qemu-devel@nongnu.org; Fri, 15 Oct 2021 00:14:41 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:43708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbEcB-0002ti-GB for qemu-devel@nongnu.org; Fri, 15 Oct 2021 00:14:40 -0400 Received: by mail-pf1-x436.google.com with SMTP id 187so7279059pfc.10 for ; Thu, 14 Oct 2021 21:14:38 -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=caXEo8XfcVNqQC/PP328NXImnbbtyaPSavWBwvAB8S1sFXsgzGxEDM0d/OTLxO8T3G j5JkZd52oY+nRfjZbQ53ifiztefYGieujZI03+qLI1jEEtFK0KyTDNkYRHMo4enAd5ym /TZBt9pGxA4jjN5A9PttOczJhsWgvXEcH4Tb8FyhxMqvXhj/XcBi7HQJceD1j7mB76cZ AWF8/hvn9spNNvAr19X2HA8clizEy+gJhjnq/6Ux7ZahOxG4k1YgAWTYkxRVpHnylCIF ZsVM7lC3olLeQ8FtjOJohuM6AcCAt8/4U6KpU3ymYLG3tSe9MM7XIsqH1X99ntyKNXlW ZvZg== 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=idiLh04DVC1IXavqpuKOqnwuOXsypp3zuVHdr6oq5zUtDgrPEzVuMXW4vLng8plhhZ kms6CW/pcxRpRF22WvXLy6DWrvP3Hm28Gf0KPacGOlLkUh+cfWFDooGqs1g0o+cLbPpb 0SfjTwut1jBGCyTtWMjr7oQGMZU9hLeoSgsaVekaUvwbXNa6ooc3lohzTHehfYdGSnlq 2CfORpxNyG+O+9rC4UmfPb5txeXAgRHUeE8r3JHVHO+wZ9/TlSIQcLJ3dAfElg0knvw0 S3jCTk8U1OWWGydsWFxjDkcE/q8Y9abDPBNmVifM85eWStagp0EXRKOaH6ncecn9SEqg FNgg== X-Gm-Message-State: AOAM533x+LBZq4b20QGz1fp1XibpmXiBUhsaqi61e822Jrp46Jg1+YXN nwjOL6zXJXlUQRPjuBzymPhGWcD9ZOJK4g== X-Received: by 2002:a63:7450:: with SMTP id e16mr3562995pgn.482.1634271277964; Thu, 14 Oct 2021 21:14:37 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id q8sm10236885pja.52.2021.10.14.21.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 21:14:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 54/67] target/sh4: Set fault address in superh_cpu_do_unaligned_access Date: Thu, 14 Oct 2021 21:10:40 -0700 Message-Id: <20211015041053.2769193-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015041053.2769193-1-richard.henderson@linaro.org> References: <20211015041053.2769193-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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?= , alex.bennee@linaro.org, laurent@vivier.eu, imp@bsdimp.com, 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); }