Il 28/03/2014 06:47, Zhang, Yang Z ha scritto:
>> + smap = smap && u && !uf &&
>> + !((kvm_x86_ops->get_cpl(vcpu) < 3) &&
>> + ((kvm_x86_ops->get_rflags(vcpu) &
>> + X86_EFLAGS_AC) == 1));
>
> Unfortunately this doesn't work.
>
> The reason is that changing X86_EFLAGS_AC doesn't trigger
> update_permission_bitmask. So the value of CPL < 3 && AC = 1 must not
> be checked in update_permission_bitmask; instead, it must be included
> in the index into the permissions array. You can reuse the
> PFERR_RSVD_MASK bit, like
>
> smapf = pfec & PFERR_RSVD_MASK;
> ...
> smap = smap && smapf u && !uf;
>
> The VCPU can then be passed to permission_fault in order to get the
> value of the CPL and the AC bit.
Is CPL check needed? Shouldn't it already have been covered by U bit?
It is not needed but actually it is covered by !uf, I think.
Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html