Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-18 Thread Fabio Estevam
Hi Pierre, On Mon, Mar 18, 2024 at 4:59 PM Pierre-Clément Tosi wrote: > I notice that the mem_map in these logs have overlapping ranges, which results > in unnecessary work when creating the PTs. For this reason, it would make > sense > to prune it in arch/arm/mach-imx/imx8/cpu.c before

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-18 Thread Pierre-Clément Tosi
Hi Fabio, On Mon, Mar 18, 2024 at 10:31:25AM -0300, Fabio Estevam wrote: > Please find the new logs here: > > https://pastebin.com/raw/qF3GbJry I notice that the mem_map in these logs have overlapping ranges, which results in unnecessary work when creating the PTs. For this reason, it would

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-18 Thread Fabio Estevam
On Mon, Mar 18, 2024 at 10:31 AM Fabio Estevam wrote: > I tried dumping the page table entries, but could not notice anything > that looked suspicious. This looks suspicious: With 41e2787f5ec4 reverted: Checking if pte fits for virt=1c00 size=6400 blocksize=4000 Checking if pte

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-18 Thread Fabio Estevam
Hi Pierre, On Fri, Mar 15, 2024 at 12:13 PM Pierre-Clément Tosi wrote: > I had a quick look through your logs and notice that U-Boot master attempts to > map addresses in the high VA range e.g. > > Checking if pte fits for virt=e400 [...] > > while the logs that boot successfully

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-15 Thread Pierre-Clément Tosi
Hi Fabio, On Fri, Mar 15, 2024 at 08:56:17AM -0300, Fabio Estevam wrote: > Hi Marc, > > On Sat, Mar 9, 2024 at 11:36 AM Fabio Estevam wrote: > > > Does the log below help? > > > > https://pastebin.com/raw/1i1VBA0a > > > > If not, please send me a debug patch and I will be glad to run it here.

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-15 Thread Fabio Estevam
Hi Marc, On Sat, Mar 9, 2024 at 11:36 AM Fabio Estevam wrote: > Does the log below help? > > https://pastebin.com/raw/1i1VBA0a > > If not, please send me a debug patch and I will be glad to run it here. I'm sorry to bother you, but have you had a chance to look at the log I shared with you?

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-09 Thread Fabio Estevam
On Sat, Mar 9, 2024 at 9:39 AM Marc Zyngier wrote: > Can you figure out what memory access is triggering it? Even at > narrowing it to the subsystem level would be a good indication. The problem happens so early that I am not able to narrow it down at subsystem level. > You could just dump the

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-09 Thread Marc Zyngier
On Sat, 09 Mar 2024 12:29:10 +, Fabio Estevam wrote: > > Hi Marc, > > On Sat, Mar 9, 2024 at 6:53 AM Marc Zyngier wrote: > > > It would be good to narrow down which access is generating this. It is > > an asynchronous error, so the code above won't help. > > > > Alternatively, and if you

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-09 Thread Fabio Estevam
Hi Marc, On Sat, Mar 9, 2024 at 6:53 AM Marc Zyngier wrote: > It would be good to narrow down which access is generating this. It is > an asynchronous error, so the code above won't help. > > Alternatively, and if you are sure that this is due to this change, > dumping the page tables and

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-09 Thread Marc Zyngier
On Fri, 08 Mar 2024 20:22:53 +, Fabio Estevam wrote: > > Hi Paul and Tom, > > On Tue, Feb 14, 2023 at 10:38 AM Ying-Chun Liu (PaulLiu) > wrote: > > > > From: Marc Zyngier > > > > In the add_map() function, for each level it populates, it iterates from > > the root of the PT tree, making

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2024-03-08 Thread Fabio Estevam
Hi Paul and Tom, On Tue, Feb 14, 2023 at 10:38 AM Ying-Chun Liu (PaulLiu) wrote: > > From: Marc Zyngier > > In the add_map() function, for each level it populates, it iterates from > the root of the PT tree, making it ineficient if a mapping needs to occur > past level 1. > > Instead, replace

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2023-08-01 Thread Marc Zyngier
On Tue, 01 Aug 2023 09:53:52 +0100, Oliver Graute wrote: > > On 14/02/23, Ying-Chun Liu (PaulLiu) wrote: > > From: Marc Zyngier > > > > In the add_map() function, for each level it populates, it iterates from > > the root of the PT tree, making it ineficient if a mapping needs to occur > >

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2023-08-01 Thread Oliver Graute
On 01/08/23, Oliver Graute wrote: > On 14/02/23, Ying-Chun Liu (PaulLiu) wrote: > > From: Marc Zyngier > > > > In the add_map() function, for each level it populates, it iterates from > > the root of the PT tree, making it ineficient if a mapping needs to occur > > past level 1. > > > >

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2023-08-01 Thread Oliver Graute
On 14/02/23, Ying-Chun Liu (PaulLiu) wrote: > From: Marc Zyngier > > In the add_map() function, for each level it populates, it iterates from > the root of the PT tree, making it ineficient if a mapping needs to occur > past level 1. > > Instead, replace it with a recursive (and much simpler)

Re: [PATCH 1/2] arm64: Reduce add_map() complexity

2023-03-07 Thread Tom Rini
On Tue, Feb 14, 2023 at 09:38:13PM +0800, Ying-Chun Liu (PaulLiu) wrote: > From: Marc Zyngier > > In the add_map() function, for each level it populates, it iterates from > the root of the PT tree, making it ineficient if a mapping needs to occur > past level 1. > > Instead, replace it with a

[PATCH 1/2] arm64: Reduce add_map() complexity

2023-02-14 Thread Ying-Chun Liu (PaulLiu)
From: Marc Zyngier In the add_map() function, for each level it populates, it iterates from the root of the PT tree, making it ineficient if a mapping needs to occur past level 1. Instead, replace it with a recursive (and much simpler) algorithm that keeps the complexity as low as possible.