Re: [PATCH v4 25/27] KVM: s390: arm64: Implement vCPU IOCTLs
From: Steffen Eiden
Date: Fri Jul 10 2026 - 10:08:30 EST
On Wed, Jul 08, 2026 at 11:44:37AM +0100, Marc Zyngier wrote:
> On Mon, 06 Jul 2026 09:52:25 +0100,
> Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:
> >
> > +static void adjust_pc(struct kvm_vcpu *vcpu)
> > +{
> > + if (vcpu_get_flag(vcpu, INCREMENT_PC)) {
> > + kvm_skip_instr(vcpu);
> > + vcpu_clear_flag(vcpu, INCREMENT_PC);
> > + }
> > +}
>
> Can you clarify the semantics of adjust_pc() here? arm64 also deals
> with exceptions in the same code, and I wonder how you deal with this.
>
We will do the same thing as native arm64 does. The KVM in this series
has no clue what an exception is. Thus I skipped the handling here. The
exception stuff is added in the second series anlongside with the sysreg
handling.
...
> > +
> > + kvm_sigset_deactivate(vcpu);
> > +out:
> > + if (unlikely(vcpu_get_flag(vcpu, INCREMENT_PC)))
> > + adjust_pc(vcpu);
>
> arm64 has the following statements:
>
> if (unlikely(vcpu_get_flag(vcpu, PENDING_EXCEPTION) ||
> vcpu_get_flag(vcpu, INCREMENT_PC)))
> kvm_call_hyp(__kvm_adjust_pc, vcpu);
>
> It isn't clear to me why you can afford not to deal with pending
> exceptions when returning to userspace.
>
Same reasoning like above. We'll do the exact same thing as native arm64
with the next series.
Thanks for looking into s390 code :)
Steffen