Subject: APM issue with thinkpad
To: None <thorpej@zembu.com>
From: None <itojun@iijlab.net>
List: port-i386
Date: 06/04/2000 00:39:45
> > > When allocating new PT pages during early bootstrap (i.e. before
> > > pmap_init() has finished), make sure to zero them.
> >
> > it seems to me that some of recent changes around here broke APM on
> > IBM notebook machines. I'm still wondering which is the genuine
> > source. see PR10271. do people with IBM thinkpad doing fine with
> > the above change?
>
>This code path is only used on large memory systems when additional
>page tables are needed.
>
>Your APM problem is somewhere else. Note that I move where the IDT
>is located with my ACPI memory map changes. Try puttint it back at
>then end of RAM like it used to be and see if that fixes your APM
>problem.
your observation is correct. the following quick-and-dirty trick
solved problem for me. not sure what is the right way to address
this in a right way...
itojun
Index: machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.387
diff -u -r1.387 machdep.c
--- machdep.c 2000/06/02 18:33:17 1.387
+++ machdep.c 2000/06/03 15:38:11
@@ -1578,8 +1578,13 @@
* to us by the boot program.
*/
bim = lookup_bootinfo(BTINFO_MEMMAP);
- if (bim != NULL) {
#if 0
+ if (bim != NULL)
+#else
+ if (0)
+#endif
+ {
+#if 0
printf("BIOS MEMORY MAP (%d ENTRIES):\n", bim->num);
#endif
for (x = 0; x < bim->num; x++) {
@@ -1715,11 +1720,19 @@
#endif
mem_clusters[1].start = IOM_END;
mem_clusters[1].size = trunc_page(KBTOB(biosextmem));
+#if 1
+ /* steal a page for IDT */
+ mem_clusters[1].size -= NBPG;
+#endif
+
physmem += atop(mem_clusters[1].size);
mem_cluster_cnt = 2;
- avail_end = IOM_END + trunc_page(KBTOB(biosextmem));
+ avail_end = mem_clusters[1].start + mem_clusters[1].size;
+#if 1
+ idt_paddr = avail_end;
+#endif
}
/*
Index: pmap.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/i386/pmap.c,v
retrieving revision 1.92
diff -u -r1.92 pmap.c
--- pmap.c 2000/06/02 18:33:16 1.92
+++ pmap.c 2000/06/03 15:38:17
@@ -821,8 +821,10 @@
idt_vaddr = virtual_avail; /* don't need pte */
virtual_avail += NBPG; pte++;
+#if 0
idt_paddr = avail_start; /* steal a page */
avail_start += NBPG;
+#endif
#if defined(I586_CPU)
/* pentium f00f bug stuff */