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

Unified Diff: src/trusted/validator_ragel/dfa_validate_64.c

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/dfa_validate_64.c
diff --git a/src/trusted/validator_ragel/dfa_validate_64.c b/src/trusted/validator_ragel/dfa_validate_64.c
index d2d971626bfd37b9064ba7c1b2adbcff002ec47d..f91d36fe95be581edacec83c3c3a303e2dec2f6e 100644
--- a/src/trusted/validator_ragel/dfa_validate_64.c
+++ b/src/trusted/validator_ragel/dfa_validate_64.c
@@ -30,6 +30,7 @@ static NaClValidationStatus ApplyDfaValidator_x86_64(
uint8_t *data,
size_t size,
int stubout_mode,
+ uint32_t flags,
int readonly_text,
const NaClCPUFeatures *f,
const struct NaClValidationMetadata *metadata,
@@ -37,8 +38,10 @@ static NaClValidationStatus ApplyDfaValidator_x86_64(
/* TODO(jfb) Use a safe cast here. */
NaClCPUFeaturesX86 *cpu_features = (NaClCPUFeaturesX86 *) f;
enum NaClValidationStatus status = NaClValidationFailed;
- int did_stubout = 0;
void *query = NULL;
+ struct StubOutCallbackData callback_data;
+ callback_data.flags = flags;
+ callback_data.did_rewrite = 0;
UNREFERENCED_PARAMETER(guest_addr);
if (stubout_mode)
@@ -72,8 +75,8 @@ static NaClValidationStatus ApplyDfaValidator_x86_64(
status = NaClValidationSucceeded;
} else {
if (ValidateChunkAMD64(data, size, 0 /*options*/, cpu_features,
- NaClDfaStubOutCPUUnsupportedInstruction,
- &did_stubout))
+ NaClDfaStubOutUnsupportedInstruction,
+ &callback_data))
status = NaClValidationSucceeded;
}
@@ -82,7 +85,7 @@ static NaClValidationStatus ApplyDfaValidator_x86_64(
/* Cache the result if validation succeeded and the code was not modified. */
if (query != NULL) {
- if (status == NaClValidationSucceeded && did_stubout == 0)
+ if (status == NaClValidationSucceeded && callback_data.did_rewrite == 0)
cache->SetKnownToValidate(query);
cache->DestroyQuery(query);
}

Powered by Google App Engine
This is Rietveld 408576698