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 CFC17D8027D for ; Fri, 12 Apr 2024 14:34:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=md7Yi63iuPFn3EkgEZfqcHRhzZsZyGduwz3ap8vyzPQ=; 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=1712932450; v=1; b=S/E54BoLkLHQo94nqwHPlEmqQcsCZvZCDTBARY2frvswkHmbcDFezBaHRp3cr+1C6dYadH18 zdaUQ37wBwySW+KQTwDZB5sl1Vp+PH0+9zph3h3js27pVisZekq/dIAsVMgwwAAlP3p3eKREPTs k9e5tVdnaQTzEx+Lpzx+EIO1Sb5H5C58KPHZZDy1LDiJK4vEU2iiMu+Cu2KrCVCT0I6lpnRHiC2 ccUg0WU6G1ib2BUtJVuP0Jgkwkl31UQ3+YKqEXdmIGktAm58F5fRvPJz146YCgnFxew5GMFMx4B PM2gUMEbmHj3sc81x39+aHSqq52JW85qKJkSqpII8J4Fg== X-Received: by 127.0.0.2 with SMTP id bQJQYY7687511x6crHzvKQi9; Fri, 12 Apr 2024 07:34:10 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.69]) by mx.groups.io with SMTP id smtpd.web10.48551.1712932442273067271 for ; Fri, 12 Apr 2024 07:34:02 -0700 X-Received: from DB6PR0301CA0099.eurprd03.prod.outlook.com (2603:10a6:6:30::46) by DB9PR08MB8226.eurprd08.prod.outlook.com (2603:10a6:10:39e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Fri, 12 Apr 2024 14:33:57 +0000 X-Received: from DB1PEPF000509E6.eurprd03.prod.outlook.com (2603:10a6:6:30:cafe::f7) by DB6PR0301CA0099.outlook.office365.com (2603:10a6:6:30::46) 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 14:33:57 +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 DB1PEPF000509E6.mail.protection.outlook.com (10.167.242.56) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Fri, 12 Apr 2024 14:33:57 +0000 X-Received: ("Tessian outbound 9fd7e4b543e6:v313"); Fri, 12 Apr 2024 14:33:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ddbb708fc5b92d10 X-CR-MTA-TID: 64aa7808 X-Received: from 948b41aab6cc.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 83BC4194-43E5-41B6-92C9-A28C681A5BC4.1; Fri, 12 Apr 2024 14:33:50 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 948b41aab6cc.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:50 +0000 X-Received: from DUZPR01CA0149.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bd::25) by DU0PR08MB8116.eurprd08.prod.outlook.com (2603:10a6:10:3ec::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.47; Fri, 12 Apr 2024 14:33:47 +0000 X-Received: from DU6PEPF00009523.eurprd02.prod.outlook.com (2603:10a6:10:4bd:cafe::95) by DUZPR01CA0149.outlook.office365.com (2603:10a6:10:4bd::25) 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 14:33: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 DU6PEPF00009523.mail.protection.outlook.com (10.167.8.4) 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 14:33:47 +0000 X-Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) 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 14:33:45 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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 14:33:44 +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 14:33:44 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 39/45] ArmVirtPkg: RMM 1.0-eac2 - Add Flags to RsiSetIpaState() Date: Fri, 12 Apr 2024 15:33:16 +0100 Message-ID: <20240412143322.5244-40-sami.mujawar@arm.com> In-Reply-To: <20240412143322.5244-1-sami.mujawar@arm.com> References: <20240412143322.5244-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU6PEPF00009523:EE_|DU0PR08MB8116:EE_|DB1PEPF000509E6:EE_|DB9PR08MB8226:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b931f10-c797-49a9-d020-08dc5afd9625 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: bhO54+J5XaDV+41TNU6IALkamCQaVcSF+4HmpvVSCcjRgmzAEsPhalZQO0QWowZtRhwsloRh5/w+nNCtbzCYTmjqlo2tlOBmELRkFx30Cqy/vIErsuj1IyKTr8h7F9S0+Z/zQf0qcFaVfdoyxR1U3upZ5IBUB2jZRo8Ubj/R/aH3DEXNvGFxDlivgHhcSUr0I1KB+gvu+LKcYhr1+tCoqgoMI5KqkZWreySnSETokjVjvO9ETHnEg4t3vlLVz2IMWpENEWlHx6HHRm8ZhuR2dKsmhrpIABN8PHYXLJUAz8tSWmFappRxAfb75BxIfn7T0mXgRbQcAlj6SnSI5YHo+mtchaggXh4n0RZg/rM7fSa+RDiUwrJjhZDYrF0KDbuO4V4ZONhI9kt0obm1tjQGWkr4r60nEuS7Ff7BJKznAOfE54LIhpHSt9y4KlOq6dRY0xPe2EmECHuVljhXTP+b43yScKOz+jPl2gYYf3J+0ry0j0LKryOWcUaLk9OuJjYQLRNfux+XHsy2gr68unQS5Hx0aUhXZjAzPyYh9JK2+u2e+WYXob4fjlWR1f9S6qJFyE46Mr2NZZ04InPd0WnDqqV9tDX4zuM2utqAis9pMCAasF4CmI8bQ5PxSWCiEPrnI+WHDuAxgtkbwGIKxN2ilJe9213aJ5yZPIzzwXFDCED4VvqigHKtQostnRXpEiH5RSLZ6AyXAlb8QMdXljQC288aS7cCDPgGOoHZpEJBYOnNXNr778zAo7R7AQt1MiqJ 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)(82310400014)(376005)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8116 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509E6.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d5b1c1e6-b003-4d21-1f5b-08dc5afd905d X-Microsoft-Antispam-Message-Info: MdSNP68cfTpzMYMhE5BOkcrNMfoDSQbKAuYGBl76NQJpwzRnRoDNqWQPHTcb4TJLrBAD2Iy9DyHLZM14pIA5bjYMLq1y2uYBSLSbpyI9Hgov2IlQFOIrlIxsiM9ZfQ+nBhSItVjBrqOox1dUGbNztNpQrz53zH1lEUAUCh5Dxk4eDjKbiHDSWeNITebkKIxPJhMdAtdi8WoAj9m7z52kXLUIKkCBnhsVGpEYO9dgA1GUWyUcjha/qmS5ucvrrdPVC+8uUVNXNiz768H1XGsLswuwgZS2RkE9IyHYhp1un7pFSlKlQEXxMlvb0xTFnyHUSZ0E7xREsyJDANKnUpaU7WJa3MLhEx8BP8uixqGQMnFqaHlRDyw8zhZX3Xl9wX4t+kO6MH+vOIZRJ590za3icsiAt/7aj6wLFdVrM5MsTM1qTnWX4/Ed3iAJMQBEUT0v4qBJhfmzC/YyYGi0a+/ArRp/8qs43l7gkMj/Y7yTbUU+DrHS83ARTZ/ovNc1zfrB7u7D2zQUFm2w2DG3w4TPKi68MGqLT4u72ntSFB5Bjdd6qYPenADlSc4kYLsjq6R14ky5gySjIvZQ81Opko8stZ2CuoICzSMBzRdKoNvvYJugJz834HP/ste7Caizg33ZTCj1SY5/T8Ges5o6FJOiD2/R3BmFmjzC1EHtiEifCNQ4qRT2tjmgkZkSvfxq2niV88gry9onr3OCYjvMzPyG+mTh5sHGCY3hiBz4pwN8KsRBx140n4dyOPLWLwYpQG2w X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:57.1897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b931f10-c797-49a9-d020-08dc5afd9625 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: DB1PEPF000509E6.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8226 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 07:34:02 -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: C1PPhlq2MKabeNqdmxmzf61sx7686176AA= 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="S/E54BoL"; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) The RMM specification 1.0-eac2 updates the RSI_IPA_STATE_SET interface to add a new parameter RsiRipasChangeFlags. The RsiRipasChangeFlags fieldset is 64 bits and the bit 0 describes the RsiRipasChangeDestroyed type which is used to indicate if a RIPAS change from DESTROYED should be permitted or not. Therefore, update the RsiSetIpaState() to add a new parameter for specifying the RsiRipasChangeFlags. Also update the usage of RsiSetIpaState() in ArmCcaInitPeiLib and in RealmApertureManagementProtocolDxe. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann Signed-off-by: Sami Mujawar --- ArmVirtPkg/Include/Library/ArmCcaRsiLib.h | 4 +++- ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c | 3 ++- ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c | 7 +++++-- ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c | 6 ++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h index 154a5717f259502952a36312f6c3b3d6b75f15cb..5c2f996d3b4376e831a901f2919780acffec3313 100644 --- a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h +++ b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h @@ -205,6 +205,7 @@ RsiGetIpaState ( @param [in] Address Address to the start of the memory range. @param [in] Size Length of the memory range. @param [in] State The RIPAS state to be configured. + @param [in] Flags The RIPAS change flags. @retval RETURN_SUCCESS Success. @retval RETURN_INVALID_PARAMETER A parameter is invalid. @@ -214,7 +215,8 @@ EFIAPI RsiSetIpaState ( IN UINT64 *Address, IN UINT64 Size, - IN RIPAS State + IN RIPAS State, + IN UINT64 Flags ); /** diff --git a/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c index 2b2801cc5426994efc15c970fd6b0adf43bd7d36..e59a990da42526e280c1951b404e318df6a7bfca 100644 --- a/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c +++ b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c @@ -50,7 +50,8 @@ ArmCcaConfigureSystemMemory ( Status = RsiSetIpaState ( (UINT64 *)PcdGet64 (PcdSystemMemoryBase), PcdGet64 (PcdSystemMemorySize), - RipasRam + RipasRam, + RIPAS_CHANGE_FLAGS_RSI_NO_CHANGE_DESTROYED ); if (RETURN_ERROR (Status)) { // Panic diff --git a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c index 0280d8e42882ddfb02d0a40c47a6fba7855ba84f..0535254a3991bfe7a19b904e83b9482f801da20c 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-eac1 + - Realm Management Monitor (RMM) Specification, version 1.0-eac2 (https://developer.arm.com/documentation/den0137/) **/ @@ -318,6 +318,7 @@ RsiGetIpaState ( @param [in] Address Address to the start of the memory range. @param [in] Size Length of the memory range. @param [in] State The RIPAS state to be configured. + @param [in] Flags The RIPAS change flags. @retval RETURN_SUCCESS Success. @retval RETURN_INVALID_PARAMETER A parameter is invalid. @@ -327,7 +328,8 @@ EFIAPI RsiSetIpaState ( IN UINT64 *Address, IN UINT64 Size, - IN RIPAS State + IN RIPAS State, + IN UINT64 Flags ) { RETURN_STATUS Status; @@ -353,6 +355,7 @@ RsiSetIpaState ( SmcCmd.Arg1 = (UINTN)BaseAddress; SmcCmd.Arg2 = (UINTN)EndAddress; SmcCmd.Arg3 = (UINTN)State; + SmcCmd.Arg4 = Flags; ArmCallSmc (&SmcCmd); Status = RsiCmdStatusToEfiStatus (SmcCmd.Arg0); diff --git a/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c b/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c index 991054d47b10b45ed5c211827e795d88f8942c02..9212f0f6d2522a59bf289d2699d0972a074b8f9d 100644 --- a/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c +++ b/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c @@ -236,7 +236,8 @@ RampOpenAperture ( Status = RsiSetIpaState ( (UINT64 *)Memory, (Pages * EFI_PAGE_SIZE), - RipasEmpty + RipasEmpty, + RIPAS_CHANGE_FLAGS_RSI_NO_CHANGE_DESTROYED ); if (RETURN_ERROR (Status)) { DEBUG (( @@ -335,7 +336,8 @@ RampCloseAperture ( Status = RsiSetIpaState ( (UINT64 *)ApertInfo->BaseAddress, (ApertInfo->Pages * EFI_PAGE_SIZE), - RipasRam + RipasRam, + RIPAS_CHANGE_FLAGS_RSI_NO_CHANGE_DESTROYED ); if (RETURN_ERROR (Status)) { DEBUG (( -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117696): https://edk2.groups.io/g/devel/message/117696 Mute This Topic: https://groups.io/mt/105483436/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-