All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] s390x: KVM: CPU Topology
@ 2021-08-03  8:26 Pierre Morel
  2021-08-03  8:26 ` [PATCH v3 1/3] s390x: KVM: accept STSI for CPU topology information Pierre Morel
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Pierre Morel @ 2021-08-03  8:26 UTC (permalink / raw)
  To: kvm
  Cc: linux-s390, linux-kernel, borntraeger, frankja, cohuck, david,
	thuth, imbrenda, hca, gor, pmorel

Hi all,

This new series add the implementation of interpretation for
the PTF instruction.

The series is devided in three parts:
1- handling of the STSI instruction forwarding the CPU topology
2- implementation of the interpretation of the PTF instruction
3- use of the PTF interpretation to optimize topology change callback

1- STSI
To provide Topology information to the guest through the STSI
instruction, we need to forward STSI with Function Code 15 to
QEMU which will take care to provide the right information to
the guest.

To let the guest use both the PTF instruction  to check if a topology
change occured and sthe STSI_15.x.x instruction we add a new KVM
capability to enable the topology facility.

2- PTF
To implement PTF interpretation we make the MTCR pending when the
last CPU backed by the vCPU changed from one socket to another.

The PTF instruction will report a topology change if there is any change
with a previous STSI_15_2 SYSIB.
Changes inside a STSI_15_2 SYSIB occur if CPU bits are set or clear
inside the CPU Topology List Entry CPU mask field, which happens with
changes in CPU polarization, dedication, CPU types and adding or
removing CPUs in a socket.

The reporting to the guest is done using the Multiprocessor
Topology-Change-Report (MTCR) bit of the utility entry of the guest's
SCA which will be cleared during the interpretation of PTF.

To check if the topology has been modified we use a new field of the
arch vCPU to save the previous real CPU ID at the end of a schedule
and verify on next schedule that the CPU used is in the same socket.

We deliberatly ignore:
- polarization: only horizontal polarization is currently used in linux.
- CPU Type: only IFL Type are supported in Linux
- Dedication: we consider that only a complete dedicated CPU stack can
  take benefit of the CPU Topology and let the admin take care of that.


Regards,
Pierre


Pierre Morel (3):
  s390x: KVM: accept STSI for CPU topology information
  s390x: KVM: Implementation of Multiprocessor Topology-Change-Report
  s390x: optimization of the check for CPU topology change

 arch/s390/include/asm/kvm_host.h | 14 +++++++---
 arch/s390/kernel/topology.c      |  3 ++
 arch/s390/kvm/kvm-s390.c         | 48 +++++++++++++++++++++++++++++++-
 arch/s390/kvm/priv.c             |  7 ++++-
 arch/s390/kvm/vsie.c             |  3 ++
 include/uapi/linux/kvm.h         |  1 +
 6 files changed, 70 insertions(+), 6 deletions(-)

-- 
2.25.1

Changelog:

from v2 to v3

- use PTF interpretation
  (Christian)

- optimize arch_update_cpu_topology using PTF
  (Pierre)

from v1 to v2:

- Add a KVM capability to let QEMU know we support PTF and STSI 15
  (David)

- check KVM facility 11 before accepting STSI fc 15
  (David)

- handle all we can in userland
  (David)

- add tracing to STSI fc 15
  (Connie)


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

end of thread, other threads:[~2021-09-09  9:03 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  8:26 [PATCH v3 0/3] s390x: KVM: CPU Topology Pierre Morel
2021-08-03  8:26 ` [PATCH v3 1/3] s390x: KVM: accept STSI for CPU topology information Pierre Morel
2021-08-31 13:59   ` David Hildenbrand
2021-09-01  9:43     ` Pierre Morel
2021-09-06 18:14       ` David Hildenbrand
2021-09-07 10:11         ` Pierre Morel
2021-08-03  8:26 ` [PATCH v3 2/3] s390x: KVM: Implementation of Multiprocessor Topology-Change-Report Pierre Morel
2021-08-31 14:03   ` David Hildenbrand
2021-09-01  9:46     ` Pierre Morel
2021-09-06 18:37   ` David Hildenbrand
2021-09-07 10:24     ` Pierre Morel
2021-09-08  7:04       ` Christian Borntraeger
2021-09-08 12:00         ` Pierre Morel
2021-09-08 12:01           ` Christian Borntraeger
2021-09-08 12:52             ` Pierre Morel
2021-09-07 12:28     ` Pierre Morel
2021-09-08  7:07       ` Christian Borntraeger
2021-09-08 13:09         ` Pierre Morel
2021-09-08 13:16           ` Christian Borntraeger
2021-09-08 14:17             ` Pierre Morel
2021-09-09  9:03     ` Pierre Morel
2021-08-03  8:26 ` [PATCH v3 3/3] s390x: optimization of the check for CPU topology change Pierre Morel
2021-08-03  8:42   ` Heiko Carstens
2021-08-03  8:57     ` Pierre Morel
2021-08-03  9:28       ` Pierre Morel

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.