qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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 6/8] qapi/misc: Restrict ACPI commands to machine code
Date: Mon, 16 Mar 2020 13:47:36 +0100	[thread overview]
Message-ID: <20200316134736.2a8f5abe@redhat.com> (raw)
In-Reply-To: <20200316000348.29692-7-philmd@redhat.com>

On Mon, 16 Mar 2020 01:03:46 +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                    | 154 +++++++++++++++++++++++++++
>  qapi/misc.json                       | 154 ---------------------------
>  include/hw/acpi/acpi_dev_interface.h |   2 +-
>  hw/acpi/core.c                       |   2 +-
>  hw/acpi/cpu.c                        |   2 +-
>  hw/acpi/memory_hotplug.c             |   2 +-
>  6 files changed, 158 insertions(+), 158 deletions(-)
> 
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 1a2a4b0d48..f77ee63730 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1018,3 +1018,157 @@
>  ##
>  { 'event': 'BALLOON_CHANGE',
>    'data': { 'actual': 'int' } }
> +
> +##
> +# @AcpiTableOptions:
> +#
> +# Specify an ACPI table on the command line to load.
> +#
> +# At most one of @file and @data can be specified. The list of files specified
> +# by any one of them is loaded and concatenated in order. If both are omitted,
> +# @data is implied.
> +#
> +# Other fields / optargs can be used to override fields of the generic ACPI
> +# table header; refer to the ACPI specification 5.0, section 5.2.6 System
> +# Description Table Header. If a header field is not overridden, then the
> +# corresponding value from the concatenated blob is used (in case of @file), or
> +# it is filled in with a hard-coded value (in case of @data).
> +#
> +# String fields are copied into the matching ACPI member from lowest address
> +# upwards, and silently truncated / NUL-padded to length.
> +#
> +# @sig: table signature / identifier (4 bytes)
> +#
> +# @rev: table revision number (dependent on signature, 1 byte)
> +#
> +# @oem_id: OEM identifier (6 bytes)
> +#
> +# @oem_table_id: OEM table identifier (8 bytes)
> +#
> +# @oem_rev: OEM-supplied revision number (4 bytes)
> +#
> +# @asl_compiler_id: identifier of the utility that created the table
> +#                   (4 bytes)
> +#
> +# @asl_compiler_rev: revision number of the utility that created the
> +#                    table (4 bytes)
> +#
> +# @file: colon (:) separated list of pathnames to load and
> +#        concatenate as table data. The resultant binary blob is expected to
> +#        have an ACPI table header. At least one file is required. This field
> +#        excludes @data.
> +#
> +# @data: colon (:) separated list of pathnames to load and
> +#        concatenate as table data. The resultant binary blob must not have an
> +#        ACPI table header. At least one file is required. This field excludes
> +#        @file.
> +#
> +# Since: 1.5
> +##
> +{ 'struct': 'AcpiTableOptions',
> +  'data': {
> +    '*sig':               'str',
> +    '*rev':               'uint8',
> +    '*oem_id':            'str',
> +    '*oem_table_id':      'str',
> +    '*oem_rev':           'uint32',
> +    '*asl_compiler_id':   'str',
> +    '*asl_compiler_rev':  'uint32',
> +    '*file':              'str',
> +    '*data':              'str' }}
> +
> +##
> +# @MEM_UNPLUG_ERROR:
> +#
> +# Emitted when memory hot unplug error occurs.
> +#
> +# @device: device name
> +#
> +# @msg: Informative message
> +#
> +# Since: 2.4
> +#
> +# Example:
> +#
> +# <- { "event": "MEM_UNPLUG_ERROR"
> +#      "data": { "device": "dimm1",
> +#                "msg": "acpi: device unplug for unsupported device"
> +#      },
> +#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> +#
> +##
> +{ 'event': 'MEM_UNPLUG_ERROR',
> +  'data': { 'device': 'str', 'msg': 'str' } }
> +
> +##
> +# @ACPISlotType:
> +#
> +# @DIMM: memory slot
> +# @CPU: logical CPU slot (since 2.7)
> +##
> +{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
> +
> +##
> +# @ACPIOSTInfo:
> +#
> +# OSPM Status Indication for a device
> +# For description of possible values of @source and @status fields
> +# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
> +#
> +# @device: device ID associated with slot
> +#
> +# @slot: slot ID, unique per slot of a given @slot-type
> +#
> +# @slot-type: type of the slot
> +#
> +# @source: an integer containing the source event
> +#
> +# @status: an integer containing the status code
> +#
> +# Since: 2.1
> +##
> +{ 'struct': 'ACPIOSTInfo',
> +  'data'  : { '*device': 'str',
> +              'slot': 'str',
> +              'slot-type': 'ACPISlotType',
> +              'source': 'int',
> +              'status': 'int' } }
> +
> +##
> +# @query-acpi-ospm-status:
> +#
> +# Return a list of ACPIOSTInfo for devices that support status
> +# reporting via ACPI _OST method.
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# -> { "execute": "query-acpi-ospm-status" }
> +# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
> +#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
> +#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
> +#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
> +#    ]}
> +#
> +##
> +{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
> +
> +##
> +# @ACPI_DEVICE_OST:
> +#
> +# Emitted when guest executes ACPI _OST method.
> +#
> +# @info: OSPM Status Indication
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# <- { "event": "ACPI_DEVICE_OST",
> +#      "data": { "device": "d1", "slot": "0",
> +#                "slot-type": "DIMM", "source": 1, "status": 0 } }
> +#
> +##
> +{ 'event': 'ACPI_DEVICE_OST',
> +     'data': { 'info': 'ACPIOSTInfo' } }
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 8c02870227..3d9d7327fe 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -999,64 +999,6 @@
>  ##
>  { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
>  
> -##
> -# @AcpiTableOptions:
> -#
> -# Specify an ACPI table on the command line to load.
> -#
> -# At most one of @file and @data can be specified. The list of files specified
> -# by any one of them is loaded and concatenated in order. If both are omitted,
> -# @data is implied.
> -#
> -# Other fields / optargs can be used to override fields of the generic ACPI
> -# table header; refer to the ACPI specification 5.0, section 5.2.6 System
> -# Description Table Header. If a header field is not overridden, then the
> -# corresponding value from the concatenated blob is used (in case of @file), or
> -# it is filled in with a hard-coded value (in case of @data).
> -#
> -# String fields are copied into the matching ACPI member from lowest address
> -# upwards, and silently truncated / NUL-padded to length.
> -#
> -# @sig: table signature / identifier (4 bytes)
> -#
> -# @rev: table revision number (dependent on signature, 1 byte)
> -#
> -# @oem_id: OEM identifier (6 bytes)
> -#
> -# @oem_table_id: OEM table identifier (8 bytes)
> -#
> -# @oem_rev: OEM-supplied revision number (4 bytes)
> -#
> -# @asl_compiler_id: identifier of the utility that created the table
> -#                   (4 bytes)
> -#
> -# @asl_compiler_rev: revision number of the utility that created the
> -#                    table (4 bytes)
> -#
> -# @file: colon (:) separated list of pathnames to load and
> -#        concatenate as table data. The resultant binary blob is expected to
> -#        have an ACPI table header. At least one file is required. This field
> -#        excludes @data.
> -#
> -# @data: colon (:) separated list of pathnames to load and
> -#        concatenate as table data. The resultant binary blob must not have an
> -#        ACPI table header. At least one file is required. This field excludes
> -#        @file.
> -#
> -# Since: 1.5
> -##
> -{ 'struct': 'AcpiTableOptions',
> -  'data': {
> -    '*sig':               'str',
> -    '*rev':               'uint8',
> -    '*oem_id':            'str',
> -    '*oem_table_id':      'str',
> -    '*oem_rev':           'uint32',
> -    '*asl_compiler_id':   'str',
> -    '*asl_compiler_rev':  'uint32',
> -    '*file':              'str',
> -    '*data':              'str' }}
> -
>  ##
>  # @CommandLineParameterType:
>  #
> @@ -1249,102 +1191,6 @@
>  ##
>  { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
>  
> -##
> -# @MEM_UNPLUG_ERROR:
> -#
> -# Emitted when memory hot unplug error occurs.
> -#
> -# @device: device name
> -#
> -# @msg: Informative message
> -#
> -# Since: 2.4
> -#
> -# Example:
> -#
> -# <- { "event": "MEM_UNPLUG_ERROR"
> -#      "data": { "device": "dimm1",
> -#                "msg": "acpi: device unplug for unsupported device"
> -#      },
> -#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> -#
> -##
> -{ 'event': 'MEM_UNPLUG_ERROR',
> -  'data': { 'device': 'str', 'msg': 'str' } }
> -
> -##
> -# @ACPISlotType:
> -#
> -# @DIMM: memory slot
> -# @CPU: logical CPU slot (since 2.7)
> -##
> -{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
> -
> -##
> -# @ACPIOSTInfo:
> -#
> -# OSPM Status Indication for a device
> -# For description of possible values of @source and @status fields
> -# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
> -#
> -# @device: device ID associated with slot
> -#
> -# @slot: slot ID, unique per slot of a given @slot-type
> -#
> -# @slot-type: type of the slot
> -#
> -# @source: an integer containing the source event
> -#
> -# @status: an integer containing the status code
> -#
> -# Since: 2.1
> -##
> -{ 'struct': 'ACPIOSTInfo',
> -  'data'  : { '*device': 'str',
> -              'slot': 'str',
> -              'slot-type': 'ACPISlotType',
> -              'source': 'int',
> -              'status': 'int' } }
> -
> -##
> -# @query-acpi-ospm-status:
> -#
> -# Return a list of ACPIOSTInfo for devices that support status
> -# reporting via ACPI _OST method.
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# -> { "execute": "query-acpi-ospm-status" }
> -# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
> -#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
> -#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
> -#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
> -#    ]}
> -#
> -##
> -{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
> -
> -##
> -# @ACPI_DEVICE_OST:
> -#
> -# Emitted when guest executes ACPI _OST method.
> -#
> -# @info: OSPM Status Indication
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# <- { "event": "ACPI_DEVICE_OST",
> -#      "data": { "device": "d1", "slot": "0",
> -#                "slot-type": "DIMM", "source": 1, "status": 0 } }
> -#
> -##
> -{ 'event': 'ACPI_DEVICE_OST',
> -     'data': { 'info': 'ACPIOSTInfo' } }
> -
>  ##
>  # @ReplayMode:
>  #
> diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
> index a2a12af9b9..a1b63d51db 100644
> --- a/include/hw/acpi/acpi_dev_interface.h
> +++ b/include/hw/acpi/acpi_dev_interface.h
> @@ -1,7 +1,7 @@
>  #ifndef ACPI_DEV_INTERFACE_H
>  #define ACPI_DEV_INTERFACE_H
>  
> -#include "qapi/qapi-types-misc.h"
> +#include "qapi/qapi-types-machine.h"
>  #include "qom/object.h"
>  #include "hw/boards.h"
>  #include "hw/qdev-core.h"
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index 45cbed49ab..4f8d90f50b 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -27,7 +27,7 @@
>  #include "qapi/error.h"
>  #include "qapi/opts-visitor.h"
>  #include "qapi/qapi-events-run-state.h"
> -#include "qapi/qapi-visit-misc.h"
> +#include "qapi/qapi-visit-machine.h"
>  #include "qemu/error-report.h"
>  #include "qemu/module.h"
>  #include "qemu/option.h"
> diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
> index e2c957ce00..8be15db96d 100644
> --- a/hw/acpi/cpu.c
> +++ b/hw/acpi/cpu.c
> @@ -3,7 +3,7 @@
>  #include "migration/vmstate.h"
>  #include "hw/acpi/cpu.h"
>  #include "qapi/error.h"
> -#include "qapi/qapi-events-misc.h"
> +#include "qapi/qapi-events-machine.h"
>  #include "trace.h"
>  #include "sysemu/numa.h"
>  
> diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
> index 8d2e82240f..aa454f5cb2 100644
> --- a/hw/acpi/memory_hotplug.c
> +++ b/hw/acpi/memory_hotplug.c
> @@ -7,7 +7,7 @@
>  #include "migration/vmstate.h"
>  #include "trace.h"
>  #include "qapi/error.h"
> -#include "qapi/qapi-events-misc.h"
> +#include "qapi/qapi-events-machine.h"
>  
>  #define MEMORY_SLOTS_NUMBER          "MDNR"
>  #define MEMORY_HOTPLUG_IO_REGION     "HPMR"



  reply	other threads:[~2020-03-16 15:50 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 [this message]
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

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=20200316134736.2a8f5abe@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).