8.0-RC1 panic attaching ppc

Alan Cox alc at cs.rice.edu
Sat Sep 26 21:04:15 UTC 2009


Daniel O'Connor wrote:
> On Sat, 26 Sep 2009, Alan Cox wrote:
>   
>> John Baldwin wrote:
>>     
>>> On Friday 25 September 2009 3:20:05 am Daniel O'Connor wrote:
>>>       
>>>> On Thu, 24 Sep 2009, John Baldwin wrote:
>>>>         
>>>>> Can you try this patch perhaps:
>>>>>
>>>>> Index: sys/amd64/isa/isa_dma.c
>>>>> =================================================================
>>>>> == --- isa_dma.c	(revision 197430)
>>>>> +++ isa_dma.c	(working copy)
>>>>>           
>>>> This patch fixes the panic for me.
>>>>
>>>> I haven't tried printing (don't have any device handy here).
>>>>         
>>> I wonder if pmap_extract(kernel_pmap) doesn't work with direct map
>>> addresses for some reason?  I kind of find that hard to believe
>>> actually.  Alan, the original panic was in
>>> pmap_extract(kernel_pmap, ...) calls in the isa_dma code.  My patch
>>> that "fixes" the panic just changes them to pmap_kextract().
>>>       
>> Is this problem occurring on an AMD processor?
>>     
>
> Yes,
> CPU: AMD Athlon(tm) II X2 240 Processor (2812.73-MHz K8-class CPU)
>   Origin = "AuthenticAMD"  Id = 0x100f62  Stepping = 2
>   Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
>   Features2=0x802009<SSE3,MON,CX16,POPCNT>
>   AMD Features=0xee500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM,3DNow!+,3DNow!>
>   AMD Features2=0x37ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT>
>   TSC: P-state invariant
> real memory  = 4294967296 (4096 MB)
> avail memory = 3974762496 (3790 MB)
>
>   

Ok, now I can explain what is happening.  The kernel is using 1GB pages 
to implement the direct map.  Unfortunately, pmap_extract() doesn't know 
how to handle a 1GB page mapping.  pmap_kextract() only works by an 
"accident" of its different implementation.  In other words, it should 
not be relied upon to work either.

Please revert whatever patch John gave you and try the attached patch.  
It simply disables the use of 1GB page mapping by the direct map.

Regards,
Alan


-------------- next part --------------
Index: amd64/amd64/pmap.c
===================================================================
--- amd64/amd64/pmap.c	(revision 197425)
+++ amd64/amd64/pmap.c	(working copy)
@@ -442,7 +442,7 @@
 	if (ndmpdp < 4)		/* Minimum 4GB of dirmap */
 		ndmpdp = 4;
 	DMPDPphys = allocpages(firstaddr, NDMPML4E);
-	if ((amd_feature & AMDID_PAGE1GB) == 0)
+	if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0)
 		DMPDphys = allocpages(firstaddr, ndmpdp);
 	dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT;
 
@@ -476,7 +476,7 @@
 
 	/* Now set up the direct map space using either 2MB or 1GB pages */
 	/* Preset PG_M and PG_A because demotion expects it */
-	if ((amd_feature & AMDID_PAGE1GB) == 0) {
+	if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0) {
 		for (i = 0; i < NPDEPG * ndmpdp; i++) {
 			((pd_entry_t *)DMPDphys)[i] = (vm_paddr_t)i << PDRSHIFT;
 			((pd_entry_t *)DMPDphys)[i] |= PG_RW | PG_V | PG_PS |


More information about the freebsd-stable mailing list