From patchwork Tue May 24 09:09:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9133073 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 8E950607D3 for ; Tue, 24 May 2016 09:11:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84BD628258 for ; Tue, 24 May 2016 09:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79E6828279; Tue, 24 May 2016 09:11:09 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F89128285 for ; Tue, 24 May 2016 09:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753066AbcEXJLA (ORCPT ); Tue, 24 May 2016 05:11:00 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35851 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932479AbcEXJKz (ORCPT ); Tue, 24 May 2016 05:10:55 -0400 Received: by mail-wm0-f47.google.com with SMTP id n129so118571511wmn.1 for ; Tue, 24 May 2016 02:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zZGs0785HEH9mSDohXFHK5i5K+vX3jkqbPyb9xFTf24=; b=FFiVo67/9VhErZKHEHhbr0q0e5+gUnKITqB2Dw1BnoW4LTQ+ycr+fTv6kyAACyOWNm HTRaIppcx0DECtMwPp2WQgNp3tggtu+7kbJnWze7XfF4WzTz7/wUpjeevxwgXchVea/Z 5A0UAn9NZBe63ceMRVQf3bZ4UZW6nBYUYzeFY= 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=zZGs0785HEH9mSDohXFHK5i5K+vX3jkqbPyb9xFTf24=; b=ARIUsePp1kwG8VI85lBAjo6LYyzBeX/hF2PQNGFwxOGLbzqledNTiswvkbKVvxxJ5Q UO8bwFn+c3Diaz51zSahbBi5aghWIakHAo31Beh7b5bxtx7ItatMGIJMz1p7Xr47BRFK iGKOB8qhdaKoJvhVaiuEqn2bXsT/3pj0/ZCZBJZBofQU7uTLM5gJYXyWcFyox/cbGco7 tt4eDgdol+jAW7wbEgyVut1FRtNHMZKyKqFDha2jx1KHCwhbze49uut0fqbYVtNQgvNh rwLv5HMmKX+RBuv0QgwEtdSug4Vao6TojvdFKbh+J3DgoZNy2BeRvDTOgvGNjY9DuNwS WVSQ== X-Gm-Message-State: ALyK8tJ2KgvpTRC4f80KfXnHh3k/czQ5i7Ui4a1PpXIyhXPfGRPNQBcCnRokUfTe+Ri4bnw4 X-Received: by 10.194.84.74 with SMTP id w10mr3079980wjy.118.1464081053661; Tue, 24 May 2016 02:10:53 -0700 (PDT) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id f11sm18163246wmf.22.2016.05.24.02.10.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 May 2016 02:10:53 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Andre Przywara Subject: [PULL 56/59] KVM: arm/arm64: vgic-new: Wire up irqfd injection Date: Tue, 24 May 2016 11:09:50 +0200 Message-Id: <1464080993-10884-57-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1464080993-10884-1-git-send-email-christoffer.dall@linaro.org> References: <1464080993-10884-1-git-send-email-christoffer.dall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andre Przywara Connect to the new VGIC to the irqfd framework, so that we can inject IRQs. GSI routing and MSI routing is not yet implemented. Signed-off-by: Andre Przywara Reviewed-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-irqfd.c | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 virt/kvm/arm/vgic/vgic-irqfd.c diff --git a/virt/kvm/arm/vgic/vgic-irqfd.c b/virt/kvm/arm/vgic/vgic-irqfd.c new file mode 100644 index 0000000..c675513 --- /dev/null +++ b/virt/kvm/arm/vgic/vgic-irqfd.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2015, 2016 ARM Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +int kvm_irq_map_gsi(struct kvm *kvm, + struct kvm_kernel_irq_routing_entry *entries, + int gsi) +{ + return 0; +} + +int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned int irqchip, + unsigned int pin) +{ + return pin; +} + +int kvm_set_irq(struct kvm *kvm, int irq_source_id, + u32 irq, int level, bool line_status) +{ + unsigned int spi = irq + VGIC_NR_PRIVATE_IRQS; + + trace_kvm_set_irq(irq, level, irq_source_id); + + BUG_ON(!vgic_initialized(kvm)); + + return kvm_vgic_inject_irq(kvm, 0, spi, level); +} + +/* MSI not implemented yet */ +int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, + struct kvm *kvm, int irq_source_id, + int level, bool line_status) +{ + return 0; +}