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

Re: [Xen-devel] [PATCH] x86/mm: subsume set_gpfn_from_mfn() into guest_physmap_add_entry()



>>> On 08.05.19 at 16:59, <george.dunlap@xxxxxxxxxx> wrote:
> On 5/8/19 2:57 PM, Jan Beulich wrote:
>>>>> On 07.05.19 at 18:15, <george.dunlap@xxxxxxxxxx> wrote:
>>> On 5/2/19 7:58 AM, Jan Beulich wrote:
>>>> This is what both callers of guest_physmap_add_page() in memory.c want
>>>> (for the !paging_mode_translate() case), and it is also what both
>>>> callers in gnttab_transfer() need (but have been lacking). The other
>>>> (x86-specific) callers are all HVM-only, and hence unaffected by this
>>>> change.
>>>
>>> Sorry, what's going on here?
>> 
>> I guess that's a Jan-wrote-an-unparsable-description-once-again
>> question?
> 
> Sort of, yes. :-)  It's not unparsable; it's just missing some information.
> 
>> 1) The two callers in common/memory.c currently call set_gpfn_from_mfn()
>> themselves, so moving the call into guest_physmap_add_page() helps
>> tidy their code.
>> 
>> 2) The two callers in common/grant_table.c fail to make that call alongside
>> the one to guest_physmap_add_page(), so will actually get fixed by the
>> change.
>> 
>> 3) Other callers are HVM only and are hence unaffected by a change to
>> the function's !paging_mode_translate() part.
> 
> Right.  I think I would have written something like this:

Well, I can certainly use your suggested text, but for now I
was meaning to perhaps use the text from my earlier reply as
replacement, if that's deemed better than the original. Just
let me know.

Jan

> 8<---
> 
> When giving ownership of a page to a PV guest, a number of things need
> to be done, including adding the page into the IOMMU if appropriate, and
> updating the m2p.  At the moment this is done by calling
> guest_physmap_add_entry() and set_gpfn_from_mfn() separately.
> 
> Unfortunately, this duplication leads to mistakes: gnttab_transfer()
> calls guest_physmap_add_entry() but fails to call set_gpfn_from_mfn().
> 
> Since guest_physmap_add_entry() is already special-casing PV guests,
> move set_gpfn_from_mfn() into that function.
> 
> --->8
> 
> I have a technical question about the patch; I'll reply inline to the
> patch itself.
> 
>  -George





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