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 13D9EAC09FF for ; Fri, 5 Jan 2024 04:37:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HxNju5EBcgemDm0zHA7DUClYt9164uzX8hbOd8Q+iaM=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704429434; v=1; b=uz6a0uTQbupEMgde0dNaJXPihgXIVcvTGP4N7gqUErJzuYhHE5ZqfCeDHJ6XSSKnYno0bWVn bJ6/iG+5RSquEkFqIgOaBGpBmLszBaI4Y0StB1yDAVMw9wUgkdUIlSFlKYJNrSIwyOcGId5jhzV gc39AeoIxFuTzBzDoGU315Wc= X-Received: by 127.0.0.2 with SMTP id JzKCYY7687511xSlnl6gVJyd; Thu, 04 Jan 2024 20:37:14 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.113]) by mx.groups.io with SMTP id smtpd.web10.17200.1704429430875622080 for ; Thu, 04 Jan 2024 20:37:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=esmxp3I7fFVwGhl7PBBTFkjbDdEJKnZp3RnR4zfGqtDOnVCunKd4tsalaJYjn/2cwPnrDsBEbee/f+dDB8mKkT+bBZnOTJ6f4jb4Rx4Jda3cOqhxX2Fymx+e/mtXCOoidnNr2v99VoJoHCgFt04hLTQP9Uztm7fX3qV8TCsTkyE4w9mcXeAshJxe2Iuskg9UwKa3njG3W4UZMbfun3Zox3H3Vymze/GTxgmK78xScmXC3cyhObx0UvYXYtTX1XpxHkn2okI4fjUMPQBFhZqz37aWCB6gXMA7XxOUsFzrWBWddYBwTidXLxwYE/mqTXzsZPRrYbbcABjWQNbYKLBwNg== 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=MFhBUevKJg9aLPRout3TE6a8z6n/iieDadsdTJc4cjk=; b=L5So6hmhWnr2hDz7ZnLfxZdGFEOzs8iI1etIYjmNTQl3tl9JojjxKHeE1Z4KatAmJOsXti0BiCUQz3n1r++6jr0PknRhbgQ+0ERzWFQxh5jxIo+SBpkB/wzZ6ZRjKMkJqbhLERqXhwYaXLFbglIH0oyceK2ni46/ic1sM+3oRRN3CITRt9e+n9jnRR2ARp+njQGC771TwReBlc+K4EY/xYDWl2tgXTnbrwipm39uqGjxTGFvZ+TZqQWrp9BHkPc2Cf1X7qXZaY1XFtd0YONvTWvoPPuf1ZLJ4I46wm+vz9hz1j4dQwFZPWHqGIBcPEpEqPrWgx5fK0/c9ETO0XDUWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none X-Received: from LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) by SA0PR01MB6220.prod.exchangelabs.com (2603:10b6:806:e2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13; Fri, 5 Jan 2024 04:37:09 +0000 X-Received: from LV3PR01MB8464.prod.exchangelabs.com ([fe80::7748:d4a3:bcd9:14c1]) by LV3PR01MB8464.prod.exchangelabs.com ([fe80::7748:d4a3:bcd9:14c1%6]) with mapi id 15.20.7159.013; Fri, 5 Jan 2024 04:37:09 +0000 From: "Rebecca Cran via groups.io" To: Leif Lindholm , Ard Biesheuvel , Sami Mujawar CC: Rebecca Cran , devel@edk2.groups.io Subject: [edk2-devel] [PATCH v2 3/3] ArmPkg: Disable watchdog interaction after exiting boot services Date: Thu, 4 Jan 2024 21:35:08 -0700 Message-ID: <20240105043508.461417-4-rebecca@os.amperecomputing.com> In-Reply-To: <20240105043508.461417-1-rebecca@os.amperecomputing.com> References: <20240105043508.461417-1-rebecca@os.amperecomputing.com> X-ClientProxiedBy: CH0PR03CA0267.namprd03.prod.outlook.com (2603:10b6:610:e5::32) To LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV3PR01MB8464:EE_|SA0PR01MB6220:EE_ X-MS-Office365-Filtering-Correlation-Id: 174ee40d-2ac7-48c5-bd94-08dc0da7fa6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: PYmb4evxVBKNLC/fKX0tmY9CulD+r/tcsekwuKDNNFxS+Kq/6z7MzDDol27xqrsmgIG0KN3ILnAn3Ic2JynqcOm3dIaIblOc49y/B/TAdoxGiDsLY7Wya6MyXuzmhVBcmXHAQzknTsejAAAegR3XwX/8hdPcgXxYlUEUixkF5YQMyTbwDZvKk+Mc84LCwkY1u6eqWa57DxR01I/t3QtHUTvcL7scIiZu4evrWwK4VvYhHWEitgV2kayBWpB6Rdr4NvkL0j7e2Fs2x6QS3TJlpi7IAWuegYRN201e+7PgzXU+g/Uzsg+TE6zmmzx3R3AlpyENaPe/cU4NShlsBmjAQEZP+kOegb/Sc3qF6xjXxbJRa2gtNdC4CVQGt0/cn5VsV4GBY1Ah460RamwQG/nn6mln5GaOpCJq732/IauNJxf1fnBHxu/5G9Lga4lXofDBGV1Iergen2VbfRqgeu63i5FHzMWRCmFVZbz5OJIEzYIHAThRym00WxBYBJyWi1V21U2GYWQB7gFG+w6hbdMDeDYOnETbTQQw48oKENMPgGgoHPHHAGcxJMwmXkjmlAtPF4lh9RZxMchZVDpiKsbSJG40rK2QxxEXGzs72XlVMru54P3ApE4ex/MupyCiJQhJ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ke/JkD5XDPsY4AiwJ/kPyxGtX2KFYkIL9908NzF+GTf/PhFM3RR6J6JhhWmc?= =?us-ascii?Q?x9v+4TCRNhdhqXJ2K/cf9pc5j/vSdaPgF+lDMWDs7x84EKIRBvw4jAHlssUs?= =?us-ascii?Q?dNndjLQdSttCunzGtnrAb9lw9ZiAAkK00vEwilILrxf3I28Q0fbYe3UIxYiP?= =?us-ascii?Q?NzJtBzqpWlyUWJ0x3SsVccS+dRN10u9NJNY6EdVzcipxRUKzTph1DaMITYNg?= =?us-ascii?Q?l0uXs9cfmX+HHemO6F4yHGU4sGH3szRTICE/hUzjaGb8RtNAzVs+1hu3ZIva?= =?us-ascii?Q?ghXG+80we3OVANeSxj341JS0zDZKvqVcuvs0bIosBQEbrxqAmWRo8dJb5MOf?= =?us-ascii?Q?CKCCpqAVx+sn59nj/jc3yRFQkXVK4sQGSRo0tX5ReO4azYV53KEx039BbBbc?= =?us-ascii?Q?LP/snclWUtdiaN13Pu58BaorEfXZkpyIfrSOhjn1t7tNwhKf7jqF3ynEv21s?= =?us-ascii?Q?Q4wOjP2RNT8Y19I2nP8sE1lev6ruQR6hvqkm3dczCTkoeZeTiA5wzQvcpvui?= =?us-ascii?Q?86AskhBHp1aJwVwp+FcLGXtfLSU8Ne9qPA+wIRugLFGR+ceqDwJZuy0hX/Ls?= =?us-ascii?Q?uJHztBgTx2lkNcZ4/SKJ2Ympauq9CmRYcDcvJAwSixMSiSBTE/BOAGvRQcZi?= =?us-ascii?Q?+oU3AiVrHSJ9k77wycmjTSZuEQRPKBc5ppt7R2BLwln1lGKp/ja5BXyj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Qw9YLusk1PcYQl6AhVTEB?= =?us-ascii?Q?ryo8fW55yIcrPFOSywVX5Vw=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 174ee40d-2ac7-48c5-bd94-08dc0da7fa6e X-MS-Exchange-CrossTenant-AuthSource: LV3PR01MB8464.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 04:37:09.2801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GU7BcjCVzBKKw8WhpkJwt5oOzYXk4c/4EbAdEsDRyZ+tgAOkPht82jzhePVC7BzNsr4zw5PN5MrVoOU33y9a3gnBraUowe+eKXy4HhZKIbg/tLTv+mfPXsAddPfuExzT X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR01MB6220 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,rebecca@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LtvI0NfJn85FL2498NKnC1skx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=uz6a0uTQ; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 Update GenericWatchdogDxe to disable watchdog interaction after exiting boot services. Also, move the mEfiExitBootServicesEvent event to the top of the file with the other static variables. Signed-off-by: Rebecca Cran --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPk= g/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index f74d0d1ced2e..44d812193031 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -33,10 +33,14 @@ It is therefore stored here. 0 means the timer is not running. */ STATIC UINT64 mTimerPeriod =3D 0; =20 +/* disables watchdog interaction after Exit Boot Services */ +STATIC BOOLEAN mExitedBootServices =3D FALSE; + #define MAX_UINT48 0xFFFFFFFFFFFFULL =20 STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol; STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify; +STATIC EFI_EVENT mEfiExitBootServicesEvent; =20 STATIC VOID @@ -200,7 +204,13 @@ WatchdogSetTimerPeriod ( UINT64 TimerFrequencyHz; UINT64 NumTimerTicks; =20 - // if TimerPeriod is 0, this is a request to stop the watchdog. + // If we've exited Boot Services but TimerPeriod isn't zero, this + // indicates that the caller is doing something wrong. + if (mExitedBootServices && (TimerPeriod !=3D 0)) { + return EFI_DEVICE_ERROR; + } + + // If TimerPeriod is 0 this is a request to stop the watchdog. if (TimerPeriod =3D=3D 0) { mTimerPeriod =3D 0; WatchdogDisable (); @@ -304,8 +314,6 @@ STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer= =3D { WatchdogGetTimerPeriod }; =20 -STATIC EFI_EVENT mEfiExitBootServicesEvent; - EFI_STATUS EFIAPI GenericWatchdogEntry ( --=20 2.34.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 (#113212): https://edk2.groups.io/g/devel/message/113212 Mute This Topic: https://groups.io/mt/103537820/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-