summaryrefslogtreecommitdiff
path: root/arch/loongarch/include/asm/kvm_dmsintc.h
blob: 5a71b9ccbe78ec268026df31831398f91e1fbc1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2025 Loongson Technology Corporation Limited
 */

#ifndef __ASM_KVM_DMSINTC_H
#define __ASM_KVM_DMSINTC_H

#include <linux/kvm_types.h>

struct loongarch_dmsintc {
	struct kvm *kvm;
	uint64_t msg_addr_base;
	uint64_t msg_addr_size;
	uint32_t cpu_mask;
};

struct dmsintc_state {
	atomic64_t vector_map[4];
};

int kvm_loongarch_register_dmsintc_device(void);
void dmsintc_inject_irq(struct kvm_vcpu *vcpu);
int dmsintc_set_irq(struct kvm *kvm, u64 addr, int data, int level);
int dmsintc_deliver_msi_to_vcpu(struct kvm *kvm, struct kvm_vcpu *vcpu, u32 vector, int level);

#endif