On 19/10/18 17:00, Wei Liu wrote:
> On Fri, Oct 19, 2018 at 04:42:24PM +0100, Andrew Cooper wrote:
>> On 19/10/18 15:28, Wei Liu wrote:
>>> The symbol will not be available when PV is disabled.
>>>
>>> Signed-off-by: Wei Liu <wei.l...@citrix.com>
>>> ---
>>> v2: new
>>> ---
>>>  xen/arch/x86/hvm/vmx/vmcs.c | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
>>> index d9747b4..282677a 100644
>>> --- a/xen/arch/x86/hvm/vmx/vmcs.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
>>> @@ -1159,9 +1159,16 @@ static int construct_vmcs(struct vcpu *v)
>>>      __vmwrite(HOST_CS_SELECTOR, __HYPERVISOR_CS);
>>>      __vmwrite(HOST_RIP, (unsigned long)vmx_asm_vmexit_handler);
>>>  
>>> +#ifdef CONFIG_PV
>>>      /* Host SYSENTER CS:RIP. */
>>>      __vmwrite(HOST_SYSENTER_CS, __HYPERVISOR_CS);
>>>      __vmwrite(HOST_SYSENTER_EIP, (unsigned long)sysenter_entry);
>>> +#else
>>> +    /*
>>> +     * Should something be put here for debugging purpose? We never
>>> +     * set it up in the first place.
>> With MSR_SYSENTER_CS set to 0, SYSENTER/SYSEXIT instructions
>> automatically #GP[0].
> OK. So we should initialise MSR_SYSENTER_CS to 0 in a previous patch.

Yes, but not for this reason.  vmexit on Intel systems unilaterally
loads the two HOST SYSENTER MSRs, so will clobber whatever was
previously there.  (There isn't even an option to turn this off to speed
up vmentry/vmexit).

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to