xref: /linux/arch/loongarch/include/asm/kvm_dmsintc.h (revision 214f4aeb2255f2f9b5f5de1a15f650a429c43490)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2025 Loongson Technology Corporation Limited
4  */
5 
6 #ifndef __ASM_KVM_DMSINTC_H
7 #define __ASM_KVM_DMSINTC_H
8 
9 #include <linux/kvm_types.h>
10 
11 struct loongarch_dmsintc {
12 	struct kvm *kvm;
13 	uint64_t msg_addr_base;
14 	uint64_t msg_addr_size;
15 	uint32_t cpu_mask;
16 };
17 
18 struct dmsintc_state {
19 	atomic64_t vector_map[4];
20 };
21 
22 int kvm_loongarch_register_dmsintc_device(void);
23 void kvm_loongarch_unregister_dmsintc_device(void);
24 void dmsintc_inject_irq(struct kvm_vcpu *vcpu);
25 int dmsintc_set_irq(struct kvm *kvm, u64 addr, int data, int level);
26 int dmsintc_deliver_msi_to_vcpu(struct kvm *kvm, struct kvm_vcpu *vcpu, u32 vector, int level);
27 
28 #endif
29