All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] hw/rx: rx-gdbsim DTB load address aligned of 16byte.
@ 2022-02-02 10:30 Yoshinori Sato
  2022-02-02 12:46 ` Philippe Mathieu-Daudé via
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshinori Sato @ 2022-02-02 10:30 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: Philippe Mathieu-Daudé, Yoshinori Sato

Linux kernel required alined address of DTB.
But missing align in dtb load function.
Fixed to load to the correct address.

v2 changes.
Use ROUND_DOWN macro.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/rx/rx-gdbsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
index 75d1fec6ca..2356af83a0 100644
--- a/hw/rx/rx-gdbsim.c
+++ b/hw/rx/rx-gdbsim.c
@@ -142,7 +142,7 @@ static void rx_gdbsim_init(MachineState *machine)
                 exit(1);
             }
             /* DTB is located at the end of SDRAM space. */
-            dtb_offset = machine->ram_size - dtb_size;
+            dtb_offset = ROUND_DOWN(machine->ram_size - dtb_size, 16 - 1);
             rom_add_blob_fixed("dtb", dtb, dtb_size,
                                SDRAM_BASE + dtb_offset);
             /* Set dtb address to R1 */
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] hw/rx: rx-gdbsim DTB load address aligned of 16byte.
  2022-02-02 10:30 [PATCH v2] hw/rx: rx-gdbsim DTB load address aligned of 16byte Yoshinori Sato
@ 2022-02-02 12:46 ` Philippe Mathieu-Daudé via
  2022-02-03 15:24   ` Yoshinori Sato
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-02 12:46 UTC (permalink / raw)
  To: Yoshinori Sato, qemu-devel, qemu-trivial

On 2/2/22 11:30, Yoshinori Sato wrote:
> Linux kernel required alined address of DTB.
> But missing align in dtb load function.
> Fixed to load to the correct address.
> 
> v2 changes.
> Use ROUND_DOWN macro.
> 
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   hw/rx/rx-gdbsim.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
> index 75d1fec6ca..2356af83a0 100644
> --- a/hw/rx/rx-gdbsim.c
> +++ b/hw/rx/rx-gdbsim.c
> @@ -142,7 +142,7 @@ static void rx_gdbsim_init(MachineState *machine)
>                   exit(1);
>               }
>               /* DTB is located at the end of SDRAM space. */
> -            dtb_offset = machine->ram_size - dtb_size;
> +            dtb_offset = ROUND_DOWN(machine->ram_size - dtb_size, 16 - 1);

Why did you add '-1'?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] hw/rx: rx-gdbsim DTB load address aligned of 16byte.
  2022-02-02 12:46 ` Philippe Mathieu-Daudé via
@ 2022-02-03 15:24   ` Yoshinori Sato
  0 siblings, 0 replies; 3+ messages in thread
From: Yoshinori Sato @ 2022-02-03 15:24 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-trivial, qemu-devel

On Wed, 02 Feb 2022 21:46:22 +0900,
Philippe Mathieu-Daudé via wrote:
> 
> On 2/2/22 11:30, Yoshinori Sato wrote:
> > Linux kernel required alined address of DTB.
> > But missing align in dtb load function.
> > Fixed to load to the correct address.
> > 
> > v2 changes.
> > Use ROUND_DOWN macro.
> > 
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> >   hw/rx/rx-gdbsim.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
> > index 75d1fec6ca..2356af83a0 100644
> > --- a/hw/rx/rx-gdbsim.c
> > +++ b/hw/rx/rx-gdbsim.c
> > @@ -142,7 +142,7 @@ static void rx_gdbsim_init(MachineState *machine)
> >                   exit(1);
> >               }
> >               /* DTB is located at the end of SDRAM space. */
> > -            dtb_offset = machine->ram_size - dtb_size;
> > +            dtb_offset = ROUND_DOWN(machine->ram_size - dtb_size, 16 - 1);
> 
> Why did you add '-1'?
> 

Oh. I misunderstood.
I'll sent v3.
Thanks.

-- 
Yosinori Sato


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-03 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 10:30 [PATCH v2] hw/rx: rx-gdbsim DTB load address aligned of 16byte Yoshinori Sato
2022-02-02 12:46 ` Philippe Mathieu-Daudé via
2022-02-03 15:24   ` Yoshinori Sato

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.