From patchwork Tue Jun 20 12:44:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 694510 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp287172wrm; Tue, 20 Jun 2023 05:49:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48sNcjhUa9BqV+EKV2yWHfxmfSok/+r/nh5yBY3Bw9GlYJmEWmW9lkyI+qUWrthty0HOaw X-Received: by 2002:a05:6214:1303:b0:626:2bf5:d532 with SMTP id pn3-20020a056214130300b006262bf5d532mr17793581qvb.14.1687265361857; Tue, 20 Jun 2023 05:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687265361; cv=none; d=google.com; s=arc-20160816; b=Imw4QYXiUfRCunbLvO8ifovMkWzNqF8AH7bivM0Mj8rw7lx6QRWgoWyYLP3NzOg51m TB7hNLDvEL57jR0nvOIDg617FmIRgzO7vqGRfq+3Xay2uwxqqY+IFqtdAPBONwNm49Zv YQuEDOw7iHtNmb3XWf1vBT+aCGFsWSYFRCetiZCqjazIXn91eIMNb7dfg++dPtxv8zgn e9V3LT01b51pcxhA017eFG6AV1carkzO2VyVc2K3QeKfIHnAYWdDVAX3aBAWVRwU12px SQ3IBlcMuct43PZoV++Ahg4HJrghgUD5cOeCDMnGIyXGO3x4Kd+R6q1ICH0+16hKO18b rnjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=c5AwidcO4tfQ++xn12IPRLJwHDY5LLSrHnZYAWEeDsc=; b=X7T1jVAtWE9/gSwOYK1wJtzZ5q0eS5qmYRbHx+DcZwPVbxxuHhfnsqYdsobYGhlN9s Ebun4JVE4YjmrzHKy1VJCHjPzr/Ye7B9okF4Ihp31mdmFdv5dwCqoInM7NxnoYFvmOa/ th12Qi8Qb3I81y3PO2OKFx9essJVpN85TCzploM80kFRdK+ZQ2IWcgbo+eQ1yRFRQGFX t9FBQrCFjt2/P979nsuP0WsMFJH7B0XVg+5WNu7wyKiND30X5RM547PhWFh3dDbvTPAZ AuWf2tke21SsjfM3BOfGFGFByzNKXITlBVj0kAqWwz2VWYKZSQ9eBk8fDFm/brLDPET0 8wFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oHA1ewzo; 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=pass (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 kd11-20020a056214400b00b006261ac14745si774618qvb.440.2023.06.20.05.49.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jun 2023 05:49:21 -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=pass header.i=@linaro.org header.s=google header.b=oHA1ewzo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBaix-0001gH-Aj; Tue, 20 Jun 2023 08:44:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBaiu-0001cR-1r for qemu-devel@nongnu.org; Tue, 20 Jun 2023 08:44:40 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBais-00023w-AW for qemu-devel@nongnu.org; Tue, 20 Jun 2023 08:44:39 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-51a2661614cso6201841a12.2 for ; Tue, 20 Jun 2023 05:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687265077; x=1689857077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c5AwidcO4tfQ++xn12IPRLJwHDY5LLSrHnZYAWEeDsc=; b=oHA1ewzoXz7Y5z4TTe7NiK1UdbgDTcmyTx0gUwcFk4XhPb3M/rwwZy5/3zKBpS1Qrr NO1ixT9nr14S8DGm5Z8nBpCkzs9JcKZAce+6DpxQqiTiqB5pHY9+lNVqZsDw8J+/dxmX ckdcD3nkpDpMIJwpiYydp96aLaWIThNjoHjLZc2UDVoU8+dfZSgNmUFKCg6PSCa9WOE/ k2eu42zaldgLqP2a7RCytLfwZ+yV02tBVBrTvirY1mTk6WuEqDADMoX4nLB7etZ+nu/o XQtfmGs+JhOXAOGXtr93661BpmcLJYyyCzxWQhokTgsF67o69VVzhqi8HAKXnwye+HnS gwbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687265077; x=1689857077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c5AwidcO4tfQ++xn12IPRLJwHDY5LLSrHnZYAWEeDsc=; b=XHDrjkEClaQaAmZN/Fra0KMGe54TUgNN6JUeP9xMeQmsyZNFfHwxa2WgNBazZj25pi b2/0ymYNptE3kFg3DzEDTsM2chFoxAsJqKoxOzhVXLVUgXL8wkRLH4OANetCyts3wMGV FappfgZIHC2eBE7QqMzB9Hde0/iz3scQKgQi2ZYIRlGQodKcJmd1GNbNS7qB3f6ui1Xk 7pVMyaBjVbDmhHoEZALlXnyvxMSRWnELfPIzMM9h4HZImlBQzSINpbtavykN9BiF9P1O g1H+SjR8WXwDv1Esp9N3kgQa0Gg5TV6RhpBWEtDr77cMwL6JZvLx7STEkdeF0xNqAZaR D9ig== X-Gm-Message-State: AC+VfDwhrGUCD90Uf4btjH+MMSB0xeUzwn2CZoVpZQAPGjP7mxWO6wKJ cyhAKFrLr4aX4UZ6Obl45AKT+5EskkM4CuVUhKmgtOC3 X-Received: by 2002:aa7:cf19:0:b0:51a:313c:4407 with SMTP id a25-20020aa7cf19000000b0051a313c4407mr8210666edy.6.1687265077016; Tue, 20 Jun 2023 05:44:37 -0700 (PDT) Received: from stoup.lan ([176.176.183.29]) by smtp.gmail.com with ESMTPSA id w9-20020aa7dcc9000000b0051a313a66e8sm1142541edu.45.2023.06.20.05.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 05:44:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 16/20] target/arm: Use get_phys_addr_with_struct for stage2 Date: Tue, 20 Jun 2023 14:44:14 +0200 Message-Id: <20230620124418.805717-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620124418.805717-1-richard.henderson@linaro.org> References: <20230620124418.805717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-ed1-x531.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This fixes a bug in which we failed to initialize the result attributes properly after the memset. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/ptw.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 558b4b731b..7c4526e2da 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -39,10 +39,6 @@ typedef struct S1Translate { void *out_host; } S1Translate; -static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, - uint64_t address, MMUAccessType access_type, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi); - static bool get_phys_addr_with_struct(CPUARMState *env, S1Translate *ptw, target_ulong address, MMUAccessType access_type, @@ -2886,12 +2882,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw, cacheattrs1 = result->cacheattrs; memset(result, 0, sizeof(*result)); - if (arm_feature(env, ARM_FEATURE_PMSA)) { - ret = get_phys_addr_pmsav8(env, ipa, access_type, - ptw->in_mmu_idx, is_secure, result, fi); - } else { - ret = get_phys_addr_lpae(env, ptw, ipa, access_type, result, fi); - } + ret = get_phys_addr_with_struct(env, ptw, ipa, access_type, result, fi); fi->s2addr = ipa; /* Combine the S1 and S2 perms. */