[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm: scan CLIDR Ctype fields upwards when probing LLC
- To: Mykola Kvach <xakep.amatop@xxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Fri, 15 May 2026 11:50:05 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gmail.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RQ1DQe1F9Ha1zKGB0iIc/Qjo0CwP1ZEYCWbR7VWO6/o=; b=nTMhZQofcefzl6g8/LzvdMEs3Oqy6UWFFfVcFLkoZ5xiTGphXu8KVGcg0OU55kK6Xsy+Z0CZr6Bmaxu2J460XkLTqQzJoNHTC98q9C4f2k/IrwsR6R46LXkWpdXDhs2lw7g28W4Tdcxknw2wpfJR27oKXvKCd97b9MtDDOQwyEUtnjLZenBOmqOwA/vJKWbkjX1iUjf7RxTNpfxZN0OIXiX4qVl2SVP9ppMZHFNCa2Ypy4PmcE13a7BEr5jJKEwRAqr7uve93ga88mk973ls/JCqMaNrWXWUNJtBD37drilL86LLFK1akkfZNQa1vt21OkDja8GVGYXzzTfCm1Q72g==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RQ1DQe1F9Ha1zKGB0iIc/Qjo0CwP1ZEYCWbR7VWO6/o=; b=inVqhfg7F8431hQ3Z+yaMHknJkJC6WPqrqdbn873T2OpwCcDP9Q6TG1dKqhuS82HgeCk4se7xgqkUsDKEa/hn4O0yx3Gb4r6AanpyATirf8USbCfuKVIumUYIo7lFtBsUoSyTNT8h5fOf7xsWA4kV5JBU8Qn7RspTxta2Om9UOeuiOxto76gUwHSJSvzssNyRc7h/tZYwVue5JIiQs/jdQKabLI0bHcjq2mQfTJSXnp7+KYx7noixiDl43V6J8pd3c+CJIQHt2S37by2l7lNW/gvbQMm/pJB7H4UcQHIi9IryDWM7IcB6WEsaTmS7gp9OJOTZngr2tr1Qx5X5q/VDQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=D7VSCEti2Q0x02HqzENpwga+4rOZjJfYp3nlvanNMzVR0Ovdkbh9R2sBhEcmXOK9Dhz39yCDtZVG1PiEI5TaBx7D4F8D9ZJYj0bOyk/YTSd2D0mvlMc4ckDCDgX8M3nBK8ahCv8ON/g4JJ07qSl5q7EO+LSytv+4nS+jO86sO9sd7CA9vx3c5IFpxB9NEBSOzc8nMPMYGKqKkHetPNDwFLQHqQAbx7u99NC0Ntbl0bSP31UHiVmHye7J/zn8+ocEOZZzXhSb7Kewy9uPcxHqgh0d76YoZRib2ZKmSLZq+gJkRnm03TZc5TjURZqrV1MXF98WLB5iXWYBBHAa29Ooyg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qZhCMJUKpESbj8YAcvhMRSTRr0DqEBpdjXQ+8Z20QHHZ/C2843Kg8E/tw0g0VLqxUO/xI674eG/E9QKcUc+rZ1deRCmITOxXKAjdOf34NsvGQolndwMMNXYQrBeDB8t68GQmHpa7z8mtKlDpdhJgqN194GRud0LN32TkhWsUN7F/001P8jL2ve3QLfaucjHBsgspw0HHR9oRNQ+AFLv7wIPO+J1x6LWaPcOTuFQu0iyDBypwME4k/YQRSyArYaAGyV38iMztj8MR6wKvHo+0wr6xpW1jbbwe/5aUSjHCQeFR/my28Yt68QYNJCc+Wy+/2BH+cQ1mzoG0UiOui9uluA==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Mykola Kvach <mykola_kvach@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 15 May 2026 11:51:31 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Thread-index: AQHc26dpSVe9fegCuUahO/LG6twV8rYPCn6A
- Thread-topic: [PATCH] xen/arm: scan CLIDR Ctype fields upwards when probing LLC
Hi Mykola,
> On 4 May 2026, at 10:19, Mykola Kvach <xakep.amatop@xxxxxxxxx> wrote:
>
> From: Mykola Kvach <mykola_kvach@xxxxxxxx>
>
> get_llc_way_size() currently scans CLIDR_EL1 Ctype fields from the
> highest level downwards and stops at the first unified cache it finds.
>
> However, CLIDR_EL1 describes the cache hierarchy from Ctype1 upwards.
> Arm ARM DDI 0487J.a, D19.2.27 says that once software has seen a
> Ctype value of 0b000 while reading from Ctype1 upwards, no caches
> manageable by the architected set/way maintenance instructions exist at
> further-out levels, and the higher Ctype fields must be ignored.
>
> The current reverse scan can therefore select a unified cache level from
> a Ctype field above the first no-cache level. Such a field is not part of
> the architecturally described CLIDR/CCSIDR cache hierarchy and should not
> be used for selecting the CCSIDR level.
>
> Scan Ctype fields from L1 upwards, stop at the first no-cache level, and
> keep the outermost unified cache observed before that point.
>
> This preserves the result for regular cache hierarchies, while avoiding
> selection of an architecturally ignored Ctype field.
>
> Fixes: f4985fce6f0b ("xen/arm: add initial support for LLC coloring on arm64")
> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> ---
> This patch follows the xen-devel discussion:
> https://lists.xenproject.org/archives/html/xen-devel/2026-01/msg00345.html
>
> In that thread, Michal noted that the reverse scan was a simplification
> rather than an intentional requirement, and that changing the
> implementation would be fine.
>
> Testing performed:
> - standalone synthetic CLIDR tests covered both regular and pathological
> Ctype sequences and showed that the forward scan ignores unified cache
> levels above the first Ctype == 0b000 while the reverse scan can pick
> them
> - Renesas H3ULCB booted with llc-coloring=on
> ---
The changes looks ok to me
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Cheers,
Luca
|