From patchwork Mon Feb 27 23:01:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 657159 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2617447wrb; Mon, 27 Feb 2023 15:05:22 -0800 (PST) X-Google-Smtp-Source: AK7set+m1f98FYXrEcBdUqUXqmlN2/UaYcNMR2SU1bIMPY3XRMTTo9SRi6RuRB6UNLDGysUT9exB X-Received: by 2002:ac8:5a8e:0:b0:3bf:d184:7ca2 with SMTP id c14-20020ac85a8e000000b003bfd1847ca2mr1647458qtc.21.1677539122427; Mon, 27 Feb 2023 15:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677539122; cv=none; d=google.com; s=arc-20160816; b=HkmuFFW/brTiSt7ppdLumpfk43QB9rVqm9xbq5cvETHLEeBDPhNmETxCOOLX4k6Kyq yhLMoCbwAeMSJauroGP2yjjTN1zpm2P0UZAL1I/FS6kzCNqROQkYN6NDCQ9dqaMAJoQM kbGGSBrhuh7wME2Z14PdrHrV++Kh7gG51EuP+zbn/9Jxm4SnrE+DlXbgwDZzT7dQkU+X T1fVsx2OJTxk9lmzd5dfC2fbP+ZNGAw0SXN/BiF7QkPgmpL0RXfqj8Sj1XP16ZAdS5sD NKMMBiozJIQsAknr+pfWm3Gl9GlbL8VXtjTaxMdRkv4xBirVdwRfGpSyeisqHIM9E0jT +0PA== 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=WXHoQLeqrbXEjWVkbOYob2JhZTOWiyKZZ2KU5aalHNo=; b=adMOJRPbaC2umoeuLqOvEJUu+dKBTjwMSLBb2ZbjBnKeR/tBPD6j0fVB5zMBiRvdeV njM/zSt0A3H1KhAIRwa3SttIJmz3g+PFKukZ0288b31a0Callinr5xrPxwlpyug+nvhE Y9mnAaldR0C4gRRVsrRvWWPIdl6spgDPU1qX3ceCxJ0JNOmRVrj0OddlYu6LKPxLRCm2 Jjvm+0Lpf7qLVWiq4yL4VkdDDFbLYNXl3UrrhJiotl+frR540NDZYg5nN+nGWsMyg4nu 2BnqgW15LqnL7AIVk0FKDF6ACPjl1aRPe+aTxBjwC+qelhvqMf8Xc3q0us+ySx9ky78J 0qRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gdidk/Vh"; 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 h22-20020a05622a171600b003bd1a4f96casi7706116qtk.328.2023.02.27.15.05.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 15:05:22 -0800 (PST) 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="gdidk/Vh"; 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 1pWmVR-0008OX-0h; Mon, 27 Feb 2023 18:02:05 -0500 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 1pWmVJ-0007xI-F7 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 18:02:01 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWmVF-00015d-HN for qemu-devel@nongnu.org; Mon, 27 Feb 2023 18:01:56 -0500 Received: by mail-pj1-x102a.google.com with SMTP id q31-20020a17090a17a200b0023750b69614so7731370pja.5 for ; Mon, 27 Feb 2023 15:01:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=WXHoQLeqrbXEjWVkbOYob2JhZTOWiyKZZ2KU5aalHNo=; b=gdidk/VhFLaj3VqljZ5o1gIlHpzeITDJPdc08wuGRMklA414hXkOSxLa2Lv3Z0jI52 S/hMIcmkd+cfIA/FbGS/MXluTF94GNmR4QmHPH3d/2GL1lcodTa66iVYjqZtT5NuPF6u SIO6KvUjFM2YtF6gIxIms+biPOMDefiIf/TNIzyNtUPHBfO4s4N3D6rhM1XL1vifUxC1 LNhYzAfTeesMvbv13I00XZiuealgk4ft3FsPfh6KqhP6YH4lE5YLkmjfHdp6f2yDFw6u dzy+gHVD9RfbZz/j53Q0bUCM7nnwt+XBIs2E7wiL2bh412nqPhNm6vUAmwhSuFHGY3M+ TEHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WXHoQLeqrbXEjWVkbOYob2JhZTOWiyKZZ2KU5aalHNo=; b=2aEs4qeHjfybKlWoI06clz2n0PvX4f4ckDV9/Pk1tOZlt9fyRPisWrHBTYKCAD7uML PaVJDj3H6PIWmk3K3j4eB75NU7Pbt4rAjAWOhRRJpUXC242yLOjzLO+AP0ShmZNlgFrf PofhhmWuJ1upq2V7BA11lnK9wTVT9SBezp4kR04GNeckBaFYk6RueYpyxY0+RjpF4ZdT 6N/WHmOhQJEVrHxKiovjVm7FfHrxU/Jd++ExdVDqIH2EilMbo88UtBvWHcDVaaJ/lTuo jAhKzPpscGPtMmgd0nQHECP/nASV31S6Grzjo/jD8cMlMyfZUJV2k/495i38XSK+2HSC YOsQ== X-Gm-Message-State: AO0yUKW4SAUT/6EfFgwoZprRi8H81/di7KO4hSWJnt2Vwq6Xc6pZ4nLX WnmZ57yaO7rTH+ZeuT+RVKXFs5ucjsPPG0thDtY= X-Received: by 2002:a17:90b:4a4b:b0:234:b786:6869 with SMTP id lb11-20020a17090b4a4b00b00234b7866869mr831600pjb.26.1677538911720; Mon, 27 Feb 2023 15:01:51 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id u2-20020a637902000000b0050301745a5dsm4406130pgc.50.2023.02.27.15.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 15:01:51 -0800 (PST) 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 for-8.0 v4 16/21] target/arm: Use get_phys_addr_with_struct for stage2 Date: Mon, 27 Feb 2023 13:01:17 -1000 Message-Id: <20230227230122.816702-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227230122.816702-1-richard.henderson@linaro.org> References: <20230227230122.816702-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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=unavailable 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 eb3f37495c..95424bca4c 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -37,10 +37,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, @@ -2863,12 +2859,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. */