Commit a003cd280e for qemu.org
commit a003cd280eb61b04f72c13f02687e02c5f15c74c
Author: Mohamed Mediouni <mohamed@unpredictable.fr>
Date: Wed Mar 25 00:00:15 2026 +0100
target/i386: emulate: set PG_ERROR_W_MASK as expected
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>
diff --git a/target/i386/emulate/x86_mmu.c b/target/i386/emulate/x86_mmu.c
index ba0ebe4268..1aa373f5b3 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) {