From patchwork Mon Feb 20 23:26:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655139 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1661689wrc; Mon, 20 Feb 2023 15:28:30 -0800 (PST) X-Google-Smtp-Source: AK7set8eL8Otx38c16lG83UD164ZSU9nmIWL8sGDQkxMvdsoz1xkQLVRkky3HNsG2xW6EvLi0B8d X-Received: by 2002:ac8:5b83:0:b0:3ba:1e64:c24c with SMTP id a3-20020ac85b83000000b003ba1e64c24cmr5350431qta.5.1676935710469; Mon, 20 Feb 2023 15:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676935710; cv=none; d=google.com; s=arc-20160816; b=zlBewfK3+KqL/tA7xReLT2b4Uonkb3f2nrVuWL05NSqLn0hft2kbm/RuXC90WFIdtQ 09Czh/ebhjo/VoPh/lgSYER2m4MIBaPqHUZDVfKNdOZOMLCuwhT6tQwWoGKJHSqNLlC0 GisVt27WZKWZEuqqp6Ie6ae2qiaiEUgh8D8CIKjhXWqqhjwum0YJ2nc4tT9brzZiULgd +oi1+QWSp5eDaKta2UdgvD6tmIUGbLj9DrM+FfnaKAos8qs9lkPJTQafIqWJRH+6yi27 DMlkGcaRcYuq7y1EUPKOJRqBEsfy5RocYS3FuxtM5m1t/uk5G0e7WRiaADSCQFb+pHNI pYRQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=t9yw/E43hG1ECC7dOsdcRXTK3p/swP0xBKKuJw06hJ8=; b=I/yjXza0So23iOyOkTWH0Et1E5XEM63fuEqCYJnD7QIz/r9uLelRc2S8CnSUNlQWr1 8O4WeZikToiRrEGwwNoImvq5I8aAIox6UdCbynXaTzV8m5QjM/OK3Sr9sR0rrPTtHafO hMTgiDSwuZlbQajb+k+U1KEFFeEfIvJBj6wNtRdxK+Y/lXgFvXydJODobdMKnetkn8Kh dmx6hBfdQ4oRB8Javf+5aufHU8Rb0YOyyFGsLj1tQLOf5bJpsu3f/JiStuRE+yuyVLQN Az+c5ILOYnNSF269lvVICN7nJg7T0l3b0GyDdefihBCu1gN8sih+iMPhjBTk3pvnWUgB q+2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IdQgFmm1; 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 s129-20020ae9de87000000b006fa1585a6absi9932965qkf.186.2023.02.20.15.28.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 15:28:30 -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=IdQgFmm1; 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 1pUFYL-0003ee-9S; Mon, 20 Feb 2023 18:26:37 -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 1pUFYI-0003eE-Vg for qemu-devel@nongnu.org; Mon, 20 Feb 2023 18:26:34 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUFYH-0000H1-1V for qemu-devel@nongnu.org; Mon, 20 Feb 2023 18:26:34 -0500 Received: by mail-pj1-x1043.google.com with SMTP id o16so2898092pjp.3 for ; Mon, 20 Feb 2023 15:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=t9yw/E43hG1ECC7dOsdcRXTK3p/swP0xBKKuJw06hJ8=; b=IdQgFmm1oKz7zEq2UDrLixMm+IWlU9QQknTocq1ryfG+MVS+UWWbQIMs7qGx0L/3cr imnh+eUSAQ01V4wBDjZnJnzPrtchmAix2FemgbySgTRbZ79+A0ytcgb0WXjCVUwdFS6g 3D0fdjPsR0V9S7yqU3+lke3NzGcmOon98LrWQ3nlL1xGf3YwOUEhLoC4fv2R4GJufzMT nXgVB3MpKR/Id1EE2WXGtX3G9vv8hJM97HBuVPgJFonBS3xIOxFqaqgbQuqqjjXIVdJA 5B9PxSUUBU6d4VBIaG4NM2VjPZBZPinCydEA7darEpCcw7gr01WjJ2A9VduXb6wVsdX0 sr4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t9yw/E43hG1ECC7dOsdcRXTK3p/swP0xBKKuJw06hJ8=; b=196FlOxOrswBY+rOhpLhnA6M9avn/4ZtXLz6ajy8q7eNy8DtlrXzxcEH2K37RAtDo3 wlOAyKG2Vw94tjeQZEdBX4bRRqj7zyV/gCtOtYywsjuuvHXU7xT5rfZcfjpg3f9+x6Yq a0LOwQ9gNvmNDtcTzb4ui3lAzOhe9GPmAulkL31seCHOdcw4AzPYGjTi2jyeGJpnUxI5 ptUBP1KaZzz4gcW1bDK+Gkgp6oqbHXCeWHLyOBSkym1HAoXKKpPYpq+6SxY0Do6bZnzv f3RoDRQN3jr+OLc51LUXCwsFUzcPjSB+KDhkD1Q8T9eksxGfEjVQ60er84c1ocaiJMjv Nb4g== X-Gm-Message-State: AO0yUKUNFQoprafgvZiJcAeoapT3huFnAeoADvor0cRksU9vMTH9UfSy 2zePT5G6XR9rl65XDEr9pMcGMLAKEpKdDRNyOswT+A== X-Received: by 2002:a17:902:d487:b0:19a:a6c4:6403 with SMTP id c7-20020a170902d48700b0019aa6c46403mr4772590plg.1.1676935591287; Mon, 20 Feb 2023 15:26:31 -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 j10-20020a170902690a00b001992e74d058sm2665348plk.7.2023.02.20.15.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:26:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 00/21] target/arm: Implement FEAT_RME Date: Mon, 20 Feb 2023 13:26:05 -1000 Message-Id: <20230220232626.429947-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1043.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 This is based on mainline, without any extra ARMv9-A dependencies which are still under development. This is good enough to pass all of the tests within https://github.com/Huawei/Huawei_CCA_QEMU Changes for v2: * Drop "Fix pmsav8 stage2 secure parameter". * Incorporate review feedback. * Mark last two patches as "NOTFORMERGE". r~ Richard Henderson (21): target/arm: Rewrite check_s2_mmu_setup target/arm: Add isar_feature_aa64_rme target/arm: Update SCR and HCR for RME target/arm: SCR_EL3.NS may be RES1 target/arm: Add RME cpregs target/arm: Introduce ARMSecuritySpace include/exec/memattrs: Add two bits of space to MemTxAttrs target/arm: Adjust the order of Phys and Stage2 ARMMMUIdx target/arm: Introduce ARMMMUIdx_Phys_{Realm,Root} target/arm: Pipe ARMSecuritySpace through ptw.c target/arm: NSTable is RES0 for the RME EL3 regime target/arm: Handle Block and Page bits for security space target/arm: Handle no-execute for Realm and Root regimes target/arm: Use get_phys_addr_with_struct in S1_ptw_translate target/arm: Move s1_is_el0 into S1Translate target/arm: Use get_phys_addr_with_struct for stage2 target/arm: Add GPC syndrome target/arm: Implement GPC exceptions target/arm: Implement the granule protection check target/arm: Enable RME for -cpu max hw/arm/virt: Add some memory for Realm Management Monitor include/exec/memattrs.h | 9 +- include/hw/arm/virt.h | 2 + target/arm/cpu-param.h | 2 +- target/arm/cpu.h | 148 ++++++-- target/arm/internals.h | 27 ++ target/arm/syndrome.h | 10 + hw/arm/virt.c | 43 +++ target/arm/cpu.c | 4 + target/arm/cpu64.c | 37 ++ target/arm/helper.c | 155 ++++++++- target/arm/ptw.c | 748 ++++++++++++++++++++++++++++++---------- target/arm/tlb_helper.c | 96 +++++- 12 files changed, 1058 insertions(+), 223 deletions(-)