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

[Xen-devel] [PATCH v3 1/7] vTPM: event channel bind interdomain with para/hvm virtual machine



Signed-off-by: Quan Xu <quan.xu@xxxxxxxxx>
---
 extras/mini-os/tpmback.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 00b66e8..8a0a983 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -608,18 +608,21 @@ int connect_fe(tpmif_t* tpmif)
    }
    free(value);
 
-   domid = tpmif->domid;
-   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, 
&ringref, PROT_READ | PROT_WRITE)) == NULL) {
-      TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) 
tpmif->domid, tpmif->handle);
-      return -1;
-   }
+    domid = (unsigned int)tpmif->domid;
+    if ((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, 
&ringref,
+                                             PROT_READ | PROT_WRITE)) == NULL) 
{
+        TPMBACK_ERR("Failed to map grant reference %u/%u\n",
+                    tpmif->domid, tpmif->handle);
+        return -1;
+    }
+
+    /* Bind the event channel */
+    if ((evtchn_bind_interdomain(domid, evtchn, tpmback_handler, tpmif, 
&tpmif->evtchn))) {
+        TPMBACK_ERR("%u/%u Unable to bind to interdomain event channel!\n",
+                    (unsigned int) tpmif->domid, tpmif->handle);
+        goto error_post_map;
+    }
 
-   /*Bind the event channel */
-   if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, 
&tpmif->evtchn)))
-   {
-      TPMBACK_ERR("%u/%u Unable to bind to interdomain event channel!\n", 
(unsigned int) tpmif->domid, tpmif->handle);
-      goto error_post_map;
-   }
    unmask_evtchn(tpmif->evtchn);
 
    /* Write the ready flag and change status to connected */
-- 
1.8.3.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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