-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We store the size of globals as a shifted value, which extends the maximum size of globals in a compartment from 64 KiB to 256 KiB. This adds two new tests. One is added to the misc test and just checks that we correctly handle globals that are larger than the range of a csetbounds with an immediate offset. The second checks that much larger globals work. This test is disabled because it uses so much RAM that we don't have enough for the allocator tests. At some point, we should refactor the test suite to allow subsets of the test suite to be built. Add test for large objects. Fixes #230
- Loading branch information
1 parent
b043906
commit 7d9e2ef
Showing
8 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "cheri.hh" | ||
#define TEST_NAME "Big Data" | ||
#include "tests.hh" | ||
|
||
extern "C" enum ErrorRecoveryBehaviour | ||
compartment_error_handler(struct ErrorState *frame, size_t mcause, size_t mtval) | ||
{ | ||
debug_log("Detected error in instruction {}", frame->pcc); | ||
debug_log("Error cause: {}, mtval: {}", mcause, mtval); | ||
auto [reg, cause] = CHERI::extract_cheri_mtval(mtval); | ||
debug_log("Error {} in register {}", reg, cause); | ||
return ErrorRecoveryBehaviour::ForceUnwind; | ||
} | ||
|
||
void test_big_data() | ||
{ | ||
register char *cgpRegister asm("cgp"); | ||
asm("" : "=C"(cgpRegister)); | ||
static uint32_t data[16384]; | ||
debug_log("Data: {}", data); | ||
debug_log("CGP: {}", cgpRegister); | ||
debug_log("Fill with for oop"); | ||
for (int i = 0; i < 16000; ++i) { data[i] = 0x01020304; } | ||
debug_log( "Fill with memset"); | ||
memset(data, 0x5a, sizeof(data)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters