From nobody Sat Apr 20 02:15:04 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15809257979261021.7187271672977; Wed, 5 Feb 2020 10:03:17 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izP0R-0006sS-OE; Wed, 05 Feb 2020 18:02:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izP0Q-0006sG-M7 for xen-devel@lists.xenproject.org; Wed, 05 Feb 2020 18:02:30 +0000 Received: from mail-wr1-f66.google.com (unknown [209.85.221.66]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id aca46ac4-4841-11ea-9178-12813bfff9fa; Wed, 05 Feb 2020 18:02:29 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y11so3883658wrt.6 for ; Wed, 05 Feb 2020 10:02:29 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id t9sm735716wrv.63.2020.02.05.10.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 10:02:28 -0800 (PST) X-Inumbo-ID: aca46ac4-4841-11ea-9178-12813bfff9fa X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qwfpjxdFnRoECf8ot+2ry0zQDK/D4NNdHk1B2vQf5ss=; b=ium3nclbgIBMI6xmyIlO0GFpg2XJlyQPaBICZGTeQqp4H2tDzwnivtNolh59dsqC0U zipsSM0tqhh0hXWpGE8wtoX00uPw4lBPtyxYO+Fwvw5uiloYJ1Dm6AEkHUFLy7l4SiLm 6/VHUKjdKhD60ysJ1ryDxrB3YIIimcWYfRaaHJYCYaaDf+x0OAn01L5HviuJPGExVSmE WoehawSPgOE4AWhi2lsxTfmjQhvpIQtAfYtKtg2HloyYDTj7qVQ4/Ud5YQNljrqwudGa fpPMnd1GUP4jn7sRv52Ue/9AJudreInyAJ8V20r0TobU95mUUhYBjTjfGiZBJY2mYq1e KZMw== X-Gm-Message-State: APjAAAU2GX6U5sxncDWZrOUU8D0mEkBlaTQsaMKi57CPhISRBAbt1UGP oK86gBaJH64bo7EU+cC9aDgbysu+8BY= X-Google-Smtp-Source: APXvYqxXb/0KRU9PG8SwNaVqzwsUkcB642bzmrBpilBcqTecptLZdEZrlH20Lt80OxdHxRJeWJluVQ== X-Received: by 2002:adf:93c1:: with SMTP id 59mr30209599wrp.399.1580925748990; Wed, 05 Feb 2020 10:02:28 -0800 (PST) From: Wei Liu To: Xen Development List Date: Wed, 5 Feb 2020 18:02:24 +0000 Message-Id: <20200205180224.6525-1-wl@xen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/guest/xen: only set HVM parameter on BSP X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Jan Beulich , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no need for every CPU to set a guest property. Signed-off-by: Wei Liu Reviewed-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 Suggested-by: Roger? --- 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 =3D { - .domid =3D DOMID_SELF, - .index =3D HVM_PARAM_CALLBACK_IRQ, - .value =3D 1, - }; =20 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; } =20 - /* Trick toolstack to think we are enlightened */ - rc =3D xen_hypercall_hvm_op(HVMOP_set_param, &a); - if ( rc ) - printk("Unable to set HVM_PARAM_CALLBACK_IRQ\n"); + if ( smp_processor_id() =3D=3D 0 ) + { + struct xen_hvm_param a =3D { + .domid =3D DOMID_SELF, + .index =3D HVM_PARAM_CALLBACK_IRQ, + .value =3D 1, + }; + + /* Trick toolstack to think we are enlightened */ + rc =3D xen_hypercall_hvm_op(HVMOP_set_param, &a); + if ( rc ) + printk("Unable to set HVM_PARAM_CALLBACK_IRQ\n"); + } =20 return rc; } --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel