* QEMU fw_cfg DMA interface
@ 2015-08-31 9:08 Marc Marí
2015-08-31 9:11 ` [PATCH v2] QEMU fw_cfg DMA interface documentation Marc Marí
0 siblings, 1 reply; 16+ messages in thread
From: Marc Marí @ 2015-08-31 9:08 UTC (permalink / raw)
To: linux-kernel, qemu-devel, seabios
Cc: Drew, Stefan Hajnoczi, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree, Marc Marí
Implementation of the FW CFG DMA interface.
When running a Linux guest on top of QEMU, using the -kernel options, this
is the timing improvement for x86:
QEMU commit 090d0bf and SeaBIOS commit 2fc20dc
QEMU startup time: .078
BIOS startup time: .060
Kernel setup time: .578
Total time: .716
QEMU with this patch series and SeaBIOS with this patch series
QEMU startup time: .080
BIOS startup time: .039
Kernel setup time: .002
Total time: .121
QEMU startup time is the time between the start and the first kvm_entry.
BIOS startup time is the time between the first kvm_entry and the start of
function do_boot, in SeaBIOS.
Kernel setup time is the time between the start of the function do_boot in
SeaBIOS and the jump to the Linux kernel.
As you can see, both the BIOS (because of ACPI tables and other configurations)
and the Linux kernel boot (because of the copy to memory) are greatly
improved with this new interface.
Also, this new interface is an addon to the old interface. Both interfaces
are compatible and interchangeable.
Changes from v1:
- Take into account order of fields in the FWCfgDmaAccess structure
- Check and change endianness of FWCfgDmaAccess fields
- Change order of fields in the FWCfgDmaAccess structure
- Add FW_CFG_DMA_CTL_SKIP feature for control field
- Split FW_CFG_SIZE in QEMU
- Make FW_CFG_ID a bitmap of features
- Add 64 bit address support for the transfer. Trigger when writing the low
address, and address is 0 by default and at the end of each transfer.
- Align ports and addresses.
- Preserve old fw_cfg_comb_valid behaviour in QEMU
- Update documentation to reflect all these changes
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-08-31 9:08 QEMU fw_cfg DMA interface Marc Marí
@ 2015-08-31 9:11 ` Marc Marí
2015-09-02 8:20 ` Stefan Hajnoczi
0 siblings, 1 reply; 16+ messages in thread
From: Marc Marí @ 2015-08-31 9:11 UTC (permalink / raw)
To: linux-kernel
Cc: Drew, Stefan Hajnoczi, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree, Marc Marí
Add fw_cfg DMA interface specfication in the fw_cfg documentation.
Signed-off-by: Marc Marí <markmb@redhat.com>
---
Documentation/devicetree/bindings/arm/fw-cfg.txt | 51 +++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/arm/fw-cfg.txt b/Documentation/devicetree/bindings/arm/fw-cfg.txt
index 953fb64..766ddbe 100644
--- a/Documentation/devicetree/bindings/arm/fw-cfg.txt
+++ b/Documentation/devicetree/bindings/arm/fw-cfg.txt
@@ -45,6 +45,53 @@ blob to be read from the data register has size 4, and it is to be interpreted
as a uint32_t value in little endian byte order. The current value
(corresponding to the above outer protocol) is zero.
+If bit 1 of the feature bitmap is set, the DMA interface is present. This
+can be used through the 64-bit wide address register.
+
+The address register is in big-endian format. The value for the register is 0
+at startup and after an operation. A write to the lower half triggers an
+operation. This means, that operations with 32-bit addresses can be triggered
+with just one write, whereas operations with 64-bit addresses can be triggered
+with one 64-bit write or two 32-bit writes, starting with the higher part.
+
+In this register, a physical RAM address to a FWCfgDmaAccess structure should
+be written. This is the format of the FWCfgDmaAccess structure:
+
+typedef struct FWCfgDmaAccess {
+ uint32_t control;
+ uint32_t length;
+ uint64_t address;
+} FWCfgDmaAccess;
+
+The fields of the structure are in big endian mode, and the field at the lowest
+address is the "control" field.
+
+The "control" field has the following bits:
+ - Bit 0: Error
+ - Bit 1: Read
+ - Bit 2: Skip
+
+When an operation is triggered, if the "control" field has bit 1 set, a read
+operation will be performed. "length" bytes for the current selector and
+offset will be copied into the address specified by the "address" field.
+
+If the control field has only bit 2 set, a skip operation will be perfomed.
+The offset for the current selector will be advanced "length" bytes.
+
+To check result, read the "control" field:
+ error bit set -> something went wrong.
+ all bits cleared -> transfer finished successfully.
+ otherwise -> transfer still in progress (doesn't happen
+ today due to implementation not being async,
+ but may in the future).
+
+Target address goes up and transfer length goes down as the transfer happens,
+so after a successful transfer the length field is zero and the address field
+points right after the memory block written.
+
+If a partial transfer happened before an error occured the address and
+length registers indicate how much data has been transfered successfully.
+
The guest kernel is not expected to use these registers (although it is
certainly allowed to); the device tree bindings are documented here because
this is where device tree bindings reside in general.
@@ -56,6 +103,8 @@ Required properties:
- reg: the MMIO region used by the device.
* Bytes 0x0 to 0x7 cover the data register.
* Bytes 0x8 to 0x9 cover the selector register.
+ * With DMA interface enabled: Bytes 0xc to 0x13 cover the DMA address
+ register.
* Further registers may be appended to the region in case of future interface
revisions / feature bits.
@@ -66,7 +115,7 @@ Example:
#address-cells = <0x2>;
fw-cfg@9020000 {
+ reg = <0x0 0x9020000 0x0 0x14>;
compatible = "qemu,fw-cfg-mmio";
- reg = <0x0 0x9020000 0x0 0xa>;
};
};
--
2.4.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-08-31 9:11 ` [PATCH v2] QEMU fw_cfg DMA interface documentation Marc Marí
@ 2015-09-02 8:20 ` Stefan Hajnoczi
2015-09-02 8:33 ` Marc Marí
0 siblings, 1 reply; 16+ messages in thread
From: Stefan Hajnoczi @ 2015-09-02 8:20 UTC (permalink / raw)
To: Marc Marí
Cc: linux-kernel, Drew, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree
On Mon, Aug 31, 2015 at 10:11 AM, Marc Marí <markmb@redhat.com> wrote:
> Add fw_cfg DMA interface specfication in the fw_cfg documentation.
>
> Signed-off-by: Marc Marí <markmb@redhat.com>
> ---
> Documentation/devicetree/bindings/arm/fw-cfg.txt | 51 +++++++++++++++++++++++-
> 1 file changed, 50 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/fw-cfg.txt b/Documentation/devicetree/bindings/arm/fw-cfg.txt
> index 953fb64..766ddbe 100644
> --- a/Documentation/devicetree/bindings/arm/fw-cfg.txt
> +++ b/Documentation/devicetree/bindings/arm/fw-cfg.txt
> @@ -45,6 +45,53 @@ blob to be read from the data register has size 4, and it is to be interpreted
> as a uint32_t value in little endian byte order. The current value
> (corresponding to the above outer protocol) is zero.
>
> +If bit 1 of the feature bitmap is set, the DMA interface is present. This
> +can be used through the 64-bit wide address register.
> +
> +The address register is in big-endian format. The value for the register is 0
> +at startup and after an operation. A write to the lower half triggers an
> +operation. This means, that operations with 32-bit addresses can be triggered
> +with just one write, whereas operations with 64-bit addresses can be triggered
> +with one 64-bit write or two 32-bit writes, starting with the higher part.
> +
> +In this register, a physical RAM address to a FWCfgDmaAccess structure should
> +be written. This is the format of the FWCfgDmaAccess structure:
> +
> +typedef struct FWCfgDmaAccess {
> + uint32_t control;
> + uint32_t length;
> + uint64_t address;
> +} FWCfgDmaAccess;
I think including the selector field would be nice to avoid extra
register accesses, but I'm not that familiar with fw_cfg so maybe
there's a reason not to include that field.
> +The fields of the structure are in big endian mode, and the field at the lowest
> +address is the "control" field.
> +
> +The "control" field has the following bits:
> + - Bit 0: Error
> + - Bit 1: Read
> + - Bit 2: Skip
> +
> +When an operation is triggered, if the "control" field has bit 1 set, a read
> +operation will be performed. "length" bytes for the current selector and
> +offset will be copied into the address specified by the "address" field.
Minor clarification:
s/address/physical RAM address/
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-09-02 8:20 ` Stefan Hajnoczi
@ 2015-09-02 8:33 ` Marc Marí
2015-09-07 11:08 ` Gerd Hoffmann
0 siblings, 1 reply; 16+ messages in thread
From: Marc Marí @ 2015-09-02 8:33 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: linux-kernel, Drew, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree
On Wed, 2 Sep 2015 09:20:12 +0100
Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Mon, Aug 31, 2015 at 10:11 AM, Marc Marí <markmb@redhat.com> wrote:
> > Add fw_cfg DMA interface specfication in the fw_cfg documentation.
> >
> > Signed-off-by: Marc Marí <markmb@redhat.com>
> > ---
> > Documentation/devicetree/bindings/arm/fw-cfg.txt | 51
> > +++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1
> > deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/fw-cfg.txt
> > b/Documentation/devicetree/bindings/arm/fw-cfg.txt index
> > 953fb64..766ddbe 100644 ---
> > a/Documentation/devicetree/bindings/arm/fw-cfg.txt +++
> > b/Documentation/devicetree/bindings/arm/fw-cfg.txt @@ -45,6 +45,53
> > @@ blob to be read from the data register has size 4, and it is to
> > be interpreted as a uint32_t value in little endian byte order. The
> > current value (corresponding to the above outer protocol) is zero.
> >
> > +If bit 1 of the feature bitmap is set, the DMA interface is
> > present. This +can be used through the 64-bit wide address register.
> > +
> > +The address register is in big-endian format. The value for the
> > register is 0 +at startup and after an operation. A write to the
> > lower half triggers an +operation. This means, that operations with
> > 32-bit addresses can be triggered +with just one write, whereas
> > operations with 64-bit addresses can be triggered +with one 64-bit
> > write or two 32-bit writes, starting with the higher part. +
> > +In this register, a physical RAM address to a FWCfgDmaAccess
> > structure should +be written. This is the format of the
> > FWCfgDmaAccess structure: +
> > +typedef struct FWCfgDmaAccess {
> > + uint32_t control;
> > + uint32_t length;
> > + uint64_t address;
> > +} FWCfgDmaAccess;
>
> I think including the selector field would be nice to avoid extra
> register accesses, but I'm not that familiar with fw_cfg so maybe
> there's a reason not to include that field.
It's just simplicity. If you want to read a few times from the same
field (like in ACPI tables, read the data size and then the data), you
need a way to enable and disable the selector and manage the current
offset for that entry. This is already provided with the "old"
interface.
Moreover, if, for some reason, both systems are being used
simultaneously, some way of interacting both selectors and offsets is
needed.
I think the overhead of writing the selector apart is not that big,
compared to the trouble of adding a new one.
Thanks
Marc
> > +The fields of the structure are in big endian mode, and the field
> > at the lowest +address is the "control" field.
> > +
> > +The "control" field has the following bits:
> > + - Bit 0: Error
> > + - Bit 1: Read
> > + - Bit 2: Skip
> > +
> > +When an operation is triggered, if the "control" field has bit 1
> > set, a read +operation will be performed. "length" bytes for the
> > current selector and +offset will be copied into the address
> > specified by the "address" field.
>
> Minor clarification:
> s/address/physical RAM address/
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-09-02 8:33 ` Marc Marí
@ 2015-09-07 11:08 ` Gerd Hoffmann
2015-09-07 11:25 ` Laszlo Ersek
2015-09-08 16:46 ` Kevin O'Connor
0 siblings, 2 replies; 16+ messages in thread
From: Gerd Hoffmann @ 2015-09-07 11:08 UTC (permalink / raw)
To: Marc Marí
Cc: Stefan Hajnoczi, linux-kernel, Drew, Kevin O'Connor, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree
Hi,
> It's just simplicity. If you want to read a few times from the same
> field (like in ACPI tables, read the data size and then the data), you
> need a way to enable and disable the selector and manage the current
> offset for that entry. This is already provided with the "old"
> interface.
Could be handled with a 'select' control bit. Only when set select
entry and reset offset to zero.
Also: would it make sense to allow an *array* of FWCfgDmaAccess structs?
With a 'more' bit in control we could indicate that there are more
entries. I'm not sure firmware would actually use that though ...
cheers,
Gerd
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-09-07 11:08 ` Gerd Hoffmann
@ 2015-09-07 11:25 ` Laszlo Ersek
2015-09-08 16:46 ` Kevin O'Connor
1 sibling, 0 replies; 16+ messages in thread
From: Laszlo Ersek @ 2015-09-07 11:25 UTC (permalink / raw)
To: Gerd Hoffmann, Marc Marí
Cc: Stefan Hajnoczi, linux-kernel, Drew, Kevin O'Connor,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree
On 09/07/15 13:08, Gerd Hoffmann wrote:
> Hi,
>
>> It's just simplicity. If you want to read a few times from the same
>> field (like in ACPI tables, read the data size and then the data), you
>> need a way to enable and disable the selector and manage the current
>> offset for that entry. This is already provided with the "old"
>> interface.
>
> Could be handled with a 'select' control bit. Only when set select
> entry and reset offset to zero.
>
> Also: would it make sense to allow an *array* of FWCfgDmaAccess structs?
> With a 'more' bit in control we could indicate that there are more
> entries. I'm not sure firmware would actually use that though ...
Seems far-fetched.
Thanks
Laszlo
> cheers,
> Gerd
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-09-07 11:08 ` Gerd Hoffmann
2015-09-07 11:25 ` Laszlo Ersek
@ 2015-09-08 16:46 ` Kevin O'Connor
2015-09-10 14:21 ` Marc Marí
1 sibling, 1 reply; 16+ messages in thread
From: Kevin O'Connor @ 2015-09-08 16:46 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: Marc Marí,
Stefan Hajnoczi, linux-kernel, Drew, Laszlo, Arnd Bergmann,
Rob Herring, Mark Rutland, Alexander Graf, devicetree
On Mon, Sep 07, 2015 at 01:08:29PM +0200, Gerd Hoffmann wrote:
> > It's just simplicity. If you want to read a few times from the same
> > field (like in ACPI tables, read the data size and then the data), you
> > need a way to enable and disable the selector and manage the current
> > offset for that entry. This is already provided with the "old"
> > interface.
>
> Could be handled with a 'select' control bit. Only when set select
> entry and reset offset to zero.
I think two features would help "round off" the new fw_cfg DMA
proposal: add a select bit as you describe (that uses the 16 most
significant bits of the "control" field for the "select entry" when
the bit is set), and define a static signature (eg, "QEMU CFG") when
reading the 64bit MMIO dma register.
Both are optional features that don't change the fundamental
interface; I was thinking of sending them as two patches on top of
Marc's next version of his patch series (if no one else gets to it
first).
-Kevin
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] QEMU fw_cfg DMA interface documentation
2015-09-08 16:46 ` Kevin O'Connor
@ 2015-09-10 14:21 ` Marc Marí
0 siblings, 0 replies; 16+ messages in thread
From: Marc Marí @ 2015-09-10 14:21 UTC (permalink / raw)
To: Kevin O'Connor
Cc: Gerd Hoffmann, Stefan Hajnoczi, linux-kernel, Drew, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree
On Tue, 8 Sep 2015 12:46:08 -0400
"Kevin O'Connor" <kevin@koconnor.net> wrote:
> On Mon, Sep 07, 2015 at 01:08:29PM +0200, Gerd Hoffmann wrote:
> > > It's just simplicity. If you want to read a few times from the
> > > same field (like in ACPI tables, read the data size and then the
> > > data), you need a way to enable and disable the selector and
> > > manage the current offset for that entry. This is already
> > > provided with the "old" interface.
> >
> > Could be handled with a 'select' control bit. Only when set select
> > entry and reset offset to zero.
>
> I think two features would help "round off" the new fw_cfg DMA
> proposal: add a select bit as you describe (that uses the 16 most
> significant bits of the "control" field for the "select entry" when
> the bit is set), and define a static signature (eg, "QEMU CFG") when
> reading the 64bit MMIO dma register.
>
> Both are optional features that don't change the fundamental
> interface; I was thinking of sending them as two patches on top of
> Marc's next version of his patch series (if no one else gets to it
> first).
>
As there will be (at least) another version, I can add those simple
changes in the next version.
Thanks
Marc
^ permalink raw reply [flat|nested] 16+ messages in thread
* QEMU fw_cfg DMA interface
@ 2015-10-01 12:14 Marc Marí
0 siblings, 0 replies; 16+ messages in thread
From: Marc Marí @ 2015-10-01 12:14 UTC (permalink / raw)
To: linux-kernel, qemu-devel, seabios
Cc: Drew, Stefan Hajnoczi, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree, Marc Marí
Implementation of the FW CFG DMA interface.
When running a Linux guest on top of QEMU, using the -kernel options, this
is the timing improvement for x86:
QEMU commit b2312c6 and SeaBIOS commit 423542e
QEMU startup time: .080
BIOS startup time: .060
Kernel setup time: .586
Total time: .726
QEMU with this patch series and SeaBIOS with this patch series
QEMU startup time: .080
BIOS startup time: .039
Kernel setup time: .005
Total time: .126
QEMU startup time is the time between the start and the first kvm_entry.
BIOS startup time is the time between the first kvm_entry and the start of
function do_boot, in SeaBIOS.
Kernel setup time is the time between the start of the function do_boot in
SeaBIOS and the jump to the Linux kernel.
As you can see, both the BIOS (because of ACPI tables and other configurations)
and the Linux kernel boot (because of the copy to memory) are greatly
improved with this new interface.
Also, this new interface is an addon to the old interface. Both interfaces
are compatible and interchangeable.
Changes from v1:
- Take into account order of fields in the FWCfgDmaAccess structure
- Check and change endianness of FWCfgDmaAccess fields
- Change order of fields in the FWCfgDmaAccess structure
- Add FW_CFG_DMA_CTL_SKIP feature for control field
- Split FW_CFG_SIZE in QEMU
- Make FW_CFG_ID a bitmap of features
- Add 64 bit address support for the transfer. Trigger when writing the low
address, and address is 0 by default and at the end of each transfer.
- Align ports and addresses.
- Preserve old fw_cfg_comb_valid behaviour in QEMU
- Update documentation to reflect all these changes
Changes from v2:
- Make IOports fw_cfg DMA region a different IO region.
- Reuse everything for MMIO and IOport DMA regions
- Make transfer status only based on control field
- Use DMA helpers instead of direct map/unmap
- Change ARM fw_cfg DMA address space
- Change Linux boot process to match linuxboot.S
- Add select capabilities in the FWCfgDmaAccess struct
- Update documentation to reflect all these changes
Changes from v3:
- Set properly fw_cfg DMA fields in ARM
- Set fw_cfg DMA boot process properly (by Laszlo Ersek)
- Add signature to fw_cfg DMA address field (by Kevin O'Connor)
- Minor nitpicks
^ permalink raw reply [flat|nested] 16+ messages in thread
* QEMU fw_cfg DMA interface
@ 2015-09-18 8:58 Marc Marí
0 siblings, 0 replies; 16+ messages in thread
From: Marc Marí @ 2015-09-18 8:58 UTC (permalink / raw)
To: linux-kernel, qemu-devel, seabios
Cc: Drew, Stefan Hajnoczi, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Arnd Bergmann, Rob Herring, Mark Rutland, Alexander Graf,
devicetree, Marc Marí
Implementation of the FW CFG DMA interface.
When running a Linux guest on top of QEMU, using the -kernel options, this
is the timing improvement for x86:
QEMU commit 16a1b6e and SeaBIOS commit e4d2b8c
QEMU startup time: .080
BIOS startup time: .060
Kernel setup time: .586
Total time: .726
QEMU with this patch series and SeaBIOS with this patch series
QEMU startup time: .080
BIOS startup time: .039
Kernel setup time: .002
Total time: .121
QEMU startup time is the time between the start and the first kvm_entry.
BIOS startup time is the time between the first kvm_entry and the start of
function do_boot, in SeaBIOS.
Kernel setup time is the time between the start of the function do_boot in
SeaBIOS and the jump to the Linux kernel.
As you can see, both the BIOS (because of ACPI tables and other configurations)
and the Linux kernel boot (because of the copy to memory) are greatly
improved with this new interface.
Also, this new interface is an addon to the old interface. Both interfaces
are compatible and interchangeable.
Changes from v1:
- Take into account order of fields in the FWCfgDmaAccess structure
- Check and change endianness of FWCfgDmaAccess fields
- Change order of fields in the FWCfgDmaAccess structure
- Add FW_CFG_DMA_CTL_SKIP feature for control field
- Split FW_CFG_SIZE in QEMU
- Make FW_CFG_ID a bitmap of features
- Add 64 bit address support for the transfer. Trigger when writing the low
address, and address is 0 by default and at the end of each transfer.
- Align ports and addresses.
- Preserve old fw_cfg_comb_valid behaviour in QEMU
- Update documentation to reflect all these changes
Changes from v2:
- Make IOports fw_cfg DMA region a different IO region.
- Reuse everything for MMIO and IOport DMA regions
- Make transfer status only based on control field
- Use DMA helpers instead of direct map/unmap
- Change ARM fw_cfg DMA address space
- Change Linux boot process to match linuxboot.S
- Add select capabilities in the FWCfgDmaAccess struct
- Update documentation to reflect all these changes
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: QEMU fw_cfg DMA interface
2015-08-06 15:30 ` Kevin O'Connor
@ 2015-08-06 15:53 ` Marc Marí
0 siblings, 0 replies; 16+ messages in thread
From: Marc Marí @ 2015-08-06 15:53 UTC (permalink / raw)
To: Kevin O'Connor
Cc: Stefan Hajnoczi, linux-kernel, qemu-devel, seabios, Drew,
Gerd Hoffmann, Laszlo
[-- Attachment #1: Type: text/plain, Size: 2332 bytes --]
On Thu, 6 Aug 2015 11:30:43 -0400
"Kevin O'Connor" <kevin@koconnor.net> wrote:
> On Thu, Aug 06, 2015 at 02:37:45PM +0200, Marc Marí wrote:
> > On Thu, 6 Aug 2015 13:27:16 +0100
> > Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >
> > > On Thu, Aug 6, 2015 at 12:00 PM, Marc Marí <markmb@redhat.com>
> > > wrote:
> > > > When running a Linux guest on top of QEMU, using the -kernel
> > > > options, this is the timing improvement for x86:
> > > >
> > > > QEMU commit 2be4f242b50a8 and SeaBIOS commit 908a58c1d5ff
> > > > QEMU startup time: .078
> > > > BIOS startup time: .060
> > > > Kernel setup time: .578
> > > > Total time: .716
> > > >
> > > > QEMU with this patch series and SeaBIOS with this patch series
> > > > QEMU startup time: .080
> > > > BIOS startup time: .039
> > > > Kernel setup time: .002
> > > > Total time: .121
> > >
> > > Impressive results!
> > >
> > > Is this a fully-featured QEMU build or did you disable things?
> > >
> > > Is this the default SeaBIOS build or did you disable things?
> > >
> >
> > This is the default QEMU configuration I get for my system. It's
> > not a fully-featured QEMU, but it has a lot of things enabled.
> > SeaBIOS has a default configuration (with debugging disabled).
>
> Thanks!
>
> What qemu command-line did you use during testing? Also, do you have
> a quick primer on how to use the kvm trace stuff to obtain timings?
>
The command line I used is:
x86_64-softmmu/qemu-system-x86_64 --enable-kvm \
-kernel /boot/vmlinuz-4.0.7-300.fc22.x86_64 \
-L pc-bios/optionrom/ \
-bios roms/seabios/out/bios.bin -nographic
And I used perf (and two out instructions in the BIOS) to measure the
times:
perf record -a -e kvm:\* -e sched:sched_process_exec
And searching for sched:sched_process_exec, kvm:kvm_entry, pio_write at
0xf5 and pio_write at 0xf4. Out at 0xf5 is the one in "do_boot"
function, and out at 0xf4 is the one just before the jump to the Linux
kernel.
I attach the script I've been using. It can be improved, but it works.
It can be run like this:
sudo ../../results/run_test.sh x86_64-softmmu/qemu-system-x86_64 \
--enable-kvm -kernel /boot/vmlinuz-4.0.8-300.fc22.x86_64 \
-L pc-bios/optionrom/ \
-bios roms/seabios/out/bios.bin -nographic
Thanks
Marc
[-- Attachment #2: run_test.sh --]
[-- Type: application/x-shellscript, Size: 1401 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: QEMU fw_cfg DMA interface
2015-08-06 12:37 ` Marc Marí
2015-08-06 12:40 ` Stefan Hajnoczi
@ 2015-08-06 15:30 ` Kevin O'Connor
2015-08-06 15:53 ` Marc Marí
1 sibling, 1 reply; 16+ messages in thread
From: Kevin O'Connor @ 2015-08-06 15:30 UTC (permalink / raw)
To: Marc Marí
Cc: Stefan Hajnoczi, linux-kernel, qemu-devel, seabios, Drew,
Gerd Hoffmann, Laszlo
On Thu, Aug 06, 2015 at 02:37:45PM +0200, Marc Marí wrote:
> On Thu, 6 Aug 2015 13:27:16 +0100
> Stefan Hajnoczi <stefanha@gmail.com> wrote:
>
> > On Thu, Aug 6, 2015 at 12:00 PM, Marc Marí <markmb@redhat.com> wrote:
> > > When running a Linux guest on top of QEMU, using the -kernel
> > > options, this is the timing improvement for x86:
> > >
> > > QEMU commit 2be4f242b50a8 and SeaBIOS commit 908a58c1d5ff
> > > QEMU startup time: .078
> > > BIOS startup time: .060
> > > Kernel setup time: .578
> > > Total time: .716
> > >
> > > QEMU with this patch series and SeaBIOS with this patch series
> > > QEMU startup time: .080
> > > BIOS startup time: .039
> > > Kernel setup time: .002
> > > Total time: .121
> >
> > Impressive results!
> >
> > Is this a fully-featured QEMU build or did you disable things?
> >
> > Is this the default SeaBIOS build or did you disable things?
> >
>
> This is the default QEMU configuration I get for my system. It's not a
> fully-featured QEMU, but it has a lot of things enabled. SeaBIOS
> has a default configuration (with debugging disabled).
Thanks!
What qemu command-line did you use during testing? Also, do you have
a quick primer on how to use the kvm trace stuff to obtain timings?
-Kevin
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: QEMU fw_cfg DMA interface
2015-08-06 12:37 ` Marc Marí
@ 2015-08-06 12:40 ` Stefan Hajnoczi
2015-08-06 15:30 ` Kevin O'Connor
1 sibling, 0 replies; 16+ messages in thread
From: Stefan Hajnoczi @ 2015-08-06 12:40 UTC (permalink / raw)
To: Marc Marí
Cc: linux-kernel, qemu-devel, seabios, Drew, Kevin O'Connor,
Gerd Hoffmann, Laszlo
On Thu, Aug 6, 2015 at 1:37 PM, Marc Marí <markmb@redhat.com> wrote:
> On Thu, 6 Aug 2015 13:27:16 +0100
> Stefan Hajnoczi <stefanha@gmail.com> wrote:
>
>> On Thu, Aug 6, 2015 at 12:00 PM, Marc Marí <markmb@redhat.com> wrote:
>> > When running a Linux guest on top of QEMU, using the -kernel
>> > options, this is the timing improvement for x86:
>> >
>> > QEMU commit 2be4f242b50a8 and SeaBIOS commit 908a58c1d5ff
>> > QEMU startup time: .078
>> > BIOS startup time: .060
>> > Kernel setup time: .578
>> > Total time: .716
>> >
>> > QEMU with this patch series and SeaBIOS with this patch series
>> > QEMU startup time: .080
>> > BIOS startup time: .039
>> > Kernel setup time: .002
>> > Total time: .121
>>
>> Impressive results!
>>
>> Is this a fully-featured QEMU build or did you disable things?
>>
>> Is this the default SeaBIOS build or did you disable things?
>>
>
> This is the default QEMU configuration I get for my system. It's not a
> fully-featured QEMU, but it has a lot of things enabled. SeaBIOS
> has a default configuration (with debugging disabled).
That's great.
Since SeaBIOS is a default configuration, the remaining BIOS startup
time is amenable to more optimizations in the future.
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: QEMU fw_cfg DMA interface
2015-08-06 12:27 ` Stefan Hajnoczi
@ 2015-08-06 12:37 ` Marc Marí
2015-08-06 12:40 ` Stefan Hajnoczi
2015-08-06 15:30 ` Kevin O'Connor
0 siblings, 2 replies; 16+ messages in thread
From: Marc Marí @ 2015-08-06 12:37 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: linux-kernel, qemu-devel, seabios, Drew, Kevin O'Connor,
Gerd Hoffmann, Laszlo
On Thu, 6 Aug 2015 13:27:16 +0100
Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Thu, Aug 6, 2015 at 12:00 PM, Marc Marí <markmb@redhat.com> wrote:
> > When running a Linux guest on top of QEMU, using the -kernel
> > options, this is the timing improvement for x86:
> >
> > QEMU commit 2be4f242b50a8 and SeaBIOS commit 908a58c1d5ff
> > QEMU startup time: .078
> > BIOS startup time: .060
> > Kernel setup time: .578
> > Total time: .716
> >
> > QEMU with this patch series and SeaBIOS with this patch series
> > QEMU startup time: .080
> > BIOS startup time: .039
> > Kernel setup time: .002
> > Total time: .121
>
> Impressive results!
>
> Is this a fully-featured QEMU build or did you disable things?
>
> Is this the default SeaBIOS build or did you disable things?
>
This is the default QEMU configuration I get for my system. It's not a
fully-featured QEMU, but it has a lot of things enabled. SeaBIOS
has a default configuration (with debugging disabled).
The QEMU configuration is:
[...]
tcg debug enabled no
gprof enabled no
sparse enabled no
strip binaries yes
profiler no
static build no
pixman system
SDL support yes
GTK support yes
GNUTLS support yes
GNUTLS hash yes
GNUTLS gcrypt no
GNUTLS nettle yes (2.7.1)
VTE support yes
curses support yes
curl support yes
mingw32 support no
Audio drivers oss
Block whitelist (rw)
Block whitelist (ro)
VirtFS support yes
VNC support yes
VNC TLS support yes
VNC SASL support yes
VNC JPEG support yes
VNC PNG support yes
xen support no
brlapi support yes
bluez support yes
Documentation no
GUEST_BASE yes
PIE yes
vde support yes
netmap support no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs yes
KVM support yes
RDMA support yes
TCG interpreter no
fdt support yes
preadv support yes
fdatasync yes
madvise yes
posix_madvise yes
sigev_thread_id yes
uuid support yes
libcap-ng support yes
vhost-net support yes
vhost-scsi support yes
Trace backends nop
spice support yes (0.12.7/0.12.5)
rbd support yes
xfsctl support no
nss used yes
libusb yes
usb net redir yes
OpenGL support no
libiscsi support yes
libnfs support no
build guest agent yes
QGA VSS support no
QGA w32 disk info no
seccomp support yes
coroutine backend ucontext
coroutine pool yes
GlusterFS support yes
Archipelago support no
gcov gcov
gcov enabled no
TPM support yes
libssh2 support yes
TPM passthrough yes
QOM debugging yes
vhdx yes
lzo support yes
snappy support yes
bzip2 support yes
NUMA host support yes
tcmalloc support no
Marc
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: QEMU fw_cfg DMA interface
2015-08-06 11:00 Marc Marí
@ 2015-08-06 12:27 ` Stefan Hajnoczi
2015-08-06 12:37 ` Marc Marí
0 siblings, 1 reply; 16+ messages in thread
From: Stefan Hajnoczi @ 2015-08-06 12:27 UTC (permalink / raw)
To: Marc Marí
Cc: linux-kernel, qemu-devel, seabios, Drew, Kevin O'Connor,
Gerd Hoffmann, Laszlo
On Thu, Aug 6, 2015 at 12:00 PM, Marc Marí <markmb@redhat.com> wrote:
> When running a Linux guest on top of QEMU, using the -kernel options, this
> is the timing improvement for x86:
>
> QEMU commit 2be4f242b50a8 and SeaBIOS commit 908a58c1d5ff
> QEMU startup time: .078
> BIOS startup time: .060
> Kernel setup time: .578
> Total time: .716
>
> QEMU with this patch series and SeaBIOS with this patch series
> QEMU startup time: .080
> BIOS startup time: .039
> Kernel setup time: .002
> Total time: .121
Impressive results!
Is this a fully-featured QEMU build or did you disable things?
Is this the default SeaBIOS build or did you disable things?
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* QEMU fw_cfg DMA interface
@ 2015-08-06 11:00 Marc Marí
2015-08-06 12:27 ` Stefan Hajnoczi
0 siblings, 1 reply; 16+ messages in thread
From: Marc Marí @ 2015-08-06 11:00 UTC (permalink / raw)
To: linux-kernel, qemu-devel, seabios
Cc: Drew, Stefan Hajnoczi, Kevin O'Connor, Gerd Hoffmann, Laszlo,
Marc Marí
Implementation of the FW CFG DMA interface.
When running a Linux guest on top of QEMU, using the -kernel options, this
is the timing improvement for x86:
QEMU commit 2be4f242b50a8 and SeaBIOS commit 908a58c1d5ff
QEMU startup time: .078
BIOS startup time: .060
Kernel setup time: .578
Total time: .716
QEMU with this patch series and SeaBIOS with this patch series
QEMU startup time: .080
BIOS startup time: .039
Kernel setup time: .002
Total time: .121
QEMU startup time is the time between the start and the first kvm_entry.
BIOS startup time is the time between the first kvm_entry and the start of
function do_boot, in SeaBIOS.
Kernel setup time is the time between the start of the function do_boot in
SeaBIOS and the jump to the Linux kernel.
As you can see, both the BIOS (because of ACPI tables and other configurations)
and the Linux kernel boot (because of the copy to memory) are greatly
improved with this new interface.
Also, this new interface is an addon to the old interface. Both interfaces
are compatible and interchangeable.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2015-10-01 12:15 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31 9:08 QEMU fw_cfg DMA interface Marc Marí
2015-08-31 9:11 ` [PATCH v2] QEMU fw_cfg DMA interface documentation Marc Marí
2015-09-02 8:20 ` Stefan Hajnoczi
2015-09-02 8:33 ` Marc Marí
2015-09-07 11:08 ` Gerd Hoffmann
2015-09-07 11:25 ` Laszlo Ersek
2015-09-08 16:46 ` Kevin O'Connor
2015-09-10 14:21 ` Marc Marí
-- strict thread matches above, loose matches on Subject: below --
2015-10-01 12:14 QEMU fw_cfg DMA interface Marc Marí
2015-09-18 8:58 Marc Marí
2015-08-06 11:00 Marc Marí
2015-08-06 12:27 ` Stefan Hajnoczi
2015-08-06 12:37 ` Marc Marí
2015-08-06 12:40 ` Stefan Hajnoczi
2015-08-06 15:30 ` Kevin O'Connor
2015-08-06 15:53 ` Marc Marí
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome