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

Re: [PATCH 1/3] xen/arm: Add memory overlap check for bootinfo.reserved_mem



Hi Stefano,

On 12/12/2022 21:29, Stefano Stabellini wrote:
Personally, I think trying to share the code between the two types is a bit
odd. The logic is the same today, but I envision to merge reserved_mem,
mem
and acpi in a single array (it would look like the E820) as this would make
easier to find the caching attributes per regions when mapping the RAM. So
sharing the code would not be possible.

That said, if you really want to share the code between the two types. Then
I
would prefer one of the following option:
    1) Provide a callback that is used to fetch the information from the array
    2) Provide a common structure that could be used by the function.

This would match other generic function like sort & co.

I think option 2) would be the best but I couldn't think of a simple way
to do it (without using a union and I thought a union would not make
things nicer in this case).

Rather than option 1), I think I would rather have 2 different functions
to check struct bootmodules and struct meminfo, or the macro.

I personally don't have specific taste here. I think the option
is good one as long as we can (1) share most part of the code (2) make the
code easy to extend in the future. So as long as you two reach
a consensus here I will change to the agreed method in v2.

I think Julien and I already agree on having 2 separate functions to
check for struct bootmodules and struct meminfo. Julien, I take you
prefer the two separate functions to a MACRO, right?

In this case, yes because the macro would IMHO a bit too large.

Cheers,

--
Julien Grall



 


Rackspace

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