From patchwork Thu Jul 2 13:17:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6709441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7BFF09F380 for ; Thu, 2 Jul 2015 13:22:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2449206C7 for ; Thu, 2 Jul 2015 13:22:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA4F72065A for ; Thu, 2 Jul 2015 13:22:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAePe-0008Pw-VZ; Thu, 02 Jul 2015 13:20:22 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAeO3-0004OK-9C for linux-arm-kernel@lists.infradead.org; Thu, 02 Jul 2015 13:18:44 +0000 Received: by wicgi11 with SMTP id gi11so73567727wic.0 for ; Thu, 02 Jul 2015 06:18:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VS5zoJz6HXThuGOXNaf3+ZBe2R+SY4nXBpL+EyLryZY=; b=bme2cJxayrjl3QhRJ9dj9ycjDALB9RGYq4rEI6R6llrg05XCsrKabvjDGJ/KV3PdoF ODdjMkQbVGPfBcJBy+yaw0AWBEtY+CdiJk8yDuTFElifPo1M7+FX/aqX7SK9FdDHX8uf 06eYNvMen5qIO+O+9g78RWts8uSR4t05KUrj4g/lXGwa7Q795fn8Xao2ivsZ4y8Qob3k Bv+gLE/oVoojeTQdaW5UXtmvu0J0h8jasWe2Eo2OgjlWoZsjL63HdmOv4bvXtZjWuKTy N/uG7VYqQst6S134ECJokBkYnOOeNALxTK9FItWLgvvk9XUit0Eyqme+irTKp7p+t+Zj Ek3w== X-Gm-Message-State: ALoCoQkjc3DMncme1BPhyoWqTQMK1LAw/FyOuMr/3k/hxx8rdTsZ2LCVVITfUvjYEXnMwrJHcVZw X-Received: by 10.194.58.7 with SMTP id m7mr56942574wjq.109.1435843105381; Thu, 02 Jul 2015 06:18:25 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id tl3sm8157099wjc.20.2015.07.02.06.18.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 06:18:24 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.williamson@redhat.com, pbonzini@redhat.com, avi.kivity@gmail.com, mtosatti@redhat.com, feng.wu@intel.com, joro@8bytes.org, b.reynal@virtualopensystems.com Subject: [RFC 15/17] KVM: arm/arm64: implement IRQ bypass consumer functions Date: Thu, 2 Jul 2015 15:17:25 +0200 Message-Id: <1435843047-6327-16-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435843047-6327-1-git-send-email-eric.auger@linaro.org> References: <1435843047-6327-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150702_061843_516415_552C6D1C X-CRM114-Status: GOOD ( 10.86 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, patches@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - kvm_arch_add_producer: perform VGIC/irqchip settings for forwarding - kvm_arch_del_producer: same for inverse operation - kvm_arch_stop_consumer: halt guest execution - kvm_arch_resume_consumer resume guest execution Signed-off-by: Eric Auger --- arch/arm/kvm/arm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 4be6715..f9b9b1e 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -1146,6 +1146,28 @@ struct kvm_vcpu *kvm_mpidr_to_vcpu(struct kvm *kvm, unsigned long mpidr) return NULL; } +void kvm_arch_add_producer(struct irq_bypass_consumer *cons, + struct irq_bypass_producer *prod) +{ + kvm_vgic_set_forward(cons->kvm, prod->irq, cons->gsi); +} +void kvm_arch_del_producer(struct irq_bypass_consumer *cons, + struct irq_bypass_producer *prod) +{ + kvm_vgic_unset_forward(cons->kvm, prod->irq, cons->gsi, + &prod->active); +} + +void kvm_arch_stop_consumer(struct irq_bypass_consumer *cons) +{ + kvm_arm_halt_guest(cons->kvm); +} + +void kvm_arch_resume_consumer(struct irq_bypass_consumer *cons) +{ + kvm_arm_resume_guest(cons->kvm); +} + /** * Initialize Hyp-mode and memory mappings on all CPUs. */