Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Eric Farman <farman@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v2 1/3] KVM: s390: Toggle operation exception for userspace
Date: Fri, 8 May 2026 11:54:22 +0200	[thread overview]
Message-ID: <a8a40679-8949-46f3-a268-3952ee409a64@linux.ibm.com> (raw)
In-Reply-To: <20260507200836.3500368-2-farman@linux.ibm.com>



Am 07.05.26 um 22:08 schrieb Eric Farman:
> The KVM_CAP_S390_USER_OPEREXEC capability allows operation exceptions
> to be forwarded to userspace. But the actual enablement at the hardware
> level occurs in kvm_arch_vcpu_postcreate(), and only if STFLE.74 or
> user_instr0 are enabled. The latter is associated with a separate
> capability (KVM_CAP_S390_USER_INSTR0), so the only way this happens
> for the USER_OPEREXEC capability is if STFLE.74 is enabled. KVM
> unconditionally enables this bit in kvm_arch_init_vm(), but the guest
> could disable it from the CPU model and thus ignore this capability.
> 
> Add USER_OPEREXEC to the check in kvm_arch_vcpu_postcreate(), such that
> either capability would enable this type of exception.
> 
> Fixes: 8e8678e740ec ("KVM: s390: Add capability that forwards operation exceptions")
> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Signed-off-by: Eric Farman <farman@linux.ibm.com>

Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>


> ---
>   arch/s390/kvm/kvm-s390.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index e09960c2e6ed..a91a42174302 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -3521,7 +3521,8 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
>   		vcpu->arch.gmap = vcpu->kvm->arch.gmap;
>   		sca_add_vcpu(vcpu);
>   	}
> -	if (test_kvm_facility(vcpu->kvm, 74) || vcpu->kvm->arch.user_instr0)
> +	if (test_kvm_facility(vcpu->kvm, 74) || vcpu->kvm->arch.user_instr0 ||
> +	    vcpu->kvm->arch.user_operexec)
>   		vcpu->arch.sie_block->ictl |= ICTL_OPEREXC;
>   }
>   


  reply	other threads:[~2026-05-08  9:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 20:08 [PATCH v2 0/3] KVM: s390: Toggle operation exception for userspace Eric Farman
2026-05-07 20:08 ` [PATCH v2 1/3] " Eric Farman
2026-05-08  9:54   ` Christian Borntraeger [this message]
2026-05-11  8:01   ` Janosch Frank
2026-05-11  8:08   ` Janosch Frank
2026-05-11 12:56     ` Eric Farman
2026-05-07 20:08 ` [PATCH v2 2/3] KVM: s390: selftests: Extended user_operexec tests Eric Farman
2026-05-08 10:05   ` Christian Borntraeger
2026-05-08 10:30   ` Claudio Imbrenda
2026-05-11  8:04   ` Janosch Frank
2026-05-07 20:08 ` [PATCH v2 3/3] KVM: s390: Fix typo in UCONTROL documentation Eric Farman
2026-05-08 10:29   ` Claudio Imbrenda
2026-05-11 10:59   ` Hendrik Brueckner
2026-05-08 10:07 ` [PATCH v2 0/3] KVM: s390: Toggle operation exception for userspace Christian Borntraeger
2026-05-08 13:08   ` Eric Farman
2026-05-08 14:50 ` Christian Borntraeger

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=a8a40679-8949-46f3-a268-3952ee409a64@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=farman@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /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