HPET patches
cover HPET patches
This reduced series consists of the non-contentious and tangential patchs from my large HPET series, which have undergone one round of review already. They are now in a state where I believe they can go straight in.
I am currently in the process of trying to adjust the remainder of the series and strip small indepent changes out of the mamoth patch, in an effort to reduce its complexity.
PATCH 1/3 x86/acpi: Warn about multiple HPET tables
--- xen/arch/x86/acpi/boot.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
xen/arch/x86/acpi/boot.c +16 -0
@@ -289,6 +289,22 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)return -1 ; } +/* +* Some BIOSes provide multiple HPET tables. Sometimes this is a BIOS +* bug; the intended way of supporting more than 1 HPET is to use AML +* entries. +* +* If someone finds a real system with two genuine HPET tables, +* perhaps they will be kind and implement support. Until then +* however, warn that we will ignore subsequent tables. +*/ +if ( hpet_address ) + { + printk(KERN_WARNING PREFIX + "Found multiple HPET tables. Only using first\n"); +return -1 ; + } + hpet_address = hpet_tbl->address.address; hpet_blockid = hpet_tbl->sequence; printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
Signature · 1 line
1.7.10.4
PATCH 2/3 x86/hpet: Fix ambiguity in broadcast info message
In reply to Andrew Cooper"$N will be used for broadcast" is ambiguous between "$N timers" or "timer $N", particuarly when N is 0.
--- xen/arch/x86/hpet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/hpet.c +2 -2
@@ -430,8 +430,8 @@ static void __init hpet_fsb_cap_lookup(void) num_hpets_used++; } -printk (XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n" , - num_chs, num_hpets_used); +printk (XENLOG_INFO "HPET: %u timers usable for broadcast (%u total)\n" , + num_hpets_used, num_chs); }static struct hpet_event_channel *hpet_get_channel (unsigned int cpu)
Signature · 1 line
1.7.10.4
PATCH 3/3 x86/msi: Refactor msi_compose_message() to not require an irq_desc
In reply to Andrew CooperSubsequent changes will cause HPET MSIs to not have an associated IRQ.
--- xen/arch/x86/hpet.c | 2 +- xen/arch/x86/msi.c | 9 ++++----- xen/drivers/passthrough/vtd/iommu.c | 2 +- xen/include/asm-x86/msi.h | 3 ++- 4 files changed, 8 insertions(+), 8 deletions(-)
xen/arch/x86/hpet.c +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); }
xen/arch/x86/msi.c +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); }
xen/drivers/passthrough/vtd/iommu.c +1 -1
@@ -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 ;
xen/include/asm-x86/msi.h +2 -1
@@ -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 *);
Signature · 1 line
1.7.10.4
Quoted 9 lines · Andrew Cooper
This reduced series consists of the non-contentious and tangential patchs from my large HPET series, which have undergone one round of review already. They are now in a state where I believe they can go straight in.
I am currently in the process of trying to adjust the remainder of the series and strip small indepent changes out of the mamoth patch, in an effort to reduce its complexity.
Signed-off-by Andrew Cooper <[email protected]>