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

Unified Diff: src/trusted/service_runtime/sel_validate_image.c

Issue 9535001: Add validation caching interface. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Bugfix Created 8 years, 10 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/service_runtime/sel_validate_image.c
diff --git a/src/trusted/service_runtime/sel_validate_image.c b/src/trusted/service_runtime/sel_validate_image.c
index b08b2312a7743f7bb6d9be7fc24563e15e79c010..e16ba10b9a4cdc5ba5d69ee15dcd11f097d71b0e 100644
--- a/src/trusted/service_runtime/sel_validate_image.c
+++ b/src/trusted/service_runtime/sel_validate_image.c
@@ -29,7 +29,14 @@ int NaClValidateCode(struct NaClApp *nap, uintptr_t guest_addr,
uint8_t *data, size_t size) {
NaClValidationStatus status = NaClValidationSucceeded;
enum NaClSBKind sb_kind = NACL_SB_DEFAULT;
+
+ NaClValidationCache *cache = nap->validation_cache;
+ void * cache_context = nap->validation_cache_context;
Mark Seaborn 2012/02/29 21:33:34 Spacing style
Nick Bray (chromium) 2012/02/29 22:58:09 Done.
+
if (nap->validator_stub_out_mode) {
+ /* Validation caching is currently incompatable with stubout. */
Mark Seaborn 2012/02/29 21:33:34 'incompatible'
Nick Bray (chromium) 2012/02/29 22:58:09 Done.
+ cache = NULL;
+ cache_context = NULL;
/* In stub out mode, we do two passes. The second pass acts as a
sanity check that bad instructions were indeed overwritten with
allowable HLTs. */
@@ -39,7 +46,8 @@ int NaClValidateCode(struct NaClApp *nap, uintptr_t guest_addr,
sb_kind,
NaClApplyValidationDoStubout,
guest_addr, data, size,
- nap->bundle_size, &nap->cpu_features);
+ nap->bundle_size, &nap->cpu_features,
+ cache, cache_context);
}
if (status == NaClValidationSucceeded) {
status = NACL_SUBARCH_NAME(ApplyValidator,
@@ -48,7 +56,8 @@ int NaClValidateCode(struct NaClApp *nap, uintptr_t guest_addr,
sb_kind,
NaClApplyCodeValidation,
guest_addr, data, size,
- nap->bundle_size, &nap->cpu_features);
+ nap->bundle_size, &nap->cpu_features,
+ cache, cache_context);
}
return NaClValidateStatus(status);
}

Powered by Google App Engine
This is Rietveld 408576698