Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-25 Thread Ashish Singhal via groups.io
l-groups-io ; Marc Zyngier ; Sami Mujawar ; Ard Biesheuvel ; Leif Lindholm Subject: Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable Hello Ard, When we had a discussion on this topic earlier, maybe a few weeks back, we thought device memory is being accessed in a specu

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-23 Thread Ashish Singhal via groups.io
: Invalidate Instruction Cache On MMU Enable External email: Use caution opening links or attachments On Wed, 23 Feb 2022 at 19:14, Ashish Singhal wrote: > > Ard, > > During PrePi, I setup the initial memory map by calling into ArmConfigureMmu > function with my memory table where device

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-23 Thread Marc Zyngier
On Wed, 23 Feb 2022 07:02:28 +, Ard Biesheuvel wrote: > > (+ Marc) > > On Tue, 22 Feb 2022 at 03:42, Ashish Singhal wrote: > > > > Even with MMU turned off, instruction cache can speculate > > and fetch instructions. This can cause a crash if region > > being executed has been modified rece

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-23 Thread Ard Biesheuvel
On Wed, 23 Feb 2022 at 19:14, Ashish Singhal wrote: > > Ard, > > During PrePi, I setup the initial memory map by calling into ArmConfigureMmu > function with my memory table where device memory regions have attribute of > ARM_MEMORY_REGION_ATTRIBUTE_DEVICE and DRAM regions have attribute of > A

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-23 Thread Ashish Singhal via groups.io
Ashish From: Ard Biesheuvel Sent: Wednesday, February 23, 2022 10:40 AM To: edk2-devel-groups-io ; Ashish Singhal Cc: Marc Zyngier ; Sami Mujawar ; Ard Biesheuvel ; Leif Lindholm Subject: Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-23 Thread Ard Biesheuvel
On Wed, 23 Feb 2022 at 18:36, Ashish Singhal via groups.io wrote: > > Hello Ard and Marc, > > I apologize for not providing the background on this in the commit message > and I understand the commit message is not very clear as well. Let me try to > summarize the problem. > > In our UEFI impleme

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-23 Thread Ashish Singhal via groups.io
Hello Ard and Marc, I apologize for not providing the background on this in the commit message and I understand the commit message is not very clear as well. Let me try to summarize the problem. In our UEFI implementation, we are doing the following as part of the initial MMU setup: 1. Set

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-22 Thread Ard Biesheuvel
(+ Marc) On Tue, 22 Feb 2022 at 03:42, Ashish Singhal wrote: > > Even with MMU turned off, instruction cache can speculate > and fetch instructions. This can cause a crash if region > being executed has been modified recently. With this patch, > we ensure that instruction cache is invalidated rig

Re: [edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-22 Thread Ashish Singhal via groups.io
+ @Samer El-Haj-Mahmoud Hello Leif/Ard/Sami/Samer, Can you please look at this patch and provide some feedback? Thanks Ashish From: Ashish Singhal Sent: Monday, February 21, 2022 7:42 PM To: devel@edk2.groups.io ; sami.muja..

[edk2-devel] [PATCH] ArmPkg: Invalidate Instruction Cache On MMU Enable

2022-02-21 Thread Ashish Singhal via groups.io
Even with MMU turned off, instruction cache can speculate and fetch instructions. This can cause a crash if region being executed has been modified recently. With this patch, we ensure that instruction cache is invalidated right after MMU has been enabled and any potentially stale instruction fetch