diff mbox series

[25/40] sandbox: move the TCG event log to the start of ram memory

Message ID 20240724060224.3071065-26-sughosh.ganu@linaro.org
State New
Headers show
Series Make LMB memory map global and persistent | expand

Commit Message

Sughosh Ganu July 24, 2024, 6:02 a.m. UTC
The TCG event log buffer is being set at the end of ram memory. This
region of memory is to be reserved as LMB_NOMAP memory in the LMB
memory map. The current location of this buffer overlaps with the
memory region reserved for the U-Boot image, which is at the top of
the usable memory. This worked earlier as the LMB memory map was not
global but caller specific, but fails now because of the overlap. Move
the TCG event log buffer to the start of the ram memory region
instead.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since rfc: New patch

 arch/sandbox/dts/test.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass July 25, 2024, 11:32 p.m. UTC | #1
Hi Sughosh,

On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> The TCG event log buffer is being set at the end of ram memory. This
> region of memory is to be reserved as LMB_NOMAP memory in the LMB
> memory map. The current location of this buffer overlaps with the
> memory region reserved for the U-Boot image, which is at the top of
> the usable memory. This worked earlier as the LMB memory map was not
> global but caller specific, but fails now because of the overlap. Move
> the TCG event log buffer to the start of the ram memory region
> instead.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since rfc: New patch
>
>  arch/sandbox/dts/test.dts | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
> index 5fb5eac862..1e1e9eaeb5 100644
> --- a/arch/sandbox/dts/test.dts
> +++ b/arch/sandbox/dts/test.dts
> @@ -78,7 +78,7 @@
>
>                 event_log: tcg_event_log {
>                         no-map;
> -                       reg = <(CFG_SYS_SDRAM_SIZE - 0x2000) 0x2000>;
> +                       reg = <(CFG_SYS_SDRAM_BASE + 0x1000) 0x2000>;
>                 };
>         };
>
> --
> 2.34.1
>

It looks like this will conflict.

Please check and update the memory map at the end of
doc/arch/sandbox/sandbox.rst

Separate from this patch, I really think the TCG event log should go
in a bloblist. I can have a crack at that if you like.

Regards,
Simon
Sughosh Ganu July 29, 2024, 8:45 a.m. UTC | #2
On Fri, 26 Jul 2024 at 05:02, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Sughosh,
>
> On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> >
> > The TCG event log buffer is being set at the end of ram memory. This
> > region of memory is to be reserved as LMB_NOMAP memory in the LMB
> > memory map. The current location of this buffer overlaps with the
> > memory region reserved for the U-Boot image, which is at the top of
> > the usable memory. This worked earlier as the LMB memory map was not
> > global but caller specific, but fails now because of the overlap. Move
> > the TCG event log buffer to the start of the ram memory region
> > instead.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > ---
> > Changes since rfc: New patch
> >
> >  arch/sandbox/dts/test.dts | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
> > index 5fb5eac862..1e1e9eaeb5 100644
> > --- a/arch/sandbox/dts/test.dts
> > +++ b/arch/sandbox/dts/test.dts
> > @@ -78,7 +78,7 @@
> >
> >                 event_log: tcg_event_log {
> >                         no-map;
> > -                       reg = <(CFG_SYS_SDRAM_SIZE - 0x2000) 0x2000>;
> > +                       reg = <(CFG_SYS_SDRAM_BASE + 0x1000) 0x2000>;
> >                 };
> >         };
> >
> > --
> > 2.34.1
> >
>
> It looks like this will conflict.

Can you please elaborate a bit here. I am not saying that I am not
open to a different solution, but I did not get any CI errors with
this change.

>
> Please check and update the memory map at the end of
> doc/arch/sandbox/sandbox.rst
>
> Separate from this patch, I really think the TCG event log should go
> in a bloblist. I can have a crack at that if you like.

That can be taken up as a separate activity.

-sughosh

>
> Regards,
> Simon
Simon Glass July 29, 2024, 3:27 p.m. UTC | #3
Hi Sughosh,

On Mon, 29 Jul 2024 at 02:45, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> On Fri, 26 Jul 2024 at 05:02, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Sughosh,
> >
> > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> > >
> > > The TCG event log buffer is being set at the end of ram memory. This
> > > region of memory is to be reserved as LMB_NOMAP memory in the LMB
> > > memory map. The current location of this buffer overlaps with the
> > > memory region reserved for the U-Boot image, which is at the top of
> > > the usable memory. This worked earlier as the LMB memory map was not
> > > global but caller specific, but fails now because of the overlap. Move
> > > the TCG event log buffer to the start of the ram memory region
> > > instead.
> > >
> > > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > > ---
> > > Changes since rfc: New patch
> > >
> > >  arch/sandbox/dts/test.dts | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
> > > index 5fb5eac862..1e1e9eaeb5 100644
> > > --- a/arch/sandbox/dts/test.dts
> > > +++ b/arch/sandbox/dts/test.dts
> > > @@ -78,7 +78,7 @@
> > >
> > >                 event_log: tcg_event_log {
> > >                         no-map;
> > > -                       reg = <(CFG_SYS_SDRAM_SIZE - 0x2000) 0x2000>;
> > > +                       reg = <(CFG_SYS_SDRAM_BASE + 0x1000) 0x2000>;
> > >                 };
> > >         };
> > >
> > > --
> > > 2.34.1
> > >
> >
> > It looks like this will conflict.
>
> Can you please elaborate a bit here. I am not saying that I am not
> open to a different solution, but I did not get any CI errors with
> this change.
>
> >
> > Please check and update the memory map at the end of
> > doc/arch/sandbox/sandbox.rst

The address you are choosing is too low in memory...move it above the
FDT and bloblist.

> >
> > Separate from this patch, I really think the TCG event log should go
> > in a bloblist. I can have a crack at that if you like.
>
> That can be taken up as a separate activity.

Regards,
Simon
diff mbox series

Patch

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 5fb5eac862..1e1e9eaeb5 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -78,7 +78,7 @@ 
 
 		event_log: tcg_event_log {
 			no-map;
-			reg = <(CFG_SYS_SDRAM_SIZE - 0x2000) 0x2000>;
+			reg = <(CFG_SYS_SDRAM_BASE + 0x1000) 0x2000>;
 		};
 	};