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

Re: [Xen-devel] [PATCH 6/9] x86: move memory_type_changed to mm.c



>>> On 07.08.18 at 18:19, <wei.liu2@xxxxxxxxxx> wrote:
> On Tue, Aug 07, 2018 at 05:33:35AM -0600, Jan Beulich wrote:
>> >>> On 07.08.18 at 12:00, <wei.liu2@xxxxxxxxxx> wrote:
>> > This function is common to both PV and HVM. Move it to x86 common
>> > code.
>> 
>> I'm afraid that's the wrong way round: p2m_memory_type_changed()
>> is HVM (in fact EPT) specific. The only uses of the function that aren't
>> already HVM-specific are from domctl.c and from iommu_construct(),
>> yet I doubt the flush_all(FLUSH_CACHE) has any relevance there in
>> the PV case.
> 
> Yeah, I got the impression that flushing is relevant to PV from reading
> existing code.

Well, I would have thought so as well, but the few places where the
function is possibly used on a PV domain all don't look as if the cache
flush could matter there (quite possibly it could even be avoided in
those specific cases for HVM, at the very least in iommu_construct()).

> If it is HVM only I suggest we add hvm prefix to it and only call it
> when the domain in question is hvm. This follows what we already do in
> other places.
> 
>    if ( is_hvm_domain(d) )
>        hvm_memory_type_change(...)

Yeah, that would probably be fine if we indeed settle on the function
being meaningless for PV.

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