All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Christian Borntraeger <borntraeger@de.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 10:52:35 +0100	[thread overview]
Message-ID: <db6d8d0f-8a5e-8c4a-bfbb-027102a21213@linux.ibm.com> (raw)
In-Reply-To: <5a26e1af-ecdc-b815-248e-ee93a7c51ff5@de.ibm.com>


[-- Attachment #1.1: Type: text/plain, Size: 1294 bytes --]

On 1/27/20 9:05 AM, Christian Borntraeger wrote:
> 
> 
> 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(&regs->gprs, 0, sizeof(regs->gprs));
> 
> 
> 
>> +	/* Will be picked up because of save_fpu_regs() in the initial reset */
>> +	memset(&current->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(&regs->vrs, 0, sizeof(regs->vrs));

Great, thanks!
Meanwhile I had a look at the missing pieces and the guarded storage resets.

> 
> 
>> +	memset(&regs->acrs, 0, sizeof(regs->acrs));
>> +
>> +	regs->etoken = 0;
>> +	regs->etoken_extension = 0;
>> +
>> +	memset(&regs->gscb, 0, sizeof(regs->gscb));
> [....]
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2020-01-27  9:52 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 ` [PATCH v7] KVM: s390: Add new reset vcpu API Christian Borntraeger
2020-01-27  9:52   ` Janosch Frank [this message]

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=db6d8d0f-8a5e-8c4a-bfbb-027102a21213@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.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 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.