From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail03.groups.io (mail03.groups.io [45.79.227.220]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9B4D07803E0 for ; Fri, 12 Apr 2024 15:14:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GuScyk1ajRDJs534xON50rFn6QF7XxyZXr2Or4YuX1I=; c=relaxed/simple; d=groups.io; h=Received-SPF:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:NoDisclaimer:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1712934853; v=1; b=a/xgmRrrW4TS65VOMo2nOcIk3pWSd2QqMwkhOxvEd5gkvAMsy0+ZkaJB08/aXmmTa6eBwof2 avF/mfAOZQvy8WU1324mJPu09G3aCuUh6ofJ6lCd3dWR3xKzr1eSj4Eiygc2dHK+ecBn4NCfbLw ttHFESQkUElff3PpzVPkZNRr2WGuMvBz95L57954OOCy/ltTVhqkOlfC0ytmguWEI9ERo1et29a L2HwnR83f58JxcUPbTbdkotIlwpvwyaPL71RiUETcGmkpM96MiAdAh0mgTXEECqCgoFXH2wj9gq y6Bel+39YJRMbxJ3xsTfQDS9hxLYxRs9ynbMec2KUI3XA== X-Received: by 127.0.0.2 with SMTP id dv3YYY7687511xMYY36uC1xP; Fri, 12 Apr 2024 08:14:13 -0700 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.54]) by mx.groups.io with SMTP id smtpd.web10.49612.1712934852417968144 for ; Fri, 12 Apr 2024 08:14:12 -0700 X-Received: from AM0PR04CA0106.eurprd04.prod.outlook.com (2603:10a6:208:be::47) by AS8PR08MB8706.eurprd08.prod.outlook.com (2603:10a6:20b:564::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Fri, 12 Apr 2024 15:14:03 +0000 X-Received: from AM4PEPF00025F98.EURPRD83.prod.outlook.com (2603:10a6:208:be:cafe::48) by AM0PR04CA0106.outlook.office365.com (2603:10a6:208:be::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26 via Frontend Transport; Fri, 12 Apr 2024 15:14:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00025F98.mail.protection.outlook.com (10.167.16.7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7495.0 via Frontend Transport; Fri, 12 Apr 2024 15:14:02 +0000 X-Received: ("Tessian outbound f1e9a43166b5:v313"); Fri, 12 Apr 2024 15:14:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b97c386fa638228e X-CR-MTA-TID: 64aa7808 X-Received: from 8f8a53a3a4ee.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 574D09AF-8100-4F5C-AB0E-1751248B4143.1; Fri, 12 Apr 2024 15:13:55 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8f8a53a3a4ee.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 15:13:55 +0000 X-Received: from DUZP191CA0065.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4fa::6) by DBAPR08MB5640.eurprd08.prod.outlook.com (2603:10a6:10:1a3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.56; Fri, 12 Apr 2024 15:13:47 +0000 X-Received: from DU2PEPF00028D08.eurprd03.prod.outlook.com (2603:10a6:10:4fa:cafe::31) by DUZP191CA0065.outlook.office365.com (2603:10a6:10:4fa::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26 via Frontend Transport; Fri, 12 Apr 2024 15:13:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C X-Received: from nebula.arm.com (40.67.248.234) by DU2PEPF00028D08.mail.protection.outlook.com (10.167.242.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 12 Apr 2024 15:13:47 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 15:13:43 +0000 X-Received: from E114225.Arm.com (10.1.196.56) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 15:13:43 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 41/45] ArmVirtPkg: RMM 1.0-eac4 - Add RSI Features support Date: Fri, 12 Apr 2024 16:13:38 +0100 Message-ID: <20240412151341.16488-3-sami.mujawar@arm.com> In-Reply-To: <20240412151341.16488-1-sami.mujawar@arm.com> References: <20240412151341.16488-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF00028D08:EE_|DBAPR08MB5640:EE_|AM4PEPF00025F98:EE_|AS8PR08MB8706:EE_ X-MS-Office365-Filtering-Correlation-Id: 080100db-3ba8-4cb9-4f61-08dc5b03301b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 5L/ALG1HSqQe2sZ2tEi268mA+tVVAZ8O3TLhnLAFJ4sBR6Av7U1jBOHOi6W2dKc6PtryigYgkgBlTwSrkF11g5KiztY4qQ/G6wadqdJkFPBvBJB+8/MOBRw1kktTIFlonXvwsDtXtBZjsiJ1YCIRMpUZiE8xALE5crzbplQ9Ue2L1dEsMAb04O+ioJN+Z9P62EjkxnL3KHWADHASnHvKZHSWYMHHCDaY7efZx9hSqdPxaxblV2uEHehG2KtPG5GftrS82eJisOaJsBoV3SAFA9eSG4HnxUC/Qk7OpajqQLUdo7ypTPdxRqFrRLh0kfKaYkhLD0/AoiSjUJv5b1N1nn4rDW4d6BIFxGDtMq/DtBSU222/Y84Sk7hUPPwjHJ/ynmb3esmlnniXjQxDteMMkYzoEwRXOfD5jfKIjL7x/YUmj+K2dIwfX/6AAD+EizK9JynikvxqHiRkvPRy87NJGgUUMwZmNlULSSNTnvW0JYDjUpFifjH5sj6C8m40hCMBUaTjcMFh7TlHswfjVP8uzb97nPWzFoQIOFLp1JMggUVuSg0IbBfcsWT/XoGHuPINnMRKJTCZvR+9i3j47wesD1HqFEgj13mfhzY5UduUGspEQ7lu9f0q8RW8wQ1DPGPcUyQOC/FuRELJ5mJESSXK26sDrOCT6GQ6Jv18swTzt2lKDXAvVHp3G66xdHVD3RwA1ktkN9/gtcx2HvzVvUTwgFtDXaQgylNofONzh0KKJ/aVMB/9zLA3aSQR7j7FL2Gs X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(376005)(1800799015)(82310400014);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5640 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00025F98.EURPRD83.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7c445bb6-d6eb-47d9-e703-08dc5b0326b6 X-Microsoft-Antispam-Message-Info: swpXRQl5dnN6SDs4XaLKvr8GxAt2+eUeYqbOguCQn6YNhxCg0ZrrWdWF+EGlHk53/jj3RLpB7BbAHb4Gota3dRXS2QCjGish8ZWatiqP4LWn8vYVfdcJwyKkpRw00WdQ8Rpc54O+Ydw9vldiudfkltCHofGFcm5jteqt8JqLcZ8/ClJPTP+mFKrLozNnt42KFeSkVt7ox04D7eVgF7N+1Yyoa44iI7vL8FUNbw0QwOmX/4lbUDh13aCYDy6fbgvswGsoMuNS3wTQlBzWuBgGgWPzgWkNSZgiydBjqtATgG+CN81LjthBb8YAiEJercIUPvyYxfO+xc7y3BzgGz+4n6Xdzqi+v9aiPV5eYe6Xi2PWVWaUmcUqosB1FMkjZ0m5+iwXWzFabhoH2t1DJ4XEGx9yyZCX4Vl5nZg30ZfNYiqHM7ngctaAvDvIOAXcIqSGI2IPwe9PIit9FKZYUUghB9kVTJYFe+pIa95aZITIE4m3T8knLs15JwV6X5NGorxYyR7CRafd54jna+/poUgXaf/oylFVlLka9aXKqDQFVLje4QuDck/QoQiYcL4D8+h5SR+NCmlDEGrk95y3HidPsNsJEBIY0424jgHpU1zHmLO3I3UJY/ezqSvwFcLSl79suFkzhS7mhvgiauMdwVCLkIwhYG60y1CmFRgE0s9F8i+4SabJZ8Lck6uf6ctLecSAgP0V+MDwIVpTlaGPKbnXuenyBO5g76vAZ2xYTTBxUpyFoGUDB2dP9rlayIvA7BM2 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 15:14:02.8487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 080100db-3ba8-4cb9-4f61-08dc5b03301b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00025F98.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8706 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 12 Apr 2024 08:14:12 -0700 Resent-From: sami.mujawar@arm.com Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: GUrFBDlLhIyVfDdtOqKNywvGx7686176AA= Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="a/xgmRrr"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io The RMM 1.0-eac4 introduces a new FID RSI_FEATURES to query the RSI features supported that have been implemented. Therefore, introduce a new function RsiGetFeatures to query the features supported by the RSI. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann Signed-off-by: Sami Mujawar --- ArmVirtPkg/Include/Library/ArmCcaRsiLib.h | 24 +++++++++++- ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsi.h | 3 +- ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c | 39 +++++++++++++++++++- 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h index 88351f53336c42c032fcff6ea97ea7728b917b76..8c1c0d5bc19d14fa640464c8d0d44e3ef522ba79 100644 --- a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h +++ b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h @@ -11,7 +11,7 @@ - REM - Realm Extensible Measurement @par Reference(s): - - Realm Management Monitor (RMM) Specification, version 1.0-eac3 + - Realm Management Monitor (RMM) Specification, version 1.0-eac4 (https://developer.arm.com/documentation/den0137/) **/ @@ -334,4 +334,26 @@ RsiGetVersion ( OUT UINT16 *CONST Minor ); +/** + Get the features supported by the RSI implementation. + + RMM implementations across different CCA platforms may support + disparate features and may offer disparate configuration options + for Realms. The features supported by an RSI implementation are + discovered by reading feature pseudo-register values using the + RSI_FEATURES command. + + @param [in] FeatureRegIndex The Feature Register Index. + @param [out] FeatureRegValue The Feature Register Value. + + @retval RETURN_SUCCESS Success. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. +**/ +RETURN_STATUS +EFIAPI +RsiGetFeatures ( + IN UINT64 FeatureRegIndex, + OUT UINT64 *FeatureRegValue + ); + #endif // ARM_CCA_RSI_LIB_ diff --git a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsi.h b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsi.h index b1c359e2486c20ee19493b10ed3fcef1e20f2689..cd2c9ac05c02413caeed26fd764320dd751ea05b 100644 --- a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsi.h +++ b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsi.h @@ -10,7 +10,7 @@ - RIPAS - Realm IPA state @par Reference(s): - - Realm Management Monitor (RMM) Specification, version A-bet0 + - Realm Management Monitor (RMM) Specification, version 1.0-eac4 (https://developer.arm.com/documentation/den0137/) **/ @@ -20,6 +20,7 @@ // FIDs for Realm Service Interface calls. #define FID_RSI_ATTESTATION_TOKEN_CONTINUE 0xC4000195 #define FID_RSI_ATTESTATION_TOKEN_INIT 0xC4000194 +#define FID_RSI_FEATURES 0xC4000191 #define FID_RSI_HOST_CALL 0xC4000199 #define FID_RSI_IPA_STATE_GET 0xC4000198 #define FID_RSI_IPA_STATE_SET 0xC4000197 diff --git a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c index 12636c484824426b2ea81ca007d962f5f7c58f8c..edd2e11f786d11191f13dd9b087cdeec4127b375 100644 --- a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c +++ b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c @@ -11,7 +11,7 @@ - REM - Realm Extensible Measurement @par Reference(s): - - Realm Management Monitor (RMM) Specification, version 1.0-eac3 + - Realm Management Monitor (RMM) Specification, version 1.0-eac4 (https://developer.arm.com/documentation/den0137/) **/ @@ -574,3 +574,40 @@ RsiGetVersion ( *Major = (SmcCmd.Arg0 & RSI_VER_MAJOR_MASK) >> RSI_VER_MAJOR_SHIFT; return RETURN_SUCCESS; } + +/** + Get the features supported by the RSI implementation. + + RMM implementations across different CCA platforms may support + disparate features and may offer disparate configuration options + for Realms. The features supported by an RSI implementation are + discovered by reading feature pseudo-register values using the + RSI_FEATURES command. + + @param [in] FeatureRegIndex The Feature Register Index. + @param [out] FeatureRegValue The Feature Register Value. + + @retval RETURN_SUCCESS Success. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. +**/ +RETURN_STATUS +EFIAPI +RsiGetFeatures ( + IN UINT64 FeatureRegIndex, + OUT UINT64 *FeatureRegValue + ) +{ + ARM_SMC_ARGS SmcCmd; + + if (FeatureRegValue == NULL) { + return RETURN_INVALID_PARAMETER; + } + + ZeroMem (&SmcCmd, sizeof (SmcCmd)); + SmcCmd.Arg0 = FID_RSI_FEATURES; + SmcCmd.Arg1 = FeatureRegIndex; + + ArmCallSmc (&SmcCmd); + *FeatureRegValue = SmcCmd.Arg1; + return RsiCmdStatusToEfiStatus (SmcCmd.Arg0); +} -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117715): https://edk2.groups.io/g/devel/message/117715 Mute This Topic: https://groups.io/mt/105484267/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-