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
This commit is contained in:
Nathan Whitehorn 2015-01-27 07:20:00 +00:00
parent 6b0e9233e4
commit c7be335e3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=277792

View File

@ -191,13 +191,13 @@ phyp_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs,
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);