VT-d/RMRR: Adjust the return values of register_one_rmrr()
PATCH v2 1/1 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.
--- xen/drivers/passthrough/vtd/dmar.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
v2:
- Reimplement the adjustment as suggested by Jan.
xen/drivers/passthrough/vtd/dmar.c +11 -0
@@ -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
[email protected]
https://lists.xen.org/xen-devel
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 02.02.17 at 16:08, <[email protected]> wrote:
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 <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines
From: Venu Busireddy [mailto:[email protected]]
Sent: Thursday, February 02, 2017 11:08 PMAdjust/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 <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel