From patchwork Mon Oct 24 05:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617846 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2514718pvb; Sun, 23 Oct 2022 23:14:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6A+NX4JFXVFv45Ef2RNuJPdR/JO+vGbsjRTSrjkunJ39uRewbcPabaV4p3VqJSocD0Q4Xf X-Received: by 2002:ac8:4615:0:b0:39c:fa1a:aeb5 with SMTP id p21-20020ac84615000000b0039cfa1aaeb5mr24525225qtn.176.1666592074584; Sun, 23 Oct 2022 23:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666592074; cv=none; d=google.com; s=arc-20160816; b=LPvWdTGfvsTGxRmZjKos57OBG4QDr+ttWIuVYJf7ipPUdDAmeNf5VNKRRMLwTsWgkF 0pZlR0JAWWIsSqplmxcPY2nUKgHk423qA0zR+p4AlxQoerw5nnqA1yIw5870P/aGTztQ Oy+1ZAmjSeGyjJiL8nohiP3H4kWjS1GLcGj54GMvtB2MHsxBYHEYtk3dkNZ/vKQ3Cmkv 0Lf4qD+GmOoj8vdRahMI3nNxP11F25OdA9ZTE1Fiy0Ed58eawQWGgp5Akw/VMxESs8n3 fvl8TBYcR9vjvlX0a1Nw9QF0ZKe9KvINF9hJuDRPyuKtX0TfltJ4MzzBHIcioX+9trq2 GnOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=IWw+aq7JNeHsl9fq/os7SQInlY545GVW3QOnHQy7rg0=; b=U4J7YZJ6ELAxUjF6UHAJ37QbVWBvDc3VR6oGp+OcaFuO3yIfYl1eln1zlJBseAYdjy jn/NqUg+ob0JJ8iXAuwztPrJqAlTgWRhklN9a2Y9dYHqBmBS/WH/v68iIEntsaCxDku4 lS8fMQuR9Z8DSpBF55Oj7MEJljv7kiUvFzXSGrXfIHtTTE5A2sZXcP5b7gSHRD6ZfcFy 8+/wfpnwlRqIcx73aLF1B1A3uZm7XaGStwKDsNv1ej3/UJnte7FsB6txC1nS1jqHEHZ1 KODkBnkQnJBiAl6y8LajLxls1epqT8h72tbhuAfk45nP0F1C8sjT99V71uAw76Fbqx8P djTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zClpVoaH; 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 bm11-20020a05620a198b00b006eb52f0e3b5si17106586qkb.603.2022.10.23.23.14.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Oct 2022 23:14:34 -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=zClpVoaH; 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 1ompsv-0007ZI-42; Mon, 24 Oct 2022 01:20:25 -0400 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 1omps9-0006rR-Lh for qemu-devel@nongnu.org; Mon, 24 Oct 2022 01:19:39 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omps8-0002PU-0w for qemu-devel@nongnu.org; Mon, 24 Oct 2022 01:19:37 -0400 Received: by mail-pf1-x430.google.com with SMTP id m6so8169008pfb.0 for ; Sun, 23 Oct 2022 22:19:27 -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=IWw+aq7JNeHsl9fq/os7SQInlY545GVW3QOnHQy7rg0=; b=zClpVoaHHqvDQGxHaG61TifYrcxiBqg/7hR7bhQ6rq57WCCFDvjg6nyP05HOvD0r9r Tvd8jNuMd0v7C6H1CegQnSO+bqlls2w+m5ZTMWBaTb2rtikAh3RdO64jB8BNGJrSQgj8 fJw7Zd4B/sX3Xhuzv0gyTjH/NqHLO81iuBRGuy+eJxiGIPnfaC6XWv4eb+v74B3zWtEF kfqbwf+/l1PbY6Puv4LDCs/W6kTu1U5C9/Xs0cAXYEDe4ttyEUml+NrQMHDXxYEd4Dxy CzyFAbC/b8lDWOqz+vrCM5SNAE3HjxF5WlUvAcVi7izmsrTX/XHjQ5QT+p58STF1EcWo 72WQ== 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=IWw+aq7JNeHsl9fq/os7SQInlY545GVW3QOnHQy7rg0=; b=7KBeMQH7AV8/HEAi8d9UN3dGAkVBu5hR42kWzFFM17Fd5shh9X368cenqt7XSR8r+b /PKRflaWnSoQZ8LydznQWFgtVo3qPHVLgBu0i0unRPJ97QG+OD6EAy/EDdaLbdy/qXtd yOBMm8Dx5oaZjm55sDFsW97sMv3I77WfZ0wMw6WU2J6jsvQRAKbgN9ZDiTvisp/jBe5h pcduO+Zue7PsLA+QVTQMSGmOgNH5TRuZH3hHmW6DH//eqF+7kznOIP/C5ynIZgp8Gd0H W5p6NA5WwiTerpIp/M1Czpvx+tnOr+OXMKb+b3uJJW+X3fyYhTX2lp+PNE8N10ie+Kfj gyPA== X-Gm-Message-State: ACrzQf2aqc/I4idO31awAP9vEbXqxqUYZ6qF1Qe8f0lww6gilejYfefe iL1saIPBFP+CUsJDVpdk7WYmyLz7uMxI3ll/ X-Received: by 2002:a05:6a02:282:b0:439:7a97:ccd with SMTP id bk2-20020a056a02028200b004397a970ccdmr27308494pgb.297.1666588766214; Sun, 23 Oct 2022 22:19:26 -0700 (PDT) Received: from stoup.. ([103.100.225.182]) by smtp.gmail.com with ESMTPSA id q12-20020a170902f34c00b00172951ddb12sm1895231ple.42.2022.10.23.22.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:19:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH v6 10/14] target/arm: Consider GP an attribute in get_phys_addr_lpae Date: Mon, 24 Oct 2022 15:18:47 +1000 Message-Id: <20221024051851.3074715-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024051851.3074715-1-richard.henderson@linaro.org> References: <20221024051851.3074715-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- 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 cc7751218c..8004ca86df 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1077,7 +1077,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; @@ -1343,7 +1342,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 (regime_is_stage2(mmu_idx)) { /* Stage 2 table descriptors do not include any attribute fields */ @@ -1351,7 +1350,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; @@ -1404,7 +1402,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 (regime_is_stage2(mmu_idx)) {