Re: [PATCH v1 4/6] driver: Google Bootlog

From: Alan Cox
Date: Mon Jan 24 2011 - 19:50:25 EST


> +/*
> + * Search for the BLOG pointer.
> + */
> +static struct bootlog_ptr * __init bootlog_find_pointer(void)
> +{
> + unsigned long address, length, cur;
> + struct bootlog_ptr *bp;
> +
> + /* EBDA pointer contains segment the extended BIOS data area */
> + address = *(uint16_t *)phys_to_virt(BLOG_EBDA_POINTER);
> + address <<= 4; /* convert segment to physical address */
> +
> + /* EBDA length is byte 0 of the EBDA (stored in kB) */
> + length = *(uint8_t *)phys_to_virt(address);
> + length <<= 10; /* convert to bytes */

Ok this is wrong on two counts

1. If the EBDA pointer is zero then no EBDA is present (older
boxes sometimes did this up to about the Athlon era).

2. EBDA isn't an X86 property it's a PC property. asm/bios_ebda
provides one helper and perhaps it all belongs in there (along with 'is
it a PC' sanity check)

3. And its probably a good idea given the standard of BIOS code to
also check the EBDA end if given is actually within the 640K limit ...



Alan
--
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/