Lines Matching refs:self
259 encl_delete(&self->encl); in FIXTURE_TEARDOWN()
287 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
289 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
290 self->run.tcs = self->encl.encl_base; in TEST_F()
295 EXPECT_EQ(ENCL_CALL(&put_op, &self->run, false), 0); in TEST_F()
297 EXPECT_EEXIT(&self->run); in TEST_F()
298 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
303 EXPECT_EQ(ENCL_CALL(&get_op, &self->run, false), 0); in TEST_F()
306 EXPECT_EEXIT(&self->run); in TEST_F()
307 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
360 ASSERT_TRUE(setup_test_encl(total_mem, &self->encl, _metadata)); in TEST_F()
362 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
363 self->run.tcs = self->encl.encl_base; in TEST_F()
368 EXPECT_EQ(ENCL_CALL(&put_op, &self->run, false), 0); in TEST_F()
370 EXPECT_EEXIT(&self->run); in TEST_F()
371 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
376 EXPECT_EQ(ENCL_CALL(&get_op, &self->run, false), 0); in TEST_F()
379 EXPECT_EEXIT(&self->run); in TEST_F()
380 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
404 ASSERT_TRUE(setup_test_encl(total_mem, &self->encl, _metadata));
411 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc);
428 memset(&self->run, 0, sizeof(self->run));
429 self->run.tcs = self->encl.encl_base;
431 heap = &self->encl.segment_tbl[self->encl.nr_segments - 1];
436 EXPECT_EQ(ENCL_CALL(&put_op, &self->run, false), 0);
438 EXPECT_EEXIT(&self->run);
439 EXPECT_EQ(self->run.user_data, 0);
444 EXPECT_EQ(ENCL_CALL(&get_op, &self->run, false), 0);
447 EXPECT_EEXIT(&self->run);
448 EXPECT_EQ(self->run.user_data, 0);
459 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc);
468 addr = self->encl.encl_base + heap->offset;
479 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0);
481 EXPECT_EQ(self->run.exception_vector, 0);
482 EXPECT_EQ(self->run.exception_error_code, 0);
483 EXPECT_EQ(self->run.exception_addr, 0);
485 ASSERT_EQ(self->run.function, EEXIT);
496 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_REMOVE_PAGES, &remove_ioc);
509 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
511 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
512 self->run.tcs = self->encl.encl_base; in TEST_F()
517 EXPECT_EQ(ENCL_CALL(&put_op, &self->run, true), 0); in TEST_F()
519 EXPECT_EEXIT(&self->run); in TEST_F()
520 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
525 EXPECT_EQ(ENCL_CALL(&get_op, &self->run, true), 0); in TEST_F()
528 EXPECT_EEXIT(&self->run); in TEST_F()
529 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
545 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
547 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
548 self->run.tcs = self->encl.encl_base; in TEST_F()
550 self->run.user_handler = (__u64)test_handler; in TEST_F()
551 self->run.user_data = 0xdeadbeef; in TEST_F()
556 EXPECT_EQ(ENCL_CALL(&put_op, &self->run, true), 0); in TEST_F()
558 EXPECT_EEXIT(&self->run); in TEST_F()
559 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
564 EXPECT_EQ(ENCL_CALL(&get_op, &self->run, true), 0); in TEST_F()
567 EXPECT_EEXIT(&self->run); in TEST_F()
568 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
578 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
580 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
581 self->run.tcs = self->encl.encl_base; in TEST_F()
585 EXPECT_EQ(ENCL_CALL(&op, &self->run, true), 0); in TEST_F()
587 EXPECT_EEXIT(&self->run); in TEST_F()
588 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
589 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
590 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
593 self->run.tcs = self->encl.encl_base + PAGE_SIZE; in TEST_F()
595 EXPECT_EQ(ENCL_CALL(&op, &self->run, true), 0); in TEST_F()
597 EXPECT_EEXIT(&self->run); in TEST_F()
598 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
599 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
600 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
623 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
625 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
626 self->run.tcs = self->encl.encl_base; in TEST_F()
628 data_start = self->encl.encl_base + in TEST_F()
629 encl_get_data_offset(&self->encl) + in TEST_F()
642 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
644 EXPECT_EEXIT(&self->run); in TEST_F()
645 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
646 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
647 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
657 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
660 EXPECT_EEXIT(&self->run); in TEST_F()
661 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
662 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
663 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
678 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
680 EXPECT_EQ(self->run.exception_vector, 14); in TEST_F()
681 EXPECT_EQ(self->run.exception_error_code, 0x7); in TEST_F()
682 EXPECT_EQ(self->run.exception_addr, data_start); in TEST_F()
684 self->run.exception_vector = 0; in TEST_F()
685 self->run.exception_error_code = 0; in TEST_F()
686 self->run.exception_addr = 0; in TEST_F()
698 0, ERESUME, 0, 0, &self->run), in TEST_F()
701 EXPECT_EEXIT(&self->run); in TEST_F()
702 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
703 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
704 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
708 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
711 EXPECT_EEXIT(&self->run); in TEST_F()
712 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
713 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
714 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
725 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
727 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
728 self->run.tcs = self->encl.encl_base; in TEST_F()
737 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_RESTRICT_PERMISSIONS, &ioc); in TEST_F()
757 ioc.offset = encl_get_tcs_offset(&self->encl); in TEST_F()
761 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_RESTRICT_PERMISSIONS, &ioc); in TEST_F()
788 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
790 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
791 self->run.tcs = self->encl.encl_base; in TEST_F()
799 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_RESTRICT_PERMISSIONS, in TEST_F()
825 data_start = self->encl.encl_base + in TEST_F()
826 encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
838 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
840 EXPECT_EEXIT(&self->run); in TEST_F()
841 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
842 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
843 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
853 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
856 EXPECT_EEXIT(&self->run); in TEST_F()
857 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
858 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
859 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
867 restrict_ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
871 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_RESTRICT_PERMISSIONS, in TEST_F()
888 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
890 EXPECT_EEXIT(&self->run); in TEST_F()
891 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
892 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
893 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
902 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
904 EXPECT_EQ(self->run.function, ERESUME); in TEST_F()
905 EXPECT_EQ(self->run.exception_vector, 14); in TEST_F()
906 EXPECT_EQ(self->run.exception_error_code, 0x8007); in TEST_F()
907 EXPECT_EQ(self->run.exception_addr, data_start); in TEST_F()
909 self->run.exception_vector = 0; in TEST_F()
910 self->run.exception_error_code = 0; in TEST_F()
911 self->run.exception_addr = 0; in TEST_F()
918 self->run.tcs = self->encl.encl_base + PAGE_SIZE; in TEST_F()
930 EXPECT_EQ(ENCL_CALL(&emodpe_op, &self->run, true), 0); in TEST_F()
932 EXPECT_EEXIT(&self->run); in TEST_F()
933 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
934 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
935 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
941 self->run.tcs = self->encl.encl_base; in TEST_F()
948 self->run.tcs = self->encl.encl_base; in TEST_F()
952 &self->run), in TEST_F()
955 EXPECT_EEXIT(&self->run); in TEST_F()
956 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
957 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
958 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
962 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
965 EXPECT_EEXIT(&self->run); in TEST_F()
966 EXPECT_EQ(self->run.user_data, 0); in TEST_F()
967 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
968 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
969 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
989 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
991 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
992 self->run.tcs = self->encl.encl_base; in TEST_F()
994 for (i = 0; i < self->encl.nr_segments; i++) { in TEST_F()
995 struct encl_segment *seg = &self->encl.segment_tbl[i]; in TEST_F()
1005 EXPECT_LT(total_size + PAGE_SIZE, self->encl.encl_size); in TEST_F()
1015 addr = mmap((void *)self->encl.encl_base + total_size, PAGE_SIZE, in TEST_F()
1017 MAP_SHARED | MAP_FIXED, self->encl.fd, 0); in TEST_F()
1020 self->run.exception_vector = 0; in TEST_F()
1021 self->run.exception_error_code = 0; in TEST_F()
1022 self->run.exception_addr = 0; in TEST_F()
1038 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
1040 EXPECT_EQ(self->run.function, ERESUME); in TEST_F()
1041 EXPECT_EQ(self->run.exception_vector, 14); in TEST_F()
1042 EXPECT_EQ(self->run.exception_addr, (unsigned long)addr); in TEST_F()
1044 if (self->run.exception_error_code == 0x6) { in TEST_F()
1049 EXPECT_EQ(self->run.exception_error_code, 0x8007); in TEST_F()
1051 self->run.exception_vector = 0; in TEST_F()
1052 self->run.exception_error_code = 0; in TEST_F()
1053 self->run.exception_addr = 0; in TEST_F()
1056 self->run.tcs = self->encl.encl_base + PAGE_SIZE; in TEST_F()
1058 eaccept_op.epc_addr = self->encl.encl_base + total_size; in TEST_F()
1063 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1065 EXPECT_EEXIT(&self->run); in TEST_F()
1066 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1067 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1068 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1072 self->run.tcs = self->encl.encl_base; in TEST_F()
1076 &self->run), in TEST_F()
1079 EXPECT_EEXIT(&self->run); in TEST_F()
1080 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1081 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1082 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1092 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1095 EXPECT_EEXIT(&self->run); in TEST_F()
1096 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1097 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1098 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1119 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
1121 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
1122 self->run.tcs = self->encl.encl_base; in TEST_F()
1124 for (i = 0; i < self->encl.nr_segments; i++) { in TEST_F()
1125 struct encl_segment *seg = &self->encl.segment_tbl[i]; in TEST_F()
1135 EXPECT_LT(total_size + PAGE_SIZE, self->encl.encl_size); in TEST_F()
1146 addr = mmap((void *)self->encl.encl_base + total_size, PAGE_SIZE, in TEST_F()
1148 self->encl.fd, 0); in TEST_F()
1151 self->run.exception_vector = 0; in TEST_F()
1152 self->run.exception_error_code = 0; in TEST_F()
1153 self->run.exception_addr = 0; in TEST_F()
1159 eaccept_op.epc_addr = self->encl.encl_base + total_size; in TEST_F()
1164 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1166 if (self->run.exception_vector == 14 && in TEST_F()
1167 self->run.exception_error_code == 4 && in TEST_F()
1168 self->run.exception_addr == self->encl.encl_base + total_size) { in TEST_F()
1173 EXPECT_EEXIT(&self->run); in TEST_F()
1174 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1175 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1176 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1187 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
1189 EXPECT_EEXIT(&self->run); in TEST_F()
1190 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1191 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1192 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1202 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1205 EXPECT_EEXIT(&self->run); in TEST_F()
1206 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1207 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1208 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1240 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, in TEST_F()
1243 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
1244 self->run.tcs = self->encl.encl_base; in TEST_F()
1251 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1273 for (i = 0; i < self->encl.nr_segments; i++) { in TEST_F()
1274 struct encl_segment *seg = &self->encl.segment_tbl[i]; in TEST_F()
1284 EXPECT_LT(total_size + 3 * PAGE_SIZE, self->encl.encl_size); in TEST_F()
1290 addr = mmap((void *)self->encl.encl_base + total_size, 3 * PAGE_SIZE, in TEST_F()
1292 self->encl.fd, 0); in TEST_F()
1295 self->run.exception_vector = 0; in TEST_F()
1296 self->run.exception_error_code = 0; in TEST_F()
1297 self->run.exception_addr = 0; in TEST_F()
1299 stack_end = (void *)self->encl.encl_base + total_size; in TEST_F()
1300 tcs = (void *)self->encl.encl_base + total_size + PAGE_SIZE; in TEST_F()
1301 ssa = (void *)self->encl.encl_base + total_size + 2 * PAGE_SIZE; in TEST_F()
1313 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1315 if (self->run.exception_vector == 14 && in TEST_F()
1316 self->run.exception_error_code == 4 && in TEST_F()
1317 self->run.exception_addr == (unsigned long)stack_end) { in TEST_F()
1322 EXPECT_EEXIT(&self->run); in TEST_F()
1323 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1324 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1325 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1330 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1332 EXPECT_EEXIT(&self->run); in TEST_F()
1333 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1334 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1335 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1340 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1342 EXPECT_EEXIT(&self->run); in TEST_F()
1343 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1344 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1345 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1359 val_64 = encl_get_entry(&self->encl, "encl_dyn_entry"); in TEST_F()
1367 EXPECT_EQ(ENCL_CALL(&init_tcs_page_op, &self->run, true), 0); in TEST_F()
1369 EXPECT_EEXIT(&self->run); in TEST_F()
1370 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1371 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1372 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1381 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1395 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1397 EXPECT_EEXIT(&self->run); in TEST_F()
1398 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1399 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1400 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1404 self->run.tcs = (unsigned long)tcs; in TEST_F()
1412 EXPECT_EQ(ENCL_CALL(&put_buf_op, &self->run, true), 0); in TEST_F()
1414 EXPECT_EEXIT(&self->run); in TEST_F()
1415 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1416 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1417 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1422 EXPECT_EQ(ENCL_CALL(&get_buf_op, &self->run, true), 0); in TEST_F()
1425 EXPECT_EEXIT(&self->run); in TEST_F()
1426 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1427 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1428 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1444 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1456 self->run.tcs = self->encl.encl_base; in TEST_F()
1463 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1465 EXPECT_EEXIT(&self->run); in TEST_F()
1466 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1467 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1468 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1474 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1476 EXPECT_EEXIT(&self->run); in TEST_F()
1477 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1478 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1479 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1485 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1487 EXPECT_EEXIT(&self->run); in TEST_F()
1488 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1489 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1490 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1499 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_REMOVE_PAGES, &remove_ioc); in TEST_F()
1515 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1517 EXPECT_EEXIT(&self->run); in TEST_F()
1518 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1519 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1520 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1530 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
1532 EXPECT_EEXIT(&self->run); in TEST_F()
1533 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1534 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1535 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1545 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1548 EXPECT_EEXIT(&self->run); in TEST_F()
1549 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1550 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1551 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1571 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
1573 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
1574 self->run.tcs = self->encl.encl_base; in TEST_F()
1581 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1602 data_start = self->encl.encl_base + in TEST_F()
1603 encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1615 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
1617 EXPECT_EEXIT(&self->run); in TEST_F()
1618 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1619 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1620 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1630 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1633 EXPECT_EEXIT(&self->run); in TEST_F()
1634 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1635 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1636 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1641 modt_ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1645 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1658 remove_ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1661 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_REMOVE_PAGES, &remove_ioc); in TEST_F()
1682 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
1684 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
1685 self->run.tcs = self->encl.encl_base; in TEST_F()
1692 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &ioc); in TEST_F()
1713 data_start = self->encl.encl_base + in TEST_F()
1714 encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1726 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
1728 EXPECT_EEXIT(&self->run); in TEST_F()
1729 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1730 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1731 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1741 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1744 EXPECT_EEXIT(&self->run); in TEST_F()
1745 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1746 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1747 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1752 ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1756 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &ioc); in TEST_F()
1769 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1777 EXPECT_EQ(self->run.function, ERESUME); in TEST_F()
1778 EXPECT_EQ(self->run.exception_vector, 14); in TEST_F()
1779 EXPECT_EQ(self->run.exception_error_code, 0x8005); in TEST_F()
1780 EXPECT_EQ(self->run.exception_addr, data_start); in TEST_F()
1797 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
1799 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
1800 self->run.tcs = self->encl.encl_base; in TEST_F()
1807 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &ioc); in TEST_F()
1828 data_start = self->encl.encl_base + in TEST_F()
1829 encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1841 EXPECT_EQ(ENCL_CALL(&put_addr_op, &self->run, true), 0); in TEST_F()
1843 EXPECT_EEXIT(&self->run); in TEST_F()
1844 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1845 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1846 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1856 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1859 EXPECT_EEXIT(&self->run); in TEST_F()
1860 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1861 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1862 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1867 ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1871 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &ioc); in TEST_F()
1884 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1886 EXPECT_EEXIT(&self->run); in TEST_F()
1887 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1888 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1889 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1899 EXPECT_EQ(ENCL_CALL(&get_addr_op, &self->run, true), 0); in TEST_F()
1907 EXPECT_EQ(self->run.function, ERESUME); in TEST_F()
1908 EXPECT_EQ(self->run.exception_vector, 14); in TEST_F()
1909 EXPECT_EQ(self->run.exception_error_code, 0x8005); in TEST_F()
1910 EXPECT_EQ(self->run.exception_addr, data_start); in TEST_F()
1921 ASSERT_TRUE(setup_test_encl(ENCL_HEAP_SIZE_DEFAULT, &self->encl, _metadata)); in TEST_F()
1928 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1945 memset(&self->run, 0, sizeof(self->run)); in TEST_F()
1946 self->run.tcs = self->encl.encl_base; in TEST_F()
1948 data_start = self->encl.encl_base + in TEST_F()
1949 encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1953 modt_ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1956 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc); in TEST_F()
1974 EXPECT_EQ(ENCL_CALL(&eaccept_op, &self->run, true), 0); in TEST_F()
1975 EXPECT_EEXIT(&self->run); in TEST_F()
1976 EXPECT_EQ(self->run.exception_vector, 0); in TEST_F()
1977 EXPECT_EQ(self->run.exception_error_code, 0); in TEST_F()
1978 EXPECT_EQ(self->run.exception_addr, 0); in TEST_F()
1983 remove_ioc.offset = encl_get_data_offset(&self->encl) + PAGE_SIZE; in TEST_F()
1985 ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_REMOVE_PAGES, &remove_ioc); in TEST_F()