]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: account for the offset when performing subpage r/o MMIO access
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 29 Apr 2025 09:44:04 +0000 (11:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2025 09:44:04 +0000 (11:44 +0200)
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é <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 38d07809794e3c723a4de7e10c25c1f6cb590dc6
master date: 2025-04-15 16:01:48 +0200

xen/arch/x86/mm.c

index e6a61520d5198e1ac7cdb8a57c285295da929eb9..0d242739b1f7d153cb9d736e0356455d4a25faa7 100644 (file)
@@ -5128,6 +5128,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1: