From patchwork Mon Aug 22 15:27:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599184 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp1873911mae; Mon, 22 Aug 2022 11:28:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR7GUXod+vEJfNlL4iaa8jgfFNI1HFVAgPCAbbxn8WT1cmEyL5dljKG76TcVVYHfjR8HygJ3 X-Received: by 2002:a0c:ab07:0:b0:474:9c36:413e with SMTP id h7-20020a0cab07000000b004749c36413emr16437530qvb.56.1661192881036; Mon, 22 Aug 2022 11:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661192881; cv=none; d=google.com; s=arc-20160816; b=GUHLOJ060WN2aOW+KY1k6qIww/UoV31VgwIXxjDoAZo9AKv7Gyw2fOC/t02o8RGnP/ 3FNPY5ewCayWTyczkENgFviqXrKvC24NX7DspwPjkiz3l8bFBAECUmSd4Vl/93/3AMKW 2jVNECtTPTbWaKm1YGXA/9pwlk2IgagWRbRY3AyNrg8sTwymknLy0YuqpOR8ivaFJMZT wAo90k1eINew4/d2nDAFlfM1H/UoORqs1XTQw3WC1VSq1smJIgb9nBilRWgNkctwQ3Us +8px/8+AMcn0MEPdb5cKHVUMsIpVqa8PY9RV0iVXRFLRd0uN74Dhk3s6WrEKdwLzCzUj xJ6A== 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=717fzziULIfrv0GZaFcKnjtRk3XAFj/8qM7MoF3/+do=; b=GPJHkGBafrYIDqODfen6shdvbi/X1SNErrbYAkuFIup9GrJSwJ0n0J9QrvHZylb5+U r4oLF2ZMYmrY6O5FmCgGMmortdHMvtrxneigf8XA+6uSjoER4G0FWBDIPsR1OI6AJNKp g067UapMy9qBzgL/9C9QBzcQX0KO1BGgf3IVFPqBQXx7atpp94fyWR7VDvq5gEP2MRH2 It9fjQxdxmfqyuCM3FFGe+XNUVhWxCWmwQ2jJhM0ooaJqakjSJB2qZ7/Lvl5DuV5TjW+ srSw2T/1w5xJwx18TXAFEaVRI+WDsM1Lw/zQNB9eoNOAzcgcvjA3lCKKqKylACROT9Fg 5fNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="omKxley/"; 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 fd3-20020a05622a4d0300b0031ed2695f88si4920029qtb.565.2022.08.22.11.28.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Aug 2022 11:28:01 -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="omKxley/"; 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]:52314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQC9Y-00085q-IB for patch@linaro.org; Mon, 22 Aug 2022 14:28:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ9P6-0004ok-My for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:31:52 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:45708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ9P0-0001i8-4y for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:31:52 -0400 Received: by mail-pj1-x102b.google.com with SMTP id x63-20020a17090a6c4500b001fabbf8debfso11663579pjj.4 for ; Mon, 22 Aug 2022 08:31:39 -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; bh=717fzziULIfrv0GZaFcKnjtRk3XAFj/8qM7MoF3/+do=; b=omKxley/3yr+rIUu3wY3+x6pT4C8/r5M8W9+CWcEKcyyHXLzXQ/sldfdbDwZNMIK0w 21GK5i3RpQAoIsW48nVITOfAV8KvybMdcEGAeQ2GBQwjcGA40AzYISbGZH0DAHuqzjKQ VrgPM6e/p+Q/5liy6TalDUYfR6x/0lbK3bC2eNP/8mmdClT3CN54PWbxrFIXxtsIMhF+ IjmoDmnC20FKc7pC0LzGTzbFMgqMhHkXQee5tNcEgXBNkKDw1BkySmX16hdgYQXCLfQA PaMT7iDNqsZK7439Diu8NBAa6KUISJPiHjsUipvMABPh9B5JrmcwfaDpEze87FXwaYtf aqlQ== 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; bh=717fzziULIfrv0GZaFcKnjtRk3XAFj/8qM7MoF3/+do=; b=Fw9R0dMucraWSHSTRMv03TFIy4HEazQ43LgF6l0whU3KwMhRrtSCQNasCXcGoo0rPc c2XxJthy7+8EgfLiv/uaY1LqHoyJS0HarGL1g0NtEEj69OTm72JCnZr/heOo4p9MQTuF Q18oct6aCKBaaXh3JyfQ8x6HLnk+nP1WSQaaD/PdNl8Ph8JPd6z1T3MWBR8pjVY3+guu 7zj0sMOlEOFia0tlOlE+Z3pikLdXYmOfgapIu936tZejMDy+uocMP/oilhL3gIJp/oGj aauYqx1VD+UCeRLDkA2c6pzxqHCG6rrXu6Au8FfPyUcB/FSRf1tQ0NB93iN7iAKp8BG7 k/Rg== X-Gm-Message-State: ACgBeo2biM5sJ4ztGPwfEQFE00MIZ+9pot8fzKGyhMi573J37HckhNii KoRc7E+atAzlWmnRanRk1h8syFMsTHNYvA== X-Received: by 2002:a17:90a:f88:b0:1fa:da0f:5e6 with SMTP id 8-20020a17090a0f8800b001fada0f05e6mr20236534pjz.102.1661182298340; Mon, 22 Aug 2022 08:31:38 -0700 (PDT) Received: from stoup.. ([71.212.157.236]) by smtp.gmail.com with ESMTPSA id i6-20020a17090a3d8600b001f262f6f717sm10353835pjc.3.2022.08.22.08.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:31:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 65/66] target/arm: Consider GP an attribute in get_phys_addr_lpae Date: Mon, 22 Aug 2022 08:27:40 -0700 Message-Id: <20220822152741.1617527-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822152741.1617527-1-richard.henderson@linaro.org> References: <20220822152741.1617527-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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" Both GP and DBM are in the upper attribute block. Extend the computation of attrs to include them, then simplify the setting of guarded. 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 068ff2025a..c38c7d2a65 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1029,7 +1029,6 @@ static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, uint32_t el = regime_el(env, mmu_idx); uint64_t descaddrmask; bool aarch64 = arm_el_is_aa64(env, el); - bool guarded = false; S1TranslateResult s1; uint64_t descriptor; bool nstable; @@ -1291,7 +1290,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, descaddr &= ~(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 */ @@ -1299,7 +1298,6 @@ static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, } /* 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; @@ -1352,7 +1350,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, /* 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) {