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

Issue 10134056: Refactor the process of choosing validators. (Closed)

Created:
8 years, 8 months ago by pasko-google - do not use
Modified:
8 years, 6 months ago
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Refactor the process of choosing validators. On startup make a choice of validator implementation: write the choice as function pointers in NaClApp. This opens a possibility to add more experimental validators (such as MIPS) without having to add platform-specific stub implementations. BUG=http://code.google.com/p/nativeclient/issues/detail?id=2737 TEST=functionality must be left unchanged Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=9009

Patch Set 1 #

Patch Set 2 : The actual refactoring #

Total comments: 19

Patch Set 3 : minor changes relevant to discussion #

Patch Set 4 : draft that does not fully build #

Total comments: 16

Patch Set 5 : decoupled validator from instruction copy #

Patch Set 6 : changes according to review comments #

Patch Set 7 : copyright headers #

Patch Set 8 : fix tests #

Patch Set 9 : resolving compilation issues on win64 and macos #

Patch Set 10 : include more for arm and windows #

Patch Set 11 : no stdint.h on windows, argh #

Patch Set 12 : correct the NACL_WINDOWS check #

Patch Set 13 : fix NACL_WINDOWS check, I was stupid #

Patch Set 14 : upload error retry #

Total comments: 17

Patch Set 15 : portability.h instead of NACL_WINDOWS #

Total comments: 5

Patch Set 16 : gyp, extern, formatting #

Total comments: 3

Patch Set 17 : removed dead includes #

Patch Set 18 : rebased, added a todo for NaClCopyCode #

Total comments: 19

Patch Set 19 : small fixes towards Mark's comments #

Total comments: 26

Patch Set 20 : another round of review: GYP cleanup, minor fixes in comments #

Patch Set 21 : changed testing regex #

Patch Set 22 : tweaks for win64 #

Total comments: 14

Patch Set 23 : more aesthetics #

