Re: [PATCH] arm64: acpi: reenumerate topology ids

From: Jeffrey Hugo
Date: Mon Jul 02 2018 - 10:58:56 EST

On 6/29/2018 9:46 AM, Andrew Jones wrote:
On Fri, Jun 29, 2018 at 02:29:34PM +0100, Sudeep Holla wrote:
If it matters a lot, vendors must use UID for consistency. Since OS doesn't
use those IDs for any particular reason, OS must not care.

That depends. If you look at how topology_logical_package_id() is used in
x86 code you'll see it gets used as an index to an array in a couple
places. If we don't remap arbitrary IDs to counters than we may miss out
on some opportunities to avoid lists.

Also, we're talking about what's visible to users. I think it's much more
likely to break a user app by exposing topology IDs that have values
greater than the linear CPU numbers (even though properly written apps
shouldn't expect them to be strictly <=), than the opposite.

Libvirt has the assumption already that the sysfs numbers correspond to linear CPU numbers, and has an arbitrary limit of 4k. When spinning up a VM, if libvirt sees a CPU ID > 4k, it fails to init the VM since it assumes the host has more than 4k CPUs, which is unsupported.

We found this when we were making our UIDs to be the same as MPIDR in MADT. We changed our UIDs to be sequential 0-N numbering to workaround the issue.

Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.