From: Fabiano Rosas Date: Tue, 25 Jan 2022 21:56:51 +0000 (-0300) Subject: KVM: PPC: Book3S HV: Stop returning internal values to userspace X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=36d014d37d59065087e51b8381e37993f1ca99bc;p=linux.git KVM: PPC: Book3S HV: Stop returning internal values to userspace Our kvm_arch_vcpu_ioctl_run currently returns the RESUME_HOST values to userspace, against the API of the KVM_RUN ioctl which returns 0 on success. Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220125215655.1026224-2-farosas@linux.ibm.com --- diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 2ad0ccd202d5d..50414fb2a5eaa 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -1841,6 +1841,14 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) #ifdef CONFIG_ALTIVEC out: #endif + + /* + * We're already returning to userspace, don't pass the + * RESUME_HOST flags along. + */ + if (r > 0) + r = 0; + vcpu_put(vcpu); return r; }