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

Re: [Xen-devel] [PATCH 09/14] xen: Introduce HAS_M2P config and use to protect mfn_to_gmfn call



Hi,

Answering to myself.

On 10/05/2019 15:34, Julien Grall wrote:
On 10/05/2019 15:19, Jan Beulich wrote:
On 10.05.19 at 16:04, <julien.grall@xxxxxxx> wrote:
On 10/05/2019 14:45, Jan Beulich wrote:
On 10.05.19 at 15:41, <julien.grall@xxxxxxx> wrote:
The point here, we keep within the hypervisor the idea of what's valid or
invalid. This allows us more flexibility on the value here (imagine we decide to
change the value of GFN_INVALID in the future...).

Exactly, and hence INVALID_GFN should not become visible to the
outside. Hence my request to use an all-ones value here.
It is only visible if you put an exact value in the documentation. Your
suggestion is to put a exactly value and I would rather not see that.

I did specifically suggest to _not_ store INVALID_GFN here, but to
store 64-bit bits of ones. Note the difference between the two on
32-bit Arm.
Your point of having an exact value is only useful if you want to toolstack to silently ignore the missing frame and avoid a call.

The former is pretty much wrong as if you were trying to read the frame then most likely you wanted to access it. So a message makes sense here.

For the latter, avoiding the call is only going to save you a couple of cycles in a likely cold path.

You really don't need to give an exact (including say all ones). You only need to say that the address return may not be mappable. The toolstack will try to map it and fail. That's not a big deal.

Anyway, I will wait and see what's the view from the tools maintainer.

I had a discussion with Ian on IRC regarding the value here. After some debate we agreed that specifying a single value would be best.

At the moment, Xen only supports 48-bits address that could be covered by 36-bit MFN. Newer Arm revision supports up to 52-bit address, but that's only with 64KB page granularity. Even if we were supporting 64-bit address, it would only cover 48-bit, so all ones should still be invalid. So I am happy with the all ones version.

I will introduce a define so the tools can use it rather than an hardcoded 
value.

Cheers,

--
Julien Grall

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