[PATCH 1/2] target/i386: emulate: set PG_ERROR_W_MASK as expected

Mohamed Mediouni posted 2 patches 1 week, 2 days ago
Maintainers: Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Wei Liu <wei.liu@kernel.org>
[PATCH 1/2] target/i386: emulate: set PG_ERROR_W_MASK as expected
Posted by Mohamed Mediouni 1 week, 2 days ago
Make setting PG_ERROR_W_MASK no longer dependent on the access
being a priv violation.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
---
 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 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) {
-- 
2.50.1 (Apple Git-155)