[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Slow HVM boot time, was "HVM boot time optimization"



On Thu, 15 Feb 2018 17:02:35 +0100
Yessine Daoud <da.yessine@xxxxxxxxx> wrote:

> Hello,
>
>I tried to debug the issue and this what I found:
>the HVM boot takes some time at the following section
>(qemu/pc-bios/optionrom/linuxboot.S)
>/* Load kernel and initrd */
>read_fw_blob_addr32_edi(FW_CFG_INITRD) (ramdisk about 3M takes ~~7.s)
>read_fw_blob_addr32(FW_CFG_KERNEL) (vmlinuz about 7M takes ~~15.s)
>read_fw_blob_addr32(FW_CFG_CMDLINE)
>
>#define read_fw_blob_addr32(var) \
>read_fw var ## _ADDR; \
>mov %eax, %edi; \
>read_fw_blob_pre(var); \
>/* old as(1) doesn't like this insn so emit the bytes instead: \
>addr32 rep insb (%dx), %es:(%edi); \
>*/ \
>.dc.b 0x67,0xf3,0x6c
>
>#define read_fw_blob_addr32_edi(var) \
>read_fw_blob_pre(var); \
>/* old as(1) doesn't like this insn so emit the bytes instead: \
>addr32 rep insb (%dx), %es:(%edi); \
>*/ \
>.dc.b 0x67,0xf3,0x6c
>
>Any idea how to speed the  I/O read ?
>Thanks.

Hmm, looks like it does rep insb with every I/O iteration emulated
individually for some reason, hence its so slow. Normally it should be
emulated on a buffer basis. There might be a bug somewhere which cause
string I/O to be handled by every iteration.

You may try to collect QEMU trace logs using 
device_model_args = ["-trace", "events=<path to your events file>"]
Where the events file should contain lines like this:
xen_ioreq_server_create
xen_ioreq_server_destroy
xen_ioreq_server_state
xen_map_portio_range
xen_unmap_portio_range
cpu_ioreq_pio
cpu_ioreq_pio_read_reg
cpu_ioreq_pio_write_reg
handle_ioreq
handle_ioreq_read
handle_ioreq_write

The resulting log file in /var/log/xen might be large (may even require
to specify XEN_QEMU_CONSOLE_LIMIT=0) but will show how the string I/O
with port 510h is processed. This should narrow the issue.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.