From patchwork Wed Feb 22 02:33:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655676 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp456921wrb; Tue, 21 Feb 2023 18:38:03 -0800 (PST) X-Google-Smtp-Source: AK7set9PFgZUEwUBry9j8iAaPWCPKpMIPdAgthxAVJacNg/o/zltlnYHHGqRhXwwlEW1GAlvB3Cv X-Received: by 2002:a05:6214:2a86:b0:531:85bf:362a with SMTP id jr6-20020a0562142a8600b0053185bf362amr14881393qvb.23.1677033483633; Tue, 21 Feb 2023 18:38:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677033483; cv=none; d=google.com; s=arc-20160816; b=0TO3UZV89L0moMK8vPlUrLCfvK5SqCoQUhNbqjwcO+5xTG34HiNl79Bif5eEeXGXYk RLO+8rrniIi8H9p1RE1DA4SMfCuVLHs7hrcKcUeTx4fEF2lqN3+mCJV4YRXoLe+Qh+as FXquN3YTwWoEC8drbpWR/3XpGie/x7hi/5ma+QQu99YQWfkE6SenFZ6kAXcuIQbbavI9 O5d/aRk+mB618teKKVBDsl9BNBfV1LUrm4paTZkdCEddpF8L+ObSfFagJLI8xJkKu/2f QJnToMVDL0J0ckHVY9Fzs22pxocBHvBBdwmnsRcH3tNDHW/bPlK0cVjB0a/rk3S/NivG 75Qw== 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=PhxQ9e9pVV9RyCPmKQ2M0WUBfbr0akWOWFlqn9fFR48=; b=OeihI6QOxD6918CqT1XN5G4jITIhea++j7g+J9vPq+eTDmyy3nZ1JUyRxFchS1WbK+ XSZsJLdD9yLfHFPfljKsG6MbttEIw9SwW7sh9SO/t6qla9ZeUVuYC3m3LWhXfnJscoDS XQYmN7luZQEMmAS32DkNLqYiuOeXQeonNSCcBwZjW2Msg1ei/lEKIK6C5gj7hgxfff9J XkkZ0cFC6l/w5CEkwdcvJ2gTvS6AJr+MaG6mIUNMX4F5TaEqfjV6jDbQxwIli+2wL/Ks WY3OBwJANZuaSrBN49aQ5cISSm6aQcvBoCqbKqcxCugIXZemysOQimjWyZYGhUBHNfhU xNFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ElH/lQgU"; 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 f25-20020a0caa99000000b0056bfba05976si2079720qvb.342.2023.02.21.18.38.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 18:38:03 -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="ElH/lQgU"; 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 1pUexU-0007ht-By; Tue, 21 Feb 2023 21:34:16 -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 1pUexP-0007Zh-NS for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:34:11 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUexM-0001iL-Jy for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:34:11 -0500 Received: by mail-pj1-x1031.google.com with SMTP id c23so2379442pjo.4 for ; Tue, 21 Feb 2023 18:34:08 -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=PhxQ9e9pVV9RyCPmKQ2M0WUBfbr0akWOWFlqn9fFR48=; b=ElH/lQgU1lUWROxso2hhGUR7CpV70Htl3OQkwUrxntluMvqtXu1LEXdAgvT7zKyLRX /MlM1+ziqlBbBW/h+IEW81iHMA9xey0wm2VmmfS6puPIooLD8ntrnmBtwZpkYRlXO3Yt g4olycpluVe2VZBc7VJCVgq3NeEQ+mYsfQk8N8h2Y9HRGybbMgjlc1VKPd6PtTc8R+H2 mX+hMFn+Q4qe6neYvl4w9bUKEm4RC4rzsFaoMAVM9xM0yh88dQa8zcL7dM00M1q7lrTG pZl3YIEAOflwR2kX/qchxoHxiYyg5McGWiBsEbn6yZLSA1pG7Rtn75drpf+VTxYvL1nx izHg== 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=PhxQ9e9pVV9RyCPmKQ2M0WUBfbr0akWOWFlqn9fFR48=; b=RJMI9aPpgjCU+5gqPTFkAayHwlNKC5ArshN6MlCqKUbszp9M/5r1RmUrc6nx52QXos oTqPkl73Uo4knXYyuQkbKQO4p+yPZz/S3lIHUIa7qvRelou5QrE2CyK8lFyyyU8Jz/Lf 6ZA6uMYGjdJJkyT/GN4NBg8/6NdfwGzwUCRXzGKIso2d/TJRy55CNlLYSIN/0viMGa0V HTvn92/5kw8LRGrLBrhOD8/UerPkOrA23G/qth5HVaGmimfDSI3/HUBqaNrcNwHVDKOQ mJcaFIRqcJ93RToqAB5Pk+F1lYAbt5YkJwkYRRyMruRLBaej7Pj8mtUn1WodN7EEzMSr N+Kw== X-Gm-Message-State: AO0yUKWeLZcu2thdlXxylpNsd708joq4FPS7wQr4jpndcDoHoPjnCNRD lGNHzVgkv9COOHWeEFbKv9vFmDEClw0vnELB/Do= X-Received: by 2002:a17:903:2345:b0:196:3feb:1f1e with SMTP id c5-20020a170903234500b001963feb1f1emr9489627plh.47.1677033247402; Tue, 21 Feb 2023 18:34:07 -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 k3-20020a170902e90300b00198fde9178csm10520112pld.197.2023.02.21.18.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 18:34:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 20/25] target/arm: Use get_phys_addr_with_struct for stage2 Date: Tue, 21 Feb 2023 16:33:31 -1000 Message-Id: <20230222023336.915045-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222023336.915045-1-richard.henderson@linaro.org> References: <20230222023336.915045-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- 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 6fa3d33a4e..7e1aa34d24 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, @@ -2859,12 +2855,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. */