mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/msi: Refactor msi_compose_message() to not require an irq_desc
Subsequent changes will cause HPET MSIs to not have an associated IRQ. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Tim Deegan <tim@xen.org>
This commit is contained in:
1 parent
5bf1f7ba5c
commit
ac6e1ae87b
4 files changed
+8
-8
No files matched your search
+1
-1
@@ -331,7 +331,7 @@ static int __hpet_setup_msi_irq(struct irq_desc *desc)
|
||||
{
|
||||
struct msi_msg msg;
|
||||
|
||||
msi_compose_msg(desc, &msg);
|
||||
msi_compose_msg(desc->arch.vector, desc->arch.cpu_mask, &msg);
|
||||
return hpet_msi_write(desc->action->dev_id, &msg);
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -124,13 +124,12 @@ static void msix_put_fixmap(struct arch_msix *msix, int idx)
|
||||
/*
|
||||
* MSI message composition
|
||||
*/
|
||||
void msi_compose_msg(struct irq_desc *desc, struct msi_msg *msg)
|
||||
void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg *msg)
|
||||
{
|
||||
unsigned dest;
|
||||
int vector = desc->arch.vector;
|
||||
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
if ( !cpumask_intersects(desc->arch.cpu_mask, &cpu_online_map) ) {
|
||||
if ( !cpumask_intersects(cpu_mask, &cpu_online_map) ) {
|
||||
dprintk(XENLOG_ERR,"%s, compose msi message error!!\n", __func__);
|
||||
return;
|
||||
}
|
||||
@@ -138,7 +137,7 @@ void msi_compose_msg(struct irq_desc *desc, struct msi_msg *msg)
|
||||
if ( vector ) {
|
||||
cpumask_t *mask = this_cpu(scratch_mask);
|
||||
|
||||
cpumask_and(mask, desc->arch.cpu_mask, &cpu_online_map);
|
||||
cpumask_and(mask, cpu_mask, &cpu_online_map);
|
||||
dest = cpu_mask_to_apicid(mask);
|
||||
|
||||
msg->address_hi = MSI_ADDR_BASE_HI;
|
||||
@@ -491,7 +490,7 @@ int __setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc,
|
||||
|
||||
desc->msi_desc = msidesc;
|
||||
desc->handler = handler;
|
||||
msi_compose_msg(desc, &msg);
|
||||
msi_compose_msg(desc->arch.vector, desc->arch.cpu_mask, &msg);
|
||||
return write_msi_msg(msidesc, &msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -1039,7 +1039,7 @@ static void dma_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
|
||||
return;
|
||||
}
|
||||
|
||||
msi_compose_msg(desc, &msg);
|
||||
msi_compose_msg(desc->arch.vector, desc->arch.cpu_mask, &msg);
|
||||
/* Are these overrides really needed? */
|
||||
if (x2apic_enabled)
|
||||
msg.address_hi = dest & 0xFFFFFF00;
|
||||
|
||||
@@ -231,7 +231,8 @@ struct arch_msix {
|
||||
};
|
||||
|
||||
void early_msi_init(void);
|
||||
void msi_compose_msg(struct irq_desc *, struct msi_msg *);
|
||||
void msi_compose_msg(unsigned vector, const cpumask_t *mask,
|
||||
struct msi_msg *msg);
|
||||
void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
|
||||
void mask_msi_irq(struct irq_desc *);
|
||||
void unmask_msi_irq(struct irq_desc *);
|
||||
|
||||