Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2005 10:18:23 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-acpi@freebsd.org
Cc:        David Kelly <dkelly@hiwaay.net>
Subject:   Re: Worked in RELENG_5, fails in RELENG_6
Message-ID:  <200511301018.24822.jhb@freebsd.org>
In-Reply-To: <438D6CE4.8010907@root.org>
References:  <20051127010724.GA1161@Grumpy.DynDNS.org> <7689ADE7-14BF-42C8-A3BD-B10E514799B3@FreeBSD.org> <438D6CE4.8010907@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 30 November 2005 04:12 am, Nate Lawson wrote:
> John Baldwin wrote:
> > On Nov 29, 2005, at 10:50 PM, David Kelly wrote:
> >> On Nov 29, 2005, at 5:10 PM, Alex Zbyslaw wrote:
> >>> David Kelly wrote:
> >>>> Could I
> >>>> boot a 5.4 CDROM to test ACPI?
> >>>
> >>> Yes you could.  I did this the other day on a machine that doesn't
> >>> even have a disk yet ;-)  acpidump is there.  Select fixit then  live
> >>> file system (if memory serves) but you probably knew that !
> >>
> >> Problem solved, but I've been working on it too hard not to share  the
> >> story which might be useful:
> >>
> >> Without hw.physmem="2G" its now finding the full memory load so I
> >> don't know what was happening previously.
> >
> > Actually, this is the second report I've had that setting hw.physmem
> > interacts badly with ACPI.  The other report I had resulted in a  kernel
> > panic if it was set to 3G.
>
> I suspect mapping the memory to read the FACS is failing for the
> hw.physmem case.  His machine probably has tables at 2G (highmem). A
> common location (other than < 1MB) is top of memory minus 16 MB.  I
> don't know what setting hw.physmem actually does -- does it change how
> we can map high memory?

Well, it can override what the SMAP tells us such that we can extend the last 
SMAP entry:

	/*
	 * Maxmem isn't the "maximum memory", it's one larger than the
	 * highest page of the physical address space.  It should be
	 * called something like "Maxphyspage".  We may adjust this 
	 * based on ``hw.physmem'' and the results of the memory test.
	 */
	Maxmem = atop(physmap[physmap_idx + 1]);

#ifdef MAXMEM
	Maxmem = MAXMEM / 4;
#endif

	if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable))
		Maxmem = atop(physmem_tunable);

	if (atop(physmap[physmap_idx + 1]) != Maxmem &&
	    (boothowto & RB_VERBOSE))
		printf("Physical memory use set to %ldK\n", Maxmem * 4);

	/*
	 * If Maxmem has been increased beyond what the system has detected,
	 * extend the last memory segment to the new limit.
	 */ 
	if (atop(physmap[physmap_idx + 1]) < Maxmem)
		physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem);

This would force the memory up to 2g to be included as pages and I think we 
zero out pages to test them before adding them to the VM.  Extending Maxmem 
might have forced the pages holding his ACPI tables to be added to the valid 
pages resulting in those pages being overwritten.  David, can you use a 
serial console to grab a boot -v output that includes the SMAP output?  Also, 
the boot -v output might also provide the PA of FACS (or maybe acpidump -t 
would have that?) which would also be useful.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511301018.24822.jhb>