PERFORCE change 158590 for review

Ulf Lilleengen lulf at FreeBSD.org
Mon Mar 2 10:23:57 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=158590

Change 158590 by lulf at lulf_carrot on 2009/03/02 18:23:47

	- Return the complete physical address, not just the page. This fixes a
	  panic caused by busdma trying to convert the translated address into
	  the uncached P2 segment, but the conversion modified the physical
	  address, causing troubles when the memory was being used. This was
	  later detected by uma.
	- Return 0 in case the lookup is unsuccessful.
	- P1 and P2 segments are only accessible to kernel processes, so is only
	  handled in pmap_kextract.

Affected files ...

.. //depot/projects/avr32/src/sys/avr32/avr32/pmap.c#11 edit

Differences ...

==== //depot/projects/avr32/src/sys/avr32/avr32/pmap.c#11 (text+ko) ====

@@ -284,7 +284,14 @@
 vm_paddr_t
 pmap_kextract(vm_offset_t va)
 {
-	return pmap_extract(kernel_pmap, va);
+
+	/* Don't lookup in page tables for P1 and P2 segments. */
+	if ((va & AVR32_SEG_MASK) == AVR32_SEG_P1)
+		return (AVR32_P1_TO_PHYS(va));
+	else if ((va & AVR32_SEG_MASK) == AVR32_SEG_P2)
+		return (AVR32_P2_TO_PHYS(va));
+
+	return (pmap_extract(kernel_pmap, va));
 }
 
 /*
@@ -735,14 +742,10 @@
 {
 	pt_entry_t *ent;
 
-	/* Don't lookup in page tables for P1 and P2 segments. */
-	if ((va & AVR32_SEG_MASK) == AVR32_SEG_P1)
-		return (AVR32_P1_TO_PHYS(va));
-	else if ((va & AVR32_SEG_MASK) == AVR32_SEG_P2)
-		return (AVR32_P2_TO_PHYS(va));
-
 	ent = pmap_pte(pmap, va);
-	return pfn_get(*ent);
+	if (ent == NULL)
+		return (0);
+	return (pfn_get(*ent) | (va & PAGE_MASK));
 }
 
 vm_page_t


More information about the p4-projects mailing list