From patchwork Sat Oct 1 16:22:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 611404 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp283546pvb; Sat, 1 Oct 2022 09:56:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yG3sgByvivvTbdJV6dTAnNJHXb2pqkT09a7haB6GLoXwuH7a1SgPBwd/PozUH1aTxlqFC X-Received: by 2002:ac8:5f4f:0:b0:35d:19e0:a440 with SMTP id y15-20020ac85f4f000000b0035d19e0a440mr11163826qta.627.1664643368170; Sat, 01 Oct 2022 09:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664643368; cv=none; d=google.com; s=arc-20160816; b=pDdDmZELoB0co7EVaZYn46zY0xLk1go8aqPeXITb0VwFGAdzhkJdEOfjKnJSO1nGvc 0TNQHUfhH5mLzJfyDaFDqPHH7k5puz/YiQL0XXYRzCI2NKlT/WGU85iIp6n1gwThF0cj /hS1tNmcoaG6FBKO9Y6TpWc/zUUbs0OKzJRs6I8vKhp0BjqgzJAMjR5m0dkWb8dQfOVi dh8Ny1ZCP4Zd9vmjwMkxZHKUN/fXP80SEmcBWJYv3UwEW/eFOVrocWJ08fV6WdZWX3oH 21XlSh+ukylW4I62/OQYgZ87i8rxRMeRgCCBfs78x1HAL901Ll+Ml/pjIH2sM0U2tb83 S7+Q== 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=Ue9Nl0D44aZHstGkTsjwRG+rtSs9n3MbvqWOGp6wdbM=; b=amZ08Y+xLjRgb0Cng/Y7nnjI43CUpX5Kw/abm0oQpWpIHbcgt69ORjTMYacJuepTW+ OZft36nJeUElpE2pOzbFT/24u+VmGYwJ0cFcnDTKgosaBU1Cgy+IjvBmGJgl99ihrBS7 R8LlM24xEqDnTsaDUMlZg5R4T/JrwZeS6JRjFlSep4gAyjuimAd74178gPItqSu4Fu3T mdaXwb439Npa4uJyiTEkHEGAzTDIk+beQ0d4Cz4bFUgXuApbtJuDEzqfO1Fa12fw90Rn hfVXqT30NxkaGhO8weOuHCHTrhZ0ASfLJslJX9aJhs9MrP/EGDKnTEc8NsxjW7viPiGY ZCnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V4GNfkah; 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 k13-20020ad45bed000000b00496dad06379si2565338qvc.72.2022.10.01.09.56.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Oct 2022 09:56:08 -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=V4GNfkah; 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]:50078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oefmY-0001tU-Na for patch@linaro.org; Sat, 01 Oct 2022 12:56:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oefHl-0006y7-GI for qemu-devel@nongnu.org; Sat, 01 Oct 2022 12:24:17 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:34404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oefHj-0006F8-1h for qemu-devel@nongnu.org; Sat, 01 Oct 2022 12:24:16 -0400 Received: by mail-qk1-x729.google.com with SMTP id g2so4549116qkk.1 for ; Sat, 01 Oct 2022 09:24:14 -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; bh=Ue9Nl0D44aZHstGkTsjwRG+rtSs9n3MbvqWOGp6wdbM=; b=V4GNfkahZI+n5FLCJ4JJehf9MHqoVFM1H9B45TSFxJpg3iKrJbqbHDfB82xbHbMGum EMF1JAFBNg0cg887Scb5FhQNohpUyXzBSzFRJG33GoYOqOlTCZLVjp0Y9lmFqiaur03C fqOCJiKMB0U9N8hBS74hz87DBz789ujSSr3NFSoPQXmh/00DBt2PY8+RuAqm8FMy8D+a ft6JTaFlAdwaeScjjeR01Rxq7uQDOaSJuXltWP9Bh5IjqpXaTcD6PdJ4kUKMokgMg38U Faiq0u+O6maan2RGqn5rAfvgeeztPTouWsg1QX6aPE2Si+q7KuMXM9zJvtvQWDetUKA0 c6MQ== 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; bh=Ue9Nl0D44aZHstGkTsjwRG+rtSs9n3MbvqWOGp6wdbM=; b=zD9SluN28mm6OASuFQ4bcZYsoUB4WVFPughf3lvJWJkfDAVbdy+RuwM0yPAUIkz7A/ hROsifP1y8LN1D+rZ4P3zl9q52NcruuptSRIEIKNbdlkHCBZNQvM9XozY+ubT+OBhsC8 PHjkbLdcH/oHG7NNDnA4qV91BcIADsd4h55jrOFNAQvygWuEMXfKA0pTMXlbFnLzQYb5 d22c83TVfTZmQkBloNy5bi968y/kglj1VvvoAIrsLZXgdcTb/fo6YlmqmgoI0cgfh1tq xWFi5EHchGBZxxv6TrtBg1ACVTHBbhfr7SqdnRHEsyexRjiEWAuU9nv0PIAsst2P3LiI 4Xgg== X-Gm-Message-State: ACrzQf0Xkocp50WCvtQ9o3ofOicadAGfvkcAt+HdvbS+vXF/uQXUnMeC CO7KyooHJbrf8/oe5I6h/l582piZCXrcjg== X-Received: by 2002:a37:c443:0:b0:6ce:191a:bb60 with SMTP id h3-20020a37c443000000b006ce191abb60mr9578844qkm.53.1664641454395; Sat, 01 Oct 2022 09:24:14 -0700 (PDT) Received: from stoup.. ([2605:ef80:8084:91a4:f7cb:db31:c505:b931]) by smtp.gmail.com with ESMTPSA id t4-20020a37ea04000000b006d1d8fdea8asm4387445qkj.85.2022.10.01.09.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 09:24:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 21/42] target/arm: Enable TARGET_PAGE_ENTRY_EXTRA Date: Sat, 1 Oct 2022 09:22:57 -0700 Message-Id: <20221001162318.153420-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221001162318.153420-1-richard.henderson@linaro.org> References: <20221001162318.153420-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::729; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x729.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" Copy attrs and sharability, into the TLB. This will eventually be used by S1_ptw_translate to report stage1 translation failures, and by do_ats_write to fill in PAR_EL1. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/cpu-param.h | 8 ++++++++ target/arm/tlb_helper.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/target/arm/cpu-param.h b/target/arm/cpu-param.h index 08681828ac..118ca0e5c0 100644 --- a/target/arm/cpu-param.h +++ b/target/arm/cpu-param.h @@ -30,6 +30,14 @@ */ # define TARGET_PAGE_BITS_VARY # define TARGET_PAGE_BITS_MIN 10 + +/* + * Cache the attrs and sharability fields from the page table entry. + */ +# define TARGET_PAGE_ENTRY_EXTRA \ + uint8_t pte_attrs; \ + uint8_t shareability; + #endif #define NB_MMU_MODES 8 diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c index 49601394ec..353edbeb1d 100644 --- a/target/arm/tlb_helper.c +++ b/target/arm/tlb_helper.c @@ -236,6 +236,9 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int size, arm_tlb_mte_tagged(&res.f.attrs) = true; } + res.f.pte_attrs = res.cacheattrs.attrs; + res.f.shareability = res.cacheattrs.shareability; + tlb_set_page_full(cs, mmu_idx, address, &res.f); return true; } else if (probe) {