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

Re: [Xen-devel] [PATCH] x86: correct assertion in destroy_perdomain_mapping()

>>> On 20.04.18 at 17:42, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 20/04/18 16:27, Jan Beulich wrote:
>>>>> On 20.04.18 at 17:21, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> On 20/04/18 16:03, Jan Beulich wrote:
>>>> hvm_domain_initialise() may call this with nr being zero, which triggers
>>>> the "does not cross L3 boundary" check.
>>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> Is this the correct fix?
>>> Its unclear what the call to create_perdomain_mapping() is doing, but it
>>> is the sole caller which passes 0.
>>> I presume it is to allocate d->arch.perdomain_l3_pg but
>>> destroy_perdomain_mapping() doesn't free this page, so I've got no idea
>>> what the destroy call is trying to achieve.
>> Callers of this pair of functions should not be concerned about their
>> inner workings: If the create call succeeded, the destroy function should
>> be called for cleanup, even if that's _currently_ a no-op.
> Right, but its still not clear that passing 0 (even to create) is a
> legitimate thing to do.

Well, the create function specifically handles the nr == 0 case, so it's
intended to be called that way (and, as you've said, exclusively for
setting up d->arch.perdomain_l3_pg).


Xen-devel mailing list



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