Hi James,
The way I read the spec, these IDs are inclusive. PARTID_MAX : Maximum supported value of PARTID so 0..PARTID_MAX and hence PARTID_MAX + 1 partitions....
whereas a lot of the structures you allocate and the interactions over them don't add 1 to get the number of elements.
For example I think it should be valid (if odd) to narrow to 1 ID. Currently that results in a zero sized allocation and cat /sys/fs/resctrl/schemata goes boom with predictable null pointer derefernce in resctrl_arch_get_config
The note about the fact that partid 0 should be hidden from the userspace control (as it potentially includes the kernel) is fair enough, but having a situation where it goes boom isn't good in the meantime.
Looks like in a lot of cases the memory allocations are big enough (by luck) that we don't get a segfault making the issue harder to spot, but they are still running over the range that was intentionally initialized.
Of course I might be missing some subtlety in my emulation.
Jonathan