提交 bbd8bb8e 编写于 作者: C Cornelia Huck

s390x/kvm: inject via flic

Try to inject floating interrupts via the flic if it is available.
This allows us to inject the full range of floating interrupts.
Reviewed-by: NJens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
上级 de13d216
...@@ -117,6 +117,16 @@ static int flic_enqueue_irqs(void *buf, uint64_t len, ...@@ -117,6 +117,16 @@ static int flic_enqueue_irqs(void *buf, uint64_t len,
return rc ? -errno : 0; return rc ? -errno : 0;
} }
int kvm_s390_inject_flic(struct kvm_s390_irq *irq)
{
static KVMS390FLICState *flic;
if (unlikely(!flic)) {
flic = KVM_S390_FLIC(s390_get_flic());
}
return flic_enqueue_irqs(irq, sizeof(*irq), flic);
}
/** /**
* __get_all_irqs - store all pending irqs in buffer * __get_all_irqs - store all pending irqs in buffer
* @flic: pointer to flic device state * @flic: pointer to flic device state
......
...@@ -365,6 +365,7 @@ void kvm_s390_virtio_irq(int config_change, uint64_t token); ...@@ -365,6 +365,7 @@ void kvm_s390_virtio_irq(int config_change, uint64_t token);
void kvm_s390_service_interrupt(uint32_t parm); void kvm_s390_service_interrupt(uint32_t parm);
void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq); void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq);
void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq); void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq);
int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
#else #else
static inline void kvm_s390_reset_vcpu(S390CPU *cpu) static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
{ {
......
...@@ -623,7 +623,7 @@ void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq) ...@@ -623,7 +623,7 @@ void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq)
} }
} }
void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq) static void __kvm_s390_floating_interrupt(struct kvm_s390_irq *irq)
{ {
struct kvm_s390_interrupt kvmint = {}; struct kvm_s390_interrupt kvmint = {};
int r; int r;
...@@ -641,6 +641,23 @@ void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq) ...@@ -641,6 +641,23 @@ void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq)
} }
} }
void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq)
{
static bool use_flic = true;
int r;
if (use_flic) {
r = kvm_s390_inject_flic(irq);
if (r == -ENOSYS) {
use_flic = false;
}
if (!r) {
return;
}
}
__kvm_s390_floating_interrupt(irq);
}
void kvm_s390_virtio_irq(int config_change, uint64_t token) void kvm_s390_virtio_irq(int config_change, uint64_t token)
{ {
struct kvm_s390_irq irq = { struct kvm_s390_irq irq = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册