pc: bugfixes, maintainers
The following changes since commit f3bac27cc1e303e1860cc55b9b6889ba39dee587:
Update version for v5.0.0-rc2 release (2020-04-07 23:13:37 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to ce4adc0b6e6167091373389ef8befd379c61fddb:
exec: Fix for qemu_ram_resize() callback (2020-04-13 06:55:54 -0400)
----------------------------------------------------------------
pc: bugfixes, maintainers
A couple of bugfixes.
Add a new vhost-user-blk maintainer.
----------------------------------------------------------------
David Hildenbrand (1):
exec: Fix for qemu_ram_resize() callback
Raphael Norwitz (1):
MAINTAINERS: Add myself as vhost-user-blk maintainer
Shameer Kolothum (2):
acpi: Use macro for table-loader file name
fw_cfg: Migrate ACPI table mr sizes separately
include/hw/acpi/aml-build.h | 1 + include/hw/nvram/fw_cfg.h | 6 +++ exec.c | 16 +++++++- hw/arm/virt-acpi-build.c | 2 +- hw/core/machine.c | 1 + hw/i386/acpi-build.c | 2 +- hw/nvram/fw_cfg.c | 91 ++++++++++++++++++++++++++++++++++++++++++++- MAINTAINERS | 12 ++++++ 8 files changed, 126 insertions(+), 5 deletions(-)
[PULL 1/4] MAINTAINERS: Add myself as vhost-user-blk maintainer
From: Raphael Norwitz <[email protected]>
As suggested by Michael, let's add me as a maintainer of vhost-user-blk and vhost-user-scsi.
CC: Michael S. Tsirkin <[email protected]> CC Peter Maydell <[email protected]>
Message-Id: <[email protected]>
--- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+)
MAINTAINERS +12 -0
@@ -1853,6 +1853,18 @@ F: hw/display/virtio-gpu* F: hw/display/virtio-vga.* F: include/hw/virtio/virtio-gpu.h +vhost-user-blk +M: Raphael Norwitz <[email protected]> +S: Maintained +F: contrib/vhost-user-blk/ +F: contrib/vhost-user-scsi/ +F: hw/block/vhost-user-blk.c +F: hw/scsi/vhost-user-scsi.c +F: hw/virtio/vhost-user-blk-pci.c +F: hw/virtio/vhost-user-scsi-pci.c +F: include/hw/virtio/vhost-user-blk.h +F: include/hw/virtio/vhost-user-scsi.h + vhost-user-gpu M: Marc-André Lureau <[email protected]> M: Gerd Hoffmann <[email protected]>
Signature · 1 line
MST
[PULL 2/4] acpi: Use macro for table-loader file name
In reply to Michael S. TsirkinFrom: Shameer Kolothum <[email protected]>
Use macro for "etc/table-loader" and move it to the header file similar to ACPI_BUILD_TABLE_FILE/ACPI_BUILD_RSDP_FILE etc.
Message-Id: <[email protected]>
--- include/hw/acpi/aml-build.h | 1 + hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-build.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
include/hw/acpi/aml-build.h +1 -0
@@ -13,6 +13,7 @@#define ACPI_BUILD_TABLE_FILE "etc/acpi/tables"#define ACPI_BUILD_RSDP_FILE "etc/acpi/rsdp"#define ACPI_BUILD_TPMLOG_FILE "etc/tpm/log" +#define ACPI_BUILD_LOADER_FILE "etc/table-loader"#define AML_NOTIFY_METHOD "NTFY"
hw/arm/virt-acpi-build.c +1 -1
@@ -929,7 +929,7 @@ void virt_acpi_setup(VirtMachineState *vms) build_state->linker_mr =acpi_add_rom_blob (virt_acpi_build_update, build_state, - tables.linker->cmd_blob,"etc/table-loader" ,0 ); + tables.linker->cmd_blob,ACPI_BUILD_LOADER_FILE ,0 );fw_cfg_add_file (vms->fw_cfg,ACPI_BUILD_TPMLOG_FILE , tables.tcpalog->data,acpi_data_len (tables.tcpalog));
hw/i386/acpi-build.c +1 -1
@@ -3043,7 +3043,7 @@ void acpi_setup(void) build_state->linker_mr =acpi_add_rom_blob (acpi_build_update, build_state, - tables.linker->cmd_blob,"etc/table-loader" ,0 ); + tables.linker->cmd_blob,ACPI_BUILD_LOADER_FILE ,0 );fw_cfg_add_file (x86ms->fw_cfg,ACPI_BUILD_TPMLOG_FILE , tables.tcpalog->data,acpi_data_len (tables.tcpalog));
Signature · 1 line
MST
[PULL 3/4] fw_cfg: Migrate ACPI table mr sizes separately
In reply to Michael S. TsirkinFrom: Shameer Kolothum <[email protected]>
Any sub-page size update to ACPI MRs will be lost during migration, as we use aligned size in ram_load_precopy() -> qemu_ram_resize() path. This will result in inconsistency in FWCfgEntry sizes between source and destination. In order to avoid this, save and restore them separately during migration.
Up until now, this problem may not be that relevant for x86 as both ACPI table and Linker MRs gets padded and aligned. Also at present, qemu_ram_resize() doesn't invoke callback to update FWCfgEntry for unaligned size changes. But since we are going to fix the qemu_ram_resize() in the subsequent patch, the issue may become more serious especially for RSDP MR case.
Moreover, the issue will soon become prominent in arm/virt as well where the MRs are not padded or aligned at all and eventually have acpi table changes as part of future additions like NVDIMM hot-add feature.
Message-Id: <[email protected]>
--- include/hw/nvram/fw_cfg.h | 6 +++ hw/core/machine.c | 1 + hw/nvram/fw_cfg.c | 91 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 1 deletion(-)
include/hw/nvram/fw_cfg.h +6 -0
@@ -53,6 +53,12 @@ struct FWCfgState {dma_addr_t dma_addr;AddressSpace *dma_as;MemoryRegion dma_iomem; + +/* restore during migration */ +bool acpi_mr_restore; +uint64_t table_mr_size; +uint64_t linker_mr_size; +uint64_t rsdp_mr_size; };struct FWCfgIoState {
hw/core/machine.c +1 -0
@@ -39,6 +39,7 @@ GlobalProperty hw_compat_4_2[] = { { "usb-redir", "suppress-remote-wake", "off" }, { "qxl", "revision", "4" }, { "qxl-vga", "revision", "4" }, + { "fw_cfg", "acpi-mr-restore", "false" }, };const size_t hw_compat_4_2_len =G_N_ELEMENTS (hw_compat_4_2);
hw/nvram/fw_cfg.c +90 -1
145 lines not on this page · raw message
Signature · 1 line
MST
[PULL 4/4] exec: Fix for qemu_ram_resize() callback
In reply to Michael S. TsirkinFrom: David Hildenbrand <[email protected]>
Summarizing the issue:
1. Memory regions contain ram blocks with a different size, if the size is not properly aligned. While memory regions can have an unaligned size, ram blocks can't. This is true when creating resizable memory region with an unaligned size.
2. When resizing a ram block/memory region, the size of the memory region is set to the aligned size. The callback is called with the aligned size. The unaligned piece is lost.
Because of the above, if ACPI blob length modifications happens after the initial virt_acpi_build() call, and the changed blob length is within the PAGE size boundary, then the revised size is not seen by the firmware on Guest reboot.
Hence make sure callback is called if memory region size is changed, irrespective of aligned or not.
Message-Id: <[email protected]>
--- exec.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
exec.c +14 -2
@@ -2074,11 +2074,23 @@ static int memory_try_enable_merging(void *addr, size_t len)*/ int qemu_ram_resize (RAMBlock *block,ram_addr_t newsize,Error **errp) { +const ram_addr_t unaligned_size = newsize; +assert (block); newsize =HOST_PAGE_ALIGN (newsize);if (block->used_length == newsize) { +/* +* We don't have to resize the ram block (which only knows aligned +* sizes), however, we have to notify if the unaligned size changed. +*/ +if (unaligned_size !=memory_region_size (block->mr)) { +memory_region_set_size (block->mr, unaligned_size); +if (block->resized) { + block->resized (block->idstr, unaligned_size, block->host); + } + }return 0 ; }
@@ -2102,9 +2114,9 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp) block->used_length = newsize;cpu_physical_memory_set_dirty_range (block->offset, block->used_length,DIRTY_CLIENTS_ALL ); -memory_region_set_size (block->mr, newsize); +memory_region_set_size (block->mr, unaligned_size);if (block->resized) { - block->resized (block->idstr, newsize, block->host); + block->resized (block->idstr, unaligned_size, block->host); }return 0 ; }
Signature · 1 line
MST
Peter Maydell
AppliedQuoted 13 lines · Michael S. Tsirkin
The following changes since commit
f3bac27cc1e303e1860cc55b9b6889ba39dee587:Update version for v5.0.0-rc2 release (2020-04-07 23:13:37 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
ce4adc0b6e6167091373389ef8befd379c61fddb:exec: Fix for
qemu_ram_resize()callback (2020-04-13 06:55:54 -0400)
Quoted 7 lines
----------------------------------------------------------------
pc: bugfixes, maintainersA couple of bugfixes.
Add a new vhost-user-blk maintainer.Signed-off-by Michael S. Tsirkin <[email protected]>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.
-- PMM