From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.13324.1687949810160439495 for ; Wed, 28 Jun 2023 03:56:50 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65AAFC14; Wed, 28 Jun 2023 03:57:33 -0700 (PDT) Received: from [10.34.100.101] (e126645.nice.arm.com [10.34.100.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4370E3F663; Wed, 28 Jun 2023 03:56:48 -0700 (PDT) Message-ID: <93b0e69e-a3e8-bdab-1d0a-353df22158fb@arm.com> Date: Wed, 28 Jun 2023 12:56:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH edk2-platforms v1 1/1] Platform/Arm: Disable memmap platform timers for JunoR0 To: Sami Mujawar , devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, thomas.abraham@arm.com, Sudeep.Holla@arm.com, Matteo.Carlini@arm.com, Akanksha.Jain2@arm.com, Ben.Adderson@arm.com, Sibel.Allinson@arm.com, nd@arm.com References: <20230616124059.19524-1-sami.mujawar@arm.com> From: "PierreGondois" In-Reply-To: <20230616124059.19524-1-sami.mujawar@arm.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: Pierre Gondois On 6/16/23 14:40, Sami Mujawar wrote: > Juno includes a system-level wakeup timer which is an implementation > of the ARM Generic Timer architecture. > The CNTCTL frame contains some registers that are accessible using a > Non-Secure access. Juno R0 incorrectly limits these accesses to Secure > access only. This issue is documented in the Juno Errata > 832219: APB port security breaks SBSA compliance > https://developer.arm.com/documentation/epm008857/latest > > This results in a crash when the OS tries to access these registers. > Therefore, disable memory mapped platform timers for Juno R0. > > Cc: Ard Biesheuvel > Cc: Thomas Abraham > Cc: Sudeep Holla > > Signed-off-by: Sami Mujawar > Reported-by: Sudeep Holla > --- > The changes can be seen at: https://github.com/samimujawar/edk2-platforms/tree/1496_junor0_disable_memmap_plat_timers_v1 > > Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 48 ++++++++++++-------- > 1 file changed, 30 insertions(+), 18 deletions(-) > > diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c > index 48f0fd370f073c8fed1a649d8c4ab28b062a8290..91f035480dcfe81e93febfac2ef703d6c77737f1 100644 > --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c > +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c > @@ -1,7 +1,7 @@ > /** @file > Configuration Manager Dxe > > - Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
> + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -1380,26 +1380,38 @@ GetArmNameSpaceObject ( > break; > > case EArmObjPlatformGTBlockInfo: > - Status = HandleCmObject ( > - CmObjectId, > - PlatformRepo->GTBlockInfo, > - sizeof (PlatformRepo->GTBlockInfo), > - ARRAY_SIZE (PlatformRepo->GTBlockInfo), > - CmObject > - ); > + if (PlatformRepo->JunoRevision == JUNO_REVISION_R0) { > + // Disable Memory Mapped Platform Timers for Juno R0 > + // due to Juno Erratum 832219. > + Status = EFI_NOT_FOUND; > + } else { > + Status = HandleCmObject ( > + CmObjectId, > + PlatformRepo->GTBlockInfo, > + sizeof (PlatformRepo->GTBlockInfo), > + ARRAY_SIZE (PlatformRepo->GTBlockInfo), > + CmObject > + ); > + } > break; > > case EArmObjGTBlockTimerFrameInfo: > - Status = HandleCmObjectRefByToken ( > - This, > - CmObjectId, > - PlatformRepo->GTBlock0TimerInfo, > - sizeof (PlatformRepo->GTBlock0TimerInfo), > - ARRAY_SIZE (PlatformRepo->GTBlock0TimerInfo), > - Token, > - GetGTBlockTimerFrameInfo, > - CmObject > - ); > + if (PlatformRepo->JunoRevision == JUNO_REVISION_R0) { > + // Disable Memory Mapped Platform Timers for Juno R0 > + // due to Juno Erratum 832219. > + Status = EFI_NOT_FOUND; > + } else { > + Status = HandleCmObjectRefByToken ( > + This, > + CmObjectId, > + PlatformRepo->GTBlock0TimerInfo, > + sizeof (PlatformRepo->GTBlock0TimerInfo), > + ARRAY_SIZE (PlatformRepo->GTBlock0TimerInfo), > + Token, > + GetGTBlockTimerFrameInfo, > + CmObject > + ); > + } > break; > > case EArmObjGicCInfo: