On Mon, 31 Jul 2017 19:32:26 +0200 David Hildenbrand <david@xxxxxxxxxx> wrote: > This one should work for s390x, no caching (or special access patterns > like on x86) needed: > > +++ b/arch/s390/kvm/kvm-s390.c > @@ -2447,6 +2447,11 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) > return kvm_s390_vcpu_has_irq(vcpu, 0); > } > > +bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu) > +{ > + return !(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE); > +} > + > void kvm_s390_vcpu_block(struct kvm_vcpu *vcpu) > { > atomic_or(PROG_BLOCK_SIE, &vcpu->arch.sie_block->prog20); Yes, that should work.