All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Adam Lackorzynski <adam@l4re.org>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>
Subject: Re: [PATCH] multiboot: Use DMA instead port-based transfer
Date: Tue, 19 Oct 2021 18:45:44 +0200	[thread overview]
Message-ID: <da674bf3-fc7f-28c8-7c45-f98754ecb5d1@redhat.com> (raw)
In-Reply-To: <YWM6jboU9fUib6Iy@os.inf.tu-dresden.de>

On 10/10/21 21:10, Adam Lackorzynski wrote:
> Use DMA transfers in the multiboot loader to copy
> data.
> 
> This significantly lowers QEMU's startup latency by
> a factor of about 40, for example, going from 30sec
> to 0.8sec when loading modules of 120MB in size.
> This change has been used successfully for some time.
> 
> Signed-off-by: Marcus Hähnel<marcus.haehnel@kernkonzept.com>
> Signed-off-by: Adam Lackorzynski<adam@l4re.org>
> ---
>   pc-bios/multiboot.bin         | Bin 1024 -> 1536 bytes
>   pc-bios/optionrom/multiboot.S |  10 ++---
>   pc-bios/optionrom/optionrom.h |  77 ++++++++++++++++++++++++++++++++++
>   3 files changed, 82 insertions(+), 5 deletions(-)

This would break migration to QEMU 2.4 and earlier - which is in fact 
why linuxboot has a completely different option ROM when DMA is in use.

On my system (a relatively recent laptop) I get 15-20 MiB per second, 
which is slow but not as slow as what you got.  Out of curiosity, can 
you test what you get with the following kernel patch?

diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h
index 798508e8b6f5..5853ae93bcb2 100644
--- a/arch/x86/kvm/kvm_emulate.h
+++ b/arch/x86/kvm/kvm_emulate.h
@@ -272,7 +272,7 @@ struct fetch_cache {
  };

  struct read_cache {
-	u8 data[1024];
+	u8 data[4096];
  	unsigned long pos;
  	unsigned long end;
  };


Paolo



  parent reply	other threads:[~2021-10-19 17:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 19:10 [PATCH] multiboot: Use DMA instead port-based transfer Adam Lackorzynski
2021-10-19  8:28 ` Stefano Garzarella
2021-10-19 16:45 ` Paolo Bonzini [this message]
2021-10-21 21:55   ` Marcus Hähnel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da674bf3-fc7f-28c8-7c45-f98754ecb5d1@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=adam@l4re.org \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.