gnttab: adjust unmap checking of dev_bus_addr
PATCH 1/1 gnttab: adjust unmap checking of dev_bus_addr
There's no point checking ->dev_bus_addr when GNTMAP_device_map isn't set (and hence the field isn't going to be consumed). And if there is a mismatch, use the so far unused GNTST_bad_dev_addr error indicator - if not here, where else would this (so far unused) value be used?
Signed-off-by Jan Beulich <[email protected]>
xen/common/grant_table.c +2 -2
@@ -1450,9 +1450,9 @@ unmap_common( op->mfn = act->mfn; -if ( op->dev_bus_addr && +if ( op->dev_bus_addr && (flags & GNTMAP_device_map) &&unlikely (op->dev_bus_addr !=mfn_to_maddr (act->mfn)) ) -PIN_FAIL (act_release_out, GNTST_general_error, +PIN_FAIL (act_release_out, GNTST_bad_dev_addr,"Bus address doesn't match gntref (%" PRIx64" != %" PRIpaddr")\n" , op->dev_bus_addr,mfn_to_maddr (act->mfn));
Hi Jan,
Quoted 6 lines · Jan Beulich
There's no point checking ->dev_bus_addr when
GNTMAP_device_mapisn't set (and hence the field isn't going to be consumed). And if there is a mismatch, use the so far unusedGNTST_bad_dev_addrerror indicator - if not here, where else would this (so far unused) value be used?Signed-off-by Jan Beulich <[email protected]>
Acked-by Julien Grall <[email protected]>
Quoted 6 lines
xen/common/grant_table.c +0
-0@@ -1450,9 +1450,9 @@ unmap_common(
xen/common/grant_table.c unmap_common( · line 1458
Quoted 10 lines
xen/common/grant_table.c +2
-2op->mfn = act->mfn; -if ( op->dev_bus_addr && +if ( op->dev_bus_addr && (flags & GNTMAP_device_map) &&unlikely (op->dev_bus_addr !=mfn_to_maddr (act->mfn)) ) -PIN_FAIL (act_release_out, GNTST_general_error, +PIN_FAIL (act_release_out, GNTST_bad_dev_addr,"Bus address doesn't match gntref (%" PRIx64" != %" PRIpaddr")\n" , op->dev_bus_addr,mfn_to_maddr (act->mfn));
Cheers,
Signature · 1 line
Julien Grall