[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2] VT-d/RMRR: Adjust the return values of register_one_rmrr()
Adjust/manage the return values of register_one_rmrr() such that new callers log errors for non-debug builds too, while not affecting the behavior of the original callers. Signed-off-by: Venu Busireddy <venu.busireddy@xxxxxxxxxx> --- xen/drivers/passthrough/vtd/dmar.c | 11 +++++++++++ 1 file changed, 11 insertions(+) v2: - Reimplement the adjustment as suggested by Jan. diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index 1143a9d..9484f3b 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -619,6 +619,7 @@ static int register_one_rmrr(struct acpi_rmrr_unit *rmrru) rmrru->base_address, rmrru->end_address); scope_devices_free(&rmrru->scope); xfree(rmrru); + return 1; } else if ( rmrru->base_address > rmrru->end_address ) { @@ -691,7 +692,17 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header) &rmrru->scope, RMRR_TYPE, rmrr->segment); if ( !ret && (rmrru->scope.devices_cnt != 0) ) + { ret = register_one_rmrr(rmrru); + /* + * register_one_rmrr() returns greater than 0 when a specified + * PCIe device cannot be detected. To prevent VT-d from being + * disabled in such cases, reset the return value to 0 here. + */ + if ( ret > 0 ) + ret = 0; + + } else xfree(rmrru); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |