From e97aeed1abe5e1be918ced23f6e21af848d9ccaf Mon Sep 17 00:00:00 2001 From: Nick Quarton <139178705+nquarton@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:36:48 -0800 Subject: [PATCH] Disabling stack overflow check for nightly CI for ROM 1.0.x --- .github/workflows/nightly-release.yml | 10 ++++++---- sw-emulator/lib/cpu/Cargo.toml | 3 +++ sw-emulator/lib/cpu/src/cpu.rs | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 105d4e2059..444a6aac2e 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -292,6 +292,8 @@ jobs: rom-logging: false rom-version: "1.1" + # The current 1.0.x ROM used in CI will overflow the stack into unused space + # We disable the stack overflow check (sw_emu_stack_check_disable) when testing against that ROM sw-emulator-hw-1_0-full-suite-etrng-log: name: sw-emulator Suite (etrng, log) needs: find-latest-release @@ -299,7 +301,7 @@ jobs: uses: ./.github/workflows/fw-test-emu.yml with: artifact-suffix: -sw-emulator-hw-1.0-etrng-log - extra-features: hw-1.0,slow_tests + extra-features: hw-1.0,slow_tests,sw_emu_stack_check_disable rom-logging: true rom-version: "1.0" @@ -310,7 +312,7 @@ jobs: uses: ./.github/workflows/fw-test-emu.yml with: artifact-suffix: -sw-emulator-hw-1.0-etrng-nolog - extra-features: hw-1.0,slow_tests + extra-features: hw-1.0,slow_tests,sw_emu_stack_check_disable rom-logging: false rom-version: "1.0" @@ -321,7 +323,7 @@ jobs: uses: ./.github/workflows/fw-test-emu.yml with: artifact-suffix: -sw-emulator-hw-1.0-itrng-log - extra-features: hw-1.0,slow_tests,itrng + extra-features: hw-1.0,slow_tests,itrng,sw_emu_stack_check_disable rom-logging: true rom-version: "1.0" @@ -332,7 +334,7 @@ jobs: uses: ./.github/workflows/fw-test-emu.yml with: artifact-suffix: -sw-emulator-hw-1.0-itrng-nolog - extra-features: hw-1.0,slow_tests,itrng + extra-features: hw-1.0,slow_tests,itrng,sw_emu_stack_check_disable rom-logging: false rom-version: "1.0" diff --git a/sw-emulator/lib/cpu/Cargo.toml b/sw-emulator/lib/cpu/Cargo.toml index 87c9407087..7d6a356018 100644 --- a/sw-emulator/lib/cpu/Cargo.toml +++ b/sw-emulator/lib/cpu/Cargo.toml @@ -15,3 +15,6 @@ caliptra-emu-derive.workspace = true caliptra-emu-types.workspace = true lazy_static.workspace = true tock-registers.workspace = true + +[features] +"sw_emu_stack_check_disable" = [] \ No newline at end of file diff --git a/sw-emulator/lib/cpu/src/cpu.rs b/sw-emulator/lib/cpu/src/cpu.rs index 3daca5e7b5..63d8dc08a4 100644 --- a/sw-emulator/lib/cpu/src/cpu.rs +++ b/sw-emulator/lib/cpu/src/cpu.rs @@ -402,6 +402,7 @@ impl Cpu { /// * `RvException` - Exception with cause `RvExceptionCause::IllegalRegister` pub fn write_xreg(&mut self, reg: XReg, val: RvData) -> Result<(), RvException> { // XReg::X2 is the sp register. + #[cfg(not(feature = "sw_emu_stack_check_disable"))] if reg == XReg::X2 { self.check_stack(val); }