Re: [PATCH v10 12/12] x86/resctrl: Add MMIO-based LLC occupancy monitoring support
From: Reinette Chatre
Date: Wed Dec 02 2026 - 14:13:58 EST
Hi Chenyu,
On 11/29/26 4:16 AM, Chen Yu wrote:
> On Wed, Nov 25, 2026 at 11:13:11AM -0800, Reinette Chatre wrote:
>> On 11/5/26 2:10 AM, Chen Yu wrote:
...
>>> +
>>> +static int erdt_read_l3_occupancy(const struct erdt_domain_info *d, u32 rmid, u64 *val)
>>> +{
>>> + struct acpi_erdt_cmrc *cmrc;
>>> + u64 l3_cmt_count;
>>> + u32 offset;
>>> +
>>> + cmrc = d->cmrc;
>>> + if (!cmrc)
>>> + return -EIO;
>>> +
>>> + offset = cmrc_index_function_1(cmrc, rmid);
>>> + if (offset + sizeof(u64) > (u64)cmrc->cmt_reg_size * SZ_4K)
>>> + return -EINVAL;
>>
>> This looks like an out-of-bounds issue for which -EIO is more appropriate
>> since it is translated to user space as "Error" instead of the
>> "Unavailable" that -EINVAL produces?
>>
>
> OK, do you mean the ACPI table parsing error should generally return -EIO?
If it is a permanent error, yes. -EINVAL translates to "Unavailable" from
which user space can expect the system to recover.
> Let me check all the code in erdt.c and adjust it accordingly.
Thank you.
Reinette