[PATCH v6 31/33] KVM: s390: arm64: Implement vCPU IOCTLs

Steffen Eiden seiden at linux.ibm.com
Fri Aug 28 09:14:16 PDT 2026


On Fri, Aug 28, 2026 at 03:34:34PM +0200, Janosch Frank wrote:
> On 8/12/26 5:36 PM, Steffen Eiden wrote:
> > Implement all required vCPU IOCTLs.
> > 
> > Co-developed-by: Andreas Grapentin <gra at linux.ibm.com>
> > Signed-off-by: Andreas Grapentin <gra at linux.ibm.com>
> > Co-developed-by: Nina Schoetterl-Glausch <nsg at linux.ibm.com>
> > Signed-off-by: Nina Schoetterl-Glausch <nsg at linux.ibm.com>
> > Signed-off-by: Steffen Eiden <seiden at linux.ibm.com>
> > ---
> >   arch/s390/kvm/arm64/arm.c         | 392 ++++++++++++++++++++++++++++++
> >   arch/s390/kvm/arm64/guest.c       |  47 +++-
> >   arch/s390/kvm/arm64/handle_exit.c |  31 +++
> >   arch/s390/kvm/arm64/handle_exit.h |   9 +
> >   arch/s390/kvm/arm64/reset.c       |  73 ++++++
> >   arch/s390/kvm/arm64/reset.h       |  11 +
> >   arch/s390/kvm/arm64/trace.h       |   2 +-
> >   7 files changed, 562 insertions(+), 3 deletions(-)
> >   create mode 100644 arch/s390/kvm/arm64/handle_exit.h
> >   create mode 100644 arch/s390/kvm/arm64/reset.c
> >   create mode 100644 arch/s390/kvm/arm64/reset.h
> > 
> 
> [...]
> 
> > +static int kvm_vcpu_initialize(struct kvm_vcpu *vcpu,
> > +			       const struct kvm_vcpu_init *init)
> > +{
> > +	unsigned long features = init->features[0];
> > +	struct kvm *kvm = vcpu->kvm;
> > +
> > +	scoped_guard(mutex, &kvm->arch.config_lock) {
> > +		if (test_bit(KVM_ARCH_FLAG_VCPU_FEATURES_CONFIGURED,
> > +			     &kvm->arch.flags) &&
> 
> 
> In this case I'd rather have a long line than having to look at this mess.
> One of the cases where a normal mutex acquisition would have made the code
> more readable.

Technically, it would not fit into the 80chars even if I use traditional
locks.

Nontheless, I'll use a guard(mutex) and then go 2 chars over the limit
for improved reading.

...

> > +
> > +	ret = 1;
> > +	do {
> > +		if (signal_pending(current)) {
> > +			kvm_run->exit_reason = KVM_EXIT_INTR;
> > +			ret = -EINTR;
> > +			continue;
> 
> Why not break?
> With continue we'll jump to the condition which is immediately false since
> we just set ret to a negative value.
> 

I'll break


	Steffen



More information about the linux-arm-kernel mailing list