From patchwork Tue Oct 11 03:19:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 614165 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2375485pvb; Mon, 10 Oct 2022 20:44:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5q9C8ODgR6VpUd0vTZnviBp76mcoHgEyE1BBeJf07NR+/zSZhINQipeekeGCnf0Fbie2EQ X-Received: by 2002:a05:6214:29e7:b0:4b1:c8f7:5ec6 with SMTP id jv7-20020a05621429e700b004b1c8f75ec6mr17664377qvb.79.1665459860757; Mon, 10 Oct 2022 20:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665459860; cv=none; d=google.com; s=arc-20160816; b=I7vQRVWuLI6t1z8l/3abHaQlEK2wzy+AGA7BRm8ZOIcowTcLTy7y3efTcWQ8HD5xF3 EI7q/Y8iaLVap13OYhkAcipgppFHyEKiLMukvJoqmoker0QqrfojgmkN8En0w4vpsybf kgC/waLRDgDQeXrVFiIP8iHEDg/02xljVYm8PChwJroyaIJuc+0aWjgfiohNE0EK+vyv udg0G6fSPD8fe0VjyHBVUwjCFsIMLGeauEahUpV+h5P6DJEzwktAzyarJpLaroYkQEK6 hV5CCYX3ba6Keu5d/c6CfgsAWLkm0QTIU+NzeXLPmyyKc4Q/YVlW6o3OidIFmR3nICyw /wng== 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=yLLkCOK7bzChQB4VCn3LE0QgfibyZ4Lat7LyMKKGuQg=; b=MSIbPsue9jY1gfflcYlKmLl4/QLLCHTkoplIr4F5gK5KE03Y8XknOCdxCkGjpe+H2D n0cvSgJ/frEnY3onELJrTNAcmKp14ForDBNi0bwjYvmSA5pW9xI9j0kYzRobPX3MXxOT OOc5nNDS+y7gMZlGsRw8763/Ok6/etB5/xd7qMHLj+Y7MTtpJnJAESKPDaMsyKyo2kKy C7+RqGcuOZOD0hlpGcQzoUri6uFpW224dvcyjstUsRVCeB+TSFnxK7LrTS9UKGyvjQMf UHxwYgAAWogwqPheYJ3tTtnAYnK/41cusYdhn5aPHDj5LxTUkwn3EgzcGgefvn/aZXkd egmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bsWsWIg+; 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 gs12-20020a056214226c00b004afae3652c4si6109570qvb.81.2022.10.10.20.44.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2022 20:44:20 -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=bsWsWIg+; 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]:58130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi6Bo-0007Ti-BA for patch@linaro.org; Mon, 10 Oct 2022 23:44:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi5oF-0002yw-GR for qemu-devel@nongnu.org; Mon, 10 Oct 2022 23:19:59 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:34761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oi5oD-00032t-Tv for qemu-devel@nongnu.org; Mon, 10 Oct 2022 23:19:59 -0400 Received: by mail-pf1-x429.google.com with SMTP id f140so12378175pfa.1 for ; Mon, 10 Oct 2022 20:19:57 -0700 (PDT) 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=yLLkCOK7bzChQB4VCn3LE0QgfibyZ4Lat7LyMKKGuQg=; b=bsWsWIg+qvdmH6FWPNsiw35tXhii6WawZXObtX4Y9u38J9yJqYVoYz+gzgdc4uiOX3 lYkmgMIV+ah86H0FDuqZA0NraW+B1ZlBYNsyC5BuFpUzG9d+hyr4ok3VQViczYeyoSpA lVoApaw6T7Uwsa0AnkItZ191LCNsr17FgFZ4FU/KI4mBMwv+ndU7DfGd+oK/6uBje8/G YGu9jZR5g38NPfnMey+xBXk35EqBpZ7jASQgI1Op8iLfekFghhXklDurGbnNbptbKAIg GMXzsbNG9X4HJkkQ3tZPlVB7GgUx2Xq3vIIeVggl2r39xMnINnqfRuht46ADS5MDDKgo nsZA== 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=yLLkCOK7bzChQB4VCn3LE0QgfibyZ4Lat7LyMKKGuQg=; b=IftsFbX/GmL95Oful3yIYWnWLmwU39uhQnGgcwFf8ccK0LZoSLyBtgyp+XfOEOxcfB n0Kku67HU4ovYnHibd2/T/BwEJGysNRuKVgN7zm5MCfzL+4nH7gwYY83F++05y377Zjm YzEG4AI3Apu1LXHbtjrKTE46aluqMThG9a8X8PddHdZuXTdZN2pQn7sQu4Qc135PSFgp Xx0/O/nRUZ7o9OieXhrGUHXxvakHXZLE9lRljvH6folLpZOvEz9tE7vQfQVb0hysZsCN JjY3tymvljWo+92cYJga1b5DVS55YrXLtVBcRq7Zgj/uia0xdDLkcWf2U5Pqqpl/0gOm bHkg== X-Gm-Message-State: ACrzQf3byFFt88Y11TOZvEuQpu6ySYLUXtKuQUA6vONcU2MR9vV6qfnN EMCc6rKC1ddVAlkBQ/lp6srC16UnlT3biQ== X-Received: by 2002:a62:144b:0:b0:562:38de:9a0e with SMTP id 72-20020a62144b000000b0056238de9a0emr22981955pfu.78.1665458397156; Mon, 10 Oct 2022 20:19:57 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:5aa4:aba1:1c91:a9b7]) by smtp.gmail.com with ESMTPSA id o74-20020a62cd4d000000b0055f209690c0sm7663567pfg.50.2022.10.10.20.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 20:19:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v4 21/24] target/arm: Consider GP an attribute in get_phys_addr_lpae Date: Mon, 10 Oct 2022 20:19:08 -0700 Message-Id: <20221011031911.2408754-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221011031911.2408754-1-richard.henderson@linaro.org> References: <20221011031911.2408754-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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" Both GP and DBM are in the upper attribute block. Extend the computation of attrs to include them, then simplify the setting of guarded. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 2227d2a2fd..8db635ca98 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1079,7 +1079,6 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, uint32_t el = regime_el(env, mmu_idx); uint64_t descaddrmask; bool aarch64 = arm_el_is_aa64(env, el); - bool guarded = false; uint64_t descriptor; bool nstable; @@ -1338,7 +1337,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, descaddr &= ~(hwaddr)(page_size - 1); descaddr |= (address & (page_size - 1)); /* Extract attributes from the descriptor */ - attrs = descriptor & (MAKE_64BIT_MASK(2, 10) | MAKE_64BIT_MASK(52, 12)); + attrs = descriptor & (MAKE_64BIT_MASK(2, 10) | MAKE_64BIT_MASK(50, 14)); if (mmu_idx == ARMMMUIdx_Stage2 || mmu_idx == ARMMMUIdx_Stage2_S) { /* Stage 2 table descriptors do not include any attribute fields */ @@ -1346,7 +1345,6 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, } /* Merge in attributes from table descriptors */ attrs |= nstable << 5; /* NS */ - guarded = extract64(descriptor, 50, 1); /* GP */ if (param.hpd) { /* HPD disables all the table attributes except NSTable. */ goto skip_attrs; @@ -1399,7 +1397,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, /* When in aarch64 mode, and BTI is enabled, remember GP in the TLB. */ if (aarch64 && cpu_isar_feature(aa64_bti, cpu)) { - result->f.guarded = guarded; + result->f.guarded = extract64(attrs, 50, 1); /* GP */ } if (mmu_idx == ARMMMUIdx_Stage2 || mmu_idx == ARMMMUIdx_Stage2_S) {