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

Issue 9423045: validator_ragel: Add ncval tests from the old validator (Closed)

Created:
8 years, 10 months ago by pasko-google - do not use
Modified:
8 years, 10 months ago
Reviewers:
khim, Mark Seaborn
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

validator_ragel: Add ncval tests from the old validator The old validator individually analyses all instructions, and only later checks for bundle alignment rules. The validator_ragel fails at the first invalid instruction it encounters. We will introduce a feature to the validator_ragel to be able to continue with validation after error (useful for fixing invalid code), but this would be hard to rely on in tests since the validator would often continue to restart from non-interesting bytes resulting in numerous false positives. Hence, the test runner (run_ncval_tests.py) cuts each test bundle by bundle, runs these bundles through the validator. Instructions that cross a bundle get additional run, on that they get placed at offset 0. The "parse_hex.py" is used to convert the old validator output from *.rval files into the new golden files. It parses the contents of testdata/64 for tests, generalizes the validation errors it sees into 2 categories: (1) crossing a 32-byte bundle, (2) all others. For each error in (2) the offset of the first instructions' byte is recorded into the golden file. Some of the files cannot yet be parsed, for example, containing the '@' syntax, this is a TODO for later commits. BUG=http://code.google.com/p/nativeclient/issues/detail?id=2597 TEST=make check-ncval Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=7864

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : some more test classification #

Unified diffs Side-by-side diffs Delta from patch set Stats (+744 lines, --46 lines) Patch
M src/trusted/validator_ragel/unreviewed/Makefile View 4 chunks +43 lines, -3 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/3DNow.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/AhNotSubRsp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/README View 1 chunk +3 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/add_cs_gs_prefix.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/add_mult_prefix.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/add_rsp_r15.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/addrex.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/addrex2.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/ambig-segment.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/bad66.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/bsf-mask.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/bsr-mask.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/bt.val.ref View 1 chunk +7 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call-ex.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call0.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call1.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call_aligned.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call_long.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call_not_aligned.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call_not_aligned_16.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/call_short.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/change-subregs.val.ref View 1 chunk +3 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/cmpxchg.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/cpuid.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/direct-call-16.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/direct-call-32.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/direct-cond-jump-16.val.ref View 1 chunk +3 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/direct-cond-jump-32.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/direct-jump-16.val.ref View 1 chunk +3 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/direct-jump-32.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/dup-prefix.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/extensions.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/fpu.val.ref View 1 chunk +3 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/fs_use.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/hlt.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/inc67.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/incno67.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/indirect_jmp_masked.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/indirect_jmp_not_masked.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/invalid_base.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/invalid_base_store.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/invalid_width_index.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jmp-16.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jmp0.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jump_atomic.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jump_not_atomic.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jump_not_atomic_1.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jump_outside.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jump_overflow.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/jump_underflow.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/lea-add-rsp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/lea-rsp.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/lea.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/legacy.val.ref View 1 chunk +18 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/maskmov_test.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mmx.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-esi-nop-use.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rbp-bad-1.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rbp-bad-2.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rbp-bad-3.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rbp-bad-4.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rbp-bad-5.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rbp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov-lea-rsp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov_esp_add_rsp_r15.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mov_rbp_2_rsp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/movlps-ex.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/movs_test.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/movsbw.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mv_ebp_add_crossing.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mv_ebp_add_rbp_r15.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/mv_ebp_alone.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/nacl_illegal.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/nops.val.ref View 1 chunk +9 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/pop-rbp.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/prefix-2.val.ref View 1 chunk +43 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/prefix-3.val.ref View 1 chunk +6 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/prefix-single.val.ref View 1 chunk +23 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/push-memoff.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/rbp67.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/read_const_ptr.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/rep_tests.val.ref View 1 chunk +9 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/return.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/rex_invalid.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/rex_not_last.val.ref View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/rip-relative.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/rip67.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/segment_aligned.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/segment_assign.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/segment_not_aligned.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/segment_store.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/sse.val.ref View 1 chunk +17 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/stack_regs.val.ref View 1 chunk +7 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/stosd-bad.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/stosd.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/stosd67.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/stosdno67.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/strings.val.ref View 1 chunk +7 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/sub-add-rsp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/sub-rsp.val.ref View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/ud2.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/update-rsp.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/valid_and_store.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/valid_base_only.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/valid_lea_store.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/golden/x87.val.ref View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/parse_hex.py View 1 chunk +84 lines, -0 lines 0 comments Download
A src/trusted/validator_ragel/unreviewed/run_ncval_tests.py View 1 2 1 chunk +456 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
pasko-google - do not use
8 years, 10 months ago (2012-02-20 17:58:23 UTC) #1
Mark Seaborn
On 20 February 2012 09:58, <pasko@google.com> wrote: > Reviewers: khim, Mark Seaborn, > > Description: ...
8 years, 10 months ago (2012-02-20 22:27:32 UTC) #2
pasko-google - do not use
Mark, thank you for quick response. On 2012/02/20 22:27:32, Mark Seaborn wrote: > To me, ...
8 years, 10 months ago (2012-02-21 12:23:06 UTC) #3
khim
8 years, 10 months ago (2012-02-21 14:29:51 UTC) #4
LGTM

Not sure if it's good for final version but for now it's in "unreviewed "and I
REALLY want to run these tests easily when I change/fix validator.

Powered by Google App Engine
This is Rietveld 408576698