[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 01/55] virtio-mem: Don't skip alignment checks when warning abo
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 01/55] virtio-mem: Don't skip alignment checks when warning about block size |
Date: |
Fri, 7 Jan 2022 20:03:32 -0500 |
From: David Hildenbrand <david@redhat.com>
If we warn about the block size being smaller than the default, we skip
some alignment checks.
This can currently only fail on x86-64, when specifying a block size of
1 MiB, however, we detect the THP size of 2 MiB.
Fixes: 228957fea3a9 ("virtio-mem: Probe THP size to determine default block
size")
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211011173305.13778-1-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/virtio-mem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index d5a578142b..341c3fa2c1 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -733,7 +733,8 @@ static void virtio_mem_device_realize(DeviceState *dev,
Error **errp)
warn_report("'%s' property is smaller than the default block size (%"
PRIx64 " MiB)", VIRTIO_MEM_BLOCK_SIZE_PROP,
virtio_mem_default_block_size(rb) / MiB);
- } else if (!QEMU_IS_ALIGNED(vmem->requested_size, vmem->block_size)) {
+ }
+ if (!QEMU_IS_ALIGNED(vmem->requested_size, vmem->block_size)) {
error_setg(errp, "'%s' property has to be multiples of '%s' (0x%"
PRIx64
")", VIRTIO_MEM_REQUESTED_SIZE_PROP,
VIRTIO_MEM_BLOCK_SIZE_PROP, vmem->block_size);
--
MST
- [PULL v3 00/55] virtio,pci,pc: features,fixes,cleanups, Michael S. Tsirkin, 2022/01/07
- [PULL v3 01/55] virtio-mem: Don't skip alignment checks when warning about block size,
Michael S. Tsirkin <=
- [PULL v3 02/55] acpi: validate hotplug selector on access, Michael S. Tsirkin, 2022/01/07
- [PULL v3 03/55] virtio: introduce macro IRTIO_CONFIG_IRQ_IDX, Michael S. Tsirkin, 2022/01/07
- [PULL v3 04/55] virtio-pci: decouple notifier from interrupt process, Michael S. Tsirkin, 2022/01/07
- [PULL v3 05/55] virtio-pci: decouple the single vector from the interrupt process, Michael S. Tsirkin, 2022/01/07
- [PULL v3 06/55] vhost: introduce new VhostOps vhost_set_config_call, Michael S. Tsirkin, 2022/01/07
- [PULL v3 07/55] vhost-vdpa: add support for config interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v3 08/55] virtio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v3 09/55] vhost: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v3 10/55] virtio-net: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v3 11/55] virtio-mmio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07