From patchwork Wed Feb 22 02:33:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655658 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp455798wrb; Tue, 21 Feb 2023 18:34:33 -0800 (PST) X-Google-Smtp-Source: AK7set8LAFL1FOaPoghvzy45bFXTiIeNH1wW2L2x+WEShXA5nbfn5sPEBbAxrUllBoJcSDfZBJzQ X-Received: by 2002:ad4:5aed:0:b0:56e:adc7:da2c with SMTP id c13-20020ad45aed000000b0056eadc7da2cmr10949091qvh.45.1677033273677; Tue, 21 Feb 2023 18:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677033273; cv=none; d=google.com; s=arc-20160816; b=fJm72LLAic8ZTM1HO376qIB3B5kjxx5iVMRslw1uNY9R72nEIEhuqnm5kLqRYO3209 vDg2j8gqPezjRC8DAQRojcqyZEM0op9DtrFiYYbxNLpr8A+s4MXUNzJiJDXP/scPnR0y F4V5/FLS4lLzsczbwFXXC/59ZSu1/8MSL4LmISRDamK8YYrPItFrPXOTY4cdOIIRhamU qQek//F/0VrikfK5LvXs0Ns6Q6NyckCxXzeM2xAL+j9uKmGS/yxpjKF0MOWOmRHfOOf+ NOy70F6IzXIqPlV1aG73HwuORqFLHRh1w41eXH6jWphKQP2C27ogNz7VyDs8w0mKHDaZ PYvg== 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=nw++n+vjilR+k0Cfryt+0j1Zm09nTbqymOcGAUWx/EE=; b=rBoPTZHfTwjt8IqTdeYi31WeLjdqlQiGyke3oQVOQXp/V5aled6HLUPzUg0Pwl5TAe aX6F0J5jX3vtX3J3+cTWISPpVs4a+6+xI28aXfHafKkk6CxU412ENqNhoUBRMkAurc5m IYBhrAOXm7lEh8Bfz039OjdxkUtZnCWkiibtaJpIXv9JaKFw+14XsXSunWpyCKReufn3 OgZDBzOWO0wFVU8yH/qQ6na2odzJvz8BryO454/JJVEgwlvitDWpihI4v0BfkaLdbJQD IrVXOJNtZP/dYZtHpUDTssImffdckc3+3F0qJsLBQJPwiR3WC5aIo3ajwzFlKjjUcx5K wonQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s6aUvgH9; 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 m8-20020a0cdb88000000b0056eb7b22128si2881083qvk.288.2023.02.21.18.34.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 18:34:33 -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=s6aUvgH9; 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 1pUewz-0007Da-PX; Tue, 21 Feb 2023 21:33:45 -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 1pUewy-0007C4-3R for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:33:44 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUewv-0001XJ-EJ for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:33:43 -0500 Received: by mail-pl1-x643.google.com with SMTP id e5so8270792plg.8 for ; Tue, 21 Feb 2023 18:33:40 -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=nw++n+vjilR+k0Cfryt+0j1Zm09nTbqymOcGAUWx/EE=; b=s6aUvgH9Z7+Gjkgfw3EWUu7uVViVnXSWDLx7XECLzF754aKyUy4TJz8zlhvArQzazF AqK8azqzG+SNOczQiK/hbiCO+YX9CtOCei7FlEIG4ISMHQhPDgmUGzBsjdcARk6KYjho zoSInM8VvltqMRY6WhHGkpmH7bqCdsTWFDKeTB6QXmL+jKcOPNPLKCOYQhj08jsQFFWT llVzftRE5Z86VabsQVFoqCaTbr0ZN9eMg6FNvhU4laTMHX7Y8zfL/14CmkfWfPwzoqgW dRNXKdGRhens0mPkI0lLE80fyJCyURdjo/Klejbl+Q3+uD+tM4G8do5sXdR+GbiXmSlZ I4vQ== 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=nw++n+vjilR+k0Cfryt+0j1Zm09nTbqymOcGAUWx/EE=; b=Iv0frF6HqVxciYyGGXPIwOZr3ZN+ONOYu7H8dK4LCDRJsrszjxUt8IOg5mN7f2JTNY g04VzIdqdLQGHlwopTR/SUUVFdFeLON8tyFtSWyLLUu7WBB7TMqJHzSBhvLXAW+8KTeI zqgKSihr8dptOGx1zK/c1gi8HJ16g5Y8BXEn7wR/HMSb8vCj6hMz12ux2g2eFOeHadkP Jflz6WJDexp7zNUu1lLyvuuMpWW55fW09FFvVKWUP+Mr/4Lk89r3QiCxrupSEm+LtzAw N7ftxxGOb3lvDhqP7QT5aJqpkfoq+mi01IAaiMK8rcBIz3/0ujj7SuFdPspG19TjP9Qj yvOQ== X-Gm-Message-State: AO0yUKXBK06dScja1rCM4ZMG0DbSfsvndfR/dKzfvPVeOC8LkFs6maby KXDGcz5GF9bHrZO/mOwrgtkoJFnyfPvEkVpJYpK1MQ== X-Received: by 2002:a17:903:138d:b0:196:89bc:70fe with SMTP id jx13-20020a170903138d00b0019689bc70femr4778041plb.34.1677033219430; Tue, 21 Feb 2023 18:33:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 18:33:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 00/25] target/arm: Implement FEAT_RME Date: Tue, 21 Feb 2023 16:33:11 -1000 Message-Id: <20230222023336.915045-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::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.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 v3: * Incorporate fix for m-profile arm_cpu_get_phys_page_attrs_debug, since it has conflicts with the rest of the patch set. * Revert accidental change in S1_ptw_translate remapping ARMFault_GPCFOnOutput to ARMFault_GPCFOnWalk. * Remove __attribute__((nonnull)) early. * Rename get_phys_addr_{inner,outer} -> get_phys_addr_{nogpc,gpc}. Changes for v2: * Drop "Fix pmsav8 stage2 secure parameter". * Incorporate review feedback. * Mark last two patches as "NOTFORMERGE". r~ Richard Henderson (25): target/arm: Handle m-profile in arm_is_secure target/arm: Stub arm_hcr_el2_eff for m-profile target/arm: Diagnose incorrect usage of arm_is_secure subroutines 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: Remove __attribute__((nonnull)) from ptw.c 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 | 149 ++++++-- 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 | 164 ++++++++- target/arm/ptw.c | 753 ++++++++++++++++++++++++++++++---------- target/arm/tlb_helper.c | 96 ++++- 12 files changed, 1073 insertions(+), 223 deletions(-)