From: Xiaoyao Li <xiaoyao.li@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Wanpeng Li <kernellwp@gmail.com>, Tao Xu <tao3.xu@intel.com>
Cc: Radim Krcmar <rkrcmar@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>, kvm <kvm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM: vmx: Fix the broken usage of vmx_xsaves_supported
Date: Thu, 20 Jun 2019 16:55:05 +0800 [thread overview]
Message-ID: <2032f811-b583-eca1-3ece-d1e95738ff64@linux.intel.com> (raw)
In-Reply-To: <b3f76acd-cc7e-9cd7-d7f7-404ba756ab87@redhat.com>
On 6/20/2019 4:17 PM, Paolo Bonzini wrote:
> On 20/06/19 08:46, Xiaoyao Li wrote:
>>>
>>> It depends on whether or not processors support the 1-setting instead
>>> of “enable XSAVES/XRSTORS” is 1 in VM-exection control field. Anyway,
>>
>> Yes, whether this field exist or not depends on whether processors
>> support the 1-setting.
>>
>> But if "enable XSAVES/XRSTORS" is clear to 0, XSS_EXIT_BITMAP doesn't
>> work. I think in this case, there is no need to set this vmcs field?
>
> vmx->secondary_exec_control can change; you are making the code more
> complex by relying on the value of the field at the point of vmx_vcpu_setup.
>
At this point. Agreed. It's harmless to set a default value.
> I do _think_ your version is incorrect, because at this point CPUID has
> not been initialized yet and therefore
> vmx_compute_secondary_exec_control has not set SECONDARY_EXEC_XSAVES.
SECONDARY_EXEC_XSAVES is in the opt when setup_vmcs_config, and
vmx_compute_secondary_exec_control() is to clear SECONDARY_EXEC_XSAVES
based on guest cpuid.
> However I may be wrong because I didn't review the code very closely:
> the old code is obvious and so there is no point in changing it.
you mean this part about XSS_EXIT_BITMAP? how about the other part in
vmx_set/get_msr() in this patch?
> Paolo
>
next prev parent reply other threads:[~2019-06-20 8:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 5:03 [PATCH] KVM: vmx: Fix the broken usage of vmx_xsaves_supported Tao Xu
2019-06-20 6:40 ` Wanpeng Li
2019-06-20 6:46 ` Xiaoyao Li
2019-06-20 8:17 ` Paolo Bonzini
2019-06-20 8:27 ` Wanpeng Li
2019-06-20 8:36 ` Paolo Bonzini
2019-06-20 8:55 ` Xiaoyao Li [this message]
2019-06-20 8:59 ` Paolo Bonzini
2019-06-20 9:02 ` Wanpeng Li
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=2032f811-b583-eca1-3ece-d1e95738ff64@linux.intel.com \
--to=xiaoyao.li@linux.intel.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tao3.xu@intel.com \
--cc=tglx@linutronix.de \
/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.