From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C3D05740032 for ; Mon, 6 Nov 2023 00:57:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GVXDrznLAIJWNCFTb38E2VZ3B41xiXK2zaF3Gx+UTV0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699232226; v=1; b=w38cOU7GTqnqbKz1F1cr9mAdden4KrjFPx/bSVddetjpgQ9GWxXOdyCmgX6ZP7jAXXzi4vzf sRZw+v6SI9fotAKchnkanFfA57BlFkTQEw+7BiBSKXHzRElYUGr5Q9mNyTRIMrqwX0ZrHjGqlgl FQ/+p/FWRiCH4kV8HXbhlRyY= X-Received: by 127.0.0.2 with SMTP id HgUIYY7687511xR06nR6TKeR; Sun, 05 Nov 2023 16:57:06 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.65]) by mx.groups.io with SMTP id smtpd.web10.44179.1699232225482775499 for ; Sun, 05 Nov 2023 16:57:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ymhr+/zyQe8ea6jJunClnrI3fgQGtMTaLRxOWn83TsEVZO+vdnSbOAZ63khr481bwDIhIQXEaUq1npfrvyqD7dy5gk1A3yiGwiEg9pjpfAXpfldRcN/lTwjoOzGTgbCC2A75ujX93La9oq5zJbS/bDgzKpM9tqbwQc95kVT9YONtApssc5TdkwGqBA45uAfuw0bzdvjvB/9/Ovb6bgG/9RawYEDqiFJQP3Sj8UsDVXd6fejbR1EbcEQmbLDoAVbgF72n46JAlbcjI10HHBUKYvOnCII356yvkyMq+oUDdR6nxZpGUNJhszIV3BHCVyCtikUaFPId4w1fUgrXlRMICw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Dff7bkb9GNwFiN/5QmMsII3yHYGNWvh02XL4PEeijZo=; b=Cmt8TyY1VslcC2130cWh0xsesJeoS3l2tB/4dOWikdk3OwznBJKsUUzf6l+WAL/5VqamRcV6lVSQvLJT0vdRLYTsMqx48xk3s9j3gcg8+SFmkVqFruz7ptTWGJPN+F+XNioxkHEZ2Gm+wxcPSVf5OvEvUCOKmp7+soOUUcJDn/71T6iPjiYgA4bZU/NMDQl75GTEAsGvTIGqwOhSdZxmvfrVkrF6k22BdJIVPzhuoptbNBvhbkOSfHqR+pOmh6ubmRjaEgBpEbksy8MMITiLnI/FePBDtJbSX40RwHupRQWQYHNf1aipFThuu5JLDr5tXaAAcXwJC//zEHLq0DoRBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DS0PR12MB7825.namprd12.prod.outlook.com (2603:10b6:8:14d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Mon, 6 Nov 2023 00:57:00 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::e670:e45f:fa32:2420]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::e670:e45f:fa32:2420%7]) with mapi id 15.20.6954.027; Mon, 6 Nov 2023 00:57:00 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg/RedfishFeatureCoreDxe: notify platform before reboot. Thread-Topic: [edk2-redfish-client][PATCH 2/2] RedfishClientPkg/RedfishFeatureCoreDxe: notify platform before reboot. Thread-Index: AQHaDXXo/8h9T5F4iE6L4rIRJDooebBsfKHg Date: Mon, 6 Nov 2023 00:57:00 +0000 Message-ID: References: <20231102101756.13907-1-nicklew@nvidia.com> In-Reply-To: <20231102101756.13907-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=90559fcf-cd8b-44c4-81f0-0a61a21e645b;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-11-06T00:54:20Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|DS0PR12MB7825:EE_ x-ms-office365-filtering-correlation-id: 51a26354-07f3-4cab-c7d0-08dbde6348a9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: MYHWQhCiPtjY+z1F+3nfK2NpovZ039ErYFZYlSgBdi95wpAa2SWE1rbSUQc86afO0DxmvpO9y/Q1x1I+3kHkxSfIFEjvLngnWgP4795B0qFcWfNdzW0dmTC24G4E/ANRUvUasHYgfIzF+Szti+KCieQ9GTWaiDd88Rpf0WlzZmLOyFddoyifQ0xfN1hDSvsI7WbdwAo28lNY5u3JoG5JfHBbArC17/Qy8RNWoHp0kioDSmKt1zkUJbk8N8SUpAElI+TtzChbyuJz0jXsfjCxWzPVgkwVv7WhWR+YKZi+E3a0fY6UKAPZcvM9l3HzNAgEh4gBF31tdJmXX3m3KcEyDUhdhBTbZSXW0LetOiAL76zfOykiMA2sQpnAJfSSXotW+G2S9Id8wYMl6dZ49nmBeZtFGSwdOKTeOIBC/DzDsZEyqXA8PqDyxwIoNbbLKfxzCKj6fkXTbGACpJjtFiyXl6epQu5fxDHgS9DAwvcozKIn00lIUKZywLtTIsvFWTwWBfRjDSMBOJe/A0/fzF5IfazONia1ua5AhRwG/fWP8buaU+f/TVHlAC0uuiTDbPoU+TY/nZGDXvRYgNPl9wnNzQRhKhtKkU5m2k9YS63dfI2BIPEXiZsA8YPZLDg5vGCCZSH93KTjvjV2Nseao/L7asXSheWHz16eKq/eYu3b4c8= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WGuvAB5nAnZxnNajE6pjO4581wwk6aExHoJjyl3qw6TAEFKyZhVPfTbqbqp9?= =?us-ascii?Q?Wihje03SSWfi7BizxeKTmmmyu8OvJO4HB2ZGpUneFuk5YAvli0AG+dkBfxdV?= =?us-ascii?Q?P9j1uPCFos6yN9qSFloxHueElZSbJm1DvR3EUm+HIxep+wAgOUiBiNN5gREO?= =?us-ascii?Q?P5xmHhgpNElzsLRejF7oK2SwhB5s16lTJ1HGxubiLFIVgIydcSY+jDqZUtjK?= =?us-ascii?Q?Kd7TRCK0uvmG1IkGm6IBqAEHqmgasyh1dydcXLphizYyjvCtRJgOp+oy5QZu?= =?us-ascii?Q?lMArXGdwglflQr+mi2jxaDzKUXqPBxRznzzJVrJdjqTcAIkCjGQ+TiImNbJu?= =?us-ascii?Q?wuAG1reA/wJd0e2ePV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Q?hv3lHsqWWJ811PnPjUuYqwDJhPuM+TnFNDyqIgPGvfCD6PboBCAYIGQ3TdIC?= =?us-ascii?Q?XUKqfKBTlcozAcAhKUGcuFTDK9G6r7BOkb92WOXiDzViEDxZsWJuCIDjTQtA?= =?us-ascii?Q?7a+wE3p3ziQJuqKcXi5B3E9+CPrxClwzRiqUxxQL/PxmC1iupK8w0bFAmiw1?= =?us-ascii?Q?W8RPKZleqYGLf8Rr+jCmOg7LBPs2EGdBYGmpmqr9v1XewtlBTkkB4wc5CLCd?= =?us-ascii?Q?KjYgDgEcsgVyMpZEkDP7Aq/csx94DQNiLgThhBvt24GofTV59ONMY9swBnB7?= =?us-ascii?Q?dN31nZBYDtasR/MwO2E=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51a26354-07f3-4cab-c7d0-08dbde6348a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2023 00:57:00.4937 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2AoIZ3miJqP5wLyzF4SkMxI0W2z27x+FCOzPDu5agJf1yEk9Cn4JhmCl70f4KgSGa+ZZxmguAbdYJWXv29O12A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7825 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 Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: olesz6lPVeyM61KuOEvuDAl2x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=w38cOU7G; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") [AMD Official Use Only - General] Looks good, you can move EDKII_REDFISH_OVERRIDE_PROTOCOL *RedfishOverride= from local variable to global variable and locate this protocol only once = if there are more than one use cases of Redfish override protocol in Redfis= hFeatureCore in the future. Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Thursday, November 2, 2023 6:18 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > ; Nick Ramirez > Subject: [edk2-redfish-client][PATCH 2/2] > RedfishClientPkg/RedfishFeatureCoreDxe: notify platform before reboot. > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Call Redfish override protocol to notify platform that the Redfish > changes system settings and about to perform system reboot. Platform > firmware can do platform specific operation before system rebooted. > To follow platform policy, platform can reject system reboot by > returning error status and Redfish feature core driver will abort system > reboot. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../RedfishFeatureCoreDxe.inf | 1 + > .../RedfishFeatureCoreDxe.h | 1 + > .../RedfishFeatureCoreDxe.c | 25 +++++++++++++++++-- > 3 files changed, 25 insertions(+), 2 deletions(-) > > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > index c67525ee..320eddc9 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > @@ -47,6 +47,7 @@ > > [Protocols] > gEdkIIRedfishFeatureProtocolGuid ## BY_START > + gEdkiiRedfishOverrideProtocolGuid ## CONSUMED > > [Pcd] > > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupEve > ntGuid > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > index a94c7930..93139af2 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > @@ -12,6 +12,7 @@ > #define EDKII_REDFISH_FEATURE_CORE_DXE_H_ > > #include > +#include > > #include > #include > diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe= .c > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > index d9aa6e1a..e2ae125f 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > @@ -242,11 +242,14 @@ RedfishFeatureDriverStartup ( > IN VOID *Context > ) > { > + EFI_STATUS Status; > REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; > UINT16 RebootTimeout; > + EDKII_REDFISH_OVERRIDE_PROTOCOL *RedfishOverride; > > - StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; > - RebootTimeout =3D PcdGet16 (PcdRedfishSystemRebootTimeout); > + RedfishOverride =3D NULL; > + StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; > + RebootTimeout =3D PcdGet16 (PcdRedfishSystemRebootTimeout); > // > // Invoke EDK2 Redfish feature driver callback to start up > // the Redfish operations. > @@ -290,6 +293,24 @@ RedfishFeatureDriverStartup ( > if (PcdGetBool (PcdRedfishSystemRebootRequired)) { > Print (L"System configuration is changed from RESTful interface. Reb= oot > system in %d seconds...\n", RebootTimeout); > gBS->Stall (RebootTimeout * 1000000U); > + > + // > + // Call override protocol to notify platform that Redfish is process= ed > + // and about to reboot system. > + // > + Status =3D gBS->LocateProtocol ( > + &gEdkiiRedfishOverrideProtocolGuid, > + NULL, > + (VOID **)&RedfishOverride > + ); > + if (!EFI_ERROR (Status)) { > + Status =3D RedfishOverride->NotifyPhase (RedfishOverride, > EdkiiRedfishPhaseBeforeReboot); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: abort the reboot because NotifyPhase() > returns failure: %r\n", __func__, Status)); > + return; > + } > + } > + > gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > CpuDeadLoop (); > } > -- > 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110687): https://edk2.groups.io/g/devel/message/110687 Mute This Topic: https://groups.io/mt/102338708/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-