From patchwork Wed Feb 22 02:33:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655680 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp457157wrb; Tue, 21 Feb 2023 18:38:55 -0800 (PST) X-Google-Smtp-Source: AK7set+4e5j9tzdA4xtEpH0ARkZGhP+ahvobgA7rQ5L4Xl3Z4uD0TV64uZW3UJV/uhiy9db0A/Kc X-Received: by 2002:a05:622a:40b:b0:3ba:247a:3fbc with SMTP id n11-20020a05622a040b00b003ba247a3fbcmr26648439qtx.39.1677033535138; Tue, 21 Feb 2023 18:38:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677033535; cv=none; d=google.com; s=arc-20160816; b=o+ARQANHbjME/ZZ0TRODnghISvhd3XnT7dHN+dNnQbeyCR556KL01BjpJVelVaDjuh //wncntx26nB/bB8oFA/cZ7aZhIpwdl7CmzapF+RrDhBEDx5d7UZfSZ+b7dtNTixjJbf M+HItThZJTw2GGJKCFOuu3HHz5UfVeYTN36nyrWh0eF9EyjWjeJNwuu5ZTlVGoSgDXm5 Nm2Xx7G5BHgzDdIqeSr9XF1533RzFCPm5cPQrewIB83/QFTTeld68J/DQ5pD2rSqG6yb x3RiklP0jZjdAY6li9ohYST2yU2FLFrajC+YTARflPG/EoRlv5dDQRTsT/q857XmIk2C Zvew== 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=0zAr88doy4l35/U8kOUIKFNAL46N655Bwwt/mOy9kK4=; b=j35v2HWtw273iTC8w74551f1kGeFODn240b+yCzAHRfW9vPGDRt+iA4qubPEz8zwOn M3kzR4TvSqxIPJyjAPBdYq7sMPg9Ffh6SImd1WiF7K7+YbMZ20a+EXY8hDmRSM7lj1Vq be2MEhGSoeTw9jNx1JDeOOTiRo3PE+1mYElzD+bEnz0meUXg43XCuRutUknSB+pCaSr+ jKP9xP4QL1ZBAFXQM+s//24GiO1XKd119lHKzd2zZF6QIycWOJGwM1t1ffXEv8m9Kq77 JvQb69UzhuhxqXtG746/6CgxUKDrXZ7A6kEFFJIblay4E+y7QO7aD3YDOPOKP5B29v5i mXkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vAE0hyoL; 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 h11-20020ac8584b000000b003b6431be886si14068264qth.706.2023.02.21.18.38.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 18:38:55 -0800 (PST) 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=vAE0hyoL; 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 1pUexN-0007WT-Pd; Tue, 21 Feb 2023 21:34:09 -0500 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 1pUexA-0007L6-2p for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:33:57 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUex8-0001XR-D2 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:33:55 -0500 Received: by mail-pl1-x634.google.com with SMTP id c1so7463799plg.4 for ; Tue, 21 Feb 2023 18:33:54 -0800 (PST) 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=0zAr88doy4l35/U8kOUIKFNAL46N655Bwwt/mOy9kK4=; b=vAE0hyoLpcAzZ+66jQHG/RI//FDINCq6r7xYdlYqWVeK/KErV1uSa5x5YR+dsSC7ti K1ZaAmZvUUo1lvDa9es7zsZePW743U3IVZvYMJhT+a6dzzoCJfb7jHkTt13f8PZ/W/MM TwQlphHupr+Eig1uiaCmEybcBMCAe4mVU4rHXxPWUIrdg2kxwS/KJGhvUaMULPbnRQ6G OedEN+PaP4ERedfKjTDikVDD3hxYCAJOSfWJObn8hQtm7D+ixJbz1VlG2Gzi/iCNZXb5 uNvEI6FCjcj13fd0SlRhGL02P3eSKnhftJxqabqo4vXo0fUXJL17tHQojiTWNaW3NVgO ggZg== 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=0zAr88doy4l35/U8kOUIKFNAL46N655Bwwt/mOy9kK4=; b=p6t71Or00dh9WxldjBTVSp/ukzlPHs4E17ftVQdpu2E4vd9p0yI0TlenBF7zutlecv bE5ZDO0PDVrrJ6hsFQK0y2FOBy7yvtSBZaU2ParfZLRPJn6fcy5ZCv8AVlh7/N2s2bqG Ay0tiqBKwdr99/oBx4OekgQat39KsMrHLj3hLXxNm3QLTJcwkLrOtOrrCqi363Ib7Gqt lcqgw4RlnRV15VdpY5TZnFDghq/HHMlEj8KhDYnD0tK7DtNWZQ7DUXjUMDWZs0bfG/N2 qIRUI60RZKuDwMLY4mgBJaAewhJZFec81OW4qX5QzNalIwPVP+quGHkUeprzo2xqA7P7 w2qg== X-Gm-Message-State: AO0yUKW9VJRd9ChG/OrqKMmRh/nAXFJfF4srkI9dyNpMSrNo1MekvFSL jRv4X/quN5RXHS+pv6T1I24qbjp9TmR+GPzwyR8= X-Received: by 2002:a17:902:ecc3:b0:19a:9880:1764 with SMTP id a3-20020a170902ecc300b0019a98801764mr9517722plh.59.1677033233683; Tue, 21 Feb 2023 18:33:53 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id k3-20020a170902e90300b00198fde9178csm10520112pld.197.2023.02.21.18.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 18:33:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 10/25] include/exec/memattrs: Add two bits of space to MemTxAttrs Date: Tue, 21 Feb 2023 16:33:21 -1000 Message-Id: <20230222023336.915045-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222023336.915045-1-richard.henderson@linaro.org> References: <20230222023336.915045-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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-bounces+patch=linaro.org@nongnu.org We will need 2 bits to represent ARMSecurityState. Do not attempt to replace or widen secure, even though it logically overlaps the new field -- there are uses within e.g. hw/block/pflash_cfi01.c, which don't know anything specific about ARM. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/exec/memattrs.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 9fb98bc1ef..d04170aa27 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -29,10 +29,17 @@ typedef struct MemTxAttrs { * "didn't specify" if necessary. */ unsigned int unspecified:1; - /* ARM/AMBA: TrustZone Secure access + /* + * ARM/AMBA: TrustZone Secure access * x86: System Management Mode access */ unsigned int secure:1; + /* + * ARM: ArmSecuritySpace. This partially overlaps secure, but it is + * easier to have both fields to assist code that does not understand + * ARMv9 RME, or no specific knowledge of ARM at all (e.g. pflash). + */ + unsigned int space:2; /* Memory access is usermode (unprivileged) */ unsigned int user:1; /*