From e39831f5906f5e5536eea7d7ffb8d167dfb7e959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Date: Tue, 13 Jan 2026 15:41:33 +0100 Subject: [PATCH] xen/mm: reject XENMEM_claim_pages when using LLC coloring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The coloring allocator ignores claims; reject the usage of the hypercall if LLC coloring is enabled. Note that the usage of alloc_color_heap_page() is selected at boot time, and it's a system wide decision. Once enabled all domains will use alloc_color_heap_page() for allocations, which ignores any outstanding claims. The hypercall can be enabled if/when LLC coloring is adjusted to support claims. Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains") Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper master commit: b068cafc737d51c76b40d3f9f821017bfa15814c master date: 2026-01-07 15:54:33 +0100 --- xen/common/memory.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/common/memory.c b/xen/common/memory.c index 3688e6dd50..3cb6fa9495 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -1660,6 +1661,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg) break; case XENMEM_claim_pages: + if ( llc_coloring_enabled ) + return -EOPNOTSUPP; + if ( unlikely(start_extent) ) return -EINVAL;