|
From: | Paolo Bonzini |
Subject: | Re: [PATCH] multiboot: Use DMA instead port-based transfer |
Date: | Tue, 19 Oct 2021 18:45:44 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |