[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] VMX: fix/adjust trap injection



On 23/11/15 15:24, Jan Beulich wrote:
>>>> On 23.11.15 at 16:01, <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 23/11/15 12:49, Jan Beulich wrote:
>>> @@ -1525,6 +1516,16 @@ static void vmx_inject_trap(struct hvm_t
>>>              __restore_debug_registers(curr);
>>>              write_debugreg(6, read_debugreg(6) | DR_STEP);
>>>          }
>>> +        if ( !nestedhvm_vcpu_in_guestmode(curr) ||
>>> +             !nvmx_intercepts_exception(curr, TRAP_debug, 
>>> _trap.error_code) )
>>> +        {
>>> +            unsigned long val;
>>> +
>>> +            __vmread(GUEST_DR7, &val);
>>> +            __vmwrite(GUEST_DR7, val & ~DR_GENERAL_DETECT);
>>> +            __vmread(GUEST_IA32_DEBUGCTL, &val);
>>> +            __vmwrite(GUEST_IA32_DEBUGCTL, val & ~IA32_DEBUGCTLMSR_LBR);
>> Is it worth eliding the __vmwrite's if possible?  It will be fewer
>> VMexits if this Xen is running nested, and ISTR it will avoid slowing
>> down the vmentry with further consistency checks.
> I've considered this, but then decided #DB shouldn't really be
> raised on any fast paths (or such paths become non-fast anyway
> due to the many exceptions). The code certainly is easier to read
> without further conditionals.

Ok.

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.