mbox series

[RFC,v2,0/2] s390x: Improvements to SIGP handling [KVM]

Message ID 20211102194652.2685098-1-farman@linux.ibm.com (mailing list archive)
Headers show
Series s390x: Improvements to SIGP handling [KVM] | expand

Message

Eric Farman Nov. 2, 2021, 7:46 p.m. UTC
Here is a new variation of the SIGP handling discussed a few
weeks ago [1]. Notable changes:

 - Patches 1 and 6 from v1 were picked for 5.16 (Thank you!) [2]
 - Patches 2 through 5 were removed, and replaced with this
   iteration that relies on a KVM capability and IOCTL

I opted to use David's suggestion [3] for the kernel to
automatically set a vcpu "busy" and userspace to reset it
when complete. I made it dependent on the existing USER_SIGP
stuff, which maybe isn't great for potential non-SIGP scenarios
in the future, but this at least shows how it could work.

According to the Principles of Operation, only a subset of
SIGP orders would generate a "busy" condition, and a different
subset would even notice it. But I did the entirety of the SIGP
orders, even the invalid ones that would otherwise return some
status bits and CC1 instead of the CC2 (BUSY) condition.
Perhaps that's too much, perhaps not.

As I'm writing this, I'm realizing that I probably need to look
at the cpu reset paths clearer, to ensure the "busy" indicator
is actually reset to zero.

Since this is an RFC, I've left the CAP/IOCTL definitions as
a standalone patch, so I see it easier when working with the
QEMU code. Ultimately this would be squashed together, and
might have some refit after the merge window anyway.

I'll send the QEMU series shortly, which takes advantage of this.

Thoughts?

[1] https://lore.kernel.org/r/20211008203112.1979843-1-farman@linux.ibm.com/
[2] https://lore.kernel.org/r/20211031121104.14764-1-borntraeger@de.ibm.com/
[3] https://lore.kernel.org/r/3e3b38d1-b338-0211-04ab-91f913c1f557@redhat.com/

Eric Farman (2):
  Capability/IOCTL/Documentation
  KVM: s390: Extend the USER_SIGP capability

 Documentation/virt/kvm/api.rst   | 27 +++++++++++++++++++++
 arch/s390/include/asm/kvm_host.h |  2 ++
 arch/s390/kvm/kvm-s390.c         | 18 ++++++++++++++
 arch/s390/kvm/kvm-s390.h         | 10 ++++++++
 arch/s390/kvm/sigp.c             | 40 ++++++++++++++++++++++++++++++++
 include/uapi/linux/kvm.h         |  4 ++++
 6 files changed, 101 insertions(+)