On 29/10/2024 10:29 am, Frediano Ziglio wrote: > Right now, the two functions which were really too complicated to write > in asm are compiled as 32bit PIC, linked to a blob and included > directly, using global asm() to arrange for them to have function semantics. > > This is limiting and fragile; the use of data relocations will compile > fine but malfunction when used, creating hard-to-debug bugs. > > Furthermore, we would like to increase the amount of C, to > deduplicate/unify Xen's boot logic, as well as making it easier to > follow. Therefore, rework how the 32bit objects are included. > > Link all 32bit objects together first. This allows for sharing of logic > between translation units. Use differential linking and explicit > imports/exports to confirm that we only have the expected relocations, > and write the object back out as an assembly file so it can be linked > again as if it were 64bit, to integrate with the rest of Xen. > > This allows for the use of external references (e.g. access to global > variables) with reasonable assurance of doing so safely. > > No functional change. > > Signed-off-by: Frediano Ziglio <[email protected]> > Reviewed-by: Anthony PERARD <[email protected]>
Acked-by: Andrew Cooper <[email protected]>
