def test_last_byte_after_memset(self):
     assert self.MIPS.s5 == HexInt(0x12)
Exemplo n.º 2
0
 def test_a0_after_second_call(self):
     assert self.MIPS.a0 == HexInt(
         self.BAD_ADDRESS), "$a0 should still be BAD_ADDR"
Exemplo n.º 3
0
 def test_cp2_x_csc_align_value_post(self):
     assert self.MIPS.a1 == HexInt(
         0x1234), "CSC wrote to an unaligned address"
Exemplo n.º 4
0
 def test_prid_read_user_asr(self):
     assert self.MIPS.a2 == HexInt(-1), "Should not have read PrID"
Exemplo n.º 5
0
 def test_cp2_x_lb_perm_not_loaded(self):
     '''Test lbu did not read without Permit_Load permission'''
     assert self.MIPS.a1 == HexInt(
         0xdead), "lbu should not read without Permit_Load permission"
Exemplo n.º 6
0
 def test_second_load_succeeded(self):
     self.assertTrapInfoNoTrap(self.MIPS.s2)
     assert self.MIPS.a2 == HexInt(0x1234), "Should have loaded"
Exemplo n.º 7
0
 def test_prid_read_kernel_no_asr(self):
     assert self.MIPS.a1 == HexInt(-1), "Should not have read PrID"
 def test_offset_precise(self):
     assert self.MIPS.c2.offset == HexInt(
         0x10000000), "Offset should be == addr"
     assert self.MIPS.c2.offset == self.MIPS.c2.address, "Offset should be == addr"
     assert self.MIPS.s4 == self.MIPS.s1, "Offset should be == addr when precise"
     assert self.MIPS.s4 == self.MIPS.a1, "Offset should be == addr when precise"
Exemplo n.º 9
0
 def test_cp2_csub_untagged_untagged(self):
     assert self.MIPS.a1 == HexInt(0x233), "CSub untagged, untagged was wrong"
 def test_base_imprecise(self):
     assert self.MIPS.c2.base == HexInt(
         0x10000000), "base should change to retain address"
     assert self.MIPS.s2 == HexInt(
         0x10000000), "base should change to retain address"
 def test_offset_imprecise(self):
     assert self.MIPS.c2.offset == HexInt(
         0), "Offset should be zero (since base was adjusted)"
     assert self.MIPS.s4 == HexInt(
         0), "Offset should be zero (since base was adjusted)"
 def test_addr(self):
     assert self.MIPS.c2.address == HexInt(
         0x10000000), "addr should be value from csetaddr"
     assert self.MIPS.c2.address == self.MIPS.a1, "addr should be value from csetaddr"
     assert self.MIPS.s1 == self.MIPS.a1, "addr should be value from csetaddr"
Exemplo n.º 13
0
 def test_two_past_end_after_memset(self):
     assert self.MIPS.s7 == HexInt(0xff)
Exemplo n.º 14
0
 def test_one_past_end_after_memset(self):
     assert self.MIPS.s6 == HexInt(0xaa)
Exemplo n.º 15
0
 def test_precise_caps_results(self):
     # no rounding with precise caps:
     assert self.MIPS.c2.base == HexInt(0x5555aaaa5555aaaa)
     assert self.MIPS.c2.length == HexInt(0x7aaa5555aaaa5555)
     assert self.MIPS.a0 == HexInt(
         0xffffffffffffffff), "expected all-ones mask for precise caps"
Exemplo n.º 16
0
 def test_cp2_csub_tagged_untagged(self):
     assert self.MIPS.a2 == HexInt(0x1111), "CSub tagged, untagged was wrong"
Exemplo n.º 17
0
 def test_first_load_succeeded(self):
     self.assertTrapInfoNoTrap(self.MIPS.s1)
     assert self.MIPS.a1 == HexInt(0x1234), "Should have loaded"
Exemplo n.º 18
0
 def test_cp2_csub_untagged_tagged(self):
     assert self.MIPS.a3 == HexInt(0x5432), "CSub untagged, tagged was wrong"
Exemplo n.º 19
0
 def test_epcc_addr(self):
     assert self.MIPS.cp2[3].base + self.MIPS.cp2[3].offset == self.MIPS.a7 + HexInt(0x10000000), "sandbox EPCC offset incorrect"
Exemplo n.º 20
0
 def test_cp2_csub_tagged_tagged(self):
     assert self.MIPS.a4 == HexInt(0x7654), "CSub tagged, tagged (non-overlapping bounds) was wrong"
Exemplo n.º 21
0
 def test_prid_read_kernel_asr_restored(self):
     assert self.MIPS.a4 != HexInt(-1), "Should have read PrID"
Exemplo n.º 22
0
 def test_cp2_csub_tagged_null(self):
     assert self.MIPS.a5 == HexInt(0x2345), "CSub null, tagged was wrong"
Exemplo n.º 23
0
 def test_value_not_written(self):
     assert self.MIPS.s1 == HexInt(0x5656565656565656), "value before sc wrong"
     assert self.MIPS.s2 == HexInt(0x5656565656565656), "sc stored value!"
Exemplo n.º 24
0
 def test_cp2_csub_null_tagged(self):
     assert self.MIPS.a6 == HexInt(0), "CSub tagged, null was wrong"
Exemplo n.º 25
0
 def test_return_value_after_second_call(self):
     assert self.MIPS.a5 == HexInt(
         self.BAD_ADDRESS +
         1), "On second call the helper should use the saved $v0"
Exemplo n.º 26
0
 def test_imprecise_cram_expected_result(self):
     assert self.MIPS.a0 == HexInt(
         0xffe0000000000000), "wrong result from crrl?"
Exemplo n.º 27
0
 def test_cp2_x_csc_align_value_pre(self):
     assert self.MIPS.a0 == HexInt(0x1234), "Incorrect initial value"
Exemplo n.º 28
0
 def test_precise_cram_expected_result(self):
     assert self.MIPS.a0 == HexInt(
         0xffffffffffffffff), "wrong result from crrl (precise)?"
 def test_context(self):
     assert HexInt(self.MIPS.s1 & 0xffffffff) == HexInt((self.MIPS.a4 & 0xffffe000) >> 9), "Wrong Context" # TODO test page table base
Exemplo n.º 30
0
 def test_start_byte_after_memset(self):
     assert self.MIPS.s4 == HexInt(0x12)