mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
Implement irqfd that deliver msi to vCPU and vCPU dmsintc irq injection. Add pch_msi_set_irq() choice dmsintc to set msi irq by the msg_addr and implement dmsintc set msi irq. Signed-off-by: Song Gao <gaosong@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
28 lines
639 B
C
28 lines
639 B
C
/* 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
|