From patchwork Fri May 20 08:53:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Feng" X-Patchwork-Id: 9129009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABD6F6048B for ; Fri, 20 May 2016 09:19:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F65E208C2 for ; Fri, 20 May 2016 09:19:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 945C82793B; Fri, 20 May 2016 09:19:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 515EF208C2 for ; Fri, 20 May 2016 09:19:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3gZG-0006It-Ig; Fri, 20 May 2016 09:18:02 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3gZF-0006Ho-B9 for xen-devel@lists.xen.org; Fri, 20 May 2016 09:18:01 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id 9D/0A-32266-846DE375; Fri, 20 May 2016 09:18:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRWlGSWpSXmKPExsVywNwkQtfjml2 4wa0+EYslHxezODB6HN39mymAMYo1My8pvyKBNaO7+QF7wQyuigP3trI2MJ7k6GLk5BASqJRo nzSDDcSWEOCVOLJsBiuE7S9x5vVVJoiaeolPU1rA4mwCihIHLx4Cs0UEpCWufb7M2MXIxcEsc IJR4veUmWAJYQFHib09s5hBbBYBVYkTf2aADeIFih98dAVqgZzEht3/GUFsTgEniW8XnrFBLH OUmP74E9sERt4FjAyrGDWKU4vKUot0DY30kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvN zNzECw4EBCHYw9s1yPsQoycGkJMrLtcAuXIgvKT+lMiOxOCO+qDQntfgQowwHh5IE79QrQDnB otT01Iq0zBxgYMKkJTh4lER454CkeYsLEnOLM9MhUqcYFaXEeXeAJARAEhmleXBtsGi4xCgrJ czLCHSIEE9BalFuZgmq/CtGcQ5GJWHeXSBTeDLzSuCmvwJazAS0+JaYDcjikkSElFQD4yIzgZ 8ndM6+kYnoMxKebPXUiW/9zucRhlWKlzPqfRV+nPp/3LZu69Zlb5n/c85JMfzHHh7P3jBr0qJ go3meicEry388dynhntjxapttyJ4VU+o5DHKeuYQ2dt+tzX+wXOW367GzWfY8hfJeJkfnBfTr LVkx11K79PQvJzXnxI8d1+9cXtYVrMRSnJFoqMVcVJwIALPfoOeBAgAA X-Env-Sender: feng.wu@intel.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1463735872!28446085!3 X-Originating-IP: [192.55.52.88] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM3NDcyNQ==\n X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42819 invoked from network); 20 May 2016 09:18:00 -0000 Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by server-11.tower-206.messagelabs.com with SMTP; 20 May 2016 09:18:00 -0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 20 May 2016 02:17:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,338,1459839600"; d="scan'208";a="971023669" Received: from feng-bdw-de-pi.bj.intel.com ([10.238.154.60]) by fmsmga001.fm.intel.com with ESMTP; 20 May 2016 02:17:56 -0700 From: Feng Wu To: xen-devel@lists.xen.org Date: Fri, 20 May 2016 16:53:50 +0800 Message-Id: <1463734431-22353-3-git-send-email-feng.wu@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1463734431-22353-1-git-send-email-feng.wu@intel.com> References: <1463734431-22353-1-git-send-email-feng.wu@intel.com> Cc: kevin.tian@intel.com, keir@xen.org, george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, jbeulich@suse.com, Feng Wu Subject: [Xen-devel] [PATCH 2/3] VMX: Make hook pi_do_resume always available X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Make hook pi_do_resume always available, so when the last assigned device is dettached from a domain, the blocked vcpu can be removed from the per-cpu blocking list properly. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 3fbc7b1..4862b13 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -233,7 +233,6 @@ void vmx_pi_hooks_assign(struct domain *d) d->arch.hvm_domain.vmx.vcpu_block = vmx_vcpu_block; d->arch.hvm_domain.vmx.pi_switch_from = vmx_pi_switch_from; d->arch.hvm_domain.vmx.pi_switch_to = vmx_pi_switch_to; - d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; } /* This function is called when pcidevs_lock is held */ @@ -247,13 +246,14 @@ void vmx_pi_hooks_deassign(struct domain *d) d->arch.hvm_domain.vmx.vcpu_block = NULL; d->arch.hvm_domain.vmx.pi_switch_from = NULL; d->arch.hvm_domain.vmx.pi_switch_to = NULL; - d->arch.hvm_domain.vmx.pi_do_resume = NULL; } static int vmx_domain_initialise(struct domain *d) { int rc; + d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; + if ( !has_vlapic(d) ) return 0;