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: 6709161 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 49705C05AC for ; Thu, 2 Jul 2015 13:19:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6ECD206B8 for ; Thu, 2 Jul 2015 13:19:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D925F2065A for ; Thu, 2 Jul 2015 13:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbbGBNTB (ORCPT ); Thu, 2 Jul 2015 09:19:01 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:35089 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753014AbbGBNS1 (ORCPT ); Thu, 2 Jul 2015 09:18:27 -0400 Received: by wgjx7 with SMTP id x7so62926407wgj.2 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=e+FDfMpReEqz73v+FOqAznK7qJdIpciDHstaARjAY8APnTDo0H2CO8ae/8nGSu9kqU n79gCUTTbM0wsqHyPrvf7s2WVpUKHvcXORwyiCpOiSxhcMh0cTSzmzlc9Em6p7r/UO2d 9u7999c9Bv+IATBiVuGcZK/hoI9RPztb2t8qadezsBtax2IFkQInGvV3Drq/OQFOpVp7 SIutvqE0Uia41R88Ccx3OeGz+cpSqL7oJ/YWO/qp3dFXLF3A/Rjx07dnSAacVdJzjqgZ 0kSzqsaYV9qUHsp4YbL6ogdRnToHd6I5qaKthqo2AyGeUVqYpr/8Ic1ZtwEaW2PEiJ8P 2uGg== X-Gm-Message-State: ALoCoQniEzDUMywcE8aAgq9KGeWbdBRg4SqHuyEufmP5SzqQlKsbbXw5SIDsPCYwP14RhXYYCR5b 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.org 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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. */