mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] DMI/APIC updates 1 of 4: boot-time-fixmaps
@ 2002-01-02 19:07 Mikael Pettersson
  0 siblings, 0 replies; only message in thread
From: Mikael Pettersson @ 2002-01-02 19:07 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Linus,

This is part 1 of 4 of a patch set for 2.5.2-pre6 to move the
x86 DMI scan to an earlier point in the boot sequence. This is
motivated by the UP APIC code, which must be disabled on some
machines with broken BIOSen, but there are also other cases that
would benefit from it. Tested. Please apply.

This first patch (patch-boot-time-fixmaps) augments the FIXMAP
mechanism with a set of temporary boot-time maps. These maps are
recycled later, so the address space is not lost permanently.
arch/i386/mm/init.c:set_pte_phys() [used by __set_fixmap()] is
changed to permit reassigning temporary boot-time maps. PAGE_KERNEL
is no longer added automatically, but this is safe since all
callers include it anyway (see <asm-i386/fixmap.h>).

/Mikael

diff -ruN linux-2.5.2-pre6/arch/i386/mm/init.c linux-2.5.2-pre6.boot-time-fixmaps/arch/i386/mm/init.c
--- linux-2.5.2-pre6/arch/i386/mm/init.c	Tue Dec 18 00:40:11 2001
+++ linux-2.5.2-pre6.boot-time-fixmaps/arch/i386/mm/init.c	Wed Jan  2 00:54:04 2002
@@ -128,7 +128,6 @@
 static inline void set_pte_phys (unsigned long vaddr,
 			unsigned long phys, pgprot_t flags)
 {
-	pgprot_t prot;
 	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t *pte;
@@ -144,10 +143,8 @@
 		return;
 	}
 	pte = pte_offset(pmd, vaddr);
-	if (pte_val(*pte))
-		pte_ERROR(*pte);
-	pgprot_val(prot) = pgprot_val(PAGE_KERNEL) | pgprot_val(flags);
-	set_pte(pte, mk_pte_phys(phys, prot));
+	/* <phys,flags> stored as-is, to permit clearing entries */
+	set_pte(pte, mk_pte_phys(phys, flags));
 
 	/*
 	 * It's enough to flush this one mapping.
diff -ruN linux-2.5.2-pre6/include/asm-i386/fixmap.h linux-2.5.2-pre6.boot-time-fixmaps/include/asm-i386/fixmap.h
--- linux-2.5.2-pre6/include/asm-i386/fixmap.h	Thu Nov 22 20:46:19 2001
+++ linux-2.5.2-pre6.boot-time-fixmaps/include/asm-i386/fixmap.h	Wed Jan  2 00:54:04 2002
@@ -65,6 +65,11 @@
 	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */
 	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 #endif
+	__end_of_permanent_fixed_addresses,
+	/* temporary boot-time mappings, used before ioremap() is functional */
+#define NR_FIX_BTMAPS	16
+	FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
+	FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
 	__end_of_fixed_addresses
 };
 
@@ -86,8 +91,8 @@
  * at the top of mem..
  */
 #define FIXADDR_TOP	(0xffffe000UL)
-#define FIXADDR_SIZE	(__end_of_fixed_addresses << PAGE_SHIFT)
-#define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE)
+#define __FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << PAGE_SHIFT)
+#define FIXADDR_START	(FIXADDR_TOP - __FIXADDR_SIZE)
 
 #define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-02 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-02 19:07 [PATCH] DMI/APIC updates 1 of 4: boot-time-fixmaps Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®