svn commit: r278122 - stable/10/sys/powerpc/pseries

Nathan Whitehorn nwhitehorn at FreeBSD.org
Tue Feb 3 00:29:59 UTC 2015


Author: nwhitehorn
Date: Tue Feb  3 00:29:58 2015
New Revision: 278122
URL: https://svnweb.freebsd.org/changeset/base/278122

Log:
  MFC r277792:
  Fix bug in mapppings of multiple pages exposed by updates to the VSCSI
  support in QEMU. Each page of a many page mapping was getting mapped to
  the same physical address, which is not the desired behavior.

Modified:
  stable/10/sys/powerpc/pseries/plpar_iommu.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/powerpc/pseries/plpar_iommu.c
==============================================================================
--- stable/10/sys/powerpc/pseries/plpar_iommu.c	Tue Feb  3 00:19:50 2015	(r278121)
+++ stable/10/sys/powerpc/pseries/plpar_iommu.c	Tue Feb  3 00:29:58 2015	(r278122)
@@ -191,13 +191,13 @@ phyp_iommu_map(device_t dev, bus_dma_seg
 
 		tce = trunc_page(segs[i].ds_addr);
 		tce |= 0x3; /* read/write */
-		if (papr_supports_stuff_tce) {
-			error = phyp_hcall(H_STUFF_TCE, window->map->iobn,
-			    alloced, tce, allocsize/PAGE_SIZE);
-		} else {
-			for (j = 0; j < allocsize; j += PAGE_SIZE)
-				error = phyp_hcall(H_PUT_TCE, window->map->iobn,
-				    alloced + j, tce + j);
+		for (j = 0; j < allocsize; j += PAGE_SIZE) {
+			error = phyp_hcall(H_PUT_TCE, window->map->iobn,
+			    alloced + j, tce + j);
+			if (error < 0) {
+				panic("IOMMU mapping error: %d\n", error);
+				return (ENOMEM);
+			}
 		}
 
 		segs[i].ds_addr = alloced + (segs[i].ds_addr & PAGE_MASK);


More information about the svn-src-stable mailing list