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: 1541332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=caXEo8Xf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVtwd3HMYz9ssD for ; Fri, 15 Oct 2021 15:44:47 +1100 (AEDT) Received: from localhost ([::1]:45104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbF5I-0003ez-Bj for incoming@patchwork.ozlabs.org; Fri, 15 Oct 2021 00:44:44 -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-Google-Smtp-Source: ABdhPJyu8mHwae1Kf2Cd51kyKDr2xVwkAVltFhogh2lRvMBeL1Wiusj+hZhdAwpC522zcutYdYZt5g== 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+incoming=patchwork.ozlabs.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(+) 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); }