lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1203958478.20033.1239002461@webmail.messagingengine.com>
Date:	Mon, 25 Feb 2008 17:54:38 +0100
From:	"Alexander van Heukelum" <heukelum@...tmail.fm>
To:	"H. Peter Anvin" <hpa@...or.com>, "Andi Kleen" <ak@...e.de>
Cc:	"Ingo Molnar" <mingo@...e.hu>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	"LKML" <linux-kernel@...r.kernel.org>,
	"Alexander van Heukelum" <heukelum@...lshack.com>
Subject: Re: [PATCH] Fix alignment of early reservation for EBDA

On Sun, 24 Feb 2008 18:18:16 -0800, "H. Peter Anvin" <hpa@...or.com>
said:
> Alexander van Heukelum wrote:
> > early res: 3 [9f000-9ffff] EBDA
> > 
> > Is it really necessary to force the allocation to a page boundary?
> 
> It is, but that rounding gets done in reserve_bootmem() anyway, so there 
> is no need for the arch-specific code to do it.
> 
> The 32-bit EBDA code hard-codes a size of 4K, which is probably equally 
> wrong; my gut feel is that the right thing to do is to reserve from the 
> EBDA up to the 640K mark (some BIOSes use an area like that for SMM 
> stuff), possibly with some sanity checking.

Then, how about reserving everything from the end of conventional memory
up to the 1Mb mark? Like this:

/*
 * The BIOS places the EBDA/XBDA at the top of conventional
 * memory, and usually decreases the reported amount of
 * conventional memory (int 0x12) too.
 */
static __init void reserve_ebda(void)
{
        unsigned int lowmem, ebda_addr;

        /* end of low (conventional) memory */
        lowmem = *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES);
        lowmem <<= 10;

        /* start of EBDA area */
        ebda_addr = *(unsigned short *)__va(BIOS_EBDA_SEGMENT);
        ebda_addr <<= 4;

        /* Fixup: bios puts an EBDA in the top 64K segment */
        /* of conventional memory, but does not adjust lowmem. */
        if ((lowmem - ebda_addr) <= 0x10000)
                lowmem = ebda_addr;

        /* Fixup: bios does not report an EBDA at all. */
        /* Some old Dells seem to need 4k anyhow (bugzilla 2990) */
        if ((ebda_addr == 0) && (lowmem >= 0x9f000))
                lowmem = 0x9f000;

        /* Paranoia: should never happen, but... */
        if (lowmem >= 0x100000)
                lowmem = 0xa0000;

        /* reserve all memory between lowmem and the 1MB mark */
        reserve_early(lowmem, 0x100000, "BIOS reserved");
}

Greetings,
    Alexander
-- 
  Alexander van Heukelum
  heukelum@...tmail.fm

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