linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kvm list <kvm@vger.kernel.org>,
	Nadav Amit <namit@cs.technion.ac.il>,
	Wanpeng Li <wanpeng.li@linux.intel.com>
Subject: Re: [CFT PATCH 0/2] KVM: support XSAVES usage in the host
Date: Mon, 24 Nov 2014 17:28:41 +0200	[thread overview]
Message-ID: <DAC65E0B-06CC-4B34-85B2-72AD5F86826B@gmail.com> (raw)
In-Reply-To: <547318E5.8070408@redhat.com>


> On Nov 24, 2014, at 13:39, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> 
> 
> On 23/11/2014 09:16, Nadav Amit wrote:
>> I’ll try to check it tomorrow (I don’t have access to the failing machine at the moment).
> 
> Thanks, you'll need to squash this in:
> 
> diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
> index 4c540c4719d8..0de1fae2bdf0 100644
> --- a/arch/x86/kernel/xsave.c
> +++ b/arch/x86/kernel/xsave.c
> @@ -738,3 +738,4 @@ void *get_xsave_addr(struct xsave_struct *xsave, int xstate)
> 
> 	return (void *)xsave + xstate_comp_offsets[feature];
> }
> +EXPORT_SYMBOL_GPL(get_xsave_addr);

I tested the patches but there are still problems.

Since kvm_load_guest_fpu is called before the guest_fpu is ever stored, there are 2 more problems that currently cause #GP:
1. XCOMP_BV[63] = 0
2. XSTATE_BV sets a bit (including bit 63) that is not set in XCOMP_BV (XCOMP_BV is initialised to zero).

[see SDM 13.11 "OPERATION OF XRSTORS”]

Once I initialise XCOMP_BV to (1ull << 63) | XSTATE_BV, the guest runs successfully.
I have not checked any other qemu functionality that might be affected by the patch.

Nadav




  reply	other threads:[~2014-11-24 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 18:31 [CFT PATCH 0/2] KVM: support XSAVES usage in the host Paolo Bonzini
2014-11-21 18:31 ` [CFT PATCH 1/2] kvm: x86: mask out XSAVES Paolo Bonzini
2014-11-21 18:31 ` [CFT PATCH 2/2] KVM: x86: support XSAVES usage in the host Paolo Bonzini
2014-11-21 20:06   ` Andy Lutomirski
2014-11-21 21:58     ` Paolo Bonzini
2014-11-24  2:10   ` Wanpeng Li
2014-11-24 10:07     ` Paolo Bonzini
2014-11-23  8:16 ` [CFT PATCH 0/2] KVM: " Nadav Amit
2014-11-23  8:24   ` Wanpeng Li
2014-11-23  8:31     ` Nadav Amit
2014-11-23  8:34       ` Wanpeng Li
2014-11-24 11:39   ` Paolo Bonzini
2014-11-24 15:28     ` Nadav Amit [this message]
2014-11-24 15:54       ` Paolo Bonzini
2014-11-24 17:53       ` Paolo Bonzini
2014-11-24 18:31         ` Nadav Amit

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=DAC65E0B-06CC-4B34-85B2-72AD5F86826B@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namit@cs.technion.ac.il \
    --cc=pbonzini@redhat.com \
    --cc=wanpeng.li@linux.intel.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).