[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v16 08/11] qapi/s390x/cpu topology: set-cpu-topology monitor

From: Thomas Huth
Subject: Re: [PATCH v16 08/11] qapi/s390x/cpu topology: set-cpu-topology monitor command
Date: Mon, 27 Feb 2023 08:59:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 24/02/2023 18.15, Nina Schoetterl-Glausch wrote:
On Wed, 2023-02-22 at 15:21 +0100, Pierre Morel wrote:
The modification of the CPU attributes are done through a monitor

It allows to move the core inside the topology tree to optimize
the cache usage in the case the host's hypervisor previously
moved the CPU.

The same command allows to modify the CPU attributes modifiers
like polarization entitlement and the dedicated attribute to notify
the guest if the host admin modified scheduling or dedication of a vCPU.

With this knowledge the guest has the possibility to optimize the
usage of the vCPUs.

The command has a feature unstable for the moment.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
  qapi/machine-target.json |  35 +++++++++
  include/monitor/hmp.h    |   1 +
  hw/s390x/cpu-topology.c  | 154 +++++++++++++++++++++++++++++++++++++++
  hmp-commands.hx          |  17 +++++
  4 files changed, 207 insertions(+)

diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index a52cc32f09..baa9d273cf 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -354,3 +354,38 @@
  { 'enum': 'CpuS390Polarization',
    'prefix': 'S390_CPU_POLARIZATION',
    'data': [ 'horizontal', 'vertical' ] }
+# @set-cpu-topology:
+# @core-id: the vCPU ID to be moved
+# @socket-id: optional destination socket where to move the vCPU
+# @book-id: optional destination book where to move the vCPU
+# @drawer-id: optional destination drawer where to move the vCPU
+# @entitlement: optional entitlement
+# @dedicated: optional, if the vCPU is dedicated to a real CPU
+# Features:
+# @unstable: This command may still be modified.
+# Modifies the topology by moving the CPU inside the topology
+# tree or by changing a modifier attribute of a CPU.
+# Default value for optional parameter is the current value
+# used by the CPU.
+# Returns: Nothing on success, the reason on failure.
+# Since: 8.0
+{ 'command': 'set-cpu-topology',
+  'data': {
+      'core-id': 'uint16',
+      '*socket-id': 'uint16',
+      '*book-id': 'uint16',
+      '*drawer-id': 'uint16',
+      '*entitlement': 'str',

How about you add a machine-common.json and define CpuS390Entitlement there,
and then include it from both machine.json and machine-target.json?

I'm not sure whether double inclusion works with the QAPI parser (since this might code to be generated twice) ... have you tried?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]