On 31/03/2017 18:24, Radim Krčmář wrote:
>> +    if (is_guest_mode(vcpu)
>> +        && !(exit_qualification & EPT_VIOLATION_GVA_TRANSLATED)) {
>> +            /*
>> +             * Fix up exit_qualification according to whether guest
>> +             * page table accesses are reads or writes.
>> +             */
>> +            u64 eptp = nested_ept_get_cr3(vcpu);
>> +            exit_qualification &= ~EPT_VIOLATION_ACC_WRITE;
>> +            if (eptp & VMX_EPT_AD_ENABLE_BIT)
>> +                    exit_qualification |= EPT_VIOLATION_ACC_WRITE;
> I think this would be better without unconditional clearing
> 
>               if (!(eptp & VMX_EPT_AD_ENABLE_BIT))
>                       exit_qualification &= ~EPT_VIOLATION_ACC_WRITE;

Yeah, this is a remnant of my (failed) attempt at emulating A/D bits
when the processor doesn't support it.  Which worked, only it's not
compliant enough to include it in the final series.

As for the two nits you found, shall I repost or are you okay with
fixing it yourself?

Paolo

Reply via email to