[PATCH v1 0/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

David Hildenbrand posted 3 patches 2 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211130092838.24224-1-david@redhat.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
There is a newer version of this series
hw/i386/pc.c                                |  1 +
hw/virtio/virtio-mem.c                      | 63 +++++++++++++++++++++
include/hw/virtio/virtio-mem.h              |  8 +++
include/standard-headers/linux/virtio_mem.h |  9 ++-
4 files changed, 78 insertions(+), 3 deletions(-)
[PATCH v1 0/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
Posted by David Hildenbrand 2 years, 3 months ago
Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE in QEMU, which indicates to
a guest that we don't support reading unplugged memory. We indicate
the feature based on a new "unplugged-inaccessible" property available
for x86 targets only (the only ones with legacy guests). Guests that don't
support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE will fail initialization if
indicated/required by the hypervisor.

For example, Linux guests starting with v5.16 will support
VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.

For future targets that don't have legacy guests (especially arm64), we'll
always indicate VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.

More details can be found in the description of patch #2.

"
For existing compat machines, the property will default to "off", to
not change the behavior but eventually warn about a problematic setup.
Short-term, we'll set the property default to "auto" for new QEMU machines.
Mid-term, we'll set the property default to "on" for new QEMU machines.
Long-term, we'll deprecate the parameter and disallow legacy guests
completely.
"

TODO: Once 6.2 was release, adjust patch #3. Replace patch #1 by a proper
      Linux header sync.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Gavin Shan <gshan@redhat.com>
Cc: Hui Zhu <teawater@gmail.com>
Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>

David Hildenbrand (3):
  linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
  virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
  virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on
    x86

 hw/i386/pc.c                                |  1 +
 hw/virtio/virtio-mem.c                      | 63 +++++++++++++++++++++
 include/hw/virtio/virtio-mem.h              |  8 +++
 include/standard-headers/linux/virtio_mem.h |  9 ++-
 4 files changed, 78 insertions(+), 3 deletions(-)

-- 
2.31.1


Re: [PATCH v1 0/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
Posted by Michael S. Tsirkin 2 years, 3 months ago
On Tue, Nov 30, 2021 at 10:28:35AM +0100, David Hildenbrand wrote:
> Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE in QEMU, which indicates to
> a guest that we don't support reading unplugged memory. We indicate
> the feature based on a new "unplugged-inaccessible" property available
> for x86 targets only (the only ones with legacy guests). Guests that don't
> support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE will fail initialization if
> indicated/required by the hypervisor.
> 
> For example, Linux guests starting with v5.16 will support
> VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.
> 
> For future targets that don't have legacy guests (especially arm64), we'll
> always indicate VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.
> 
> More details can be found in the description of patch #2.
> 
> "
> For existing compat machines, the property will default to "off", to
> not change the behavior but eventually warn about a problematic setup.
> Short-term, we'll set the property default to "auto" for new QEMU machines.
> Mid-term, we'll set the property default to "on" for new QEMU machines.
> Long-term, we'll deprecate the parameter and disallow legacy guests
> completely.
> "
> 
> TODO: Once 6.2 was release, adjust patch #3. Replace patch #1 by a proper
>       Linux header sync.


oh so it's not for 6.2. got it.

> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Gavin Shan <gshan@redhat.com>
> Cc: Hui Zhu <teawater@gmail.com>
> Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>
> Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
> 
> David Hildenbrand (3):
>   linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
>   virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
>   virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on
>     x86
> 
>  hw/i386/pc.c                                |  1 +
>  hw/virtio/virtio-mem.c                      | 63 +++++++++++++++++++++
>  include/hw/virtio/virtio-mem.h              |  8 +++
>  include/standard-headers/linux/virtio_mem.h |  9 ++-
>  4 files changed, 78 insertions(+), 3 deletions(-)
> 
> -- 
> 2.31.1


Re: [PATCH v1 0/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
Posted by David Hildenbrand 2 years, 3 months ago
On 01.12.21 00:45, Michael S. Tsirkin wrote:
> On Tue, Nov 30, 2021 at 10:28:35AM +0100, David Hildenbrand wrote:
>> Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE in QEMU, which indicates to
>> a guest that we don't support reading unplugged memory. We indicate
>> the feature based on a new "unplugged-inaccessible" property available
>> for x86 targets only (the only ones with legacy guests). Guests that don't
>> support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE will fail initialization if
>> indicated/required by the hypervisor.
>>
>> For example, Linux guests starting with v5.16 will support
>> VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.
>>
>> For future targets that don't have legacy guests (especially arm64), we'll
>> always indicate VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.
>>
>> More details can be found in the description of patch #2.
>>
>> "
>> For existing compat machines, the property will default to "off", to
>> not change the behavior but eventually warn about a problematic setup.
>> Short-term, we'll set the property default to "auto" for new QEMU machines.
>> Mid-term, we'll set the property default to "on" for new QEMU machines.
>> Long-term, we'll deprecate the parameter and disallow legacy guests
>> completely.
>> "
>>
>> TODO: Once 6.2 was release, adjust patch #3. Replace patch #1 by a proper
>>       Linux header sync.
> 
> 
> oh so it's not for 6.2. got it.

It would be awesome to get it into 6.2 (!), but I assume that ship has
sailed, right?


-- 
Thanks,

David / dhildenb