From patchwork Tue Oct 11 03:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 614145 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2368667pvb; Mon, 10 Oct 2022 20:23:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RCd9z6hFplftPqxhQNQ0gBDBlV2UfL5ToJajgYkdHWVPzNIQvJ4aE2bB1/lm+hvibPL68 X-Received: by 2002:a05:622a:34d:b0:35d:4338:463e with SMTP id r13-20020a05622a034d00b0035d4338463emr17568936qtw.559.1665458584777; Mon, 10 Oct 2022 20:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665458584; cv=none; d=google.com; s=arc-20160816; b=GZrl96LNXMHGKtCemYH/Va90zBXCW2VktmZXxsVchmywWYgiPa64jzKBN8Rqk1Nv4C HY+PPt3Cfb7414qA+R3dQ5wP0GFMVU17hrBAU8WgOKokdSYSUAtAl/xz8gSVofXyJAZj 0BvrtNtdXwjHVm9JYSDxf15wg67xKKxioahHYbAsHWziONpXUBP5qNWx7flvrwuN5RTF iu0P4aZIHwt+I/f26wEyOsVm3yNgDKxH8yWGiij/T21vEzKFNVwJ+7jprjtCr1skWWix +B1H//agsF8K96c1ZxWOd4b/6rsQ3ePVvZpqlD0o8sLyhVedJYWWVsvAGPdhFoJ0O7kB N3vg== 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=sfKD/zCeIYRQKq3df3kFwiCr1YlgQpiKDEPmo1WYAa8=; b=p0zcX2Gb2BHmJUkaAvL7rH5vhEwK/F93dLdqj2fdl80Tg7DcMQpxi2cmmW7YyZGpTK k0W2Dyd0HC/070yoRGIUlxZLNqQbC0F1e5+6txANZm25lrgs0k5kZiakvzz2jz2a+9lc WTKDcs9PedjU7c+xMW0O4I994/83ymgbC342o7ozS/B3369Ua0x9ngqRVnK9mBjh1DGi BLC/BFsG6LR+eFGp5imXLrSU3k1NFReYnAr2R3RLsIBi5cxrZJ2pi/VeqNHWtShIoU/u 9eMGO00QI22MnMKPGij7TrAXqPXfqOTLiAaL/fzSge5WVrndC0aP4xEYuAOm2QtX6EZQ k5rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q4Kh+Ofq; 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 6-20020ad45ba6000000b004ad1ff65311si5797980qvq.586.2022.10.10.20.23.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2022 20:23:04 -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=Q4Kh+Ofq; 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]:59348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi5rE-0004n9-9M for patch@linaro.org; Mon, 10 Oct 2022 23:23:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi5nr-0002Mq-Lh for qemu-devel@nongnu.org; Mon, 10 Oct 2022 23:19:35 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:51978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oi5nc-0002zP-Vu for qemu-devel@nongnu.org; Mon, 10 Oct 2022 23:19:34 -0400 Received: by mail-pj1-x1035.google.com with SMTP id b15so11375604pje.1 for ; Mon, 10 Oct 2022 20:19:16 -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=sfKD/zCeIYRQKq3df3kFwiCr1YlgQpiKDEPmo1WYAa8=; b=Q4Kh+OfqNBXwng1azAIntY1pAvDIHMjnS2eC0EHHYt65A/Kf+28QHRAuE9SHWYKsUZ 971fd0G1QiQjr1u/+O4OziUJDZRwGyVddapTadoeh2tbrJ2VmjEs2XH8YRtujbBw/Kwb jLgCmYoPtUgFkKCbSgZNK6gbYvzbXgb3N9pVME5yl9fPb2C3ljzj9EfR58EgcQW1LF2F f+Ad3x2+12ss248p6BT7qXRGlBCsH4EcMeY91Hh0YnC3Y3gkHEmNpHb7HrkV6BxWxQFu O9JQjfc5KYrgjZ/m36UPWIdHC6OfvMupzqDqAE4MqYacFQYgquYMOsvVSy18r5eMi95l E2yQ== 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=sfKD/zCeIYRQKq3df3kFwiCr1YlgQpiKDEPmo1WYAa8=; b=eRqYVYZ6uEPyrMVdIfh4pGWDmPZJvL2Sm7GX8XMNVw1aj0CqVRrh5ZojsN2uHfOskB xXM12BGfZym7p9WYJ+zP4o3UWlE4JrlI/Xkms2oDmFIZdkA0MoD+W0QQUyTkDldwCs6g +Ccvbtpouy7g/nHKrDnhe2LwjgQxsgrFixxu4Zq3HMMpIbh5MdN4KEgaarlWYvD15gTc xNjUeK2B1MpmWSN9oP5BwoBpz/cjChzKdxmHj0xBRtAmBTZRVlJcxWu76BrVbeU983u6 mpE9n1UvhHR6vA7wEqJdqIYd06Km2zhQ+Ew1bWIk0kEuBiBish8jqzKQwp/HDP7qlgzQ +w+w== X-Gm-Message-State: ACrzQf37Qb+NwAiRIcaaS0aQdUAvy2qlcGp/14/LyO3UqtXd09rT6Cmj 9uvedO+NSmAsRUp5KjgHD0kOG2t+dsrDTg== X-Received: by 2002:a17:902:f7cf:b0:17f:9081:a3f7 with SMTP id h15-20020a170902f7cf00b0017f9081a3f7mr21742207plw.3.1665458355565; Mon, 10 Oct 2022 20:19:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 20:19:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v4 01/24] target/arm: Enable TARGET_PAGE_ENTRY_EXTRA Date: Mon, 10 Oct 2022 20:18:48 -0700 Message-Id: <20221011031911.2408754-2-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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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, 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Copy attrs and shareability, 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 12 ++++++++++++ target/arm/tlb_helper.c | 3 +++ 2 files changed, 15 insertions(+) diff --git a/target/arm/cpu-param.h b/target/arm/cpu-param.h index 08681828ac..38347b0d20 100644 --- a/target/arm/cpu-param.h +++ b/target/arm/cpu-param.h @@ -30,6 +30,18 @@ */ # define TARGET_PAGE_BITS_VARY # define TARGET_PAGE_BITS_MIN 10 + +/* + * Cache the attrs and shareability fields from the page table entry. + * + * For ARMMMUIdx_Stage2*, pte_attrs is the S2 descriptor bits [5:2]. + * Otherwise, pte_attrs is the same as the MAIR_EL1 8-bit format. + * For shareability, as in the SH field of the VMSAv8-64 PTEs. + */ +# 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) {