Unified diffs Side-by-side diffs Delta from patch set Stats (+549 lines, -413 lines) Patch
M site_scons/site_tools/library_deps.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +6 lines, -3 lines 0 comments Download
M src/tools/validator_tools/build.scons View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M src/tools/validator_tools/ncstubout.c View 1 2 3 4 5 1 chunk +2 lines, -4 lines 0 comments Download
M src/trusted/service_runtime/build.scons View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -1 line 0 comments Download
M src/trusted/service_runtime/sel_ldr.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +2 lines, -1 line 0 comments Download
M src/trusted/service_runtime/sel_ldr.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M src/trusted/service_runtime/sel_main.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +0 lines, -6 lines 0 comments Download
M src/trusted/service_runtime/sel_main_chrome.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +0 lines, -5 lines 0 comments Download
M src/trusted/service_runtime/sel_validate_image.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +25 lines, -40 lines 0 comments Download
M src/trusted/service_runtime/service_runtime.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/testdata/dfa_validator_hello.stderr View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/trusted/validator/build.scons View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M src/trusted/validator/ncvalidate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +78 lines, -92 lines 0 comments Download
M src/trusted/validator/validation_cache_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +14 lines, -15 lines 0 comments Download
A src/trusted/validator/validator.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +35 lines, -0 lines 0 comments Download
A src/trusted/validator/validator_init.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +41 lines, -0 lines 0 comments Download
M src/trusted/validator/x86/32/ncvalidate.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +68 lines, -7 lines 0 comments Download
M src/trusted/validator/x86/64/ncvalidate.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +105 lines, -7 lines 0 comments Download
M src/trusted/validator/x86/ncval_seg_sfi/ncdecode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +11 lines, -3 lines 0 comments Download
M src/trusted/validator/x86/ncval_seg_sfi/ncdecode.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -1 line 0 comments Download
M src/trusted/validator/x86/ncval_seg_sfi/ncvalidate.c View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/trusted/validator_arm/cpuid_arm.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/validator_arm/ncvalidate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +40 lines, -28 lines 0 comments Download
M src/trusted/validator_ragel/unreviewed/decoder.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/validator_ragel/unreviewed/dfa_validate_32.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +42 lines, -2 lines 0 comments Download
M src/trusted/validator_ragel/unreviewed/dfa_validate_64.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +42 lines, -2 lines 0 comments Download
M src/trusted/validator_x86/nccopycode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -20 lines 0 comments Download
M src/trusted/validator_x86/nccopycode.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +7 lines, -167 lines 0 comments Download
M src/trusted/validator_x86/ncenuminsts_x86_32.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -1 line 0 comments Download
M src/trusted/validator_x86/ncenuminsts_x86_64.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 36 (0 generated)
pasko-google - do not use
I uploaded this in two parts: 1. patchset1 is identical to https://chromiumcodereview.appspot.com/10174016/ (since depending on ...
8 years, 8 months ago (2012-04-25 13:23:10 UTC) #1
Nick Bray
Updated the BUG= to point to the issue I've been using to track the refactoring. ...
8 years, 8 months ago (2012-04-25 20:57:42 UTC) #2
Nick Bray
Ah, sorry, I misunderstood what you were doing the the patchsets. I assumed the CL ...
8 years, 8 months ago (2012-04-25 21:06:02 UTC) #3
pasko-google - do not use
On 2012/04/25 21:06:02, Nick Bray wrote: > Ah, sorry, I misunderstood what you were doing ...
8 years, 8 months ago (2012-04-26 15:10:09 UTC) #4
pasko-google - do not use
https://chromiumcodereview.appspot.com/10134056/diff/2001/src/trusted/service_runtime/sel_ldr.h File src/trusted/service_runtime/sel_ldr.h (right): https://chromiumcodereview.appspot.com/10134056/diff/2001/src/trusted/service_runtime/sel_ldr.h#newcode105 src/trusted/service_runtime/sel_ldr.h:105: typedef NaClValidationStatus (*NaClValidateFunc) ( On 2012/04/25 20:57:42, Nick Bray ...
8 years, 8 months ago (2012-04-26 15:17:01 UTC) #5
Nick Bray
https://chromiumcodereview.appspot.com/10134056/diff/2001/src/trusted/service_runtime/sel_ldr.h File src/trusted/service_runtime/sel_ldr.h (right): https://chromiumcodereview.appspot.com/10134056/diff/2001/src/trusted/service_runtime/sel_ldr.h#newcode398 src/trusted/service_runtime/sel_ldr.h:398: NaClValidateFunc validate_func; > well, I thought about this same ...
8 years, 8 months ago (2012-04-27 00:41:30 UTC) #6
pasko-google - do not use
https://chromiumcodereview.appspot.com/10134056/diff/2001/src/trusted/service_runtime/sel_validate_image.c File src/trusted/service_runtime/sel_validate_image.c (right): https://chromiumcodereview.appspot.com/10134056/diff/2001/src/trusted/service_runtime/sel_validate_image.c#newcode30 src/trusted/service_runtime/sel_validate_image.c:30: static NaClValidationStatus ValidatorCopyNotImplemented( On 2012/04/27 00:41:30, Nick Bray wrote: ...
8 years, 8 months ago (2012-04-27 17:32:11 UTC) #7
Nick Bray
I am very happy with how this is looking. I hope you are too, and ...
8 years, 8 months ago (2012-04-27 22:21:36 UTC) #8
pasko-google - do not use
On 2012/04/27 22:21:36, Nick Bray wrote: > I am very happy with how this is ...
8 years, 7 months ago (2012-04-28 16:51:16 UTC) #9
Nick Bray
What's up? I am ready to resume if you are ready.
8 years, 7 months ago (2012-05-10 17:10:21 UTC) #10
pasko-google - do not use
On 2012/05/10 17:10:21, Nick Bray wrote: > What's up? I am ready to resume if ...
8 years, 7 months ago (2012-05-11 17:11:15 UTC) #11
pasko-google - do not use
PTAL https://chromiumcodereview.appspot.com/10134056/diff/15001/src/trusted/service_runtime/sel_validate_image.c File src/trusted/service_runtime/sel_validate_image.c (right): https://chromiumcodereview.appspot.com/10134056/diff/15001/src/trusted/service_runtime/sel_validate_image.c#newcode38 src/trusted/service_runtime/sel_validate_image.c:38: /* TODO: make it more nested. */ On ...
8 years, 7 months ago (2012-05-12 12:18:40 UTC) #12
pasko-google - do not use
hm, build issues remaining: 1. GYP on win64 special casing makes it difficult to add ...
8 years, 7 months ago (2012-05-12 17:09:22 UTC) #13
pasko-google - do not use
On 2012/05/12 17:09:22, pasko wrote: > hm, build issues remaining: > > 1. GYP on ...
8 years, 7 months ago (2012-05-14 19:14:52 UTC) #14
pasko-google - do not use
a veeery friendly ping :)
8 years, 7 months ago (2012-05-15 16:45:49 UTC) #15
Nick Bray
I worked on it yesterday. I'll keep working on it today. It's big. On Tue, ...
8 years, 7 months ago (2012-05-15 17:23:34 UTC) #16
pasko-google - do not use
https://chromiumcodereview.appspot.com/10134056/diff/15001/src/trusted/validator/ncvalidate.h File src/trusted/validator/ncvalidate.h (right): https://chromiumcodereview.appspot.com/10134056/diff/15001/src/trusted/validator/ncvalidate.h#newcode126 src/trusted/validator/ncvalidate.h:126: NaClValidateCopyFunc ValidateCopy; On 2012/05/12 12:18:40, pasko wrote: > On ...
8 years, 7 months ago (2012-05-17 10:20:15 UTC) #17
Nick Bray
The difficulty I have reviewing a CL is roughly quadratic or cubic, so this one ...
8 years, 7 months ago (2012-05-22 23:46:31 UTC) #18
pasko-google - do not use
On 2012/05/22 23:46:31, Nick Bray wrote: > The difficulty I have reviewing a CL is ...
8 years, 7 months ago (2012-05-23 12:13:26 UTC) #19
pasko-google - do not use
uploaded only tiny changes in gyp file, ncvalidate.h, postponing larger changes until discussion https://chromiumcodereview.appspot.com/10134056/diff/26024/src/trusted/service_runtime/sel_validate_image.c File ...
8 years, 7 months ago (2012-05-23 14:28:11 UTC) #20
Nick Bray
OK, I played around with your patch and now think I understand the linkage problem. ...
8 years, 7 months ago (2012-05-24 01:17:15 UTC) #21
pasko-google - do not use
https://chromiumcodereview.appspot.com/10134056/diff/26024/src/trusted/validator/validator_init.c File src/trusted/validator/validator_init.c (right): https://chromiumcodereview.appspot.com/10134056/diff/26024/src/trusted/validator/validator_init.c#newcode24 src/trusted/validator/validator_init.c:24: #elif NACL_TARGET_SUBARCH == 32 && defined(NACL_STANDALONE) On 2012/05/24 01:17:15, ...
8 years, 7 months ago (2012-05-24 10:16:57 UTC) #22
pasko-google - do not use
On 2012/05/24 01:17:15, Nick Bray wrote: > OK, I played around with your patch and ...
8 years, 7 months ago (2012-05-24 10:29:52 UTC) #23
Nick Bray
Let's go crazy. LGTM w/ order independent #defines for validator selection and adding a TODO. ...
8 years, 7 months ago (2012-05-25 06:41:21 UTC) #24
pasko-google - do not use
On 2012/05/25 06:41:21, Nick Bray wrote: > Let's go crazy. LGTM w/ order independent #defines ...
8 years, 7 months ago (2012-05-25 10:45:04 UTC) #25
pasko-google - do not use
Missing LGTM from an OWNER for files in these directories: src/trusted/service_runtime added Mark Seaborn to ...
8 years, 6 months ago (2012-06-14 14:59:34 UTC) #26
Mark Seaborn
This is pretty huge and I don't understand it fully yet. Is there a way ...
8 years, 6 months ago (2012-06-14 20:11:56 UTC) #27
pasko-google - do not use
On 2012/06/14 20:11:56, Mark Seaborn wrote: > This is pretty huge and I don't understand ...
8 years, 6 months ago (2012-06-17 14:45:49 UTC) #28
pasko-google - do not use
https://chromiumcodereview.appspot.com/10134056/diff/63002/src/trusted/service_runtime/sel_validate_image.c File src/trusted/service_runtime/sel_validate_image.c (right): https://chromiumcodereview.appspot.com/10134056/diff/63002/src/trusted/service_runtime/sel_validate_image.c#newcode110 src/trusted/service_runtime/sel_validate_image.c:110: #ifdef __arm__ On 2012/06/14 20:11:56, Mark Seaborn wrote: > ...
8 years, 6 months ago (2012-06-17 14:46:45 UTC) #29
pasko-google - do not use
Mark, did you work on this change yesterday? We crafted this more concise validator interface ...
8 years, 6 months ago (2012-06-19 09:27:14 UTC) #30
pasko-google - do not use
ping sometimes we should let things go. If we do not know a better way ...
8 years, 6 months ago (2012-06-20 17:38:22 UTC) #31
Brad Chen
Waiting for a week is not okay. I will add Nick to the OWNERS file. ...
8 years, 6 months ago (2012-06-20 18:46:57 UTC) #32
Mark Seaborn
Should be OK with the changes below. I'd like to do one quick pass after ...
8 years, 6 months ago (2012-06-20 20:02:26 UTC) #33
pasko-google - do not use
Ok, now I am pretty sure the trybots will pass. Feel free to wait until ...
8 years, 6 months ago (2012-06-21 15:24:18 UTC) #34
Mark Seaborn
LGTM with changes below https://chromiumcodereview.appspot.com/10134056/diff/104003/src/trusted/service_runtime/build.scons File src/trusted/service_runtime/build.scons (right): https://chromiumcodereview.appspot.com/10134056/diff/104003/src/trusted/service_runtime/build.scons#newcode753 src/trusted/service_runtime/build.scons:753: filter_group_only = 'true', Nit: put ...
8 years, 6 months ago (2012-06-21 18:42:01 UTC) #35
pasko-google - do not use
8 years, 6 months ago (2012-06-22 10:11:27 UTC) #36
http://codereview.chromium.org/10134056/diff/104003/src/trusted/service_runti...
File src/trusted/service_runtime/build.scons (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/service_runti...
src/trusted/service_runtime/build.scons:753: filter_group_only = 'true',
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Nit: put this immediately after the "filter_regex" argument, to keep related
> args together?

Ok a little more goodness. Done.

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator/val...
File src/trusted/validator/validator_init.c (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator/val...
src/trusted/validator/validator_init.c:17: const struct NaClValidatorInterface*
NaClCreateValidator() {
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Use " *" spacing style

Done.

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator/x86...
File src/trusted/validator/x86/32/ncvalidate.c (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator/x86...
src/trusted/validator/x86/32/ncvalidate.c:165: const struct
NaClValidatorInterface* NaClValidatorCreate_x86_32() {
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Use " *" spacing style

Done.

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator/x86...
File src/trusted/validator/x86/64/ncvalidate.c (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator/x86...
src/trusted/validator/x86/64/ncvalidate.c:224: const struct
NaClValidatorInterface* NaClValidatorCreate_x86_64() {
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Use " *" spacing style

Done.

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator_arm...
File src/trusted/validator_arm/ncvalidate.cc (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator_arm...
src/trusted/validator_arm/ncvalidate.cc:128: const struct
NaClValidatorInterface* NaClValidatorCreateArm() {
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Use " *" spacing style

Done.

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator_rag...
File src/trusted/validator_ragel/unreviewed/dfa_validate_32.c (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator_rag...
src/trusted/validator_ragel/unreviewed/dfa_validate_32.c:88: const struct
NaClValidatorInterface* NaClDfaValidatorCreate_x86_32() {
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Use " *" spacing style

Done.

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator_rag...
File src/trusted/validator_ragel/unreviewed/dfa_validate_64.c (right):

http://codereview.chromium.org/10134056/diff/104003/src/trusted/validator_rag...
src/trusted/validator_ragel/unreviewed/dfa_validate_64.c:87: const struct
NaClValidatorInterface* NaClDfaValidatorCreate_x86_64() {
On 2012/06/21 18:42:01, Mark Seaborn wrote:
> Use " *" spacing style

Done.

Powered by Google App Engine
This is Rietveld 408576698