Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: src/trusted/validator_ragel/validator.py

Issue 1234393005: A mechanism to identify/forbid/"rewrite" non-temporal instructions (and other) (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Fixing nits Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_ragel/validator.py
diff --git a/src/trusted/validator_ragel/validator.py b/src/trusted/validator_ragel/validator.py
index 2a27c44c86d5c89e35a8ac15c6f02b78d84c6b13..0bf0363f8330b57cdab5d40697423d6783bede69 100644
--- a/src/trusted/validator_ragel/validator.py
+++ b/src/trusted/validator_ragel/validator.py
@@ -14,7 +14,8 @@ import objdump_parser
# Some constants from validator.h
-VALIDATION_ERRORS_MASK = 0x01ffc000
+VALIDATION_ERRORS_MASK = 0x05ffc000
+UNSUPPORTED_INSTRUCTION = 0x04000000
BAD_JUMP_TARGET = 0x40000000
RESTRICTED_REGISTER_MASK = 0x00001f00
@@ -176,6 +177,10 @@ class Validator(object):
end_index = ctypes.cast(end, ctypes.c_void_p).value - data_addr
callback(begin_index, end_index, info)
+ # UNSUPPORTED_INSTRUCTION indicates validator failure only for pnacl-mode.
+ # Since by default we are in non-pnacl-mode, the flag is simply cleared.
+ info &= ~UNSUPPORTED_INSTRUCTION
+
# See validator.h for details
if info & (VALIDATION_ERRORS_MASK | BAD_JUMP_TARGET) != 0:
return 0

Powered by Google App Engine
This is Rietveld 408576698