[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] x86/ioapic: Check 1k alignment for IO-APIC physical addresses
commit ee34444712999069cad457dd1792ea0921994c22 Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> AuthorDate: Wed Aug 5 12:39:30 2020 +0100 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Tue Nov 21 13:28:51 2023 +0000 x86/ioapic: Check 1k alignment for IO-APIC physical addresses The MP spec requires a minimum of 1k alignment. So too does Xen's use of a single fixmap page to map the IO-APIC. Reject out-of-spec values so we don't end up in a position where a bad firmware value causes Xen to use the wrong mapping. Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- xen/arch/x86/io_apic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 0ef61fb2f1..d11c880544 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2589,10 +2589,11 @@ static void __init ioapic_init_mappings(void) union IO_APIC_reg_01 reg_01; paddr_t ioapic_phys = mp_ioapics[i].mpc_apicaddr; - if ( !ioapic_phys ) + if ( !ioapic_phys || !IS_ALIGNED(ioapic_phys, KB(1)) ) { printk(KERN_ERR - "WARNING: bogus zero IO-APIC address found in MPTABLE, disabling IO/APIC support!\n"); + "WARNING: bogus IO-APIC address %08lx found in MPTABLE, disabling IO-APIC support\n", + ioapic_phys); smp_found_config = false; skip_ioapic_setup = true; break; -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |