Date: Tue, 27 Jan 2015 07:20:00 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277792 - head/sys/powerpc/pseries Message-ID: <201501270720.t0R7K0rr068326@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Tue Jan 27 07:20:00 2015 New Revision: 277792 URL: https://svnweb.freebsd.org/changeset/base/277792 Log: 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. MFC after: 1 week Modified: head/sys/powerpc/pseries/plpar_iommu.c Modified: head/sys/powerpc/pseries/plpar_iommu.c ============================================================================== --- head/sys/powerpc/pseries/plpar_iommu.c Tue Jan 27 06:50:01 2015 (r277791) +++ head/sys/powerpc/pseries/plpar_iommu.c Tue Jan 27 07:20:00 2015 (r277792) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501270720.t0R7K0rr068326>