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.
This commit is contained in:
parent
00fdf5663a
commit
f1bce3cd64
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user