2012-11-22 02:34:08 +00:00
|
|
|
/*
|
2014-06-26 19:11:34 +00:00
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* KVM/MIPS: Interrupts
|
|
|
|
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
|
|
|
|
* Authors: Sanjay Lal <sanjayl@kymasys.com>
|
|
|
|
*/
|
2012-11-22 02:34:08 +00:00
|
|
|
|
2014-06-26 19:11:34 +00:00
|
|
|
/*
|
|
|
|
* MIPS Exception Priorities, exceptions (including interrupts) are queued up
|
2012-11-22 02:34:08 +00:00
|
|
|
* for the guest in the order specified by their priorities
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MIPS_EXC_RESET 0
|
|
|
|
#define MIPS_EXC_SRESET 1
|
|
|
|
#define MIPS_EXC_DEBUG_ST 2
|
|
|
|
#define MIPS_EXC_DEBUG 3
|
|
|
|
#define MIPS_EXC_DDB 4
|
|
|
|
#define MIPS_EXC_NMI 5
|
|
|
|
#define MIPS_EXC_MCHK 6
|
|
|
|
#define MIPS_EXC_INT_TIMER 7
|
KVM: MIPS: Add more types of virtual interrupts
In current implementation, MIPS KVM uses IP2, IP3, IP4 and IP7 for
external interrupt, two kinds of IPIs and timer interrupt respectively,
but Loongson-3 based machines prefer to use IP2, IP3, IP6 and IP7 for
two kinds of external interrupts, IPI and timer interrupt. So we define
two priority-irq mapping tables: kvm_loongson3_priority_to_irq[] for
Loongson-3, and kvm_default_priority_to_irq[] for others. The virtual
interrupt infrastructure is updated to deliver all types of interrupts
from IP2, IP3, IP4, IP6 and IP7.
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <1590220602-3547-10-git-send-email-chenhc@lemote.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-05-23 07:56:36 +00:00
|
|
|
#define MIPS_EXC_INT_IO_1 8
|
|
|
|
#define MIPS_EXC_INT_IO_2 9
|
|
|
|
#define MIPS_EXC_EXECUTE 10
|
|
|
|
#define MIPS_EXC_INT_IPI_1 11
|
|
|
|
#define MIPS_EXC_INT_IPI_2 12
|
|
|
|
#define MIPS_EXC_MAX 13
|
2012-11-22 02:34:08 +00:00
|
|
|
/* XXXSL More to follow */
|
|
|
|
|
|
|
|
#define C_TI (_ULCAST_(1) << 30)
|
|
|
|
|
KVM: MIPS: Add more types of virtual interrupts
In current implementation, MIPS KVM uses IP2, IP3, IP4 and IP7 for
external interrupt, two kinds of IPIs and timer interrupt respectively,
but Loongson-3 based machines prefer to use IP2, IP3, IP6 and IP7 for
two kinds of external interrupts, IPI and timer interrupt. So we define
two priority-irq mapping tables: kvm_loongson3_priority_to_irq[] for
Loongson-3, and kvm_default_priority_to_irq[] for others. The virtual
interrupt infrastructure is updated to deliver all types of interrupts
from IP2, IP3, IP4, IP6 and IP7.
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <1590220602-3547-10-git-send-email-chenhc@lemote.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-05-23 07:56:36 +00:00
|
|
|
extern u32 *kvm_priority_to_irq;
|
|
|
|
u32 kvm_irq_to_priority(u32 irq);
|
|
|
|
|
2012-11-22 02:34:08 +00:00
|
|
|
int kvm_mips_pending_timer(struct kvm_vcpu *vcpu);
|
|
|
|
|
2016-06-09 13:19:07 +00:00
|
|
|
void kvm_mips_deliver_interrupts(struct kvm_vcpu *vcpu, u32 cause);
|