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

Issue 7799013: Intial Thumb2 Sandbox (naclrev 6680)

Created:
9 years, 3 months ago by jasonwkim
Modified:
9 years, 2 months ago
Reviewers:
bsy, sehr (please use chromium), Karl, pnacl-team
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Intial Thumb2 Sandbox (naclrev 6583) by MMaurer BUG=http://code.google.com/p/nativeclient/issues/detail?id=1713 BUG=http://code.google.com/p/nativeclient/issues/detail?id=2193 TEST=none

Patch Set 1 #

Patch Set 2 : fix thumb2 vs build_arm_thumb2 #

Total comments: 39

Patch Set 3 : fixed some bugs, more remaining #

Patch Set 4 : odd address error on arm-mode has been fixed #

Patch Set 5 : simplified some airhtmetic #

Patch Set 6 : fix %d/size_t nonsense #

Patch Set 7 : fix comma #

Total comments: 66

Patch Set 8 : fixed TODO #

Patch Set 9 : more nits fixed #

Patch Set 10 : re-fixed unnecessary presubmit error #

Patch Set 11 : asdsa #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+2644 lines, -252 lines) Patch
M .gitignore View 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/service_runtime/arch/arm/springboard_thumb2.S View 1 chunk +29 lines, -29 lines 0 comments Download
M src/trusted/service_runtime/build.scons View 1 2 3 4 2 chunks +6 lines, -4 lines 0 comments Download
M src/trusted/service_runtime/elf_util.c View 1 2 3 4 5 1 chunk +2 lines, -2 lines 1 comment Download
M src/trusted/service_runtime/sel_validate_image.c View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -4 lines 0 comments Download
M src/trusted/validator/ncfileutil.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/validator/ncfileutil.c View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -2 lines 0 comments Download
M src/trusted/validator_arm/address_set.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -5 lines 0 comments Download
M src/trusted/validator_arm/address_set.cc View 1 2 3 5 chunks +12 lines, -7 lines 6 comments Download
A src/trusted/validator_arm/armv7-thumb.table View 1 chunk +421 lines, -0 lines 0 comments Download
M src/trusted/validator_arm/build.scons View 1 2 3 4 5 6 7 8 3 chunks +32 lines, -2 lines 0 comments Download
M src/trusted/validator_arm/decode.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -3 lines 0 comments Download
M src/trusted/validator_arm/dgen_input.py View 2 chunks +5 lines, -2 lines 0 comments Download
M src/trusted/validator_arm/dgen_output.py View 5 chunks +45 lines, -32 lines 0 comments Download
M src/trusted/validator_arm/generate_decoder.py View 1 chunk +14 lines, -10 lines 0 comments Download
M src/trusted/validator_arm/inst_classes.h View 1 2 3 4 5 6 7 8 6 chunks +609 lines, -0 lines 0 comments Download
M src/trusted/validator_arm/inst_classes.cc View 1 2 3 4 5 6 7 8 2 chunks +274 lines, -1 line 0 comments Download
M src/trusted/validator_arm/model.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -2 lines 0 comments Download
M src/trusted/validator_arm/ncval.cc View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -6 lines 0 comments Download
M src/trusted/validator_arm/ncvalidate.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M src/trusted/validator_arm/ncvalidate.cc View 1 2 2 chunks +12 lines, -6 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/branch_test.S View 1 chunk +13 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/branch_test.err View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/branch_test.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/branch_test.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/bundle_test.S View 1 chunk +14 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/bundle_test.err View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/bundle_test.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/bundle_test.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A + src/trusted/validator_arm/testdata-thumb/compile_tests.sh View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -8 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/it_test.S View 1 2 3 4 5 6 7 1 chunk +71 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/it_test.err View 1 chunk +3 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/it_test.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/it_test.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/ld_script_arm_thumb2_untrusted View 1 chunk +270 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/lit_pool_test.S View 1 chunk +26 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/lit_pool_test.err View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/lit_pool_test.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/lit_pool_test.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_allowed.S View 1 chunk +6 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_allowed.err View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_allowed.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_allowed.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_disallowed.S View 1 chunk +9 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_disallowed.err View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_disallowed.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/local_disallowed.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/masking_instructions.S View 1 chunk +10 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/masking_instructions.err View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/masking_instructions.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/masking_instructions.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/masks.h View 1 chunk +11 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/mem_test.S View 1 chunk +16 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/mem_test.err View 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/mem_test.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/mem_test.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_external_jumps.S View 1 2 3 4 5 6 7 8 1 chunk +45 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_external_jumps.err View 1 chunk +7 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_external_jumps.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_external_jumps.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_forbidden_instructions.S View 1 chunk +22 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_forbidden_instructions.err View 1 chunk +2 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_forbidden_instructions.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_forbidden_instructions.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S View 1 2 3 4 5 6 7 8 1 chunk +74 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_internal_jumps.err View 1 chunk +6 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_internal_jumps.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_internal_jumps.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_sp_updates.S View 1 chunk +59 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_sp_updates.err View 1 chunk +6 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_sp_updates.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_sp_updates.out View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_stores.S View 1 2 3 4 5 6 7 8 1 chunk +91 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_stores.err View 1 chunk +7 lines, -0 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_stores.nexe View 0 chunks +-1 lines, --1 lines 0 comments Download
A src/trusted/validator_arm/testdata-thumb/test_stores.out View 0 chunks +-1 lines, --1 lines 0 comments Download
M src/trusted/validator_arm/testdata/compile_tests.sh View 1 chunk +7 lines, -8 lines 0 comments Download
M src/trusted/validator_arm/validator.h View 1 2 3 4 5 6 7 8 17 chunks +127 lines, -26 lines 0 comments Download
M src/trusted/validator_arm/validator.cc View 1 2 3 4 5 6 7 8 19 chunks +226 lines, -118 lines 0 comments Download
M src/trusted/validator_arm/validator_arm.gyp View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M src/trusted/validator_arm/validator_tests.cc View 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
jasonwkim
PTAL This is the newly updated issue: This CL supercedes ALL PRIOR EMAIL. Thanks
9 years, 3 months ago (2011-08-30 00:42:55 UTC) #1
Karl
http://codereview.chromium.org/7799013/diff/2001/src/trusted/service_runtime/build.scons File src/trusted/service_runtime/build.scons (right): http://codereview.chromium.org/7799013/diff/2001/src/trusted/service_runtime/build.scons#newcode136 src/trusted/service_runtime/build.scons:136: if env.Bit('build_arm_thumb2') or env.Bit('target_arm_thumb2'): Why is this needed for ...
9 years, 3 months ago (2011-08-30 19:53:52 UTC) #2
bsy
some nits. http://codereview.chromium.org/7799013/diff/2001/src/trusted/service_runtime/build.scons File src/trusted/service_runtime/build.scons (right): http://codereview.chromium.org/7799013/diff/2001/src/trusted/service_runtime/build.scons#newcode138 src/trusted/service_runtime/build.scons:138: thumb2_env.Replace(ASFLAGS=['-mthumb']) could env already have other ASFLAGS ...
9 years, 3 months ago (2011-09-01 00:30:00 UTC) #3
jasonwkim
PTAL - all tests passing
9 years, 3 months ago (2011-09-14 21:14:37 UTC) #4
bsy
please reply to previous CR comments in reitveld. http://codereview.chromium.org/7799013/diff/15002/src/trusted/service_runtime/build.scons File src/trusted/service_runtime/build.scons (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/service_runtime/build.scons#newcode139 src/trusted/service_runtime/build.scons:139: thumb2_env.Replace(ASFLAGS=['-mthumb']) ...
9 years, 3 months ago (2011-09-16 18:28:34 UTC) #5
bsy
more comments http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/validator.cc File src/trusted/validator_arm/validator.cc (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/validator.cc#newcode149 src/trusted/validator_arm/validator.cc:149: // TODO(mrm) re-enable s/mrm/jasonwkim/ cannot assign TODO ...
9 years, 3 months ago (2011-09-16 18:35:51 UTC) #6
bsy
more nits. http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/validator.h File src/trusted/validator_arm/validator.h (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/validator.h#newcode12 src/trusted/validator_arm/validator.h:12: * MRM DEBUG Header, clean this out ...
9 years, 3 months ago (2011-09-16 18:42:21 UTC) #7
jasonwkim
http://codereview.chromium.org/7799013/diff/2001/src/trusted/service_runtime/build.scons File src/trusted/service_runtime/build.scons (right): http://codereview.chromium.org/7799013/diff/2001/src/trusted/service_runtime/build.scons#newcode136 src/trusted/service_runtime/build.scons:136: if env.Bit('build_arm_thumb2') or env.Bit('target_arm_thumb2'): On 2011/08/30 19:53:52, Karl wrote: ...
9 years, 3 months ago (2011-09-16 20:09:16 UTC) #8
Karl
http://codereview.chromium.org/7799013/diff/15002/src/trusted/service_runtime/sel_validate_image.c File src/trusted/service_runtime/sel_validate_image.c (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/service_runtime/sel_validate_image.c#newcode93 src/trusted/service_runtime/sel_validate_image.c:93: NIT: why blank line here? http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/address_set.h File src/trusted/validator_arm/address_set.h (right): ...
9 years, 3 months ago (2011-09-19 19:56:04 UTC) #9
sehr (please use chromium)
One nit. More to come. http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/testdata-thumb/compile_tests.sh File src/trusted/validator_arm/testdata-thumb/compile_tests.sh (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator_arm/testdata-thumb/compile_tests.sh#newcode14 src/trusted/validator_arm/testdata-thumb/compile_tests.sh:14: tools="$topdir/toolchain/pnacl_linux_x86_64/arm-none-linux-gnueabi/bin" I believe this ...
9 years, 3 months ago (2011-09-20 18:24:15 UTC) #10
bsy
nits and more nits http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator/ncfileutil.c File src/trusted/validator/ncfileutil.c (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/validator/ncfileutil.c#newcode196 src/trusted/validator/ncfileutil.c:196: memcpy(ncf->eheader, &h, sizeof(Elf_Ehdr)); *ncf->eheader = ...
9 years, 3 months ago (2011-09-21 22:32:17 UTC) #11
jasonwkim
hopefully all nits addressed. PTAL http://codereview.chromium.org/7799013/diff/15002/src/trusted/service_runtime/sel_validate_image.c File src/trusted/service_runtime/sel_validate_image.c (right): http://codereview.chromium.org/7799013/diff/15002/src/trusted/service_runtime/sel_validate_image.c#newcode93 src/trusted/service_runtime/sel_validate_image.c:93: On 2011/09/19 19:56:05, Karl ...
9 years, 2 months ago (2011-09-26 21:35:52 UTC) #12
Karl
LGTM, assuming no one else has any problems.
9 years, 2 months ago (2011-09-27 17:05:38 UTC) #13
bsy
given the 32 vs 16 address_set bug that i found, i assert that there aren't ...
9 years, 2 months ago (2011-09-27 23:27:28 UTC) #14
bsy
9 years, 2 months ago (2011-09-28 00:31:12 UTC) #15
http://codereview.chromium.org/7799013/diff/40003/src/trusted/validator_arm/a...
File src/trusted/validator_arm/address_set.cc (right):

http://codereview.chromium.org/7799013/diff/40003/src/trusted/validator_arm/a...
src/trusted/validator_arm/address_set.cc:20: bits_(new uint32_t[(size + RUPADDR)
/ ADDRFACTOR]) {
as discussed, this is a bit vector the max size of which depends on the sandbox
model: the |size| parameter is the address space size but on arm we only care
about |address| div 4 (in add, contains, etc), and on thumb2 we care about
|address| div 2.

i think this should be templated or otherwise parameterized according to the
sandbox model.  in particular, this CL would have the same AddressSet be used
for both arm and thumb2, and when used for arm the sequence

AddressSet as;
as.add(n);  // n is 0 mod 4, within size, etc.
CHECK(as.contains(n+2));

would pass on the original code but fail with the CL applied.

http://codereview.chromium.org/7799013/diff/40003/src/trusted/validator_arm/a...
src/trusted/validator_arm/address_set.cc:32: bits_[word_address / 32] |= 1 <<
(word_address % 32);
this code was correct.  my apologies.

it would be nice if the code were more obviously correct....

http://codereview.chromium.org/7799013/diff/40003/src/trusted/validator_arm/a...
src/trusted/validator_arm/address_set.cc:40: return bits_[word_address / 32] &
(1 << (word_address % 32));
ditto

Powered by Google App Engine
This is Rietveld 408576698