Re: [PATCH] arm64: PCI: Validate the node before setting node id for root bus

From: Lorenzo Pieralisi
Date: Thu Nov 12 2020 - 12:05:56 EST


[+Jonathan]

On Mon, Nov 09, 2020 at 08:27:09PM +0800, Baolin Wang wrote:

[...]

> I did some investigation for this issue. I am sorry I made some
> misleading description in the commit message. The issue is, when we
> want to disable the NUMA from firmware, we usually just remove the SRAT
> table from the BIOS. But the devices' proximity domain information is
> still remain in the ACPI tables.

I understand and it should not.

> For example, the IORT table still contains the proximity domain
> information for the SMMU devices, so in this case, the SMMU devices still
> can get incorrect NUMA nodes if we remove the SRAT table. But
> the SMMU devices will validate the numa node in
> arm_smmu_v3_set_proximity() to avoid this issue.
>
> static int __init arm_smmu_v3_set_proximity(struct device *dev,
> struct acpi_iort_node *node)
> {
> struct acpi_iort_smmu_v3 *smmu;
>
> smmu = (struct acpi_iort_smmu_v3 *)node->node_data;
> if (smmu->flags & ACPI_IORT_SMMU_V3_PXM_VALID) {
> int dev_node = pxm_to_node(smmu->pxm);
>
> if (dev_node != NUMA_NO_NODE && !node_online(dev_node))
> return -EINVAL;
>
> set_dev_node(dev, dev_node);
> pr_info("SMMU-v3[%llx] Mapped to Proximity domain %d\n",
> smmu->base_address,
> smmu->pxm);
> }
> return 0;
> }
>
> So similar with SMMU devices, the DSDT table will still contain the PCI
> root host devices' proximity domain though we already remove the SRAT
> table. So I think we still need this validation in
> pcibios_root_bridge_prepare() to avoid this issue like other devices did.
No. The right thing to do is to fix the PXM handling and that's what
Jonathan did:

https://lore.kernel.org/linux-mm/20200818142430.1156547-2-Jonathan.Cameron@xxxxxxxxxx

Can you try booting with v5.10-rc* and report back the *full* boot log
please ?

> I can update the commit message in next version if you think this is
> reasonable. Thanks.

See above.

Thanks,
Lorenzo