All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size
@ 2021-10-11 17:33 David Hildenbrand
  2021-10-12  7:27 ` Michael S. Tsirkin
  2021-12-17 14:54 ` David Hildenbrand
  0 siblings, 2 replies; 5+ messages in thread
From: David Hildenbrand @ 2021-10-11 17:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael S. Tsirkin, David Hildenbrand

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>
---
 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 df91e454b2..7ce9901791 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -701,7 +701,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);
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size
  2021-10-11 17:33 [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size David Hildenbrand
@ 2021-10-12  7:27 ` Michael S. Tsirkin
  2021-11-22 12:01   ` David Hildenbrand
  2021-12-17 14:54 ` David Hildenbrand
  1 sibling, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2021-10-12  7:27 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: qemu-devel

On Mon, Oct 11, 2021 at 07:33:05PM +0200, David Hildenbrand wrote:
> 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>

Reviewed-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 df91e454b2..7ce9901791 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -701,7 +701,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);
> -- 
> 2.31.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size
  2021-10-12  7:27 ` Michael S. Tsirkin
@ 2021-11-22 12:01   ` David Hildenbrand
  2021-11-22 23:53     ` Michael S. Tsirkin
  0 siblings, 1 reply; 5+ messages in thread
From: David Hildenbrand @ 2021-11-22 12:01 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel

On 12.10.21 09:27, Michael S. Tsirkin wrote:
> On Mon, Oct 11, 2021 at 07:33:05PM +0200, David Hildenbrand wrote:
>> 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>
> 
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

Thanks Michael, will you send this for the v6.2 release?


-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size
  2021-11-22 12:01   ` David Hildenbrand
@ 2021-11-22 23:53     ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2021-11-22 23:53 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: qemu-devel

On Mon, Nov 22, 2021 at 01:01:51PM +0100, David Hildenbrand wrote:
> On 12.10.21 09:27, Michael S. Tsirkin wrote:
> > On Mon, Oct 11, 2021 at 07:33:05PM +0200, David Hildenbrand wrote:
> >> 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>
> > 
> > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Thanks Michael, will you send this for the v6.2 release?
> 
> 
> -- 
> Thanks,
> 
> David / dhildenb

sure



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size
  2021-10-11 17:33 [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size David Hildenbrand
  2021-10-12  7:27 ` Michael S. Tsirkin
@ 2021-12-17 14:54 ` David Hildenbrand
  1 sibling, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2021-12-17 14:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael S. Tsirkin

On 11.10.21 19:33, David Hildenbrand wrote:
> 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>
> ---
>  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 df91e454b2..7ce9901791 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -701,7 +701,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);
> 

Ping, this already missed the v6.2 release ...

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-17 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 17:33 [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size David Hildenbrand
2021-10-12  7:27 ` Michael S. Tsirkin
2021-11-22 12:01   ` David Hildenbrand
2021-11-22 23:53     ` Michael S. Tsirkin
2021-12-17 14:54 ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.