From: Avi Kivity <avi@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
KVM list <kvm@vger.kernel.org>, Alexander Graf <agraf@suse.de>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Carsten Otte <cotte@de.ibm.com>
Subject: Re: [PATCH]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs
Date: Tue, 20 Dec 2011 11:52:16 +0200 [thread overview]
Message-ID: <4EF05AD0.8050808@redhat.com> (raw)
In-Reply-To: <4EF0577D.6010902@de.ibm.com>
On 12/20/2011 11:38 AM, Christian Borntraeger wrote:
> Avi, Marcelo,
>
> let me know if you would prefer to reuse another register load/save ioctls
> that is still unused for s390 (e.g. XCRS).
No, the proposed names are fine.
>
> From: Christian Borntraeger <borntraeger@de.ibm.com>
>
> For guest relocation and virsh dump qemu needs an interface to
> get/set additional registers from kvm. We also need the prefix
> register for all guest memory accesses to the prefix pages.
>
> The prefix register could also be set via the KVM_S390_SIGP_SET_PREFIX
> interrupt ioctl, but I also added the synchronous operation to have
>
> o symmetry: we want to have the same struct for get/set routine
> o the interrupt is only delivered before entering the SIE, we also
> want to cover the sequence set prefix/store status at prefix
>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
> arch/s390/include/asm/kvm.h | 9 +++++++++
> arch/s390/kvm/kvm-s390.c | 24 ++++++++++++++++++++++++
> include/linux/kvm.h | 4 ++++
> 3 files changed, 37 insertions(+)
The lack of documentation is not.
> @@ -673,6 +674,29 @@ long kvm_arch_vcpu_ioctl(struct file *fi
> case KVM_S390_INITIAL_RESET:
> r = kvm_arch_vcpu_ioctl_initial_reset(vcpu);
> break;
> + case KVM_S390_GET_SREGS2: {
> + struct kvm_s390_sregs2 sregs2;
> +
> + sregs2.prefix = vcpu->arch.sie_block->prefix;
> + sregs2.gbea = vcpu->arch.sie_block->gbea;
> + sregs2.cputm = vcpu->arch.sie_block->cputm;
> + sregs2.ckc = vcpu->arch.sie_block->ckc;
> + sregs2.todpr = vcpu->arch.sie_block->todpr;
> + r = copy_to_user(argp, &sregs2, sizeof(sregs2));
Need to return -EFAULT, not the number of remaining bytes to copy.
> + break;
> + }
> + case KVM_S390_SET_SREGS2: {
> + struct kvm_s390_sregs2 sregs2;
> +
> + vcpu->arch.sie_block->prefix = sregs2.prefix;
> + vcpu->arch.sie_block->gbea = sregs2.gbea;
> + vcpu->arch.sie_block->cputm = sregs2.cputm;
> + vcpu->arch.sie_block->ckc = sregs2.ckc;
> + vcpu->arch.sie_block->todpr = sregs2.todpr;
Copying uninitialized data.
> + r = copy_from_user(&sregs2, argp, sizeof(sregs2));
Then initializing it.
> + vcpu->arch.sie_block->ihcpu = 0xffff;
What's this?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-12-20 9:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 9:38 [PATCH]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs Christian Borntraeger
2011-12-20 9:52 ` Avi Kivity [this message]
2011-12-20 9:59 ` Christian Borntraeger
2011-12-20 10:09 ` Avi Kivity
2011-12-20 11:40 ` [PATCH 1/2]: kvm-s390: use guest flush inline function Christian Borntraeger
2011-12-20 11:41 ` [PATCH 2/2]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs Christian Borntraeger
2011-12-20 14:20 ` Alexander Graf
2011-12-20 16:16 ` Christian Borntraeger
2011-12-20 16:28 ` Alexander Graf
2011-12-21 6:52 ` Christian Borntraeger
2011-12-21 7:10 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EF05AD0.8050808@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.