Re: [PATCH 3/4] KVM: s390: pv: Fix rc/rrc offset for PVM_DUMP

Claudio Imbrenda <[email protected]>
Newsgroups org.kernel.vger.linux-s390,org.kernel.vger.kvm
Organization IBM
Message-ID <20260812132613.17852142@p-imbrenda>
On Tue, 11 Aug 2026 17:37:37 +0200
Christian Borntraeger <[email protected]> wrote:

> The rc/rrc value is copied to the cmd location of the cmd in the kvm_pv_cmd
> structure. Fix the offset.
> 
> Fixes: 8aba09588d2a ("KVM: s390: Add CPU dump functionality")
> Cc: [email protected]
> Signed-off-by: Christian Borntraeger <[email protected]>

Reviewed-by: Claudio Imbrenda <[email protected]>

the documentation for KVM_S390_PV_CPU_COMMAND looks wrong, we should
fix that at some point.

> ---
>  arch/s390/kvm/kvm-s390.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index ea9bfb32d0f2..f3814dd60184 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -5734,7 +5734,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  		r = kvm_s390_handle_pv_vcpu_dump(vcpu, &cmd);
>  
>  		/* Always copy over UV rc / rrc data */
> -		if (copy_to_user((__u8 __user *)argp, &cmd.rc,
> +		if (copy_to_user(argp + offsetof(struct kvm_pv_cmd, rc), &cmd.rc,
>  				 sizeof(cmd.rc) + sizeof(cmd.rrc)))
>  			r = -EFAULT;
>  		break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.