From patchwork Wed Oct 13 02:45:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515675 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp6080456ime; Tue, 12 Oct 2021 19:49:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTywRdZSIfpN+c5yrDx+YDBlkmn6YB/u8+ctQhIqx+hcP+yiqGbYrkanlZ+9pCX4mCMyJI X-Received: by 2002:ac8:5809:: with SMTP id g9mr27221306qtg.161.1634093377334; Tue, 12 Oct 2021 19:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634093377; cv=none; d=google.com; s=arc-20160816; b=oy9UdQFMiTq/J08KJRXZeBnmSqIx69TtFU/iQ7a2FEZ+Qns+aQMGaXtihBXjc66EbG 7rohvk1DnbtHVPG26NSAIFnlx/VPBfZnuQKrk0KcLV3z8Q1NAsRQV4k+lA8usPRCTWfj 7BI/T26Qbz9aJcJKeDWzMFX5StkipITEW4NkOdmNcsrgrQBJCKPvb1CFmodh2lCOSJ7d DlAdU5I6hrxHxHBbKC2AEzSpB9oFYtwb4dId6e/xSieURVIFWohuqyr1iTovRBsEHmUk J9EONLsedv/WplUkI4EsY6bY8U7CejGu/3bX/bGoJH723AmwDDcNIzzvseEgCSPgCZDe HRgg== 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=SttDrREQq6hsw1e6wi6gOFRhVJLqzj/IGCKsRbbMdzc=; b=yiiXkNyT8Ukrhm8U2OSYmfJq+rtR0FGVPBZ97Kf2LCNDoAvq6jVGq9FFzyng6btd/V 4v1kQFFX44fmhPbP+uDYWsgNJpou0nMgf70GixHTiL1P1CX5b9Q/Q6XYENhYAkOlCGRn 46vPF5+UbzOSGzjcTZWZ3qUQ8aVBBzFAgGBh2c8RcKc2deZ0jsLBpU7/nGyJF3yiI9Qb tOlC/7QJwByy8w7fyU+/bIpCPnTBA4kDO2mG1cb4gbGvjwdFRMJ88Mkc2PjAxFxsiTc3 KMqpVXr3VC3Xe2CljB3wnAzdi6YDNzzaYRdKMnfST4DkmOvOYb5jzrpfHj8+MKPVlG3O ct8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JsaGtVZ7; 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 a28si8729236qkk.231.2021.10.12.19.49.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Oct 2021 19:49:37 -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=JsaGtVZ7; 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]:49194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maUKm-0001pl-RH for patch@linaro.org; Tue, 12 Oct 2021 22:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maUHc-0004Dq-Nm for qemu-devel@nongnu.org; Tue, 12 Oct 2021 22:46:20 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:40829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maUHa-0004oi-V9 for qemu-devel@nongnu.org; Tue, 12 Oct 2021 22:46:20 -0400 Received: by mail-pg1-x533.google.com with SMTP id q5so880275pgr.7 for ; Tue, 12 Oct 2021 19:46:18 -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=SttDrREQq6hsw1e6wi6gOFRhVJLqzj/IGCKsRbbMdzc=; b=JsaGtVZ7CGOJJh7a3y9zj91s/CpsEhKVA9bqf7S92PSwSSiKMQYdcXCJk3qXu8+WiI lRLnQfeTxP+1edrSoKmDa0/f30xNEHPR+DcwyTSfEVxYk36+JgIFaVhddEpLj5pIKTjR TJKHvgEHp/bNz/sjnCabLTzPgK4PncqZfATGzn1MDh2xlZ93d9eMOoBoo1kO/nfzPxZ0 voyWZEidPt3ksVdcTAxv0CMOt8OK/o3Sx/2I4tatWxhGi6tzmaQ9tGGTFM2zR/MhNX0d Z6egmZbtukmh/ojvVU039kGxDotagBQiC+Fak+w8ItJlWtDJzztvZItSVKpKf3kvZWeF c9hQ== 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=SttDrREQq6hsw1e6wi6gOFRhVJLqzj/IGCKsRbbMdzc=; b=y6jlBV/bbmbAA/ZmdCnMbU6R0qb1TdHLiMsHsKojDUTk93ovL1WhqmPMkg987K6PyF xcDc6l5+uc9RRmQx5NS6qkQ7wxpXpr1yNNstgrYT7yGNzqxIBZQKPx4G3ZyN8aEwVeM/ dzW6LC11YslgtqCOyi4rjAs/udeiNlyqSQuwy5g12fap+fkvtXEduP/99DnuSZB27vxS WCTFTQ8/VS+lrBXY9/tODTkBp2kurD2gJGj36hCCHPIWv6J6hOuSxXNa4perSCNO9Tcn ayylR/NYnVgPzEcXt58ptT6wQ7Rzc6oW4WVsfZVGlzcgyK/Z3RKMfq12RpBTvVx/2aoj 9rtA== X-Gm-Message-State: AOAM532xfGMqGJST7lA3KdU/nF1wqoAKudRhC+hWdNtCj6MSIiD+j9uc HWcw8x1kDq4nCxXAuDjhJU/PgVRrsh4WtQ== X-Received: by 2002:a63:4a18:: with SMTP id x24mr25433439pga.209.1634093177614; Tue, 12 Oct 2021 19:46:17 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id qe17sm4855014pjb.39.2021.10.12.19.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 19:46:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 08/48] target/ppc: Set fault address in ppc_cpu_do_unaligned_access Date: Tue, 12 Oct 2021 19:45:27 -0700 Message-Id: <20211013024607.731881-9-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::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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: Peter Maydell , qemu-ppc@nongnu.org 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: qemu-ppc@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/ppc/excp_helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.25.1 diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 88a8de4b80..e568a54536 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1465,6 +1465,20 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, { CPUPPCState *env = cs->env_ptr; + switch (env->mmu_model) { + case POWERPC_MMU_SOFT_4xx: + case POWERPC_MMU_SOFT_4xx_Z: + env->spr[SPR_40x_DEAR] = vaddr; + break; + case POWERPC_MMU_BOOKE: + case POWERPC_MMU_BOOKE206: + env->spr[SPR_BOOKE_DEAR] = vaddr; + break; + default: + env->spr[SPR_DAR] = vaddr; + break; + } + cs->exception_index = POWERPC_EXCP_ALIGN; env->error_code = 0; cpu_loop_exit_restore(cs, retaddr);