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]
Date:	Thu, 28 Feb 2008 23:16:49 +0000
From:	Ian Campbell <ijc@...lion.org.uk>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Alexander van Heukelum <heukelum@...lshack.com>,
	Ingo Molnar <mingo@...e.hu>,
	Alexander van Heukelum <heukelum@...tmail.fm>,
	Andi Kleen <ak@...e.de>, Thomas Gleixner <tglx@...utronix.de>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Mark McLoughlin <markmc@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] use realmode code to reserve end-of-conventional-memory
	to 1MB


On Thu, 2008-02-28 at 13:14 -0800, H. Peter Anvin wrote:
> Ian Campbell wrote:
> > On Thu, 2008-02-28 at 14:28 +0100, Alexander van Heukelum wrote:
> >> Instead of using early reservations inside the kernel code,
> >> we could use the realmode code to modify the e820 memmap.
> >> This patch shows what that would look like. I have not looked
> >> at the case where the BIOS does not provide an e820 memmap
> >> yet. Probably a full solution would need to create a fake
> >> e820 memmap in that case.
> > 
> > An e820 is already faked up in machine_specific_memory_setup() if one
> > doesn't already exist.
> > 
> >> Comments?
> > 
> > This won't work for Xen since the real-mode code never runs there. I
> > think it could be fixed in xen_memory_setup() though if native goes down
> > this route.
> > 
> 
> s/could/should/.
> 
> You need to set up your memory map more sensibly; it's not just the 
> kernel, user space tries to access these areas too.

Agreed, I think it's pure luck that Xen kernels have gotten away with it
in the past.

The patch below seems like the right thing to do. It certainly boots in
a domU without the DMI problem (without any of the other related patches
such as Alexander's).

However ddcprobe hangs when run -- need to investigate some more, vm86
in general works ok (i.e. my vm86 test code passes).

BTW Jeremy, the kernel doesn't use XENMEM_memory_map -- any reason other
than it not being useful at the time? These days the tools can push an
arbitrary e820 down for a guest which might be useful to support,
although nothing interesting is done with it today.

Ian.

x86/xen: Construct e820 map with a hole between 640K-1M.

Signed-off-by: Ian Campbell <ijc@...lion.org.uk>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Jeremy Fitzhardinge <jeremy@...p.org>
---
 arch/x86/xen/setup.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 3bad477..2341492 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -38,7 +38,8 @@ char * __init xen_memory_setup(void)
 	unsigned long max_pfn = xen_start_info->nr_pages;
 
 	e820.nr_map = 0;
-	add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
+	add_memory_region(0, LOWMEMSIZE(), E820_RAM);
+	add_memory_region(HIGH_MEMORY, PFN_PHYS(max_pfn)-HIGH_MEMORY, E820_RAM);
 
 	return "Xen";
 }
-- 
1.5.4.2


-- 
Ian Campbell

His mind is like a steel trap: full of mice.
		-- Foghorn Leghorn

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