Nakajima, Jun
2005-May-12 05:28 UTC
RE: [Xen-devel] VMX check in /xen/arch/x86/domain.c is invalid onx86-64 (at least AMD)
Jerone Young wrote:> if (!(c->flags & ECF_VMX_GUEST)) > if ( ((c->cpu_ctxt.cs & 3) == 0) || > ((c->cpu_ctxt.ss & 3) == 0) ) > return -EINVAL; > > This check in /xen/arch/x86/domain.c (line 394) is invalid for AMD > x86-64 as this field 1<<1 is a reserved field in the rflags (name for > 64bit eflags) that reads as 1. This can be found in the AMD x86-64 > Programming manual vol 2 on page 65. Below is the code, I''m not sure > how to put an ifdef around since I''m not sure if Intel''s EMT64 with > VMX cpus have the same rflag reserved (which if this check is correct > they do)? This helps break x86-64 building domU domains.This c-flags has nothing to do with the machine architecture, but it''s just a software field for the domain builder to specify the type of the domain (i.e. VMX or not, for example). The rflags is in execution_context_t. Jun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jonathan S. Shapiro
2005-May-12 09:11 UTC
RE: [Xen-devel] VMX check in /xen/arch/x86/domain.c is invalid onx86-64 (at least AMD)
On Wed, 2005-05-11 at 22:28 -0700, Nakajima, Jun wrote:> Jerone Young wrote: > > if (!(c->flags & ECF_VMX_GUEST)) > > if ( ((c->cpu_ctxt.cs & 3) == 0) || > > ((c->cpu_ctxt.ss & 3) == 0) ) > > return -EINVAL; > > > > This check in /xen/arch/x86/domain.c (line 394) is invalid for AMD > > x86-64 as this field 1<<1 is a reserved field in the rflags (name for > > 64bit eflags) that reads as 1. This can be found in the AMD x86-64 > > Programming manual vol 2 on page 65. Below is the code, I''m not sure > > how to put an ifdef around since I''m not sure if Intel''s EMT64 with > > VMX cpus have the same rflag reserved (which if this check is correct > > they do)? This helps break x86-64 building domU domains. > > This c->flags has nothing to do with the machine architecture, but it''s > just a software field for the domain builder to specify the type of the > domain (i.e. VMX or not, for example). The rflags is in > execution_context_t.Then it *definitely* should not be named flags. Perhaps rename to domFlags? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jonathan S. Shapiro
2005-May-12 09:15 UTC
RE: [Xen-devel] VMX check in /xen/arch/x86/domain.c is invalid onx86-64 (at least AMD)
On Thu, 2005-05-12 at 05:11 -0400, Jonathan S. Shapiro wrote:> On Wed, 2005-05-11 at 22:28 -0700, Nakajima, Jun wrote: > > Jerone Young wrote: > > > if (!(c->flags & ECF_VMX_GUEST)) > > > if ( ((c->cpu_ctxt.cs & 3) == 0) || > > > ((c->cpu_ctxt.ss & 3) == 0) ) > > > return -EINVAL; > > > > This c->flags has nothing to do with the machine architecture, but it''s > > just a software field for the domain builder to specify the type of the > > domain (i.e. VMX or not, for example). The rflags is in > > execution_context_t. > > Then it *definitely* should not be named flags. Perhaps rename to > domFlags?Sorry. That was excessively terse. The field should be renamed because the above misread is likely to be a recurring issue for code maintenance. shap _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel