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

Re: [PATCH] xen/arm: Remove most of the *_VIRT_END defines



Hi Wei,

On 24/05/2022 09:16, Wei Chen wrote:
It seems you prefer to point _end to the address after the end. Even
though we got rid of the macro definition of _END. But we didn't agree
on how to use it. For me, when I first saw
"end = start + LIVEPATCH_VMAP_SIZE" I subconsciously think the -1 is
missing here. I even added a comment, but removed it when I reached
to this line : )
May be it's better to place some code guide for END in code comment
in the SIZE definition, otherwise, we may have different point addresses
of _end functions.

I think it is quite common to have size being the actual size and not size
-1.
END is clearly the last address of the area but SIZE should be the number
of bytes in the area so I think Julien here is right.


Maybe I didn't describe it clearly : )
I agree with the SIZE that Julien has done. My concern is that, should we
need a guide line for how to use the SIZE to calculate END

It is not possible to have a guideline at the moment because we are not consistent how "END" is defined in Xen.

This is also why I want to get rid of "END" completely. It is more difficult (to not say impossible) to interpret (start, size) differently.

As I wrote in the commit message, I haven't yet addressed the common part (there work is a lot more consequent). But I wanted at least to start to get rid of some and push the use of "end" as far as possible.

For example, in this patch, Julien is using END=START+SIZE, then END is
pointing to the address after the end. But for me, I intend to use
END=START+SIZE-1, because I want the END point to the last address.

Same here.


Over time, when there are a lot of get_xxx_end functions in the code,
their actual meanings will be different, just as confusing as the previous
macro definitions

My plan is to get rid of get_XXX_end completely and instead return start, size.

This is only the first part of the work. I need this one start reshuffling the memory layout because I want to be able to use (start, size) consistently in the layout.

Cheers,

--
Julien Grall



 


Rackspace

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