From patchwork Wed Sep 21 02:37:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Feng" X-Patchwork-Id: 9342709 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 6E5DC607EE for ; Wed, 21 Sep 2016 03:10:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74BE3296C1 for ; Wed, 21 Sep 2016 03:10:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6739A29CDD; Wed, 21 Sep 2016 03:10:23 +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 3E83C29689 for ; Wed, 21 Sep 2016 03:10:21 +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 1bmXt4-0002fE-7i; Wed, 21 Sep 2016 03:07:54 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmXt2-0002en-41 for xen-devel@lists.xen.org; Wed, 21 Sep 2016 03:07:52 +0000 Received: from [85.158.143.35] by server-8.bemta-6.messagelabs.com id C0/4A-05361-789F1E75; Wed, 21 Sep 2016 03:07:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRWlGSWpSXmKPExsVywNwkVrf958N wg0PbpC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyVP9rZC9ZyVdxbc4GpgfE5RxcjJ4eQQIXE t9+zWUFsCQFeiSPLZkDZARKfN69ggqipl1hzYAsLiM0moChx8OIhsBoRAWmJa58vM3YxcnEwC yxglGi8eJQZJCEsYC2xv38fmM0ioCoxa8E5RhCbV8BBYuHOc1AL5CQ27P4PFucUcJS40fYJap mDxMOvH9knMPIuYGRYxahRnFpUllqka2ihl1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5y fu4kRGA4MQLCD8ebGgEOMkhxMSqK8cnwPwoX4kvJTKjMSizPii0pzUosPMcpwcChJ8G778TBc SLAoNT21Ii0zBxiYMGkJDh4lEV4hkDRvcUFibnFmOkTqFKOilDhvBUhCACSRUZoH1waLhkuMs lLCvIxAhwjxFKQW5WaWoMq/YhTnYFQS5p0PMoUnM68EbvoroMVMQIu3/HwAsrgkESEl1cDId/ KJQ7xq+t7eT5KmD+Oe+xs07/bc6O3jb+z5IOXE//1PXQKrRJLEp/ZxLFz+yWqnziX1yhOtAYa OHF1yU0JUGPNWfHVfOfv0Gi7Z4/f8Sj0vJvvN6XwfGnXUcpm2R9fXyVI/mqMX/Zo93znCwK0w 46zaGWfp9YuUPtVXWkzb8ru1o0O6TUGJpTgj0VCLuag4EQAGGxCIgQIAAA== X-Env-Sender: feng.wu@intel.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1474427268!34296260!2 X-Originating-IP: [192.55.52.93] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDMyNDY2NQ==\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50011 invoked from network); 21 Sep 2016 03:07:51 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by server-12.tower-21.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 21 Sep 2016 03:07:51 -0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 20 Sep 2016 20:07:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.30,371,1470726000"; d="scan'208"; a="1033977505" Received: from feng-bdw-de-pi.bj.intel.com ([10.238.154.76]) by orsmga001.jf.intel.com with ESMTP; 20 Sep 2016 20:07:47 -0700 From: Feng Wu To: xen-devel@lists.xen.org Date: Wed, 21 Sep 2016 10:37:45 +0800 Message-Id: <1474425470-3629-2-git-send-email-feng.wu@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1474425470-3629-1-git-send-email-feng.wu@intel.com> References: <1474425470-3629-1-git-send-email-feng.wu@intel.com> Cc: kevin.tian@intel.com, Feng Wu , george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, jbeulich@suse.com Subject: [Xen-devel] [PATCH v4 1/6] VMX: Statically assign two PI hooks 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 PI hooks: vmx_pi_switch_from() and vmx_pi_switch_to() are needed even when any previously assigned device is detached from the domain. Since 'SN' bit is also used to control the CPU side PI and we change the state of SN bit in these two functions, then evaluate this bit in vmx_deliver_posted_intr() when trying to deliver the interrupt in posted way via software. The problem is if we deassign the hooks while the vCPU is runnable in the runqueue with 'SN' set, all the furture notificaton event will be suppressed. This patch makes these two hooks statically assigned. Signed-off-by: Feng Wu --- v4: - Don't zap vmx_pi_switch_from() and vmx_pi_switch_to() when any previously assigned device is detached from the domain. - Comments changes. xen/arch/x86/hvm/vmx/vmx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 3d330b6..355936a 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -221,8 +221,6 @@ void vmx_pi_hooks_deassign(struct domain *d) ASSERT(d->arch.hvm_domain.vmx.vcpu_block); 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; }