blob: c675513270bb8644f39adb534114c1cab22b0d32 [file] [log] [blame]
Andre Przywara03f0c942016-03-25 00:04:53 +00001/*
2 * Copyright (C) 2015, 2016 ARM Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/kvm.h>
18#include <linux/kvm_host.h>
19#include <trace/events/kvm.h>
20
21int kvm_irq_map_gsi(struct kvm *kvm,
22 struct kvm_kernel_irq_routing_entry *entries,
23 int gsi)
24{
25 return 0;
26}
27
28int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned int irqchip,
29 unsigned int pin)
30{
31 return pin;
32}
33
34int kvm_set_irq(struct kvm *kvm, int irq_source_id,
35 u32 irq, int level, bool line_status)
36{
37 unsigned int spi = irq + VGIC_NR_PRIVATE_IRQS;
38
39 trace_kvm_set_irq(irq, level, irq_source_id);
40
41 BUG_ON(!vgic_initialized(kvm));
42
43 return kvm_vgic_inject_irq(kvm, 0, spi, level);
44}
45
46/* MSI not implemented yet */
47int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
48 struct kvm *kvm, int irq_source_id,
49 int level, bool line_status)
50{
51 return 0;
52}