kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Janosch Frank <frankja@linux.ibm.com>, kvm@vger.kernel.org
Cc: thuth@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH v9 1/6] KVM: s390: do not clobber registers during guest reset/store status
Date: Thu, 30 Jan 2020 13:39:29 +0100	[thread overview]
Message-ID: <a8d55fbd-402d-6ee5-b0b4-a47b32b8f0cf@redhat.com> (raw)
In-Reply-To: <20200130123434.68129-2-frankja@linux.ibm.com>

On 30.01.20 13:34, Janosch Frank wrote:
> From: Christian Borntraeger <borntraeger@de.ibm.com>
> 
> The initial CPU reset clobbers the userspace fpc and the store status
> ioctl clobbers the guest acrs + fpr.  As these calls are only done via
> ioctl (and not via vcpu_run), no CPU context is loaded, so we can (and
> must) act directly on the sync regs, not on the thread context.
> 
> Cc: stable@kernel.org
> Fixes: e1788bb995be ("KVM: s390: handle floating point registers in the run ioctl not in vcpu_put/load")
> Fixes: 31d8b8d41a7e ("KVM: s390: handle access registers in the run ioctl not in vcpu_put/load")
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  arch/s390/kvm/kvm-s390.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index c059b86aacd4..328dee666b24 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -2824,8 +2824,7 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
>  	vcpu->arch.sie_block->gcr[14] = CR14_UNUSED_32 |
>  					CR14_UNUSED_33 |
>  					CR14_EXTERNAL_DAMAGE_SUBMASK;
> -	/* make sure the new fpc will be lazily loaded */
> -	save_fpu_regs();
> +	vcpu->run->s.regs.fpc = 0;
>  	current->thread.fpu.fpc = 0;
>  	vcpu->arch.sie_block->gbea = 1;
>  	vcpu->arch.sie_block->pp = 0;
> @@ -4343,7 +4342,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  	switch (ioctl) {
>  	case KVM_S390_STORE_STATUS:
>  		idx = srcu_read_lock(&vcpu->kvm->srcu);
> -		r = kvm_s390_vcpu_store_status(vcpu, arg);
> +		r = kvm_s390_store_status_unloaded(vcpu, arg);
>  		srcu_read_unlock(&vcpu->kvm->srcu, idx);
>  		break;
>  	case KVM_S390_SET_INITIAL_PSW: {
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


  reply	other threads:[~2020-01-30 12:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 12:34 [PATCH v9 0/6] KVM: s390: Add new reset vcpu API Janosch Frank
2020-01-30 12:34 ` [PATCH v9 1/6] KVM: s390: do not clobber registers during guest reset/store status Janosch Frank
2020-01-30 12:39   ` David Hildenbrand [this message]
2020-01-30 13:00   ` Cornelia Huck
2020-01-30 13:02   ` Christian Borntraeger
2020-01-30 12:34 ` [PATCH v9 2/6] KVM: s390: Cleanup initial cpu reset Janosch Frank
2020-01-30 13:20   ` Thomas Huth
2020-01-30 12:34 ` [PATCH v9 3/6] KVM: s390: Add new reset vcpu API Janosch Frank
2020-01-30 12:49   ` Janosch Frank
2020-01-30 12:55     ` [PATCH v9] " Janosch Frank
2020-01-30 12:59       ` Christian Borntraeger
2020-01-30 13:02         ` Janosch Frank
2020-01-30 13:01       ` Cornelia Huck
2020-01-30 12:53   ` [PATCH v9 3/6] " Christian Borntraeger
2020-01-30 12:34 ` [PATCH v9 4/6] selftests: KVM: Add fpu and one reg set/get library functions Janosch Frank
2020-01-30 13:03   ` Cornelia Huck
2020-01-30 12:34 ` [PATCH v9 5/6] selftests: KVM: s390x: Add reset tests Janosch Frank
2020-01-30 13:25   ` Thomas Huth
2020-01-30 16:22   ` Cornelia Huck
2020-01-30 12:34 ` [PATCH v9 6/6] selftests: KVM: testing the local IRQs resets Janosch Frank
2020-01-30 16:27   ` Cornelia Huck

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=a8d55fbd-402d-6ee5-b0b4-a47b32b8f0cf@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@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).