On 9/4/24 02:47, Jan Beulich wrote:
On 30.08.2024 23:46, Daniel P. Smith wrote:
To allow a slow conversion of x86 over to struct boot_module, start with
replacing all references to struct mod to the early_mod element of struct
boot_module. These serves twofold, first to allow the incremental transition
from struct mod fields to struct boot_module fields. The second is to allow
the conversion of function definitions from taking struct mod parameters to
accepting struct boot_module as needed when a transitioned field will be
accessed.
Yet earlier it was mentioned that early_mod is a transitory name. Will all of
this then need touching a 2nd time?
Correct, but a lot of these references are parameters to functions who
then call other functions that are passed the reference, turtles all the
way down. To ease from having to wholesale convert every function down
when switching to struct boot_module, a methodical approach was taken.
To ensure there isn't an mix of using both the mods[] array and
bm->early_mod, I did a wholesale switch which allows the immediate drop
of the mods[] array. This way, as the last usage of early_mod is
removed, then it is known that it can be dropped from struct boot_module.
The need for early_mod is that starting with __start_xen(), a commit can
be done for each function with the conversion to accepting struct
boot_module. The function is changed such that any accesses to address
and size at that level to use struct boot_module directly. Any function
calls within the function being converted that take an instance of
module_t, would be handed bm->early_mod. The next commit would then
descend into the next level, doing the same conversion.
The only other approach is to have a commit for the conversion of each
function call in __start_xen() that accepts module_t along with the
entire call chain under that function. That gets ugly very quickly.
v/r,
dps