From 38d07809794e3c723a4de7e10c25c1f6cb590dc6 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Wed, 9 Apr 2025 18:51:31 +0200 Subject: [PATCH] x86/mm: account for the offset when performing subpage r/o MMIO access MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The current logic in subpage_mmio_write_emulate() doesn't take into account the page offset, and always performs the writes at offset 0 (start of the page). Fix this by accounting for the offset before performing the write. Fixes: 8847d6e23f97 ('x86/mm: add API for marking only part of a MMIO page read only') Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper --- xen/arch/x86/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 4fecd37aec..1cf2365167 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5131,6 +5131,7 @@ static void subpage_mmio_write_emulate( return; } + addr += offset; switch ( len ) { case 1: -- 2.39.5