From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>, kvm@vger.kernel.org
Cc: thuth@redhat.com, linux-s390@vger.kernel.org, david@redhat.com,
cohuck@redhat.com
Subject: Re: [PATCH v7] KVM: s390: Add new reset vcpu API
Date: Mon, 27 Jan 2020 09:05:01 +0100 [thread overview]
Message-ID: <5a26e1af-ecdc-b815-248e-ee93a7c51ff5@de.ibm.com> (raw)
In-Reply-To: <20200110114540.90713-1-frankja@linux.ibm.com>
On 10.01.20 12:45, Janosch Frank wrote:
[...]
> +static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu)
> +{
> + struct kvm_sync_regs *regs = &vcpu->run->s.regs;
> +
> + /* Clear reset is a superset of the initial reset */
> + kvm_arch_vcpu_ioctl_normal_reset(vcpu);
> +
> + memset(®s->gprs, 0, sizeof(regs->gprs));
> + /* Will be picked up because of save_fpu_regs() in the initial reset */
> + memset(¤t->thread.fpu.vxrs, 0, sizeof(current->thread.fpu.vxrs));
So I checked with a userspace that sets f8(call-saved) to 0x123 during this ioctl.
f8 is 0 afterwards. The guest f8 is also correct, just because QEMU does clear out
its copy of the fprs and syncs that back via synv regs.
So this must be
/* we have not synced the registers from kvm_run to the thread
structure. We must clear out kvm_run*/
memset(®s->vrs, 0, sizeof(regs->vrs));
> + memset(®s->acrs, 0, sizeof(regs->acrs));
> +
> + regs->etoken = 0;
> + regs->etoken_extension = 0;
> +
> + memset(®s->gscb, 0, sizeof(regs->gscb));
[....]
next prev parent reply other threads:[~2020-01-27 8:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 11:45 [PATCH v7] KVM: s390: Add new reset vcpu API Janosch Frank
2020-01-10 12:11 ` Thomas Huth
2020-01-10 12:24 ` Janosch Frank
2020-01-10 13:47 ` Christian Borntraeger
2020-01-10 12:50 ` David Hildenbrand
2020-01-10 13:48 ` [PATCH] KVM: s390: Cleanup initial cpu reset Janosch Frank
2020-01-10 14:01 ` Cornelia Huck
2020-01-10 14:37 ` David Hildenbrand
2020-01-27 8:05 ` Christian Borntraeger [this message]
2020-01-27 9:52 ` [PATCH v7] KVM: s390: Add new reset vcpu API Janosch Frank
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=5a26e1af-ecdc-b815-248e-ee93a7c51ff5@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).