public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: pbonzini@redhat.com
Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@kernel.org,
	borntraeger@linux.ibm.com, cohuck@redhat.com,
	linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>
Subject: [GIT PULL 06/12] KVM: s390: Add KVM capability for ESA mode guests
Date: Mon, 13 Apr 2026 12:46:34 +0200	[thread overview]
Message-ID: <20260413104721.203024-7-frankja@linux.ibm.com> (raw)
In-Reply-To: <20260413104721.203024-1-frankja@linux.ibm.com>

From: Hendrik Brueckner <brueckner@linux.ibm.com>

Now that all the bits are properly addressed, provide a mechanism
for testing ESA mode guests in nested configurations.

Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
[farman@us.ibm.com: Updated commit message]
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 Documentation/virt/kvm/api.rst | 8 ++++++++
 arch/s390/kvm/kvm-s390.c       | 6 ++++++
 include/uapi/linux/kvm.h       | 1 +
 3 files changed, 15 insertions(+)

diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index 6f85e1b321dd..682ae9278943 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -9428,6 +9428,14 @@ KVM exits with the register state of either the L1 or L2 guest
 depending on which executed at the time of an exit. Userspace must
 take care to differentiate between these cases.
 
+8.47 KVM_CAP_S390_VSIE_ESAMODE
+------------------------------
+
+:Architectures: s390
+
+The presence of this capability indicates that the nested KVM guest can
+start in ESA mode.
+
 9. Known KVM API problems
 =========================
 
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index bc7d6fa66eaf..a583c0a00efd 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -629,6 +629,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_IRQFD_RESAMPLE:
 	case KVM_CAP_S390_USER_OPEREXEC:
 	case KVM_CAP_S390_KEYOP:
+	case KVM_CAP_S390_VSIE_ESAMODE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
@@ -926,6 +927,11 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
 		icpt_operexc_on_all_vcpus(kvm);
 		r = 0;
 		break;
+	case KVM_CAP_S390_VSIE_ESAMODE:
+		VM_EVENT(kvm, 3, "%s", "ENABLE: CAP_S390_VSIE_ESAMODE");
+		kvm->arch.allow_vsie_esamode = 1;
+		r = 0;
+		break;
 	default:
 		r = -EINVAL;
 		break;
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 65500f5db379..e658f89d5d3e 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -985,6 +985,7 @@ struct kvm_enable_cap {
 #define KVM_CAP_ARM_SEA_TO_USER 245
 #define KVM_CAP_S390_USER_OPEREXEC 246
 #define KVM_CAP_S390_KEYOP 247
+#define KVM_CAP_S390_VSIE_ESAMODE 248
 
 struct kvm_irq_routing_irqchip {
 	__u32 irqchip;
-- 
2.53.0


  parent reply	other threads:[~2026-04-13 10:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 10:46 [GIT PULL 00/12] KVM: s390: Changes for 7.1 Janosch Frank
2026-04-13 10:46 ` [GIT PULL 01/12] KVM: s390: only deliver service interrupt with payload Janosch Frank
2026-04-13 10:46 ` [GIT PULL 02/12] KVM: s390: Fix lpsw/e breaking event handling Janosch Frank
2026-04-13 10:46 ` [GIT PULL 03/12] KVM: s390: vsie: Allow non-zarch guests Janosch Frank
2026-04-13 10:46 ` [GIT PULL 04/12] KVM: s390: vsie: Disable some bits when in ESA mode Janosch Frank
2026-04-13 10:46 ` [GIT PULL 05/12] KVM: s390: vsie: Accommodate ESA prefix pages Janosch Frank
2026-04-13 10:46 ` Janosch Frank [this message]
2026-04-13 10:46 ` [GIT PULL 07/12] KVM: s390: Add some useful mask macros Janosch Frank
2026-04-13 10:46 ` [GIT PULL 08/12] KVM: s390: Add alignment checks for hugepages Janosch Frank
2026-04-13 10:46 ` [GIT PULL 09/12] KVM: s390: Allow 4k granularity for memslots Janosch Frank
2026-04-13 10:46 ` [GIT PULL 10/12] KVM: selftests: Remove 1M alignment requirement for s390 Janosch Frank
2026-04-13 10:46 ` [GIT PULL 11/12] KVM: s390: selftests: enable some common memory-related tests Janosch Frank
2026-04-13 10:46 ` [GIT PULL 12/12] KVM: s390: ucontrol: Fix memslot handling Janosch Frank
2026-04-13 11:23 ` [GIT PULL 00/12] KVM: s390: Changes for 7.1 Paolo Bonzini
2026-04-13 12:28   ` Janosch Frank
2026-04-13 12:33     ` Paolo Bonzini

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=20260413104721.203024-7-frankja@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brueckner@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@kernel.org \
    --cc=farman@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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