[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.20] x86/mm: account for the offset when performing subpage r/o MMIO access



commit dee15facf81d1f0f6e91ca52eb1f0f8f1b2a20dc
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Apr 29 11:44:04 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 29 11:44:04 2025 +0200

    x86/mm: account for the offset when performing subpage r/o MMIO access
    
    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@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 38d07809794e3c723a4de7e10c25c1f6cb590dc6
    master date: 2025-04-15 16:01:48 +0200
---
 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 e6a61520d5..0d242739b1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5128,6 +5128,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.