Andre Przywara | 03f0c94 | 2016-03-25 00:04:53 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 21 | int kvm_irq_map_gsi(struct kvm *kvm, |
| 22 | struct kvm_kernel_irq_routing_entry *entries, |
| 23 | int gsi) |
| 24 | { |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned int irqchip, |
| 29 | unsigned int pin) |
| 30 | { |
| 31 | return pin; |
| 32 | } |
| 33 | |
| 34 | int 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 */ |
| 47 | int 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 | } |