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:	Tue, 14 Apr 2009 10:51:39 -0500
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Ingo Molnar <mingo@...e.hu>,
	James Bottomley <James.Bottomley@...senPartnership.com>
Subject: [PATCH 13/14] [VOYAGER] x86/voyager: remove direct use of pg0 in favour of early_ioremap()

This was a hold over from the days when we didn't actually have an
early_ioremap() and we had to fiddle with the kernel page table
directly to read voyager cmos clickmap entries.

Signed-off-by: James Bottomley <James.Bottomley@...senPartnership.com>
---
 arch/x86/mach-voyager/voyager_basic.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/x86/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c
index 7c97c9a..5d37967 100644
--- a/arch/x86/mach-voyager/voyager_basic.c
+++ b/arch/x86/mach-voyager/voyager_basic.c
@@ -123,7 +123,6 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
 	__u8 cmos[4];
 	ClickMap_t *map;
 	unsigned long map_addr;
-	unsigned long old;
 
 	if (region >= CLICK_ENTRIES) {
 		printk("Voyager: Illegal ClickMap region %d\n", region);
@@ -135,13 +134,7 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
 		    voyager_extended_cmos_read(VOYAGER_MEMORY_CLICKMAP + i);
 
 	map_addr = *(unsigned long *)cmos;
-
-	/* steal page 0 for this */
-	old = pg0[0];
-	pg0[0] = ((map_addr & PAGE_MASK) | _PAGE_RW | _PAGE_PRESENT);
-	local_flush_tlb();
-	/* now clear everything out but page 0 */
-	map = (ClickMap_t *) (map_addr & (~PAGE_MASK));
+	map = (ClickMap_t *)early_ioremap(map_addr, sizeof(*map));
 
 	/* zero length is the end of the clickmap */
 	if (map->Entry[region].Length != 0) {
@@ -149,10 +142,8 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
 		*start = map->Entry[region].Address;
 		retval = 1;
 	}
+	early_iounmap(map, sizeof(*map));
 
-	/* replace the mapping */
-	pg0[0] = old;
-	local_flush_tlb();
 	return retval;
 }
 
-- 
1.6.2.1

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