From patchwork Mon Jul 13 09:47:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Feng" X-Patchwork-Id: 51066 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9320D218E9 for ; Mon, 13 Jul 2015 09:59:33 +0000 (UTC) Received: by wipp2 with SMTP id p2sf19451080wip.2 for ; Mon, 13 Jul 2015 02:59:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=gOnATmie6+YCO3qn2hEg8wYj2C4q8CRVO3j+ZL88tjA=; b=mmaiBA7w50lTwBGSuGukuEie+99RJaHPtuHDunjo5hrJi/OZmQjf5PG9YJ7QhvCIFB xXxIhRkrtcqwoAaWRaSImIKEhRVXdq5dW9R+iBB8Mvq6YqndskIczoGznvciNj+9ObQd EtzoqCoabjsbPgPgvchM0feSD3yuVeM0hQyPaJM5cYZe2Wwny2s/5iTbTLeQaGv2TOFe s2Yid6ggBRe/CrTVSTgJ175ef9q30J/FuaCPEqawwLBEhHHKIM6dN7cKgy0qr8uMyrKr avdsoY6lRKiDLXsNCv/oVQhEURqQaienizQbI3vodEWBrKyLapPAW2sSxIYLz7V25cXw 86Ew== X-Gm-Message-State: ALoCoQkx8SfoZPwBR3THvWomZW06Iq+3PooSe6Ytr00qx2dgQUV04Kk/37KeNAu6seriHGP2x793 X-Received: by 10.112.148.101 with SMTP id tr5mr18072015lbb.13.1436781572780; Mon, 13 Jul 2015 02:59:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.163 with SMTP id c3ls144738laa.98.gmail; Mon, 13 Jul 2015 02:59:32 -0700 (PDT) X-Received: by 10.152.37.37 with SMTP id v5mr30994020laj.11.1436781572598; Mon, 13 Jul 2015 02:59:32 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id k14si9430483lbh.10.2015.07.13.02.59.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2015 02:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagx9 with SMTP id x9so297152955lag.1 for ; Mon, 13 Jul 2015 02:59:32 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr31834657laa.106.1436781572500; Mon, 13 Jul 2015 02:59:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1618001lbb; Mon, 13 Jul 2015 02:59:31 -0700 (PDT) X-Received: by 10.68.175.35 with SMTP id bx3mr66826701pbc.128.1436781563607; Mon, 13 Jul 2015 02:59:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xa7si17259098pab.208.2015.07.13.02.59.22; Mon, 13 Jul 2015 02:59:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbbGMJ7I (ORCPT + 28 others); Mon, 13 Jul 2015 05:59:08 -0400 Received: from mga03.intel.com ([134.134.136.65]:34120 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752739AbbGMJ7D (ORCPT ); Mon, 13 Jul 2015 05:59:03 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 13 Jul 2015 02:59:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,462,1432623600"; d="scan'208";a="761364946" Received: from feng-bdw-de-pi.bj.intel.com ([10.238.154.75]) by fmsmga002.fm.intel.com with ESMTP; 13 Jul 2015 02:59:00 -0700 From: Feng Wu To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pbonzini@redhat.com, alex.williamson@redhat.com, joro@8bytes.org, eric.auger@linaro.org, feng.wu@intel.com Subject: [v5 15/19] KVM: eventfd: add irq bypass consumer management Date: Mon, 13 Jul 2015 17:47:31 +0800 Message-Id: <1436780855-3617-16-git-send-email-feng.wu@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436780855-3617-1-git-send-email-feng.wu@intel.com> References: <1436780855-3617-1-git-send-email-feng.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: feng.wu@intel.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Eric Auger This patch adds the registration/unregistration of an irq_bypass_consumer on irqfd assignment/deassignment. Signed-off-by: Eric Auger Signed-off-by: Feng Wu --- virt/kvm/eventfd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 647ffb8..4225eea 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -140,6 +141,7 @@ irqfd_shutdown(struct work_struct *work) /* * It is now safe to release the object's resources */ + irq_bypass_unregister_consumer(&irqfd->consumer); eventfd_ctx_put(irqfd->eventfd); kfree(irqfd); } @@ -380,6 +382,11 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) */ fdput(f); + irqfd->consumer.token = (void *)irqfd->eventfd; + kvm_arch_irq_consumer_init(&irqfd->consumer); + ret = irq_bypass_register_consumer(&irqfd->consumer); + WARN_ON(ret); + return 0; fail: