Re: [PATCH 2/4] x86_64 boot -v2: Add linked list of struct setup_data

From: Yinghai Lu
Date: Sun Mar 30 2008 - 04:15:55 EST


On Thu, Mar 27, 2008 at 7:49 PM, Huang, Ying <ying.huang@xxxxxxxxx> wrote:
> This patch add a field of 64-bit physical pointer to NULL terminated
> single linked list of struct setup_data to real-mode kernel
> header. This is used as a more extensible boot parameters passing
> mechanism.
>
> Signed-off-by: Huang Ying <ying.huang@xxxxxxxxx>
>
> ---
> arch/x86/boot/header.S | 6 +++++-
> arch/x86/kernel/head64.c | 20 ++++++++++++++++++++
> arch/x86/kernel/setup_64.c | 22 ++++++++++++++++++++++
> include/asm-x86/bootparam.h | 14 ++++++++++++++
> 4 files changed, 61 insertions(+), 1 deletion(-)
>
...
> +static void __init reserve_setup_data(void)
> +{
> + struct setup_data *data;
> + unsigned long pa_data;
> + char buf[32];
> +
> + if (boot_params.hdr.version < 0x0209)
> + return;
> + pa_data = boot_params.hdr.setup_data;
> + while (pa_data) {
> + data = early_ioremap(pa_data, sizeof(*data));
> + sprintf(buf, "setup data %x", data->type);
> + reserve_early(pa_data, pa_data+sizeof(*data)+data->len, buf);
> + pa_data = data->next;
> + early_iounmap(data, sizeof(*data));
> + }

current reserve_early will have limitation with 20 entries.

/*
* Early reserved memory areas.
*/

#define MAX_EARLY_RES 20

or we need to make reserve_early a little bit smart, so it could merge
continuous region...
and then your free_early need to be updated too.

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/