From patchwork Tue Jan 24 00:00:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 645983 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp2471496pvb; Mon, 23 Jan 2023 16:06:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtbmcCoSoEO8voMWg9W2aRtCpVJQRLXAy0arAepsgyjBUOG8kZ8UmlTfN4Z0xohQMXFFNWd X-Received: by 2002:ac8:5a95:0:b0:3b2:ea9b:76c5 with SMTP id c21-20020ac85a95000000b003b2ea9b76c5mr50898000qtc.41.1674518761778; Mon, 23 Jan 2023 16:06:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674518761; cv=none; d=google.com; s=arc-20160816; b=Z7ag+PPA+V76wYHhhN4ExbMR+4HVvfbagBKw9DYY7qv4c8UfA2Yw6qn4yXD0sH+0rN Lfs77AlScfvpB7StpGJ8MjJwgMOqrnh40kbz9d00ahZ5eSUy8FlFh3QAeZrHeVQyE04r N6YWRBQA2aD27eOXV+jTHShX93Gu8Hj76bxyE3aVaDNyd479bfmTcyL6mkXiKHLWNqf2 NgN1ML8W3uQGHt5Rm3CwCxXp7T/tgMQXDXxwxWOGq1rOuorJy8D0WRD84++CGH+BlCNG 491VGZygb4VI3rZNbBAx06ekEB/788KDQt5o0t7VVEV8RfJsMx/7+FINkk3xMaPb1MB/ 1JKg== 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=mN9cAMzgJVhB9gjvwFWE29O2HsMxPZwiEF+AaYdvZqg=; b=yfXNpiRw2qbnjT77FzqNWO1DifO0TOSK4t9ARU0DC21COfNSmWeYx4UvGPv9GGGNR3 F7n3O4JJqGA+FNTMyaMUG5F73nVPZgwNNk8J1b0G6CKCjZpXpwnsKvlClrO1sNIDbnhY xFOdoT8gbVieZJkkIz+SBFe70IFHHYcupuDGXgjiIRmZhpQ1/JU7Xy5qvUyOuSWffFFU moqA9XelAicIMbBi1kSjfK3E4UewojZRlBPSagWZOUWWynN0PCMqPGBkqFLq+tjRtgST gNL1hFqT13zHpG4Uz4zwyv3QjMaT88osa0u45WWpsffS2y0bSgvIp8rjJ+FGvhEFVBZs meBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iUOr2gxP; 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 77-20020a370c50000000b006fc8354707csi460483qkm.529.2023.01.23.16.06.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jan 2023 16:06:01 -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=iUOr2gxP; 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 1pK6kb-00016F-98; Mon, 23 Jan 2023 19:01:21 -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 1pK6kZ-0000zP-Sd for qemu-devel@nongnu.org; Mon, 23 Jan 2023 19:01:19 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pK6kX-0001yR-9K for qemu-devel@nongnu.org; Mon, 23 Jan 2023 19:01:19 -0500 Received: by mail-pl1-x630.google.com with SMTP id a18so559306plm.2 for ; Mon, 23 Jan 2023 16:01:16 -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=mN9cAMzgJVhB9gjvwFWE29O2HsMxPZwiEF+AaYdvZqg=; b=iUOr2gxPtjgQ5rX94H68LLu0v0+vSNkJcOqIinvyBPsiQVY2TGTJJZ1QONkfMpnI1J cTfVhvUyyHE3c15c88dNtSOdYL6nApIrH3GWMf/F0i0WCD8FpUDW2ptEQWMGfQO2vwFn 0JtN6VgmsoOh0W+Xr2cfKIejLyMZkk0z3iKYk8a7z2/ChR2qpDrAN/Vtra2WIjc5AuKw G51UZMHtZy7ieD0pTTxmoKyHaXbqSaldhuynbowLr5MX3DrKiP3QTzuTRxniYEzSwwis nr7sbtEHUiljenhaW8Mo5DJV0wDGskuxIUHv45DxHJd8TSH6lsdLsVyx8Ue9C/TlYpSJ gERg== 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=mN9cAMzgJVhB9gjvwFWE29O2HsMxPZwiEF+AaYdvZqg=; b=a35En8eH+K2YtLmrBSXo3lcPYQFcDNosf3P+zf1utUfI8FRWrC06tEtJiUjLeVJTkE 0CmXtAGsub/W4KZGDUfnQvbxsY0/lhl919OY3UL/KNiSC4CpL/RG8HgpuE293BgRH+F4 AEeThvaI8UgjM1cFeVfa1UrJ/FdBYgq+gkTl5dB2kN+1VKxka2sJi0MbvANSJgpGTRoP fD/CLMsLkBJmFJoF0df4PLFiGOzjRElI960gH+SIzve0vliLh3EqSUL6vtNo8YB/poXO kAe23D00nk8vddKOxe24N5nAkF+LK5oMhnuzMgXmdPnW4OtFT0JAo9GqUzUhYEYXUEm9 rDHA== X-Gm-Message-State: AFqh2ko4F60/zIkSHrpjPQpJsDDZF0/S5T3Z2engGGACnVVfLH8IWnWp lbvepA4TjlKt0N0Z+jybJYxWGgq4xxiX52Y7 X-Received: by 2002:a05:6a20:4295:b0:b8:9c66:cd64 with SMTP id o21-20020a056a20429500b000b89c66cd64mr34076018pzj.14.1674518475853; Mon, 23 Jan 2023 16:01:15 -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 x21-20020a056a00189500b0058bc37f3d13sm174104pfh.43.2023.01.23.16.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 16:01:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, yier.jin@huawei.com, jonathan.cameron@huawei.com, leonardo.garcia@linaro.org Subject: [PATCH 17/22] target/arm: Use get_phys_addr_with_struct for stage2 Date: Mon, 23 Jan 2023 14:00:22 -1000 Message-Id: <20230124000027.3565716-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230124000027.3565716-1-richard.henderson@linaro.org> References: <20230124000027.3565716-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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.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 --- target/arm/ptw.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index eaa47f6b62..3205339957 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -32,12 +32,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) - __attribute__((nonnull)); - static bool get_phys_addr_with_struct(CPUARMState *env, S1Translate *ptw, target_ulong address, MMUAccessType access_type, @@ -2854,12 +2848,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, s2walk_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. */