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

[Xen-changelog] [xen staging] x86/guest/xen: only set HVM parameter on BSP



commit 84cb6fe2e9901c5c8728605efd5601ec0f5daf7a
Author:     Wei Liu <wl@xxxxxxx>
AuthorDate: Wed Feb 5 18:02:24 2020 +0000
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Thu Feb 6 13:52:24 2020 +0000

    x86/guest/xen: only set HVM parameter on BSP
    
    There is no need for every CPU to set a guest property.
    
    Suggested-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Signed-off-by: Wei Liu <wl@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/guest/xen/xen.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 1f868f2f8d..3cf8f667a1 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -206,11 +206,6 @@ static int init_evtchn(void)
 {
     static uint8_t evtchn_upcall_vector;
     int rc;
-    struct xen_hvm_param a = {
-        .domid = DOMID_SELF,
-        .index = HVM_PARAM_CALLBACK_IRQ,
-        .value = 1,
-    };
 
     if ( !evtchn_upcall_vector )
         alloc_direct_apic_vector(&evtchn_upcall_vector, xen_evtchn_upcall);
@@ -225,10 +220,19 @@ static int init_evtchn(void)
         return rc;
     }
 
-    /* Trick toolstack to think we are enlightened */
-    rc = xen_hypercall_hvm_op(HVMOP_set_param, &a);
-    if ( rc )
-        printk("Unable to set HVM_PARAM_CALLBACK_IRQ\n");
+    if ( smp_processor_id() == 0 )
+    {
+        struct xen_hvm_param a = {
+            .domid = DOMID_SELF,
+            .index = HVM_PARAM_CALLBACK_IRQ,
+            .value = 1,
+        };
+
+        /* Trick toolstack to think we are enlightened */
+        rc = xen_hypercall_hvm_op(HVMOP_set_param, &a);
+        if ( rc )
+            printk("Unable to set HVM_PARAM_CALLBACK_IRQ\n");
+    }
 
     return rc;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
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®.