[PULL 18/19] target/i386: emulate: set PG_ERROR_W_MASK as expected

Paolo Bonzini posted 19 patches 1 week, 1 day ago
There is a newer version of this series
[PULL 18/19] target/i386: emulate: set PG_ERROR_W_MASK as expected
Posted by Paolo Bonzini 1 week, 1 day ago
From: Mohamed Mediouni <mohamed@unpredictable.fr>

Make setting PG_ERROR_W_MASK no longer dependent on the access
being a priv violation.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260324230016.80914-2-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/emulate/x86_mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/emulate/x86_mmu.c b/target/i386/emulate/x86_mmu.c
index ba0ebe4268d..1aa373f5b38 100644
--- a/target/i386/emulate/x86_mmu.c
+++ b/target/i386/emulate/x86_mmu.c
@@ -248,7 +248,7 @@ static int translate_res_to_error_code(MMUTranslateResult res, bool is_write, bo
     if (!(res & MMU_TRANSLATE_PAGE_NOT_MAPPED)) {
         error_code |= PG_ERROR_P_MASK;
     }
-    if (is_write && (res & MMU_TRANSLATE_PRIV_VIOLATION)) {
+    if (is_write) {
         error_code |= PG_ERROR_W_MASK;
     }
     if (res & MMU_TRANSLATE_INVALID_PT_FLAGS) {
-- 
2.53.0