xref: /linux/arch/loongarch/include/asm/kvm_dmsintc.h (revision 53597deca0e38c30e6cd4ba2114fa42d2bcd85bb)
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 dmsintc_inject_irq(struct kvm_vcpu *vcpu);
24 int dmsintc_set_irq(struct kvm *kvm, u64 addr, int data, int level);
25 int dmsintc_deliver_msi_to_vcpu(struct kvm *kvm, struct kvm_vcpu *vcpu, u32 vector, int level);
26 
27 #endif
28