qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH v3 2/4] s390x: kvm: topology: interception of PTF instruction


From: Pierre Morel
Subject: Re: [PATCH v3 2/4] s390x: kvm: topology: interception of PTF instruction
Date: Wed, 17 Nov 2021 14:06:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0



On 10/13/21 09:25, Thomas Huth wrote:
On 16/09/2021 15.50, Pierre Morel wrote:
When the host supports the CPU topology facility, the PTF
instruction with function code 2 is interpreted by the SIE,
provided that the userland hypervizor activates the interpretation
by using the KVM_CAP_S390_CPU_TOPOLOGY KVM extension.

The PTF instructions with function code 0 and 1 are intercepted
and must be emulated by the userland hypervizor.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
  hw/s390x/s390-virtio-ccw.c         | 36 ++++++++++++++++++++++++++++++
  include/hw/s390x/s390-virtio-ccw.h |  6 +++++
  target/s390x/kvm/kvm.c             | 15 +++++++++++++
  3 files changed, 57 insertions(+)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 61aeccb163..894f013139 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -404,6 +404,42 @@ static void s390_pv_prepare_reset(S390CcwMachineState *ms)
      s390_pv_prep_reset();
  }

Could you please add a comment in front of this function, with some explanations? If I've got that right, it's currently rather only a "dummy" function, rejecting FC 0 and 1, and FC 2 is always handled by the SIE, right?

I just saw I did not answer this question.

Yes function code 2 is handled by the SIE but it is not really a dummy function as without it PTF 0 or 1 would trigger a program check.

I will add a comment basically:

"We assume horizontal topology, the only one supported currently by Linux consequently we answer to function code 0 requesting horizontal polarization that it is already the current polarization and reject vertical polarization request without further explanation."


regards,
Pierre

--
Pierre Morel
IBM Lab Boeblingen



reply via email to

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