From: Igor Mammedov <imammedo@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Ben Warren" <ben@skyportsystems.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org,
"Ronnie Sahlberg" <ronniesahlberg@gmail.com>,
"Peter Lieven" <pl@kamp.de>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Max Reitz" <mreitz@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-block@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [PATCH v2 8/8] qapi/misc: Restrict device memory commands to machine code
Date: Mon, 16 Mar 2020 13:49:14 +0100 [thread overview]
Message-ID: <20200316134914.2152130a@redhat.com> (raw)
In-Reply-To: <20200316000348.29692-9-philmd@redhat.com>
On Mon, 16 Mar 2020 01:03:48 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
> ---
> qapi/machine.json | 131 +++++++++++++++++++++++++++++++
> qapi/misc.json | 132 --------------------------------
> include/hw/mem/memory-device.h | 1 +
> include/hw/virtio/virtio-pmem.h | 2 +-
> 4 files changed, 133 insertions(+), 133 deletions(-)
>
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 33b259dbd0..17ccebda14 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1476,3 +1476,134 @@
> #
> ##
> { 'command': 'query-pci', 'returns': ['PciInfo'] }
> +
> +##
> +# @MemoryInfo:
> +#
> +# Actual memory information in bytes.
> +#
> +# @base-memory: size of "base" memory specified with command line
> +# option -m.
> +#
> +# @plugged-memory: size of memory that can be hot-unplugged. This field
> +# is omitted if target doesn't support memory hotplug
> +# (i.e. CONFIG_MEM_DEVICE not defined at build time).
> +#
> +# Since: 2.11.0
> +##
> +{ 'struct': 'MemoryInfo',
> + 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } }
> +
> +##
> +# @query-memory-size-summary:
> +#
> +# Return the amount of initially allocated and present hotpluggable (if
> +# enabled) memory in bytes.
> +#
> +# Example:
> +#
> +# -> { "execute": "query-memory-size-summary" }
> +# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
> +#
> +# Since: 2.11.0
> +##
> +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
> +
> +##
> +# @PCDIMMDeviceInfo:
> +#
> +# PCDIMMDevice state information
> +#
> +# @id: device's ID
> +#
> +# @addr: physical address, where device is mapped
> +#
> +# @size: size of memory that the device provides
> +#
> +# @slot: slot number at which device is plugged in
> +#
> +# @node: NUMA node number where device is plugged in
> +#
> +# @memdev: memory backend linked with device
> +#
> +# @hotplugged: true if device was hotplugged
> +#
> +# @hotpluggable: true if device if could be added/removed while machine is running
> +#
> +# Since: 2.1
> +##
> +{ 'struct': 'PCDIMMDeviceInfo',
> + 'data': { '*id': 'str',
> + 'addr': 'int',
> + 'size': 'int',
> + 'slot': 'int',
> + 'node': 'int',
> + 'memdev': 'str',
> + 'hotplugged': 'bool',
> + 'hotpluggable': 'bool'
> + }
> +}
> +
> +##
> +# @VirtioPMEMDeviceInfo:
> +#
> +# VirtioPMEM state information
> +#
> +# @id: device's ID
> +#
> +# @memaddr: physical address in memory, where device is mapped
> +#
> +# @size: size of memory that the device provides
> +#
> +# @memdev: memory backend linked with device
> +#
> +# Since: 4.1
> +##
> +{ 'struct': 'VirtioPMEMDeviceInfo',
> + 'data': { '*id': 'str',
> + 'memaddr': 'size',
> + 'size': 'size',
> + 'memdev': 'str'
> + }
> +}
> +
> +##
> +# @MemoryDeviceInfo:
> +#
> +# Union containing information about a memory device
> +#
> +# nvdimm is included since 2.12. virtio-pmem is included since 4.1.
> +#
> +# Since: 2.1
> +##
> +{ 'union': 'MemoryDeviceInfo',
> + 'data': { 'dimm': 'PCDIMMDeviceInfo',
> + 'nvdimm': 'PCDIMMDeviceInfo',
> + 'virtio-pmem': 'VirtioPMEMDeviceInfo'
> + }
> +}
> +
> +##
> +# @query-memory-devices:
> +#
> +# Lists available memory devices and their state
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# -> { "execute": "query-memory-devices" }
> +# <- { "return": [ { "data":
> +# { "addr": 5368709120,
> +# "hotpluggable": true,
> +# "hotplugged": true,
> +# "id": "d1",
> +# "memdev": "/objects/memX",
> +# "node": 0,
> +# "size": 1073741824,
> +# "slot": 0},
> +# "type": "dimm"
> +# } ] }
> +#
> +##
> +{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 92b3926c6b..670b902999 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -518,39 +518,6 @@
> ##
> { 'command': 'closefd', 'data': {'fdname': 'str'} }
>
> -##
> -# @MemoryInfo:
> -#
> -# Actual memory information in bytes.
> -#
> -# @base-memory: size of "base" memory specified with command line
> -# option -m.
> -#
> -# @plugged-memory: size of memory that can be hot-unplugged. This field
> -# is omitted if target doesn't support memory hotplug
> -# (i.e. CONFIG_MEM_DEVICE not defined at build time).
> -#
> -# Since: 2.11.0
> -##
> -{ 'struct': 'MemoryInfo',
> - 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } }
> -
> -##
> -# @query-memory-size-summary:
> -#
> -# Return the amount of initially allocated and present hotpluggable (if
> -# enabled) memory in bytes.
> -#
> -# Example:
> -#
> -# -> { "execute": "query-memory-size-summary" }
> -# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
> -#
> -# Since: 2.11.0
> -##
> -{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
> -
> -
> ##
> # @AddfdInfo:
> #
> @@ -788,105 +755,6 @@
> 'returns': ['CommandLineOptionInfo'],
> 'allow-preconfig': true }
>
> -##
> -# @PCDIMMDeviceInfo:
> -#
> -# PCDIMMDevice state information
> -#
> -# @id: device's ID
> -#
> -# @addr: physical address, where device is mapped
> -#
> -# @size: size of memory that the device provides
> -#
> -# @slot: slot number at which device is plugged in
> -#
> -# @node: NUMA node number where device is plugged in
> -#
> -# @memdev: memory backend linked with device
> -#
> -# @hotplugged: true if device was hotplugged
> -#
> -# @hotpluggable: true if device if could be added/removed while machine is running
> -#
> -# Since: 2.1
> -##
> -{ 'struct': 'PCDIMMDeviceInfo',
> - 'data': { '*id': 'str',
> - 'addr': 'int',
> - 'size': 'int',
> - 'slot': 'int',
> - 'node': 'int',
> - 'memdev': 'str',
> - 'hotplugged': 'bool',
> - 'hotpluggable': 'bool'
> - }
> -}
> -
> -##
> -# @VirtioPMEMDeviceInfo:
> -#
> -# VirtioPMEM state information
> -#
> -# @id: device's ID
> -#
> -# @memaddr: physical address in memory, where device is mapped
> -#
> -# @size: size of memory that the device provides
> -#
> -# @memdev: memory backend linked with device
> -#
> -# Since: 4.1
> -##
> -{ 'struct': 'VirtioPMEMDeviceInfo',
> - 'data': { '*id': 'str',
> - 'memaddr': 'size',
> - 'size': 'size',
> - 'memdev': 'str'
> - }
> -}
> -
> -##
> -# @MemoryDeviceInfo:
> -#
> -# Union containing information about a memory device
> -#
> -# nvdimm is included since 2.12. virtio-pmem is included since 4.1.
> -#
> -# Since: 2.1
> -##
> -{ 'union': 'MemoryDeviceInfo',
> - 'data': { 'dimm': 'PCDIMMDeviceInfo',
> - 'nvdimm': 'PCDIMMDeviceInfo',
> - 'virtio-pmem': 'VirtioPMEMDeviceInfo'
> - }
> -}
> -
> -##
> -# @query-memory-devices:
> -#
> -# Lists available memory devices and their state
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# -> { "execute": "query-memory-devices" }
> -# <- { "return": [ { "data":
> -# { "addr": 5368709120,
> -# "hotpluggable": true,
> -# "hotplugged": true,
> -# "id": "d1",
> -# "memdev": "/objects/memX",
> -# "node": 0,
> -# "size": 1073741824,
> -# "slot": 0},
> -# "type": "dimm"
> -# } ] }
> -#
> -##
> -{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
> -
> ##
> # @ReplayMode:
> #
> diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h
> index 04476acb8f..76f3de0f7e 100644
> --- a/include/hw/mem/memory-device.h
> +++ b/include/hw/mem/memory-device.h
> @@ -14,6 +14,7 @@
> #define MEMORY_DEVICE_H
>
> #include "hw/qdev-core.h"
> +#include "qapi/qapi-types-machine.h"
> #include "qapi/qapi-types-misc.h"
> #include "qom/object.h"
>
> diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pmem.h
> index 33f1999320..72863412b2 100644
> --- a/include/hw/virtio/virtio-pmem.h
> +++ b/include/hw/virtio/virtio-pmem.h
> @@ -15,7 +15,7 @@
> #define HW_VIRTIO_PMEM_H
>
> #include "hw/virtio/virtio.h"
> -#include "qapi/qapi-types-misc.h"
> +#include "qapi/qapi-types-machine.h"
>
> #define TYPE_VIRTIO_PMEM "virtio-pmem"
>
prev parent reply other threads:[~2020-03-16 16:04 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 0:03 [PATCH v2 0/8] user-mode: Prune build dependencies (part 2) Philippe Mathieu-Daudé
2020-03-16 0:03 ` [PATCH v2 1/8] target/i386: Restrict X86CPUFeatureWord to X86 targets Philippe Mathieu-Daudé
2020-03-16 0:29 ` Aleksandar Markovic
2020-03-16 0:31 ` Aleksandar Markovic
2020-03-16 7:30 ` Philippe Mathieu-Daudé
2020-03-18 8:25 ` Philippe Mathieu-Daudé
2020-03-16 0:03 ` [PATCH v2 2/8] qapi/misc: Restrict LostTickPolicy enum to machine code Philippe Mathieu-Daudé
2020-05-25 14:12 ` Philippe Mathieu-Daudé
2020-05-26 15:00 ` Igor Mammedov
2020-03-16 0:03 ` [PATCH v2 3/8] qapi/misc: Restrict balloon-related commands " Philippe Mathieu-Daudé
2020-03-16 9:05 ` David Hildenbrand
2020-03-17 11:03 ` Philippe Mathieu-Daudé
2020-03-17 11:04 ` David Hildenbrand
2020-03-16 0:03 ` [PATCH v2 4/8] qapi/misc: Move query-uuid command with block code Philippe Mathieu-Daudé
2020-03-16 13:09 ` Igor Mammedov
2020-03-16 13:57 ` Philippe Mathieu-Daudé
2020-03-16 0:03 ` [PATCH v2 5/8] qapi/misc: Restrict query-vm-generation-id command to machine code Philippe Mathieu-Daudé
2020-03-16 12:45 ` Igor Mammedov
2020-03-17 9:44 ` Philippe Mathieu-Daudé
2020-03-17 11:07 ` Igor Mammedov
2020-03-16 0:03 ` [PATCH v2 6/8] qapi/misc: Restrict ACPI commands " Philippe Mathieu-Daudé
2020-03-16 12:47 ` Igor Mammedov
2020-03-16 0:03 ` [PATCH v2 7/8] qapi/misc: Restrict PCI " Philippe Mathieu-Daudé
2020-05-25 14:12 ` Philippe Mathieu-Daudé
2020-03-16 0:03 ` [PATCH v2 8/8] qapi/misc: Restrict device memory " Philippe Mathieu-Daudé
2020-03-16 12:49 ` Igor Mammedov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200316134914.2152130a@redhat.com \
--to=imammedo@redhat.com \
--cc=armbru@redhat.com \
--cc=ben@skyportsystems.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).