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

Re: [Xen-devel] [PATCH v4 3/4] x86/mm: handle foreign mappings in p2m_entry_modify



>>> On 19.02.19 at 07:14, <kevin.tian@xxxxxxxxx> wrote:
>>  From: Roger Pau Monne [mailto:roger.pau@xxxxxxxxxx]
>> Sent: Tuesday, February 19, 2019 1:27 AM
>> 
>> @@ -734,8 +735,15 @@ hap_write_p2m_entry(struct domain *d, unsigned
>> long gfn, l1_pgentry_t *p,
>>              && perms_strictly_increased(old_flags, l1e_get_flags(new)) );
>>      }
>> 
>> -    p2m_entry_modify(p2m_get_hostp2m(d),
>> p2m_flags_to_type(l1e_get_flags(new)),
>> -                     p2m_flags_to_type(old_flags), level);
>> +    rc = p2m_entry_modify(p2m_get_hostp2m(d),
>> +                          p2m_flags_to_type(l1e_get_flags(new)),
>> +                          p2m_flags_to_type(old_flags), l1e_get_mfn(new),
>> +                          l1e_get_mfn(*p), level);
> 
> why not passing old/new pte to reduce #parameters and thus stable
> against future changes?

The PTE layout is different between EPT and shadow/NPT, yet
the function here is generic. It's not impossible to do what you
suggest, but it would require field extraction abstraction
functions, which I don't think is worth it.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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