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

Re: [Xen-devel] [PATCH 1/3] x86/mmuext: tighten TLB flush address checks



On 20/01/16 14:41, Jan Beulich wrote:
>>>> On 20.01.16 at 15:23, <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 20/01/16 14:05, Jan Beulich wrote:
>>> Addresses passed by PV guests should be subjected to __addr_ok(),
>>> avoiding undue TLB flushes; .
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>>
>>> --- a/xen/arch/x86/mm.c
>>> +++ b/xen/arch/x86/mm.c
>>> @@ -3268,8 +3268,9 @@ long do_mmuext_op(
>>>          case MMUEXT_INVLPG_LOCAL:
>>>              if ( unlikely(d != pg_owner) )
>>>                  rc = -EPERM;
>>> -            else if ( !paging_mode_enabled(d) ||
>>> -                      paging_invlpg(curr, op.arg1.linear_addr) != 0 )
>>> +            else if ( !paging_mode_enabled(d)
>>> +                      ? __addr_ok(op.arg1.linear_addr)
>>> +                      : paging_invlpg(curr, op.arg1.linear_addr) )
>> paging_mode_enabled() changes depending on whether the guest has
>> logdirty currently enabled.
>>
>> As you have also patched paging_invlpg() to DTRT with __addr_ok(), I
>> think this hunk can be dropped.
> How that? Without the change there's no address validation at
> all when !paging_mode_enabled(d).

Oh - there is an inversion in there.

Sorry for the noise.

Entire patch 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®.