x86/mmcfg/drhd: Move acpi_mmcfg_init() call before calling acpi_parse_dmar()
Ok, that make sense for me. Thanks for your detailed explanation, I will rewrite the patch next week.
Sent from mobile
Quoted 44 lines · 2018年8月17日 20:28于 Jan Beulich <[email protected]>写道:
Quoted 11 lines
Quoted 2 lines
Quoted 2 lines · On 17.08.18 at 09:01, <[email protected]> wrote:
pci_conf_read8()needs pci mmcfg mapping to work on multiple pci segments system such as HPE Superdome-Flex.Move
acpi_mmcfg_init()call inacpi_boot_init()before callingacpi_parse_dmar()so that whenpci_conf_read8()is called inacpi_parse_dev_scope(), we already have the mapping set up.
acpi_mmcfg_init()only setup mmcfg mapping and has some global variables initialized so there is no hazard to move it ahead.I'm afraid this is a gross understatement. "Setup mappings" alone is already putting such movement under question. Have you checked explicitly that the initialization needed for this setting up of mappings, if any, has actually occurred before the new point the function gets called?
In particular,
mmio_ro_rangeslooks to get set up only after the call toacpi_boot_init(). I guess you didn't see a crash solely because you also move the invocation across the call tozap_low_mappings().Similary
pci_mmcfg_check_hostbridge()doesn't look all that trivial.Please may I ask that you be quite a bit more careful here, even more so when you've been warned already?
Quoted 8 lines
Meanwhile from its
name,acpi_boot_init()is a proper place to call it.The alternative is moving the
acpi_parse_dev_scope()call to a later point afteracpi_mmcfg_init(). Butacpi_parse_one_drhd(),acpi_parse_one_rmrr()andacpi_parse_one_atsr()all calledacpi_parse_dev_scope()as their main job. Splitting those functions to two pieces looks less optimal and meaningless.Certainly not meaningless; I'm also not sure why you consider the device scope parsing their main job. It's perhaps their most involved part, but the fact alone that for the purposes here we could probably get away without that part already suggests to me that this is a secondary (yet necessary) aspect.
Quoted 9 lines
Furthermore MMCFG will continue to not work this early (or more precisely not at all until Dom0 boot has progressed far enough) if the range(s) isn't/aren't marked reserved in E820. It would be worthwhile saying half a sentence to this effect in the description.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel