Re: [RFC v1 4/8] x86/init: add linker table support
From: H. Peter Anvin
Date: Thu Jan 21 2016 - 14:51:09 EST
On 01/21/16 11:46, Luis R. Rodriguez wrote:
> On Thu, Jan 21, 2016 at 11:25 AM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>>> And that's exactly what HVMlite does. Most of this shim layer is setting
>>> up boot_params, after which we jump to standard x86 boot path (i.e.
>>> startup_{32|64}). With hardware_subarch set to zero.
>>
>> Which is the way to do it as long as the early code can be the same.
>
> To be clear, with the subarchand linker table suggested in my patch
> series, it should be possible to have the same exact entry point, the
> Xen PV setup code could run early in the order. For instance in the
> linker table we could use the reserved order levels 01-09 for PV
> hypervisor code:
>
> +/* Init order levels, we can start at 01 but reserve 01-09 for now */
> +#define X86_INIT_ORDER_EARLY 10
> +#define X86_INIT_ORDER_NORMAL 30
> +#define X86_INIT_ORDER_LATE 50
>
> So perhaps X86_INIT_ORDER_PV as 05 later.
>
> The standard x86 init would just then be:
>
> asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
> {
> x86_init_fn_init_tables();
> x86_init_fn_early_init();
> }
>
> The PV init code would kick in early and could parse the
> boot_params.hdr.hardware_subarch_data pointer as it sees fit.
>
Right... we already do that.
I don't even think you need to initialize any tables. At least on i386,
we have to do this in assembly code. However, it is just a simple table
walk. :)
-hpa