From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Yang Zhang <yang.z.zhang@intel.com>
Cc: xen-devel@lists.xensource.com, eddie.dong@intel.com,
JBeulich@suse.com, jun.nakajima@intel.com
Subject: Re: [PATCH 1/3] Nested VMX: Check VMX capability before read VMX related MSRs.
Date: Thu, 5 Sep 2013 10:49:08 +0100 [thread overview]
Message-ID: <52285394.7020201@citrix.com> (raw)
In-Reply-To: <1378349840-20186-2-git-send-email-yang.z.zhang@intel.com>
On 05/09/13 03:57, Yang Zhang wrote:
> From: Yang Zhang <yang.z.zhang@Intel.com>
>
> VMX MSRs only available when the CPU support the VMX feature. In addition,
> VMX_TRUE* MSRs only available when bitt 55 of VMX_BASIC MSR is set.
As you already have to respin the patch, "bit" rather than "bitt"
~Andrew
>
> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
> ---
> xen/arch/x86/hvm/vmx/vvmx.c | 18 ++++++++++++++++++
> 1 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
> index cecc72f..2e0b7f7 100644
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -1820,6 +1820,24 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
> if ( !nestedhvm_enabled(v->domain) )
> return 0;
>
> + /*
> + * VMX capablitys MSRs available only when guest
> + * support VMX.
> + */
> + hvm_cpuid(0x1, &eax, &ebx, &ecx, &edx);
> + if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
> + return 0;
> +
> + /*
> + * Those MSRs available only when bit 55 of
> + * MSR_IA32_VMX_BASIC is set.
> + */
> + rdmsrl(MSR_IA32_VMX_BASIC, data);
> + if ( msr >= MSR_IA32_VMX_TRUE_PINBASED_CTLS &&
> + msr <= MSR_IA32_VMX_TRUE_ENTRY_CTLS &&
> + !(data & VMX_BASIC_DEFAULT1_ZERO) )
> + return 0;
> +
> rdmsrl(msr, host_data);
>
> /*
next prev parent reply other threads:[~2013-09-05 9:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 2:57 [PATCH 0/3] Nested VMX: fix bugs during reading VMX MSRs Yang Zhang
2013-09-05 2:57 ` [PATCH 1/3] Nested VMX: Check VMX capability before read VMX related MSRs Yang Zhang
2013-09-05 8:35 ` Jan Beulich
2013-09-05 9:49 ` Andrew Cooper [this message]
2013-09-05 2:57 ` [PATCH 2/3] Nested VMX: Clear bit 31 of IA32_VMX_BASIC MSR Yang Zhang
2013-09-05 10:12 ` Andrew Cooper
2013-09-05 10:16 ` Zhang, Yang Z
2013-09-05 2:57 ` [PATCH 3/3] Nested VMX: Fix IA32_VMX_CR4_FIXED1 msr emulation Yang Zhang
2013-09-05 8:46 ` Jan Beulich
2013-09-05 9:05 ` Zhang, Yang Z
2013-09-05 9:36 ` Jan Beulich
2013-09-05 10:28 ` Zhang, Yang Z
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=52285394.7020201@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=eddie.dong@intel.com \
--cc=jun.nakajima@intel.com \
--cc=xen-devel@lists.xensource.com \
--cc=yang.z.zhang@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 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.