On 10/05/17 11:51, George Dunlap wrote:
> On 10/05/17 11:26, Jan Beulich wrote:
>>>>> On 10.05.17 at 11:43, <igor.druzhi...@citrix.com> wrote:
>>> --- a/xen/arch/x86/mm/p2m-ept.c
>>> +++ b/xen/arch/x86/mm/p2m-ept.c
>>> @@ -681,6 +681,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long 
>>> gfn, mfn_t mfn,
>>>      ept_entry_t *table, *ept_entry = NULL;
>>>      unsigned long gfn_remainder = gfn;
>>>      unsigned int i, target = order / EPT_TABLE_ORDER;
>>> +    unsigned long mfn_mask = mfn_valid(mfn) ? mfn_x(mfn) : 0;
>>
>> Aiui MMIO pages will come here too, so an mfn_valid() check here
>> (and below) is too lax.
> 
> The resulting order will never be higher than the order passed in by the
> caller.  Assuming that the caller is setting an entire 2MiB (or 1GiB)
> region as MMIO, is it not valid to set a 2MiB or 1GiB entry as such?
> The code seems to be written in such a way that such entries are expected.
> 
>  -George
> 

Using mfn_valid() is my mistake here. I initially used mfn_eq(mfn,
INVALID_MFN) but then mixed them up eventually.

Igor


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

Reply via email to