]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
x86/mm: account for the offset when performing subpage r/o MMIO access
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 9 Apr 2025 16:51:31 +0000 (18:51 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Tue, 15 Apr 2025 14:01:48 +0000 (16:01 +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>
xen/arch/x86/mm.c

index 4fecd37aeca068844810c0889b2d1af7e93eec1d..1cf23651678987f8e0724ebd5386bfef10db7508 100644 (file)
@@ -5131,6 +5131,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1: