All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i386: load kernel on xen using DMA
@ 2021-04-26  3:47 ` Marek Marczykowski-Górecki
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Marczykowski-Górecki @ 2021-04-26  3:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, Marek Marczykowski-Górecki

Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version,
which loaded the kernel (and initramfs) byte by byte. Change this
to DMA, to load in bigger chunks.
This change alone reduces load time of a (big) kernel+initramfs from
~10s down to below 1s.

This change was suggested initially here:
https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/
Apparently this alone is already enough to get massive speedup.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 hw/i386/pc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 8a84b25a03..14e43d4da4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -839,7 +839,8 @@ void xen_load_linux(PCMachineState *pcms)
 
     assert(MACHINE(pcms)->kernel_filename != NULL);
 
-    fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
+    fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4,
+                                &address_space_memory);
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
     rom_set_fw(fw_cfg);
 
-- 
2.26.3



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

* [PATCH] i386: load kernel on xen using DMA
@ 2021-04-26  3:47 ` Marek Marczykowski-Górecki
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Marczykowski-Górecki @ 2021-04-26  3:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marek Marczykowski-Górecki, xen-devel

Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version,
which loaded the kernel (and initramfs) byte by byte. Change this
to DMA, to load in bigger chunks.
This change alone reduces load time of a (big) kernel+initramfs from
~10s down to below 1s.

This change was suggested initially here:
https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/
Apparently this alone is already enough to get massive speedup.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 hw/i386/pc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 8a84b25a03..14e43d4da4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -839,7 +839,8 @@ void xen_load_linux(PCMachineState *pcms)
 
     assert(MACHINE(pcms)->kernel_filename != NULL);
 
-    fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
+    fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4,
+                                &address_space_memory);
     fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
     rom_set_fw(fw_cfg);
 
-- 
2.26.3



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

* Re: [PATCH] i386: load kernel on xen using DMA
  2021-04-26  3:47 ` Marek Marczykowski-Górecki
  (?)
@ 2021-06-18  8:54 ` Alex Bennée
  2024-02-17  3:22   ` Marek Marczykowski-Górecki
  2024-03-08 17:17   ` Anthony PERARD
  -1 siblings, 2 replies; 5+ messages in thread
From: Alex Bennée @ 2021-06-18  8:54 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki; +Cc: xen-devel, qemu-devel


Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> writes:

> Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version,
> which loaded the kernel (and initramfs) byte by byte. Change this
> to DMA, to load in bigger chunks.
> This change alone reduces load time of a (big) kernel+initramfs from
> ~10s down to below 1s.
>
> This change was suggested initially here:
> https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/
> Apparently this alone is already enough to get massive speedup.
>
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  hw/i386/pc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 8a84b25a03..14e43d4da4 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -839,7 +839,8 @@ void xen_load_linux(PCMachineState *pcms)
>  
>      assert(MACHINE(pcms)->kernel_filename != NULL);
>  
> -    fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
> +    fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4,
> +                                &address_space_memory);
>      fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
>      rom_set_fw(fw_cfg);

Gentle ping. The fix looks perfectly sane to me but I don't have any x86
Xen HW to test this one. Are the x86 maintainers happy to take this on?

FWIW:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


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

* Re: [PATCH] i386: load kernel on xen using DMA
  2021-06-18  8:54 ` Alex Bennée
@ 2024-02-17  3:22   ` Marek Marczykowski-Górecki
  2024-03-08 17:17   ` Anthony PERARD
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-02-17  3:22 UTC (permalink / raw)
  To: qemu-devel, Stefano Stabellini, Anthony Perard, Paul Durrant
  Cc: Alex Bennée, xen-devel

[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]

On Fri, Jun 18, 2021 at 09:54:14AM +0100, Alex Bennée wrote:
> 
> Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> writes:
> 
> > Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version,
> > which loaded the kernel (and initramfs) byte by byte. Change this
> > to DMA, to load in bigger chunks.
> > This change alone reduces load time of a (big) kernel+initramfs from
> > ~10s down to below 1s.
> >
> > This change was suggested initially here:
> > https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/
> > Apparently this alone is already enough to get massive speedup.
> >
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > ---
> >  hw/i386/pc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 8a84b25a03..14e43d4da4 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -839,7 +839,8 @@ void xen_load_linux(PCMachineState *pcms)
> >  
> >      assert(MACHINE(pcms)->kernel_filename != NULL);
> >  
> > -    fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
> > +    fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4,
> > +                                &address_space_memory);
> >      fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
> >      rom_set_fw(fw_cfg);
> 
> Gentle ping. The fix looks perfectly sane to me but I don't have any x86
> Xen HW to test this one. Are the x86 maintainers happy to take this on?

Ping...

> 
> FWIW:
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> 
> -- 
> Alex Bennée
> 

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] i386: load kernel on xen using DMA
  2021-06-18  8:54 ` Alex Bennée
  2024-02-17  3:22   ` Marek Marczykowski-Górecki
@ 2024-03-08 17:17   ` Anthony PERARD
  1 sibling, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2024-03-08 17:17 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Marek Marczykowski-Górecki, xen-devel, qemu-devel

On Fri, Jun 18, 2021 at 09:54:14AM +0100, Alex Bennée wrote:
> 
> Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> writes:
> 
> > Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version,
> > which loaded the kernel (and initramfs) byte by byte. Change this
> > to DMA, to load in bigger chunks.
> > This change alone reduces load time of a (big) kernel+initramfs from
> > ~10s down to below 1s.
> >
> > This change was suggested initially here:
> > https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/
> > Apparently this alone is already enough to get massive speedup.
> >
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > ---
> >  hw/i386/pc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 8a84b25a03..14e43d4da4 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -839,7 +839,8 @@ void xen_load_linux(PCMachineState *pcms)
> >  
> >      assert(MACHINE(pcms)->kernel_filename != NULL);
> >  
> > -    fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
> > +    fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4,
> > +                                &address_space_memory);
> >      fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
> >      rom_set_fw(fw_cfg);
> 
> Gentle ping. The fix looks perfectly sane to me but I don't have any x86
> Xen HW to test this one. Are the x86 maintainers happy to take this on?

Yes. It looks like it works well with both SeaBIOS and OVMF, so the
patch is good.

> FWIW:
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


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

end of thread, other threads:[~2024-03-08 17:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26  3:47 [PATCH] i386: load kernel on xen using DMA Marek Marczykowski-Górecki
2021-04-26  3:47 ` Marek Marczykowski-Górecki
2021-06-18  8:54 ` Alex Bennée
2024-02-17  3:22   ` Marek Marczykowski-Górecki
2024-03-08 17:17   ` Anthony PERARD

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.