[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] VT-d/RMRR: Adjust the return values of register_one_rmrr()



commit d0de76af1c87f355f53cba146d46a4553ede69c3
Author:     Venu Busireddy <venu.busireddy@xxxxxxxxxx>
AuthorDate: Tue Feb 7 14:31:03 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Feb 7 14:31:03 2017 +0100

    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>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/dmar.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

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);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.