[4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing
PATCH 1/1 [4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing
While commit XXXXXXXXXXXX ("x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing") deals with apic_x2apic_probe() as called from x2apic_bsp_setup(), the check_x2apic_preenabled() path is similarly
affected: The call needs to occur after acpi_boot_init() (which is what calls acpi_iommu_init()), such that iommu_intremap getting disabled there can be properly taken into account by apic_x2apic_probe().
---
Based on code inspection only - I have no affected system and hence no way to actually test the case.
xen/arch/x86/setup.c +7 -2
@@ -1694,8 +1694,6 @@ void __init noreturn __start_xen(unsignedmi_scan_machine (); -generic_apic_probe (); - mmio_ro_ranges =rangeset_new (NULL ,"r/o mmio ranges" , RANGESETF_prettyprint_hex);
@@ -1705,6 +1703,13 @@ void __init noreturn __start_xen(unsigneacpi_boot_init (); +/* +* Requires initial ACPI table parsing to have happened, such that +* check_x2apic_preenabled() would be able to observe acpi_iommu_init()'s +* findings, in particular it turning off iommu_intremap. +*/ +generic_apic_probe (); +if ( smp_found_config )get_smp_config ();
Quoted 8 lines · Jan Beulich
While commit XXXXXXXXXXXX ("x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing") deals with
apic_x2apic_probe()as called fromx2apic_bsp_setup(), thecheck_x2apic_preenabled()path is similarly
affected: The call needs to occur afteracpi_boot_init()(which is what callsacpi_iommu_init()), such thatiommu_intremapgetting disabled there can be properly taken into account byapic_x2apic_probe().Signed-off-by Jan Beulich <[email protected]>
LGTM. I cannot find any dependency between acpi_boot_init and having initialized the apic.
Thanks, Roger.
Quoted 8 lines · Roger Pau Monné
Quoted 7 lines · Jan Beulich
While commit XXXXXXXXXXXX ("x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing") deals with
apic_x2apic_probe()as called fromx2apic_bsp_setup(), thecheck_x2apic_preenabled()path is similarly
affected: The call needs to occur afteracpi_boot_init()(which is what callsacpi_iommu_init()), such thatiommu_intremapgetting disabled there can be properly taken into account byapic_x2apic_probe().
Quoted 4 lines
Quoted 1 line
Signed-off-by Jan Beulich <[email protected]>LGTM. I cannot find any dependency between
acpi_boot_initand having initialized the apic.
Sadly there is, and I've now learned that when believing I would test the change yesterday I actually didn't (or else I would have spotted the problem that I've spotted now), and instead I did boot an older
binary: acpi_process_madt() calls clustered_apic_check() and hence relies on genapic to have got filled before.
I'll have to see if I can come up with some variant avoiding the issue, but I suspect that's not going to be 4.16 material anymore then. My first try is likely going to be to simply pull out acpi_iommu_init() from acpi_boot_init().
Jan
Re: [PATCH][4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing [and 1 more messages]
In reply to Jan BeulichJan Beulich writes ("[PATCH][4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing"):
Quoted 11 lines
While commit XXXXXXXXXXXX ("x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing") deals with
apic_x2apic_probe()as called fromx2apic_bsp_setup(), thecheck_x2apic_preenabled()path is similarly
affected: The call needs to occur afteracpi_boot_init()(which is what callsacpi_iommu_init()), such thatiommu_intremapgetting disabled there can be properly taken into account byapic_x2apic_probe().Signed-off-by Jan Beulich <[email protected]>---
Based on code inspection only - I have no affected system and hence no way to actually test the case.
Do we have any tests for this ? I see it's tagged for 4.16 (and I'm favourably inclined) but I'm not sure I follow the implications.
Roger Pau Monné writes ("Re: [PATCH][4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing"):
Quoted 4 lines
LGTM. I cannot find any dependency between
acpi_boot_initand having initialized the apic.Reviewed-by Roger Pau Monné <[email protected]>
Thanks,
Ian.
Re: [PATCH][4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing [and 1 more messages]
Quoted 8 lines · Ian Jackson
Jan Beulich writes ("[PATCH][4.16] x86/x2APIC: defer probe until after IOMMU ACPI table parsing"):
Quoted 7 lines
While commit XXXXXXXXXXXX ("x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing") deals with
apic_x2apic_probe()as called fromx2apic_bsp_setup(), thecheck_x2apic_preenabled()path is similarly
affected: The call needs to occur afteracpi_boot_init()(which is what callsacpi_iommu_init()), such thatiommu_intremapgetting disabled there can be properly taken into account byapic_x2apic_probe().
Quoted 6 lines
Quoted 4 lines
Signed-off-by Jan Beulich <[email protected]>---
Based on code inspection only - I have no affected system and hence no way to actually test the case.Do we have any tests for this ?
If you mean in osstest, then I'm unaware of any, but I also don't have a clear view on how much x2APIC-capable hardware we have, and whether among those there are any where the firmware pre-enables x2APIC.
Quoted 2 lines
I see it's tagged for 4.16 (and I'm
favourably inclined) but I'm not sure I follow the implications.
The main aspect here is: This is the other side of the medal as to the referenced earlier change (which I did commit an hour or so ago).
Jan