From patchwork Tue Aug 3 04:14:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 490846 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp307503jap; Mon, 2 Aug 2021 21:19:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc5Fw4lAlEKAMsaE3YwksPclg70bIBcvdphMiL4lZ9L5pSNDqqCFzGv6PLLZnTvQED1igK X-Received: by 2002:a05:6e02:1d8a:: with SMTP id h10mr634402ila.20.1627964391638; Mon, 02 Aug 2021 21:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627964391; cv=none; d=google.com; s=arc-20160816; b=gGFxiWrIOyqnzYJ8AKHO4D7I6kekMPbI8Ybeg8byL5eOfwCbN1f/pOEnCcfM0+7/9j iunwfnopViovAlqulWZpTnwVTXDq98s80N1gMlF9IBvQxyHbqjVsUPpmg0N18/PtESrS LbdVnFaLTC8PwpWUlTqduCtGigTVLfZ7VekJqlFUpfvSi3YJOPOqs5WdrL9iaM8WwLJl d3gwShV9i8cQLqis2zNLfF7YWgSjN60MGHQSh5nY6lcF+H1wXKv2eGuzZNjidq8zg45A gW8Ec1qzvP8oNORYxDFnMAO5ACaQgofTQpcLxK978mk2P6z/BEHh5wObV/MEAxZewZMW k+EQ== 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=GIpVdNHIg5QaakVIA8tXhUwX6AZiRswC1fqzYzLoAOHNbvRG69+fuNh4YATBBignJp 6TwNw2HL6/a9+2oetXa07WYMdzhmeHkQrG6yWiRT+2tapB6zsIo5iksZuQsFqU1w13+Y +DxoHL2hQ6hiKc8PBQ+sQPpLsI/I/xCj+EDvvBR6sXu2AK2K1hf+/13U4PPs6hwbvLjk lFOa8nGM2nKf2zoHGXUz+BVGsyOsMmMfWeD1DOhgOpePKJNpcUYs0iGyL8samo+o/n6q yjUbNFY2sJG4bBtAddrOrPt7qqIWJ8D1L1uyznjcOnqMcK5dlajFwzzZcoLWPJh6ytKk J6kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Wi+UvR0T; 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 g17si13645894jaq.116.2021.08.02.21.19.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Aug 2021 21:19:51 -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=Wi+UvR0T; 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]:36556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAlu9-0008Jv-Kw for patch@linaro.org; Tue, 03 Aug 2021 00:19:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAlpY-00030e-01 for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:15:04 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:47011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAlpW-0002A6-AZ for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:15:03 -0400 Received: by mail-pj1-x1030.google.com with SMTP id g23-20020a17090a5797b02901765d605e14so2967616pji.5 for ; Mon, 02 Aug 2021 21:15:01 -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=Wi+UvR0T1lvyj/L1YGRuXwDshFX/A29RyIsl56tkl4cWXGUZAbYeTzFJGW5V19CkG/ hBfLj144o/nm2VZaA+GguCsFqEHYfY4Yvl3mIGbVUdOIZri3bi/EyIij7SL9t1dPSB5s 4wQF2cAiHtqQJHcnt9m8CuoUhoKOuCVt7AzyczrULH05ggxyOfb3objee2s17EoF5Ab2 7kHmI1U+LYWGgTccHNNtvwvPG3rZ97g9jLahtoz3XUciogzJSn/uhmKQEiwLZjtRdyMv G9gfayOs4pytsoBAT+eYgSt8DmtT7Ir7jhnZj3LrdVSqLGABukircLVTd1lvpd6JUWqb 3HMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KU5GqqnHBwJE2oQY4NvVS8KLTvZHsylgeTI1DbvIUb8=; b=NfO5quWkIw7L4M14pM9WSqc5L+Yeuta9Kt3BTOrT2nHWiwThiC72+NMF3T4wB53QdN m5NjYD4yp1tXQ1DmaVaXRqU1dQnCn0RIeQXn2Z4xjz4cA8SOQbzvj6EQdWSuu4WbzKTt LsEdf8gPdTZCcnH5ZF5OylhkaeFc3bmOgETjoVkBmL9Qia1xRRf9DdUR/JZGUe3zKv9p mnzHfP0yqtnTcTP4Xjdg4bTr8wXk1ew88hvMTNpitQuJIR1qv8+kZ1d9fYyiNvs54udK PT5+7mnHzgFec6nujK7cV0iObLuXRyX/7wpSKqPEX1wKIqfPCxFBRBbluyOodpzZbNQM f+IQ== X-Gm-Message-State: AOAM530j5Z7Bp+fG03ehh4gpcf90mym2rdM1MbHsvzqnbsiMTdQETWNn cWGjxUtQKTMil5kFLjfVadxvi7kxXdR0nw== X-Received: by 2002:a17:90b:153:: with SMTP id em19mr2462621pjb.158.1627964100955; Mon, 02 Aug 2021 21:15:00 -0700 (PDT) Received: from localhost.localdomain (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id c23sm13718532pfn.140.2021.08.02.21.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 21:15:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 13/55] target/sh4: Set fault address in superh_cpu_do_unaligned_access Date: Mon, 2 Aug 2021 18:14:01 -1000 Message-Id: <20210803041443.55452-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210803041443.55452-1-richard.henderson@linaro.org> References: <20210803041443.55452-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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); }