From be710df23742bab304acfea5d206661e353282c4 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 14 Dec 2022 13:13:43 -0800 Subject: [PATCH] Cranelift: Add `.wat` to assembly test support and generate Wasm load/store tests for all ISAs (#5439) * cranelift-filetest: Add the ability to test `.wat` to assembly * Make the load/store test case generator script use `.wat` tests And generate tests that exercise both Wasm-to-CLIF lowering and Wasm all the way to assembly. * Remove old versions of generated load/store tests * Add new generated load/store tests * Fix filename reference in script --- ...0_guard_no_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 80 +++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 80 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 80 +++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 70 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 80 +++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 80 +++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 80 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 80 +++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 70 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 80 +++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 74 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 78 ++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 68 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 74 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 78 ++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 74 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 78 ++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 74 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 78 ++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 74 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 78 ++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 68 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 74 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 78 ++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 74 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 78 ++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 74 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 78 ++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 68 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 72 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 68 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 72 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 68 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 72 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 72 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 54 +++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 56 ++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 54 +++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 56 ++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 54 +++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 56 ++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 54 +++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 56 ++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 66 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 66 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 66 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 66 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 74 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 82 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 84 +++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 72 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 82 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 84 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 78 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 80 +++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 78 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 80 +++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 74 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 82 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 84 +++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 72 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 82 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 84 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 78 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 80 +++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 78 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 80 +++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 80 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 82 +++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 80 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 82 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 68 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 78 ++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 78 ++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 80 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 82 +++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 80 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 82 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 68 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 78 ++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 78 ++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 72 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 68 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 72 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 72 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 58 ++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 62 ++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 58 ++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 62 ++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 58 ++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 62 ++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 58 ++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 62 ++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 74 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 74 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 74 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 74 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 46 ++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 46 ++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 76 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 81 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 97 +++++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 81 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 97 +++++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 88 ++++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 88 ++++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 93 ++++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 88 ++++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 93 ++++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 76 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 81 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 97 +++++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 81 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 97 +++++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 88 ++++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 88 ++++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 93 ++++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 88 ++++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 93 ++++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 74 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 78 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 86 +++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 72 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 78 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 86 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 86 +++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 89 ++++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 89 ++++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 89 ++++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 89 ++++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 74 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 78 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 86 +++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 72 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 78 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 86 +++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 86 +++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 89 ++++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 89 ++++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 89 ++++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 89 ++++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 72 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 75 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 72 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 75 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 69 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 69 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 62 ++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 62 ++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 62 ++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 62 ++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 68 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 72 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 68 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 72 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 73 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 68 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 73 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 68 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 68 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 72 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 68 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 72 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 73 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 68 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 50 +++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 73 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 68 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 50 +++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 84 +++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 84 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 90 ++++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 82 +++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 84 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 90 ++++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 84 +++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 84 +++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 86 +++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 80 +++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 84 +++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 86 +++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 84 +++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 84 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 90 ++++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 82 +++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 84 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 90 ++++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 84 +++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 84 +++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 86 +++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 80 +++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 84 +++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 86 +++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 82 +++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 82 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 88 ++++++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 80 +++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 82 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 88 ++++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 80 +++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 83 +++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 86 +++++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 78 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 83 +++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 86 +++++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 82 +++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 82 +++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 88 ++++++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 80 +++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 82 +++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 88 ++++++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 80 +++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 83 +++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 86 +++++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 78 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 83 +++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 86 +++++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 78 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 78 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 78 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 78 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 76 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 78 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 78 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 68 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 68 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 68 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 68 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 68 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 68 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 68 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 68 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 76 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 74 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 74 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 76 ++++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 76 ++++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 74 ++++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 76 ++++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 54 +++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 74 ++++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 76 ++++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 54 +++++++ ...tore_dynamic_i32_no_guards_no_spectre.clif | 41 ------ ...ore_dynamic_i32_no_guards_yes_spectre.clif | 41 ------ ...ore_dynamic_i32_yes_guards_no_spectre.clif | 41 ------ ...re_dynamic_i32_yes_guards_yes_spectre.clif | 41 ------ ...tore_dynamic_i64_no_guards_no_spectre.clif | 41 ------ ...ore_dynamic_i64_no_guards_yes_spectre.clif | 41 ------ ...ore_dynamic_i64_yes_guards_no_spectre.clif | 41 ------ ...re_dynamic_i64_yes_guards_yes_spectre.clif | 41 ------ ...store_static_i32_no_guards_no_spectre.clif | 41 ------ ...tore_static_i32_no_guards_yes_spectre.clif | 41 ------ ...tore_static_i32_yes_guards_no_spectre.clif | 41 ------ ...ore_static_i32_yes_guards_yes_spectre.clif | 41 ------ ...store_static_i64_no_guards_no_spectre.clif | 41 ------ ...tore_static_i64_no_guards_yes_spectre.clif | 41 ------ ...tore_static_i64_yes_guards_no_spectre.clif | 41 ------ ...ore_static_i64_yes_guards_yes_spectre.clif | 41 ------ .../runtests/make-heap-load-store-tests.sh | 91 ------------ ...0_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 70 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 70 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 70 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 70 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 70 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 70 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 70 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 70 +++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 70 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 70 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 70 +++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 66 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 66 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 66 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 66 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ...0_guard_no_spectre_i32_access_0_offset.wat | 66 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ..._0_guard_no_spectre_i8_access_0_offset.wat | 66 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ...0_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ...f_guard_no_spectre_i32_access_0_offset.wat | 66 +++++++++ ...rd_no_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...o_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ...ff_guard_no_spectre_i8_access_0_offset.wat | 66 +++++++++ ...ard_no_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...no_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ ..._guard_yes_spectre_i32_access_0_offset.wat | 66 +++++++++ ...d_yes_spectre_i32_access_0x1000_offset.wat | 66 +++++++++ ...s_spectre_i32_access_0xffff0000_offset.wat | 66 +++++++++ ...f_guard_yes_spectre_i8_access_0_offset.wat | 66 +++++++++ ...rd_yes_spectre_i8_access_0x1000_offset.wat | 66 +++++++++ ...es_spectre_i8_access_0xffff0000_offset.wat | 66 +++++++++ .../wasm/load-store/make-load-store-tests.sh | 134 ++++++++++++++++++ cranelift/filetests/src/runner.rs | 4 +- cranelift/filetests/src/test_wasm.rs | 30 +++- cranelift/filetests/src/test_wasm/config.rs | 3 + cranelift/filetests/src/test_wasm/env.rs | 26 +++- 502 files changed, 34040 insertions(+), 760 deletions(-) create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_yes_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_no_spectre.clif delete mode 100644 cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_yes_spectre.clif delete mode 100755 cranelift/filetests/filetests/runtests/make-heap-load-store-tests.sh create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat create mode 100644 cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat create mode 100755 cranelift/filetests/filetests/wasm/load-store/make-load-store-tests.sh diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..d4eb6bba53 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; mov w7, w0 +;; ldr x8, [x2, #8] +;; sub x8, x8, #4 +;; subs xzr, x7, x8 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x2] +;; str w1, [x9, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w7, w0 +;; ldr x8, [x1, #8] +;; sub x8, x8, #4 +;; subs xzr, x7, x8 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x1] +;; ldr w0, [x9, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..bcd5760a7c --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2, #8] +;; movn x8, #4099 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x2] +;; add x11, x11, #4096 +;; str w1, [x11, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1, #8] +;; movn x8, #4099 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x1] +;; add x10, x11, #4096 +;; ldr w0, [x10, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..6d0f53cd80 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w10, w0 +;; movn w9, #65531 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x2, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x2] +;; movz x14, #65535, LSL #16 +;; add x13, x14, x13 +;; str w1, [x13, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w10, w0 +;; movn w9, #65531 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x1, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x1] +;; movz x12, #65535, LSL #16 +;; add x12, x12, x13 +;; ldr w0, [x12, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..49420a488d --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; mov w6, w0 +;; ldr x7, [x2, #8] +;; subs xzr, x6, x7 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x8, [x2] +;; strb w1, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w6, w0 +;; ldr x7, [x1, #8] +;; subs xzr, x6, x7 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x8, [x1] +;; ldrb w0, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..3fd48e371a --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2, #8] +;; movn x8, #4096 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x2] +;; add x11, x11, #4096 +;; strb w1, [x11, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1, #8] +;; movn x8, #4096 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x1] +;; add x10, x11, #4096 +;; ldrb w0, [x10, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b823b8bc29 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w10, w0 +;; movn w9, #65534 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x2, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x2] +;; movz x14, #65535, LSL #16 +;; add x13, x14, x13 +;; strb w1, [x13, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w10, w0 +;; movn w9, #65534 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x1, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x1] +;; movz x12, #65535, LSL #16 +;; add x12, x12, x13 +;; ldrb w0, [x12, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..c82e67afa9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; mov w10, w0 +;; ldr x11, [x2, #8] +;; sub x11, x11, #4 +;; ldr x12, [x2] +;; add x12, x12, x0, UXTW +;; movz x9, #0 +;; subs xzr, x10, x11 +;; csel x12, x9, x12, hi +;; csdb +;; str w1, [x12] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w10, w0 +;; ldr x11, [x1, #8] +;; sub x11, x11, #4 +;; ldr x12, [x1] +;; add x12, x12, x0, UXTW +;; movz x9, #0 +;; subs xzr, x10, x11 +;; csel x12, x9, x12, hi +;; csdb +;; ldr w0, [x12] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..fa26d1cf9c --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w12, w0 +;; ldr x13, [x2, #8] +;; movn x11, #4099 +;; add x13, x13, x11 +;; ldr x14, [x2] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; str w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w12, w0 +;; ldr x13, [x1, #8] +;; movn x11, #4099 +;; add x13, x13, x11 +;; ldr x14, [x1] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; ldr w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..1045f257d3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w13, w0 +;; movn w12, #65531 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x2, #8] +;; ldr x2, [x2] +;; add x0, x2, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; str w1, [x0] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w13, w0 +;; movn w12, #65531 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x1, #8] +;; ldr x1, [x1] +;; add x0, x1, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; ldr w0, [x0] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..2c7966fd53 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2, #8] +;; ldr x11, [x2] +;; add x11, x11, x0, UXTW +;; movz x8, #0 +;; subs xzr, x9, x10 +;; csel x11, x8, x11, hs +;; csdb +;; strb w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1, #8] +;; ldr x11, [x1] +;; add x11, x11, x0, UXTW +;; movz x8, #0 +;; subs xzr, x9, x10 +;; csel x11, x8, x11, hs +;; csdb +;; ldrb w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..879af7e76b --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w12, w0 +;; ldr x13, [x2, #8] +;; movn x11, #4096 +;; add x13, x13, x11 +;; ldr x14, [x2] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; strb w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w12, w0 +;; ldr x13, [x1, #8] +;; movn x11, #4096 +;; add x13, x13, x11 +;; ldr x14, [x1] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; ldrb w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ee621302c6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w13, w0 +;; movn w12, #65534 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x2, #8] +;; ldr x2, [x2] +;; add x0, x2, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; strb w1, [x0] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w13, w0 +;; movn w12, #65534 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x1, #8] +;; ldr x1, [x1] +;; add x0, x1, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; ldrb w0, [x0] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..b6c9dfd757 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; mov w7, w0 +;; ldr x8, [x2, #8] +;; sub x8, x8, #4 +;; subs xzr, x7, x8 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x2] +;; str w1, [x9, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w7, w0 +;; ldr x8, [x1, #8] +;; sub x8, x8, #4 +;; subs xzr, x7, x8 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x1] +;; ldr w0, [x9, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..c1a2f8e5b2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2, #8] +;; movn x8, #4099 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x2] +;; add x11, x11, #4096 +;; str w1, [x11, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1, #8] +;; movn x8, #4099 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x1] +;; add x10, x11, #4096 +;; ldr w0, [x10, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..2ede1a5a2e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w10, w0 +;; movn w9, #65531 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x2, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x2] +;; movz x14, #65535, LSL #16 +;; add x13, x14, x13 +;; str w1, [x13, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w10, w0 +;; movn w9, #65531 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x1, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x1] +;; movz x12, #65535, LSL #16 +;; add x12, x12, x13 +;; ldr w0, [x12, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..c039b6351f --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; mov w6, w0 +;; ldr x7, [x2, #8] +;; subs xzr, x6, x7 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x8, [x2] +;; strb w1, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w6, w0 +;; ldr x7, [x1, #8] +;; subs xzr, x6, x7 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x8, [x1] +;; ldrb w0, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..0b2ef270d1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2, #8] +;; movn x8, #4096 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x2] +;; add x11, x11, #4096 +;; strb w1, [x11, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1, #8] +;; movn x8, #4096 +;; add x10, x10, x8 +;; subs xzr, x9, x10 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x11, [x1] +;; add x10, x11, #4096 +;; ldrb w0, [x10, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b68345f1b9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w10, w0 +;; movn w9, #65534 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x2, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x2] +;; movz x14, #65535, LSL #16 +;; add x13, x14, x13 +;; strb w1, [x13, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w10, w0 +;; movn w9, #65534 +;; adds x11, x10, x9 +;; b.lo 8 ; udf +;; ldr x12, [x1, #8] +;; subs xzr, x11, x12 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x13, [x1] +;; movz x12, #65535, LSL #16 +;; add x12, x12, x13 +;; ldrb w0, [x12, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..f2792b70ea --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; mov w10, w0 +;; ldr x11, [x2, #8] +;; sub x11, x11, #4 +;; ldr x12, [x2] +;; add x12, x12, x0, UXTW +;; movz x9, #0 +;; subs xzr, x10, x11 +;; csel x12, x9, x12, hi +;; csdb +;; str w1, [x12] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w10, w0 +;; ldr x11, [x1, #8] +;; sub x11, x11, #4 +;; ldr x12, [x1] +;; add x12, x12, x0, UXTW +;; movz x9, #0 +;; subs xzr, x10, x11 +;; csel x12, x9, x12, hi +;; csdb +;; ldr w0, [x12] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..de731eb7e5 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w12, w0 +;; ldr x13, [x2, #8] +;; movn x11, #4099 +;; add x13, x13, x11 +;; ldr x14, [x2] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; str w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w12, w0 +;; ldr x13, [x1, #8] +;; movn x11, #4099 +;; add x13, x13, x11 +;; ldr x14, [x1] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; ldr w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ecb66f9d8e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w13, w0 +;; movn w12, #65531 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x2, #8] +;; ldr x2, [x2] +;; add x0, x2, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; str w1, [x0] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w13, w0 +;; movn w12, #65531 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x1, #8] +;; ldr x1, [x1] +;; add x0, x1, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; ldr w0, [x0] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..65f07f50c0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2, #8] +;; ldr x11, [x2] +;; add x11, x11, x0, UXTW +;; movz x8, #0 +;; subs xzr, x9, x10 +;; csel x11, x8, x11, hs +;; csdb +;; strb w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1, #8] +;; ldr x11, [x1] +;; add x11, x11, x0, UXTW +;; movz x8, #0 +;; subs xzr, x9, x10 +;; csel x11, x8, x11, hs +;; csdb +;; ldrb w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..903c28106f --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w12, w0 +;; ldr x13, [x2, #8] +;; movn x11, #4096 +;; add x13, x13, x11 +;; ldr x14, [x2] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; strb w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w12, w0 +;; ldr x13, [x1, #8] +;; movn x11, #4096 +;; add x13, x13, x11 +;; ldr x14, [x1] +;; add x14, x14, x0, UXTW +;; add x14, x14, #4096 +;; movz x11, #0 +;; subs xzr, x12, x13 +;; csel x14, x11, x14, hi +;; csdb +;; ldrb w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..172db1ef54 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; mov w13, w0 +;; movn w12, #65534 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x2, #8] +;; ldr x2, [x2] +;; add x0, x2, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; strb w1, [x0] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w13, w0 +;; movn w12, #65534 +;; adds x14, x13, x12 +;; b.lo 8 ; udf +;; ldr x15, [x1, #8] +;; ldr x1, [x1] +;; add x0, x1, x0, UXTW +;; movz x13, #65535, LSL #16 +;; add x0, x0, x13 +;; movz x13, #0 +;; subs xzr, x14, x15 +;; csel x0, x13, x0, hi +;; csdb +;; ldrb w0, [x0] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..15bba90979 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x6, [x2, #8] +;; sub x6, x6, #4 +;; subs xzr, x0, x6 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x2] +;; str w1, [x8, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x6, [x1, #8] +;; sub x6, x6, #4 +;; subs xzr, x0, x6 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x1] +;; ldr w0, [x8, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..cbaae04146 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2, #8] +;; movn x7, #4099 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x2] +;; add x11, x0, #4096 +;; str w1, [x11, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1, #8] +;; movn x7, #4099 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x1] +;; add x9, x0, #4096 +;; ldr w0, [x9, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..95d88d8988 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w8, #65531 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x2, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x2] +;; movz x13, #65535, LSL #16 +;; add x13, x13, x0 +;; str w1, [x13, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movn w8, #65531 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x1, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x1] +;; movz x11, #65535, LSL #16 +;; add x11, x11, x0 +;; ldr w0, [x11, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..4c80c3e4e7 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x5, [x2, #8] +;; subs xzr, x0, x5 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x7, [x2] +;; strb w1, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x5, [x1, #8] +;; subs xzr, x0, x5 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x7, [x1] +;; ldrb w0, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..0a3c767231 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2, #8] +;; movn x7, #4096 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x2] +;; add x11, x0, #4096 +;; strb w1, [x11, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1, #8] +;; movn x7, #4096 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x1] +;; add x9, x0, #4096 +;; ldrb w0, [x9, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..be840953c9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w8, #65534 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x2, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x2] +;; movz x13, #65535, LSL #16 +;; add x13, x13, x0 +;; strb w1, [x13, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movn w8, #65534 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x1, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x1] +;; movz x11, #65535, LSL #16 +;; add x11, x11, x0 +;; ldrb w0, [x11, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..3349ecc0ac --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x9, [x2, #8] +;; sub x9, x9, #4 +;; ldr x10, [x2] +;; add x10, x10, x0 +;; movz x8, #0 +;; subs xzr, x0, x9 +;; csel x11, x8, x10, hi +;; csdb +;; str w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x9, [x1, #8] +;; sub x9, x9, #4 +;; ldr x10, [x1] +;; add x10, x10, x0 +;; movz x8, #0 +;; subs xzr, x0, x9 +;; csel x11, x8, x10, hi +;; csdb +;; ldr w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..23ed4ef0a0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x11, [x2, #8] +;; movn x10, #4099 +;; add x12, x11, x10 +;; ldr x11, [x2] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; str w1, [x13] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x11, [x1, #8] +;; movn x10, #4099 +;; add x12, x11, x10 +;; ldr x11, [x1] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; ldr w0, [x13] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..8a71b333a8 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w11, #65531 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x2, #8] +;; ldr x15, [x2] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; str w1, [x15] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; movn w11, #65531 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x1, #8] +;; ldr x15, [x1] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; ldr w0, [x15] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..7fc77149ab --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2, #8] +;; ldr x9, [x2] +;; add x9, x9, x0 +;; movz x7, #0 +;; subs xzr, x0, x8 +;; csel x10, x7, x9, hs +;; csdb +;; strb w1, [x10] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1, #8] +;; ldr x9, [x1] +;; add x9, x9, x0 +;; movz x7, #0 +;; subs xzr, x0, x8 +;; csel x10, x7, x9, hs +;; csdb +;; ldrb w0, [x10] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..9a16a2fc68 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x11, [x2, #8] +;; movn x10, #4096 +;; add x12, x11, x10 +;; ldr x11, [x2] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; strb w1, [x13] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x11, [x1, #8] +;; movn x10, #4096 +;; add x12, x11, x10 +;; ldr x11, [x1] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; ldrb w0, [x13] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..0457daf21e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w11, #65534 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x2, #8] +;; ldr x15, [x2] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; strb w1, [x15] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; movn w11, #65534 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x1, #8] +;; ldr x15, [x1] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; ldrb w0, [x15] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..2b5d8c3fc3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x6, [x2, #8] +;; sub x6, x6, #4 +;; subs xzr, x0, x6 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x2] +;; str w1, [x8, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x6, [x1, #8] +;; sub x6, x6, #4 +;; subs xzr, x0, x6 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x1] +;; ldr w0, [x8, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..d40999d6e0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2, #8] +;; movn x7, #4099 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x2] +;; add x11, x0, #4096 +;; str w1, [x11, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1, #8] +;; movn x7, #4099 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x1] +;; add x9, x0, #4096 +;; ldr w0, [x9, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..8c429cf53a --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w8, #65531 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x2, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x2] +;; movz x13, #65535, LSL #16 +;; add x13, x13, x0 +;; str w1, [x13, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movn w8, #65531 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x1, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x1] +;; movz x11, #65535, LSL #16 +;; add x11, x11, x0 +;; ldr w0, [x11, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..666b88cbbf --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x5, [x2, #8] +;; subs xzr, x0, x5 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x7, [x2] +;; strb w1, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x5, [x1, #8] +;; subs xzr, x0, x5 +;; b.lo label1 ; b label3 +;; block1: +;; ldr x7, [x1] +;; ldrb w0, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..4488f886e6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2, #8] +;; movn x7, #4096 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x2] +;; add x11, x0, #4096 +;; strb w1, [x11, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1, #8] +;; movn x7, #4096 +;; add x9, x8, x7 +;; subs xzr, x0, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x1] +;; add x9, x0, #4096 +;; ldrb w0, [x9, x10] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..9db0489a4a --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w8, #65534 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x2, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x2] +;; movz x13, #65535, LSL #16 +;; add x13, x13, x0 +;; strb w1, [x13, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movn w8, #65534 +;; adds x10, x0, x8 +;; b.lo 8 ; udf +;; ldr x11, [x1, #8] +;; subs xzr, x10, x11 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x12, [x1] +;; movz x11, #65535, LSL #16 +;; add x11, x11, x0 +;; ldrb w0, [x11, x12] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..c077483338 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x9, [x2, #8] +;; sub x9, x9, #4 +;; ldr x10, [x2] +;; add x10, x10, x0 +;; movz x8, #0 +;; subs xzr, x0, x9 +;; csel x11, x8, x10, hi +;; csdb +;; str w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x9, [x1, #8] +;; sub x9, x9, #4 +;; ldr x10, [x1] +;; add x10, x10, x0 +;; movz x8, #0 +;; subs xzr, x0, x9 +;; csel x11, x8, x10, hi +;; csdb +;; ldr w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..06af27033e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x11, [x2, #8] +;; movn x10, #4099 +;; add x12, x11, x10 +;; ldr x11, [x2] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; str w1, [x13] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x11, [x1, #8] +;; movn x10, #4099 +;; add x12, x11, x10 +;; ldr x11, [x1] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; ldr w0, [x13] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..535faa0c1c --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w11, #65531 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x2, #8] +;; ldr x15, [x2] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; str w1, [x15] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; movn w11, #65531 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x1, #8] +;; ldr x15, [x1] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; ldr w0, [x15] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..f5a3cdff11 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2, #8] +;; ldr x9, [x2] +;; add x9, x9, x0 +;; movz x7, #0 +;; subs xzr, x0, x8 +;; csel x10, x7, x9, hs +;; csdb +;; strb w1, [x10] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1, #8] +;; ldr x9, [x1] +;; add x9, x9, x0 +;; movz x7, #0 +;; subs xzr, x0, x8 +;; csel x10, x7, x9, hs +;; csdb +;; ldrb w0, [x10] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..a324ddc258 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x11, [x2, #8] +;; movn x10, #4096 +;; add x12, x11, x10 +;; ldr x11, [x2] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; strb w1, [x13] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x11, [x1, #8] +;; movn x10, #4096 +;; add x12, x11, x10 +;; ldr x11, [x1] +;; add x11, x11, x0 +;; add x11, x11, #4096 +;; movz x10, #0 +;; subs xzr, x0, x12 +;; csel x13, x10, x11, hi +;; csdb +;; ldrb w0, [x13] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e5d4ccf585 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; movn w11, #65534 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x2, #8] +;; ldr x15, [x2] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; strb w1, [x15] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; movn w11, #65534 +;; adds x13, x0, x11 +;; b.lo 8 ; udf +;; ldr x14, [x1, #8] +;; ldr x15, [x1] +;; add x15, x15, x0 +;; movz x12, #65535, LSL #16 +;; add x15, x15, x12 +;; movz x12, #0 +;; subs xzr, x13, x14 +;; csel x15, x12, x15, hi +;; csdb +;; ldrb w0, [x15] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..cfa9c5f81a --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; mov w6, w0 +;; orr x7, xzr, #268435452 +;; subs xzr, x6, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x2] +;; str w1, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w6, w0 +;; orr x7, xzr, #268435452 +;; subs xzr, x6, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x1] +;; ldr w0, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..c9b271daaf --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w8, w0 +;; movz w9, #61436 +;; movk w9, w9, #4095, LSL #16 +;; subs xzr, x8, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x2] +;; add x10, x10, #4096 +;; str w1, [x10, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w8, w0 +;; movz w9, #61436 +;; movk w9, w9, #4095, LSL #16 +;; subs xzr, x8, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x1] +;; add x9, x10, #4096 +;; ldr w0, [x9, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..df1caebc46 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..602626dc09 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; mov w6, w0 +;; orr x7, xzr, #268435455 +;; subs xzr, x6, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x2] +;; strb w1, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w6, w0 +;; orr x7, xzr, #268435455 +;; subs xzr, x6, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x8, [x1] +;; ldrb w0, [x8, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..60296e3e47 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w8, w0 +;; movz w9, #61439 +;; movk w9, w9, #4095, LSL #16 +;; subs xzr, x8, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x2] +;; add x10, x10, #4096 +;; strb w1, [x10, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; mov w8, w0 +;; movz w9, #61439 +;; movk w9, w9, #4095, LSL #16 +;; subs xzr, x8, x9 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x10, [x1] +;; add x9, x10, #4096 +;; ldrb w0, [x9, w0, UXTW] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..8db0d38772 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..0049a0790d --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2] +;; add x10, x10, x0, UXTW +;; orr x7, xzr, #268435452 +;; movz x11, #0 +;; subs xzr, x9, x7 +;; csel x12, x11, x10, hi +;; csdb +;; str w1, [x12] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1] +;; add x10, x10, x0, UXTW +;; orr x7, xzr, #268435452 +;; movz x11, #0 +;; subs xzr, x9, x7 +;; csel x12, x11, x10, hi +;; csdb +;; ldr w0, [x12] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..1f78efa5eb --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w11, w0 +;; ldr x12, [x2] +;; add x12, x12, x0, UXTW +;; add x12, x12, #4096 +;; movz w9, #61436 +;; movk w9, w9, #4095, LSL #16 +;; movz x13, #0 +;; subs xzr, x11, x9 +;; csel x15, x13, x12, hi +;; csdb +;; str w1, [x15] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w11, w0 +;; ldr x12, [x1] +;; add x12, x12, x0, UXTW +;; add x12, x12, #4096 +;; movz w9, #61436 +;; movk w9, w9, #4095, LSL #16 +;; movz x13, #0 +;; subs xzr, x11, x9 +;; csel x15, x13, x12, hi +;; csdb +;; ldr w0, [x15] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..5cdc824d24 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..f03d73c555 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; mov w9, w0 +;; ldr x10, [x2] +;; add x10, x10, x0, UXTW +;; orr x7, xzr, #268435455 +;; movz x11, #0 +;; subs xzr, x9, x7 +;; csel x12, x11, x10, hi +;; csdb +;; strb w1, [x12] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w9, w0 +;; ldr x10, [x1] +;; add x10, x10, x0, UXTW +;; orr x7, xzr, #268435455 +;; movz x11, #0 +;; subs xzr, x9, x7 +;; csel x12, x11, x10, hi +;; csdb +;; ldrb w0, [x12] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..baf6bd3bc6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; mov w11, w0 +;; ldr x12, [x2] +;; add x12, x12, x0, UXTW +;; add x12, x12, #4096 +;; movz w9, #61439 +;; movk w9, w9, #4095, LSL #16 +;; movz x13, #0 +;; subs xzr, x11, x9 +;; csel x15, x13, x12, hi +;; csdb +;; strb w1, [x15] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; mov w11, w0 +;; ldr x12, [x1] +;; add x12, x12, x0, UXTW +;; add x12, x12, #4096 +;; movz w9, #61439 +;; movk w9, w9, #4095, LSL #16 +;; movz x13, #0 +;; subs xzr, x11, x9 +;; csel x15, x13, x12, hi +;; csdb +;; ldrb w0, [x15] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b012bdf5d1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..0247a4acf3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,54 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x4, [x2] +;; str w1, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x4, [x1] +;; ldr w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..d33617eca9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,56 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x5, [x2] +;; add x5, x5, #4096 +;; str w1, [x5, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x5, [x1] +;; add x4, x5, #4096 +;; ldr w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..a6773c8673 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..985fcdf140 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,54 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x4, [x2] +;; strb w1, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x4, [x1] +;; ldrb w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..77d6d0598c --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,56 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x5, [x2] +;; add x5, x5, #4096 +;; strb w1, [x5, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x5, [x1] +;; add x4, x5, #4096 +;; ldrb w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..11b44de08e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..62b9dec59e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,54 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x4, [x2] +;; str w1, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x4, [x1] +;; ldr w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..7b610d167d --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,56 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x5, [x2] +;; add x5, x5, #4096 +;; str w1, [x5, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x5, [x1] +;; add x4, x5, #4096 +;; ldr w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..d0d62100fe --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..6be5ab6933 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,54 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x4, [x2] +;; strb w1, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x4, [x1] +;; ldrb w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..d8b759dc57 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,56 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x5, [x2] +;; add x5, x5, #4096 +;; strb w1, [x5, w0, UXTW] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x5, [x1] +;; add x4, x5, #4096 +;; ldrb w0, [x4, w0, UXTW] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..bc1227b994 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..a827cbd940 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; orr x5, xzr, #268435452 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x2] +;; str w1, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; orr x5, xzr, #268435452 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x1] +;; ldr w0, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..8e47267332 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; movz w7, #61436 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x2] +;; add x10, x0, #4096 +;; str w1, [x10, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movz w7, #61436 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x1] +;; add x8, x0, #4096 +;; ldr w0, [x8, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..45da79cdb5 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..bd897201a3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; orr x5, xzr, #268435455 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x2] +;; strb w1, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; orr x5, xzr, #268435455 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x1] +;; ldrb w0, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..95f8087302 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; movz w7, #61439 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x2] +;; add x10, x0, #4096 +;; strb w1, [x10, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movz w7, #61439 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x1] +;; add x8, x0, #4096 +;; ldrb w0, [x8, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f67e084528 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..bf44169940 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2] +;; add x8, x8, x0 +;; orr x6, xzr, #268435452 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; str w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1] +;; add x8, x8, x0 +;; orr x6, xzr, #268435452 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; ldr w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..3a21ca2702 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x10, [x2] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61436 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; str w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x10, [x1] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61436 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; ldr w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..c21d2caa23 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a198194868 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2] +;; add x8, x8, x0 +;; orr x6, xzr, #268435455 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; strb w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1] +;; add x8, x8, x0 +;; orr x6, xzr, #268435455 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; ldrb w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..89cdcd61b9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x10, [x2] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61439 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; strb w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x10, [x1] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61439 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; ldrb w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e72895b062 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..97065ce72e --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; orr x5, xzr, #268435452 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x2] +;; str w1, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; orr x5, xzr, #268435452 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x1] +;; ldr w0, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..4779c70c24 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; movz w7, #61436 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x2] +;; add x10, x0, #4096 +;; str w1, [x10, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movz w7, #61436 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x1] +;; add x8, x0, #4096 +;; ldr w0, [x8, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..5d6ab28cf3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a3fa2d47aa --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; orr x5, xzr, #268435455 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x2] +;; strb w1, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; orr x5, xzr, #268435455 +;; subs xzr, x0, x5 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x7, [x1] +;; ldrb w0, [x7, x0] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..d6718365e2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; movz w7, #61439 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x2] +;; add x10, x0, #4096 +;; strb w1, [x10, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; movz w7, #61439 +;; movk w7, w7, #4095, LSL #16 +;; subs xzr, x0, x7 +;; b.ls label1 ; b label3 +;; block1: +;; ldr x9, [x1] +;; add x8, x0, #4096 +;; ldrb w0, [x8, x9] +;; b label2 +;; block2: +;; ret +;; block3: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b176811d00 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..a2441e1b72 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2] +;; add x8, x8, x0 +;; orr x6, xzr, #268435452 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; str w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1] +;; add x8, x8, x0 +;; orr x6, xzr, #268435452 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; ldr w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..e3a91edf66 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x10, [x2] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61436 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; str w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x10, [x1] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61436 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; ldr w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..cf7e58ea38 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..6ef1108ef3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ldr x8, [x2] +;; add x8, x8, x0 +;; orr x6, xzr, #268435455 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; strb w1, [x11] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x8, [x1] +;; add x8, x8, x0 +;; orr x6, xzr, #268435455 +;; movz x9, #0 +;; subs xzr, x0, x6 +;; csel x11, x9, x8, hi +;; csdb +;; ldrb w0, [x11] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..3f60bb8bd9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ldr x10, [x2] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61439 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; strb w1, [x14] +;; b label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ldr x10, [x1] +;; add x10, x10, x0 +;; add x10, x10, #4096 +;; movz w8, #61439 +;; movk w8, w8, #4095, LSL #16 +;; movz x11, #0 +;; subs xzr, x0, x8 +;; csel x14, x11, x10, hi +;; csdb +;; ldrb w0, [x14] +;; b label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..cfd4909140 --- /dev/null +++ b/cranelift/filetests/filetests/isa/aarch64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "aarch64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf #0xc11f +;; +;; function u0:1: +;; block0: +;; udf #0xc11f \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..094bcec0e5 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a6,a0 +;; ld a7,8(a2) +;; addi a7,a7,-4 +;; ule a7,a6,a7##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a2) +;; add a7,a7,a6 +;; sw a1,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w a6,a0 +;; ld a7,8(a1) +;; addi a7,a7,-4 +;; ule a7,a6,a7##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a1) +;; add a7,a7,a6 +;; lw a0,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..988e99e808 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a2) +;; lui t4,1048575 +;; addi t4,t4,4092 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; sw a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a1) +;; lui t4,1048575 +;; addi t4,t4,4092 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; lw a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..8125a69d12 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0004 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a2) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a2) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; sw a1,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0004 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a1) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a1) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; lw a0,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..615bac9516 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a5,a0 +;; ld a6,8(a2) +;; ult a6,a5,a6##ty=i64 +;; bne a6,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a5 +;; sb a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w a5,a0 +;; ld a6,8(a1) +;; ult a6,a5,a6##ty=i64 +;; bne a6,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a5 +;; lbu a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..1d6c2aa3a2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a2) +;; lui t4,1048575 +;; addi t4,t4,4095 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; sb a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a1) +;; lui t4,1048575 +;; addi t4,t4,4095 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; lbu a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..11170dc238 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0001 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a2) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a2) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; sb a1,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0001 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a1) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a1) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; lbu a0,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..8cd38b1d86 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w t3,a0 +;; ld t4,8(a2) +;; addi t4,t4,-4 +;; ld t0,0(a2) +;; add t0,t0,t3 +;; ugt a7,t3,t4##ty=i64 +;; li t4,0 +;; selectif_spectre_guard t3,t4,t0##test=a7 +;; sw a1,0(t3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t3,a0 +;; ld t4,8(a1) +;; addi t4,t4,-4 +;; ld t0,0(a1) +;; add t0,t0,t3 +;; ugt a7,t3,t4##ty=i64 +;; li t4,0 +;; selectif_spectre_guard t3,t4,t0##test=a7 +;; lw a0,0(t3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..27e9956181 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a2) +;; lui t1,1048575 +;; addi t1,t1,4092 +;; add a3,a0,t1 +;; ld a0,0(a2) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a3##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sw a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a1) +;; lui t1,1048575 +;; addi t1,t1,4092 +;; add a2,a0,t1 +;; ld a0,0(a1) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lw a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..98afb5b82f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0004 +;; add t2,a0,t0 +;; ult a3,t2,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld a3,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a2,a0,a2 +;; ugt t2,t2,a3##ty=i64 +;; li a3,0 +;; selectif_spectre_guard a0,a3,a2##test=t2 +;; sw a1,0(a0) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0004 +;; add t2,a0,t0 +;; ult a2,t2,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld a2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a1,a0,a1 +;; ugt t2,t2,a2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard a0,a2,a1##test=t2 +;; lw a0,0(a0) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a39f703d2e --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a7,a0 +;; ld t3,8(a2) +;; ld t4,0(a2) +;; add t4,t4,a7 +;; uge a6,a7,t3##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a7,t3,t4##test=a6 +;; sb a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a7,a0 +;; ld t3,8(a1) +;; ld t4,0(a1) +;; add t4,t4,a7 +;; uge a6,a7,t3##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a7,t3,t4##test=a6 +;; lbu a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..d258ac3c4c --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a2) +;; lui t1,1048575 +;; addi t1,t1,4095 +;; add a3,a0,t1 +;; ld a0,0(a2) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a3##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sb a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a1) +;; lui t1,1048575 +;; addi t1,t1,4095 +;; add a2,a0,t1 +;; ld a0,0(a1) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lbu a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..8088426a5f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0001 +;; add t2,a0,t0 +;; ult a3,t2,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld a3,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a2,a0,a2 +;; ugt t2,t2,a3##ty=i64 +;; li a3,0 +;; selectif_spectre_guard a0,a3,a2##test=t2 +;; sb a1,0(a0) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0001 +;; add t2,a0,t0 +;; ult a2,t2,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld a2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a1,a0,a1 +;; ugt t2,t2,a2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard a0,a2,a1##test=t2 +;; lbu a0,0(a0) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..d896eadf16 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a6,a0 +;; ld a7,8(a2) +;; addi a7,a7,-4 +;; ule a7,a6,a7##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a2) +;; add a7,a7,a6 +;; sw a1,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w a6,a0 +;; ld a7,8(a1) +;; addi a7,a7,-4 +;; ule a7,a6,a7##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a1) +;; add a7,a7,a6 +;; lw a0,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..1a06a74a1e --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a2) +;; lui t4,1048575 +;; addi t4,t4,4092 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; sw a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a1) +;; lui t4,1048575 +;; addi t4,t4,4092 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; lw a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e59f6b26e4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0004 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a2) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a2) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; sw a1,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0004 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a1) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a1) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; lw a0,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..5ff0d386c4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a5,a0 +;; ld a6,8(a2) +;; ult a6,a5,a6##ty=i64 +;; bne a6,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a5 +;; sb a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w a5,a0 +;; ld a6,8(a1) +;; ult a6,a5,a6##ty=i64 +;; bne a6,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a5 +;; lbu a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..1f1ba32605 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a2) +;; lui t4,1048575 +;; addi t4,t4,4095 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; sb a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; ld t1,8(a1) +;; lui t4,1048575 +;; addi t4,t4,4095 +;; add t2,t1,t4 +;; ule t1,t0,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,t0 +;; lui t0,1 +;; add t2,t1,t0 +;; lbu a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e50a943411 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0001 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a2) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a2) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; sb a1,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; auipc t3,0; ld t3,12(t3); j 12; .8byte 0xffff0001 +;; add t1,t0,t3 +;; ult t2,t1,t0##ty=i64 +;; trap_if t2,heap_oob +;; ld t2,8(a1) +;; ule t1,t1,t2##ty=i64 +;; bne t1,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t2,0(a1) +;; add t2,t2,t0 +;; auipc t1,0; ld t1,12(t1); j 12; .8byte 0xffff0000 +;; add a0,t2,t1 +;; lbu a0,0(a0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..b4b8f8aa4b --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w t3,a0 +;; ld t4,8(a2) +;; addi t4,t4,-4 +;; ld t0,0(a2) +;; add t0,t0,t3 +;; ugt a7,t3,t4##ty=i64 +;; li t4,0 +;; selectif_spectre_guard t3,t4,t0##test=a7 +;; sw a1,0(t3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t3,a0 +;; ld t4,8(a1) +;; addi t4,t4,-4 +;; ld t0,0(a1) +;; add t0,t0,t3 +;; ugt a7,t3,t4##ty=i64 +;; li t4,0 +;; selectif_spectre_guard t3,t4,t0##test=a7 +;; lw a0,0(t3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..874019fb5d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a2) +;; lui t1,1048575 +;; addi t1,t1,4092 +;; add a3,a0,t1 +;; ld a0,0(a2) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a3##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sw a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a1) +;; lui t1,1048575 +;; addi t1,t1,4092 +;; add a2,a0,t1 +;; ld a0,0(a1) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lw a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f613be130b --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0004 +;; add t2,a0,t0 +;; ult a3,t2,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld a3,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a2,a0,a2 +;; ugt t2,t2,a3##ty=i64 +;; li a3,0 +;; selectif_spectre_guard a0,a3,a2##test=t2 +;; sw a1,0(a0) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0004 +;; add t2,a0,t0 +;; ult a2,t2,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld a2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a1,a0,a1 +;; ugt t2,t2,a2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard a0,a2,a1##test=t2 +;; lw a0,0(a0) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..7b5a80e7b1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a7,a0 +;; ld t3,8(a2) +;; ld t4,0(a2) +;; add t4,t4,a7 +;; uge a6,a7,t3##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a7,t3,t4##test=a6 +;; sb a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a7,a0 +;; ld t3,8(a1) +;; ld t4,0(a1) +;; add t4,t4,a7 +;; uge a6,a7,t3##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a7,t3,t4##test=a6 +;; lbu a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..dce3d5cafd --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a2) +;; lui t1,1048575 +;; addi t1,t1,4095 +;; add a3,a0,t1 +;; ld a0,0(a2) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a3##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sb a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t2,a0 +;; ld a0,8(a1) +;; lui t1,1048575 +;; addi t1,t1,4095 +;; add a2,a0,t1 +;; ld a0,0(a1) +;; add a0,a0,t2 +;; lui t1,1 +;; add a0,a0,t1 +;; ugt t1,t2,a2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lbu a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b34c53839b --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0001 +;; add t2,a0,t0 +;; ult a3,t2,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld a3,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a2,a0,a2 +;; ugt t2,t2,a3##ty=i64 +;; li a3,0 +;; selectif_spectre_guard a0,a3,a2##test=t2 +;; sb a1,0(a0) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a0,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0001 +;; add t2,a0,t0 +;; ult a2,t2,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld a2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a1,a0,a1 +;; ugt t2,t2,a2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard a0,a2,a1##test=t2 +;; lbu a0,0(a0) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..821dee400f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ld a5,8(a2) +;; addi a5,a5,-4 +;; ule a5,a0,a5##ty=i64 +;; bne a5,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a0 +;; sw a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld a5,8(a1) +;; addi a5,a5,-4 +;; ule a5,a0,a5##ty=i64 +;; bne a5,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a0 +;; lw a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..863bc69b39 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,8(a2) +;; lui t3,1048575 +;; addi t3,t3,4092 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a2) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; sw a1,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld t4,8(a1) +;; lui t3,1048575 +;; addi t3,t3,4092 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a1) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; lw a0,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..d7629a4711 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0004 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a2) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; sw a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0004 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a1) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; lw a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..36783cb239 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ld a4,8(a2) +;; ult a4,a0,a4##ty=i64 +;; bne a4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a5,0(a2) +;; add a5,a5,a0 +;; sb a1,0(a5) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld a4,8(a1) +;; ult a4,a0,a4##ty=i64 +;; bne a4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a5,0(a1) +;; add a5,a5,a0 +;; lbu a0,0(a5) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..3048a5c0b4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,8(a2) +;; lui t3,1048575 +;; addi t3,t3,4095 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a2) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; sb a1,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld t4,8(a1) +;; lui t3,1048575 +;; addi t3,t3,4095 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a1) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; lbu a0,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e73189853d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0001 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a2) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; sb a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0001 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a1) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; lbu a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..f8c8987729 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ld a7,8(a2) +;; addi a7,a7,-4 +;; ld t3,0(a2) +;; add t3,t3,a0 +;; ugt a6,a0,a7##ty=i64 +;; li t4,0 +;; selectif_spectre_guard a7,t4,t3##test=a6 +;; sw a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a7,8(a1) +;; addi a7,a7,-4 +;; ld t3,0(a1) +;; add t3,t3,a0 +;; ugt a6,a0,a7##ty=i64 +;; li t4,0 +;; selectif_spectre_guard a7,t4,t3##test=a6 +;; lw a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..0c7024c3f8 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t1,8(a2) +;; lui t0,1048575 +;; addi t0,t0,4092 +;; add a3,t1,t0 +;; ld t1,0(a2) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; sw a1,0(t1) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t1,8(a1) +;; lui t0,1048575 +;; addi t0,t0,4092 +;; add a2,t1,t0 +;; ld t1,0(a1) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a2##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; lw a0,0(t1) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..bf692814db --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0004 +;; add t1,a0,t4 +;; ult a3,t1,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld t2,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a0,a0,a2 +;; ugt t1,t1,t2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sw a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0004 +;; add t1,a0,t4 +;; ult a2,t1,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld t2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a0,a0,a1 +;; ugt t1,t1,t2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lw a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..b2658aa514 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ld a6,8(a2) +;; ld a7,0(a2) +;; add a7,a7,a0 +;; uge a5,a0,a6##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a6,t3,a7##test=a5 +;; sb a1,0(a6) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a6,8(a1) +;; ld a7,0(a1) +;; add a7,a7,a0 +;; uge a5,a0,a6##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a6,t3,a7##test=a5 +;; lbu a0,0(a6) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..ec69de30c6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t1,8(a2) +;; lui t0,1048575 +;; addi t0,t0,4095 +;; add a3,t1,t0 +;; ld t1,0(a2) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; sb a1,0(t1) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t1,8(a1) +;; lui t0,1048575 +;; addi t0,t0,4095 +;; add a2,t1,t0 +;; ld t1,0(a1) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a2##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; lbu a0,0(t1) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..c0de90c270 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0001 +;; add t1,a0,t4 +;; ult a3,t1,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld t2,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a0,a0,a2 +;; ugt t1,t1,t2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sb a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0001 +;; add t1,a0,t4 +;; ult a2,t1,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld t2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a0,a0,a1 +;; ugt t1,t1,t2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lbu a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..64331034ad --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ld a5,8(a2) +;; addi a5,a5,-4 +;; ule a5,a0,a5##ty=i64 +;; bne a5,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a0 +;; sw a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld a5,8(a1) +;; addi a5,a5,-4 +;; ule a5,a0,a5##ty=i64 +;; bne a5,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a0 +;; lw a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..d0b5e101f1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,8(a2) +;; lui t3,1048575 +;; addi t3,t3,4092 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a2) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; sw a1,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld t4,8(a1) +;; lui t3,1048575 +;; addi t3,t3,4092 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a1) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; lw a0,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..c509b188a0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0004 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a2) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; sw a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0004 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a1) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; lw a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..5daa2c0be4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ld a4,8(a2) +;; ult a4,a0,a4##ty=i64 +;; bne a4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a5,0(a2) +;; add a5,a5,a0 +;; sb a1,0(a5) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld a4,8(a1) +;; ult a4,a0,a4##ty=i64 +;; bne a4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a5,0(a1) +;; add a5,a5,a0 +;; lbu a0,0(a5) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..532cf646bb --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,80 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,8(a2) +;; lui t3,1048575 +;; addi t3,t3,4095 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a2) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; sb a1,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; ld t4,8(a1) +;; lui t3,1048575 +;; addi t3,t3,4095 +;; add t1,t4,t3 +;; ule t4,a0,t1##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t0,0(a1) +;; add t0,t0,a0 +;; lui t4,1 +;; add t1,t0,t4 +;; lbu a0,0(t1) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..05eb78d444 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0001 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a2) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a2) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; sb a1,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; auipc a7,0; ld a7,12(a7); j 12; .8byte 0xffff0001 +;; add t4,a0,a7 +;; ult t1,t4,a0##ty=i64 +;; trap_if t1,heap_oob +;; ld t0,8(a1) +;; ule t0,t4,t0##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t1,0(a1) +;; add t1,t1,a0 +;; auipc t0,0; ld t0,12(t0); j 12; .8byte 0xffff0000 +;; add t2,t1,t0 +;; lbu a0,0(t2) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..1394499d0d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ld a7,8(a2) +;; addi a7,a7,-4 +;; ld t3,0(a2) +;; add t3,t3,a0 +;; ugt a6,a0,a7##ty=i64 +;; li t4,0 +;; selectif_spectre_guard a7,t4,t3##test=a6 +;; sw a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a7,8(a1) +;; addi a7,a7,-4 +;; ld t3,0(a1) +;; add t3,t3,a0 +;; ugt a6,a0,a7##ty=i64 +;; li t4,0 +;; selectif_spectre_guard a7,t4,t3##test=a6 +;; lw a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..dcea0981e2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t1,8(a2) +;; lui t0,1048575 +;; addi t0,t0,4092 +;; add a3,t1,t0 +;; ld t1,0(a2) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; sw a1,0(t1) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t1,8(a1) +;; lui t0,1048575 +;; addi t0,t0,4092 +;; add a2,t1,t0 +;; ld t1,0(a1) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a2##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; lw a0,0(t1) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e5762ae96d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0004 +;; add t1,a0,t4 +;; ult a3,t1,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld t2,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a0,a0,a2 +;; ugt t1,t1,t2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sw a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0004 +;; add t1,a0,t4 +;; ult a2,t1,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld t2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a0,a0,a1 +;; ugt t1,t1,t2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lw a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..0818bc6b2f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ld a6,8(a2) +;; ld a7,0(a2) +;; add a7,a7,a0 +;; uge a5,a0,a6##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a6,t3,a7##test=a5 +;; sb a1,0(a6) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a6,8(a1) +;; ld a7,0(a1) +;; add a7,a7,a0 +;; uge a5,a0,a6##ty=i64 +;; li t3,0 +;; selectif_spectre_guard a6,t3,a7##test=a5 +;; lbu a0,0(a6) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..6a3f5877ce --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t1,8(a2) +;; lui t0,1048575 +;; addi t0,t0,4095 +;; add a3,t1,t0 +;; ld t1,0(a2) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; sb a1,0(t1) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t1,8(a1) +;; lui t0,1048575 +;; addi t0,t0,4095 +;; add a2,t1,t0 +;; ld t1,0(a1) +;; add t1,t1,a0 +;; lui t0,1 +;; add t2,t1,t0 +;; ugt t0,a0,a2##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t1,a0,t2##test=t0 +;; lbu a0,0(t1) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..a4b0f0c6a3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0001 +;; add t1,a0,t4 +;; ult a3,t1,a0##ty=i64 +;; trap_if a3,heap_oob +;; ld t2,8(a2) +;; ld a2,0(a2) +;; add a0,a2,a0 +;; auipc a2,0; ld a2,12(a2); j 12; .8byte 0xffff0000 +;; add a0,a0,a2 +;; ugt t1,t1,t2##ty=i64 +;; li a2,0 +;; selectif_spectre_guard t2,a2,a0##test=t1 +;; sb a1,0(t2) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; auipc t4,0; ld t4,12(t4); j 12; .8byte 0xffff0001 +;; add t1,a0,t4 +;; ult a2,t1,a0##ty=i64 +;; trap_if a2,heap_oob +;; ld t2,8(a1) +;; ld a1,0(a1) +;; add a0,a1,a0 +;; auipc a1,0; ld a1,12(a1); j 12; .8byte 0xffff0000 +;; add a0,a0,a1 +;; ugt t1,t1,t2##ty=i64 +;; li a1,0 +;; selectif_spectre_guard t2,a1,a0##test=t1 +;; lbu a0,0(t2) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..6af0cbaa67 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a6,a0 +;; lui a5,65536 +;; addi a5,a5,4092 +;; ule t3,a6,a5##ty=i64 +;; bne t3,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a2) +;; add a7,a7,a6 +;; sw a1,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w a6,a0 +;; lui a5,65536 +;; addi a5,a5,4092 +;; ule t3,a6,a5##ty=i64 +;; bne t3,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a1) +;; add a7,a7,a6 +;; lw a0,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..0c53c31566 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t3,a0 +;; lui a7,65535 +;; addi a7,a7,4092 +;; ule t0,t3,a7##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t4,0(a2) +;; add t4,t4,t3 +;; lui t3,1 +;; add t0,t4,t3 +;; sw a1,0(t0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t3,a0 +;; lui a7,65535 +;; addi a7,a7,4092 +;; ule t0,t3,a7##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t4,0(a1) +;; add t4,t4,t3 +;; lui t3,1 +;; add t0,t4,t3 +;; lw a0,0(t0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..186d975692 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..1543356ad0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a6,a0 +;; lui a5,65536 +;; addi a5,a5,4095 +;; ule t3,a6,a5##ty=i64 +;; bne t3,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a2) +;; add a7,a7,a6 +;; sb a1,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w a6,a0 +;; lui a5,65536 +;; addi a5,a5,4095 +;; ule t3,a6,a5##ty=i64 +;; bne t3,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a7,0(a1) +;; add a7,a7,a6 +;; lbu a0,0(a7) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..da9001913d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t3,a0 +;; lui a7,65535 +;; addi a7,a7,4095 +;; ule t0,t3,a7##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t4,0(a2) +;; add t4,t4,t3 +;; lui t3,1 +;; add t0,t4,t3 +;; sb a1,0(t0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; uext.w t3,a0 +;; lui a7,65535 +;; addi a7,a7,4095 +;; ule t0,t3,a7##ty=i64 +;; bne t0,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t4,0(a1) +;; add t4,t4,t3 +;; lui t3,1 +;; add t0,t4,t3 +;; lbu a0,0(t0) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..162da88fc7 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..6b6f0d5fd6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w t3,a0 +;; ld t4,0(a2) +;; add t4,t4,t3 +;; lui a6,65536 +;; addi a6,a6,4092 +;; ugt t0,t3,a6##ty=i64 +;; li t1,0 +;; selectif_spectre_guard t3,t1,t4##test=t0 +;; sw a1,0(t3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t3,a0 +;; ld t4,0(a1) +;; add t4,t4,t3 +;; lui a6,65536 +;; addi a6,a6,4092 +;; ugt t0,t3,a6##ty=i64 +;; li t1,0 +;; selectif_spectre_guard t3,t1,t4##test=t0 +;; lw a0,0(t3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..1244a323d2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; ld t1,0(a2) +;; add t1,t1,t0 +;; lui t4,1 +;; add t1,t1,t4 +;; lui t3,65535 +;; addi t3,t3,4092 +;; ugt t2,t0,t3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t0,a0,t1##test=t2 +;; sw a1,0(t0) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; ld t1,0(a1) +;; add t1,t1,t0 +;; lui t4,1 +;; add t1,t1,t4 +;; lui t3,65535 +;; addi t3,t3,4092 +;; ugt t2,t0,t3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t0,a0,t1##test=t2 +;; lw a0,0(t0) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..eafaf4ef13 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..fc21d9a220 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w t3,a0 +;; ld t4,0(a2) +;; add t4,t4,t3 +;; lui a6,65536 +;; addi a6,a6,4095 +;; ugt t0,t3,a6##ty=i64 +;; li t1,0 +;; selectif_spectre_guard t3,t1,t4##test=t0 +;; sb a1,0(t3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t3,a0 +;; ld t4,0(a1) +;; add t4,t4,t3 +;; lui a6,65536 +;; addi a6,a6,4095 +;; ugt t0,t3,a6##ty=i64 +;; li t1,0 +;; selectif_spectre_guard t3,t1,t4##test=t0 +;; lbu a0,0(t3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..f15246b82d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w t0,a0 +;; ld t1,0(a2) +;; add t1,t1,t0 +;; lui t4,1 +;; add t1,t1,t4 +;; lui t3,65535 +;; addi t3,t3,4095 +;; ugt t2,t0,t3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t0,a0,t1##test=t2 +;; sb a1,0(t0) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w t0,a0 +;; ld t1,0(a1) +;; add t1,t1,t0 +;; lui t4,1 +;; add t1,t1,t4 +;; lui t3,65535 +;; addi t3,t3,4095 +;; ugt t2,t0,t3##ty=i64 +;; li a0,0 +;; selectif_spectre_guard t0,a0,t1##test=t2 +;; lbu a0,0(t0) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..084fc90ac4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..70ddfd4750 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,58 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a2) +;; add a3,a4,a3 +;; sw a1,0(a3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a1) +;; add a3,a4,a3 +;; lw a0,0(a3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..b14789ed1f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,62 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a2) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; sw a1,0(a6) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a1) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; lw a0,0(a6) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..9307ec8c74 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..485b53e31f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,58 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a2) +;; add a3,a4,a3 +;; sb a1,0(a3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a1) +;; add a3,a4,a3 +;; lbu a0,0(a3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..32d610bf87 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,62 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a2) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; sb a1,0(a6) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a1) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; lbu a0,0(a6) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b80b341475 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..35af1aca9d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,58 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a2) +;; add a3,a4,a3 +;; sw a1,0(a3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a1) +;; add a3,a4,a3 +;; lw a0,0(a3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..b1164c8be4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,62 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a2) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; sw a1,0(a6) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a1) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; lw a0,0(a6) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b0c6cc3980 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..505fd34494 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,58 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a2) +;; add a3,a4,a3 +;; sb a1,0(a3) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a3,a0 +;; ld a4,0(a1) +;; add a3,a4,a3 +;; lbu a0,0(a3) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..e94a3e2d48 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,62 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a2) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; sb a1,0(a6) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; uext.w a5,a0 +;; ld a6,0(a1) +;; add a5,a6,a5 +;; lui a4,1 +;; add a6,a5,a4 +;; lbu a0,0(a6) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..8eefcbb200 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..29856b085f --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4092 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a0 +;; sw a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4092 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a0 +;; lw a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..1e95a0c1ea --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4092 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a2) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; sw a1,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4092 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a1) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; lw a0,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..387204d0da --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..aa270442d4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4095 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a0 +;; sb a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4095 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a0 +;; lbu a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..a3a6eff4af --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4095 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a2) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; sb a1,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4095 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a1) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; lbu a0,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..1104e644c3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..bb4b66f545 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ld a7,0(a2) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4092 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; sw a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a7,0(a1) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4092 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; lw a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..3039686489 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,0(a2) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4092 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; sw a1,0(t4) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t4,0(a1) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4092 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; lw a0,0(t4) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..d84c81cf50 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..37f86c7620 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ld a7,0(a2) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4095 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; sb a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a7,0(a1) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4095 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; lbu a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..64a1daff3e --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,0(a2) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4095 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; sb a1,0(t4) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t4,0(a1) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4095 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; lbu a0,0(t4) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..49190329a4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..25b7c6fd26 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4092 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a0 +;; sw a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4092 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a0 +;; lw a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..4863723b84 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4092 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a2) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; sw a1,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4092 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a1) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; lw a0,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..4dd28696b2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..73bc2983d2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4095 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a2) +;; add a6,a6,a0 +;; sb a1,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a4,65536 +;; addi a4,a4,4095 +;; ule a7,a0,a4##ty=i64 +;; bne a7,zero,taken(label1),not_taken(label3) +;; block1: +;; ld a6,0(a1) +;; add a6,a6,a0 +;; lbu a0,0(a6) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..b25b88f5b1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,74 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4095 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a2) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; sb a1,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; lui a6,65535 +;; addi a6,a6,4095 +;; ule t4,a0,a6##ty=i64 +;; bne t4,zero,taken(label1),not_taken(label3) +;; block1: +;; ld t3,0(a1) +;; add t3,t3,a0 +;; lui a7,1 +;; add t4,t3,a7 +;; lbu a0,0(t4) +;; j label2 +;; block2: +;; ret +;; block3: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..93b2ed4755 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..dd24c07a1e --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; block0: +;; ld a7,0(a2) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4092 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; sw a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a7,0(a1) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4092 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; lw a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..0adb37c09d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,0(a2) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4092 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; sw a1,0(t4) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t4,0(a1) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4092 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; lw a0,0(t4) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..2777fe3707 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..ada4120532 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; block0: +;; ld a7,0(a2) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4095 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; sb a1,0(a7) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld a7,0(a1) +;; add a7,a7,a0 +;; lui a5,65536 +;; addi a5,a5,4095 +;; ugt t3,a0,a5##ty=i64 +;; li t0,0 +;; selectif_spectre_guard a7,t0,a7##test=t3 +;; lbu a0,0(a7) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..c593deacf2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; block0: +;; ld t4,0(a2) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4095 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; sb a1,0(t4) +;; j label1 +;; block1: +;; ret +;; +;; function u0:1: +;; block0: +;; ld t4,0(a1) +;; add t4,t4,a0 +;; lui t3,1 +;; add t0,t4,t3 +;; lui a7,65535 +;; addi a7,a7,4095 +;; ugt t1,a0,a7##ty=i64 +;; li t2,0 +;; selectif_spectre_guard t4,t2,t0##test=t1 +;; lbu a0,0(t4) +;; j label1 +;; block1: +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b0c522984d --- /dev/null +++ b/cranelift/filetests/filetests/isa/riscv64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,46 @@ +;;! target = "riscv64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; block0: +;; udf##trap_code=heap_oob +;; +;; function u0:1: +;; block0: +;; udf##trap_code=heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..70be41259e --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lghi %r2, -4 +;; ag %r2, 8(%r4) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; strv %r3, 0(%r5,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lghi %r2, -4 +;; ag %r2, 8(%r3) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r3, 0(%r3) +;; lrv %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..6a783d780b --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,81 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lghi %r2, -4100 +;; ag %r2, 8(%r5) +;; clgr %r4, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; lghi %r5, 4096 +;; strv %r3, 0(%r5,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; lghi %r2, -4100 +;; lgr %r5, %r4 +;; ag %r2, 8(%r5) +;; clgr %r3, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r5) +;; lghi %r4, 4096 +;; lrv %r2, 0(%r4,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f0e39bea97 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,97 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r4 +;; llgfr %r4, %r2 +;; lgr %r5, %r2 +;; llilf %r2, 4294901764 +;; algfr %r2, %r5 +;; jle 6 ; trap +;; lgr %r5, %r7 +;; lg %r7, 8(%r5) +;; clgr %r2, %r7 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; llilh %r2, 65535 +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901764 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lg %r2, 8(%r4) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r4) +;; llilh %r5, 65535 +;; lrv %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..b437d143f8 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lgr %r2, %r5 +;; lg %r5, 8(%r2) +;; clgr %r4, %r5 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r2, 0(%r2) +;; stc %r3, 0(%r4,%r2) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r4, %r2 +;; lg %r5, 8(%r3) +;; clgr %r4, %r5 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r2, 0(%r3) +;; llc %r2, 0(%r4,%r2) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..5c4a19c52c --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,81 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lghi %r2, -4097 +;; ag %r2, 8(%r5) +;; clgr %r4, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; lghi %r5, 4096 +;; stc %r3, 0(%r5,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; lghi %r2, -4097 +;; lgr %r5, %r4 +;; ag %r2, 8(%r5) +;; clgr %r3, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r5) +;; lghi %r4, 4096 +;; llc %r2, 0(%r4,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ddafcac1df --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,97 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r4 +;; llgfr %r4, %r2 +;; lgr %r5, %r2 +;; llilf %r2, 4294901761 +;; algfr %r2, %r5 +;; jle 6 ; trap +;; lgr %r5, %r7 +;; lg %r7, 8(%r5) +;; clgr %r2, %r7 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; llilh %r2, 65535 +;; stc %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901761 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lg %r2, 8(%r4) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r4) +;; llilh %r5, 65535 +;; llc %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..fe721964fb --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,88 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r4 +;; llgfr %r4, %r2 +;; lghi %r5, -4 +;; lgr %r9, %r7 +;; ag %r5, 8(%r9) +;; lgr %r2, %r4 +;; ag %r2, 0(%r9) +;; lghi %r14, 0 +;; clgr %r4, %r5 +;; locgrh %r2, %r14 +;; strv %r3, 0(%r2) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lghi %r4, -4 +;; ag %r4, 8(%r5) +;; lgr %r2, %r3 +;; ag %r2, 0(%r5) +;; lghi %r5, 0 +;; clgr %r3, %r4 +;; locgrh %r2, %r5 +;; lrv %r2, 0(%r2) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..22e4ea549c --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lghi %r5, -4100 +;; ag %r5, 8(%r4) +;; lgr %r7, %r2 +;; ag %r7, 0(%r4) +;; aghik %r4, %r7, 4096 +;; lghi %r6, 0 +;; clgr %r2, %r5 +;; locgrh %r4, %r6 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r4, %r2 +;; lghi %r5, -4100 +;; ag %r5, 8(%r3) +;; lgr %r2, %r4 +;; ag %r2, 0(%r3) +;; aghik %r3, %r2, 4096 +;; lghi %r2, 0 +;; clgr %r4, %r5 +;; locgrh %r3, %r2 +;; lrv %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e21b828a26 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,93 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r9, %r15, 72(%r15) +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; llilf %r9, 4294901764 +;; algfr %r9, %r2 +;; jle 6 ; trap +;; lgr %r2, %r5 +;; lg %r5, 8(%r2) +;; ag %r4, 0(%r2) +;; llilh %r2, 65535 +;; agr %r4, %r2 +;; lghi %r2, 0 +;; clgr %r9, %r5 +;; locgrh %r4, %r2 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r9, %r15, 72(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901764 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lgr %r2, %r4 +;; lg %r4, 8(%r2) +;; ag %r3, 0(%r2) +;; llilh %r2, 65535 +;; agr %r3, %r2 +;; lghi %r2, 0 +;; clgr %r5, %r4 +;; locgrh %r3, %r2 +;; lrv %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..5e785edee6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r14, %r15, 112(%r15) +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lg %r14, 8(%r4) +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 0 +;; clgr %r2, %r14 +;; locgrhe %r5, %r4 +;; stc %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r14, %r15, 112(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lg %r4, 8(%r3) +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r3, 0 +;; clgr %r2, %r4 +;; locgrhe %r5, %r3 +;; llc %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..56c2fa0687 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lghi %r5, -4097 +;; ag %r5, 8(%r4) +;; lgr %r7, %r2 +;; ag %r7, 0(%r4) +;; aghik %r4, %r7, 4096 +;; lghi %r6, 0 +;; clgr %r2, %r5 +;; locgrh %r4, %r6 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r4, %r2 +;; lghi %r5, -4097 +;; ag %r5, 8(%r3) +;; lgr %r2, %r4 +;; ag %r2, 0(%r3) +;; aghik %r3, %r2, 4096 +;; lghi %r2, 0 +;; clgr %r4, %r5 +;; locgrh %r3, %r2 +;; llc %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..4d8ebec82b --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,93 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r9, %r15, 72(%r15) +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; llilf %r9, 4294901761 +;; algfr %r9, %r2 +;; jle 6 ; trap +;; lgr %r2, %r5 +;; lg %r5, 8(%r2) +;; ag %r4, 0(%r2) +;; llilh %r2, 65535 +;; agr %r4, %r2 +;; lghi %r2, 0 +;; clgr %r9, %r5 +;; locgrh %r4, %r2 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r9, %r15, 72(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901761 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lgr %r2, %r4 +;; lg %r4, 8(%r2) +;; ag %r3, 0(%r2) +;; llilh %r2, 65535 +;; agr %r3, %r2 +;; lghi %r2, 0 +;; clgr %r5, %r4 +;; locgrh %r3, %r2 +;; llc %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..a62cf9150f --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lghi %r2, -4 +;; ag %r2, 8(%r4) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; strv %r3, 0(%r5,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lghi %r2, -4 +;; ag %r2, 8(%r3) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r3, 0(%r3) +;; lrv %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..441d99c2b6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,81 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lghi %r2, -4100 +;; ag %r2, 8(%r5) +;; clgr %r4, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; lghi %r5, 4096 +;; strv %r3, 0(%r5,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; lghi %r2, -4100 +;; lgr %r5, %r4 +;; ag %r2, 8(%r5) +;; clgr %r3, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r5) +;; lghi %r4, 4096 +;; lrv %r2, 0(%r4,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..5f26642d13 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,97 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r4 +;; llgfr %r4, %r2 +;; lgr %r5, %r2 +;; llilf %r2, 4294901764 +;; algfr %r2, %r5 +;; jle 6 ; trap +;; lgr %r5, %r7 +;; lg %r7, 8(%r5) +;; clgr %r2, %r7 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; llilh %r2, 65535 +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901764 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lg %r2, 8(%r4) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r4) +;; llilh %r5, 65535 +;; lrv %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..18c99848d6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lgr %r2, %r5 +;; lg %r5, 8(%r2) +;; clgr %r4, %r5 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r2, 0(%r2) +;; stc %r3, 0(%r4,%r2) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r4, %r2 +;; lg %r5, 8(%r3) +;; clgr %r4, %r5 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r2, 0(%r3) +;; llc %r2, 0(%r4,%r2) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..4c97ac1fe9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,81 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lghi %r2, -4097 +;; ag %r2, 8(%r5) +;; clgr %r4, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; lghi %r5, 4096 +;; stc %r3, 0(%r5,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; lghi %r2, -4097 +;; lgr %r5, %r4 +;; ag %r2, 8(%r5) +;; clgr %r3, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r5) +;; lghi %r4, 4096 +;; llc %r2, 0(%r4,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..47ab84f616 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,97 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r4 +;; llgfr %r4, %r2 +;; lgr %r5, %r2 +;; llilf %r2, 4294901761 +;; algfr %r2, %r5 +;; jle 6 ; trap +;; lgr %r5, %r7 +;; lg %r7, 8(%r5) +;; clgr %r2, %r7 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; llilh %r2, 65535 +;; stc %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901761 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lg %r2, 8(%r4) +;; clgr %r5, %r2 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r3, 0(%r4) +;; llilh %r5, 65535 +;; llc %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..dae8f9ac52 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,88 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r4 +;; llgfr %r4, %r2 +;; lghi %r5, -4 +;; lgr %r9, %r7 +;; ag %r5, 8(%r9) +;; lgr %r2, %r4 +;; ag %r2, 0(%r9) +;; lghi %r14, 0 +;; clgr %r4, %r5 +;; locgrh %r2, %r14 +;; strv %r3, 0(%r2) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lghi %r4, -4 +;; ag %r4, 8(%r5) +;; lgr %r2, %r3 +;; ag %r2, 0(%r5) +;; lghi %r5, 0 +;; clgr %r3, %r4 +;; locgrh %r2, %r5 +;; lrv %r2, 0(%r2) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..927d19e061 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lghi %r5, -4100 +;; ag %r5, 8(%r4) +;; lgr %r7, %r2 +;; ag %r7, 0(%r4) +;; aghik %r4, %r7, 4096 +;; lghi %r6, 0 +;; clgr %r2, %r5 +;; locgrh %r4, %r6 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r4, %r2 +;; lghi %r5, -4100 +;; ag %r5, 8(%r3) +;; lgr %r2, %r4 +;; ag %r2, 0(%r3) +;; aghik %r3, %r2, 4096 +;; lghi %r2, 0 +;; clgr %r4, %r5 +;; locgrh %r3, %r2 +;; lrv %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..6318857dbc --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,93 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r9, %r15, 72(%r15) +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; llilf %r9, 4294901764 +;; algfr %r9, %r2 +;; jle 6 ; trap +;; lgr %r2, %r5 +;; lg %r5, 8(%r2) +;; ag %r4, 0(%r2) +;; llilh %r2, 65535 +;; agr %r4, %r2 +;; lghi %r2, 0 +;; clgr %r9, %r5 +;; locgrh %r4, %r2 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r9, %r15, 72(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901764 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lgr %r2, %r4 +;; lg %r4, 8(%r2) +;; ag %r3, 0(%r2) +;; llilh %r2, 65535 +;; agr %r3, %r2 +;; lghi %r2, 0 +;; clgr %r5, %r4 +;; locgrh %r3, %r2 +;; lrv %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..331874bbf3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r14, %r15, 112(%r15) +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lg %r14, 8(%r4) +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 0 +;; clgr %r2, %r14 +;; locgrhe %r5, %r4 +;; stc %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r14, %r15, 112(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lg %r4, 8(%r3) +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r3, 0 +;; clgr %r2, %r4 +;; locgrhe %r5, %r3 +;; llc %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..2c196b2c7e --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lghi %r5, -4097 +;; ag %r5, 8(%r4) +;; lgr %r7, %r2 +;; ag %r7, 0(%r4) +;; aghik %r4, %r7, 4096 +;; lghi %r6, 0 +;; clgr %r2, %r5 +;; locgrh %r4, %r6 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r4, %r2 +;; lghi %r5, -4097 +;; ag %r5, 8(%r3) +;; lgr %r2, %r4 +;; ag %r2, 0(%r3) +;; aghik %r3, %r2, 4096 +;; lghi %r2, 0 +;; clgr %r4, %r5 +;; locgrh %r3, %r2 +;; llc %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..5c3b7162a9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,93 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r9, %r15, 72(%r15) +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; llilf %r9, 4294901761 +;; algfr %r9, %r2 +;; jle 6 ; trap +;; lgr %r2, %r5 +;; lg %r5, 8(%r2) +;; ag %r4, 0(%r2) +;; llilh %r2, 65535 +;; agr %r4, %r2 +;; lghi %r2, 0 +;; clgr %r9, %r5 +;; locgrh %r4, %r2 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r9, %r15, 72(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; llilf %r5, 4294901761 +;; algfr %r5, %r2 +;; jle 6 ; trap +;; lgr %r2, %r4 +;; lg %r4, 8(%r2) +;; ag %r3, 0(%r2) +;; llilh %r2, 65535 +;; agr %r3, %r2 +;; lghi %r2, 0 +;; clgr %r5, %r4 +;; locgrh %r3, %r2 +;; llc %r2, 0(%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..2ed0acb5c0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4 +;; ag %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r4, -4 +;; ag %r4, 8(%r3) +;; clgr %r2, %r4 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r3, 0(%r3) +;; lrv %r2, 0(%r2,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..33d89ee1c2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4100 +;; ag %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 4096 +;; strv %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4100 +;; ag %r5, 8(%r3) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; lghi %r2, 4096 +;; lrv %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..3968ab7a81 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r14, %r15, 112(%r15) +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901764 +;; jle 6 ; trap +;; lg %r14, 8(%r4) +;; clgr %r5, %r14 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; llilh %r4, 65535 +;; strv %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; lmg %r14, %r15, 112(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901764 +;; jle 6 ; trap +;; lg %r4, 8(%r3) +;; clgr %r5, %r4 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; llilh %r3, 65535 +;; lrv %r2, 0(%r3,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..b83b9d40f4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r4) +;; stc %r3, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r4, 8(%r3) +;; clgr %r2, %r4 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r3) +;; llc %r2, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..d49a9ab7d7 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4097 +;; ag %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 4096 +;; stc %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4097 +;; ag %r5, 8(%r3) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; lghi %r2, 4096 +;; llc %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..3f9dc4448a --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r14, %r15, 112(%r15) +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901761 +;; jle 6 ; trap +;; lg %r14, 8(%r4) +;; clgr %r5, %r14 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; llilh %r4, 65535 +;; stc %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; lmg %r14, %r15, 112(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901761 +;; jle 6 ; trap +;; lg %r4, 8(%r3) +;; clgr %r5, %r4 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; llilh %r3, 65535 +;; llc %r2, 0(%r3,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..fd18599271 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,86 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; lghi %r4, -4 +;; lgr %r7, %r5 +;; ag %r4, 8(%r7) +;; lgr %r5, %r2 +;; ag %r5, 0(%r7) +;; lghi %r13, 0 +;; clgr %r2, %r4 +;; locgrh %r5, %r13 +;; strv %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; lghi %r3, -4 +;; ag %r3, 8(%r4) +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 0 +;; clgr %r2, %r3 +;; locgrh %r5, %r4 +;; lrv %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..f6887d7089 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; lghi %r4, -4100 +;; ag %r4, 8(%r5) +;; lgr %r6, %r2 +;; ag %r6, 0(%r5) +;; aghik %r5, %r6, 4096 +;; lghi %r14, 0 +;; clgr %r2, %r4 +;; locgrh %r5, %r14 +;; strv %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; lghi %r3, -4100 +;; lgr %r5, %r4 +;; ag %r3, 8(%r5) +;; lgr %r4, %r2 +;; ag %r4, 0(%r5) +;; aghi %r4, 4096 +;; lghi %r5, 0 +;; clgr %r2, %r3 +;; locgrh %r4, %r5 +;; lrv %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..a6189b33bb --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r2 +;; algfi %r7, 4294901764 +;; jle 6 ; trap +;; lg %r5, 8(%r4) +;; ag %r2, 0(%r4) +;; llilh %r4, 65535 +;; agrk %r4, %r2, %r4 +;; lghi %r2, 0 +;; clgr %r7, %r5 +;; locgrh %r4, %r2 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r2 +;; algfi %r4, 4294901764 +;; jle 6 ; trap +;; lg %r5, 8(%r3) +;; ag %r2, 0(%r3) +;; llilh %r3, 65535 +;; agr %r2, %r3 +;; lghi %r3, 0 +;; clgr %r4, %r5 +;; locgrh %r2, %r3 +;; lrv %r2, 0(%r2) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..1b53ae5104 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r12, %r15, 96(%r15) +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r5, 8(%r4) +;; lgr %r13, %r2 +;; ag %r13, 0(%r4) +;; lghi %r12, 0 +;; clgr %r2, %r5 +;; locgrhe %r13, %r12 +;; stc %r3, 0(%r13) +;; jg label1 +;; block1: +;; lmg %r12, %r15, 96(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r5, 8(%r3) +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; lghi %r3, 0 +;; clgr %r2, %r5 +;; locgrhe %r4, %r3 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..2980a318cc --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; lghi %r4, -4097 +;; ag %r4, 8(%r5) +;; lgr %r6, %r2 +;; ag %r6, 0(%r5) +;; aghik %r5, %r6, 4096 +;; lghi %r14, 0 +;; clgr %r2, %r4 +;; locgrh %r5, %r14 +;; stc %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; lghi %r3, -4097 +;; lgr %r5, %r4 +;; ag %r3, 8(%r5) +;; lgr %r4, %r2 +;; ag %r4, 0(%r5) +;; aghi %r4, 4096 +;; lghi %r5, 0 +;; clgr %r2, %r3 +;; locgrh %r4, %r5 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..4cfd07ea9d --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r2 +;; algfi %r7, 4294901761 +;; jle 6 ; trap +;; lg %r5, 8(%r4) +;; ag %r2, 0(%r4) +;; llilh %r4, 65535 +;; agrk %r4, %r2, %r4 +;; lghi %r2, 0 +;; clgr %r7, %r5 +;; locgrh %r4, %r2 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r2 +;; algfi %r4, 4294901761 +;; jle 6 ; trap +;; lg %r5, 8(%r3) +;; ag %r2, 0(%r3) +;; llilh %r3, 65535 +;; agr %r2, %r3 +;; lghi %r3, 0 +;; clgr %r4, %r5 +;; locgrh %r2, %r3 +;; llc %r2, 0(%r2) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..541424fcf4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4 +;; ag %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r4, -4 +;; ag %r4, 8(%r3) +;; clgr %r2, %r4 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r3, 0(%r3) +;; lrv %r2, 0(%r2,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..bd33018575 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4100 +;; ag %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 4096 +;; strv %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4100 +;; ag %r5, 8(%r3) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; lghi %r2, 4096 +;; lrv %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..23b26ef0ab --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r14, %r15, 112(%r15) +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901764 +;; jle 6 ; trap +;; lg %r14, 8(%r4) +;; clgr %r5, %r14 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; llilh %r4, 65535 +;; strv %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; lmg %r14, %r15, 112(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901764 +;; jle 6 ; trap +;; lg %r4, 8(%r3) +;; clgr %r5, %r4 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; llilh %r3, 65535 +;; lrv %r2, 0(%r3,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..69473187da --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r4) +;; stc %r3, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r4, 8(%r3) +;; clgr %r2, %r4 +;; jgnhe label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r3) +;; llc %r2, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..deacfa1e0a --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4097 +;; ag %r5, 8(%r4) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 4096 +;; stc %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lghi %r5, -4097 +;; ag %r5, 8(%r3) +;; clgr %r2, %r5 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; lghi %r2, 4096 +;; llc %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..1484f04906 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r14, %r15, 112(%r15) +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901761 +;; jle 6 ; trap +;; lg %r14, 8(%r4) +;; clgr %r5, %r14 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; llilh %r4, 65535 +;; stc %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; lmg %r14, %r15, 112(%r15) +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; algfi %r5, 4294901761 +;; jle 6 ; trap +;; lg %r4, 8(%r3) +;; clgr %r5, %r4 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; llilh %r3, 65535 +;; llc %r2, 0(%r3,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..f8d6f839e1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,86 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; lghi %r4, -4 +;; lgr %r7, %r5 +;; ag %r4, 8(%r7) +;; lgr %r5, %r2 +;; ag %r5, 0(%r7) +;; lghi %r13, 0 +;; clgr %r2, %r4 +;; locgrh %r5, %r13 +;; strv %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; lghi %r3, -4 +;; ag %r3, 8(%r4) +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r4, 0 +;; clgr %r2, %r3 +;; locgrh %r5, %r4 +;; lrv %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..2608bb0554 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; lghi %r4, -4100 +;; ag %r4, 8(%r5) +;; lgr %r6, %r2 +;; ag %r6, 0(%r5) +;; aghik %r5, %r6, 4096 +;; lghi %r14, 0 +;; clgr %r2, %r4 +;; locgrh %r5, %r14 +;; strv %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; lghi %r3, -4100 +;; lgr %r5, %r4 +;; ag %r3, 8(%r5) +;; lgr %r4, %r2 +;; ag %r4, 0(%r5) +;; aghi %r4, 4096 +;; lghi %r5, 0 +;; clgr %r2, %r3 +;; locgrh %r4, %r5 +;; lrv %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..237c141ab1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r2 +;; algfi %r7, 4294901764 +;; jle 6 ; trap +;; lg %r5, 8(%r4) +;; ag %r2, 0(%r4) +;; llilh %r4, 65535 +;; agrk %r4, %r2, %r4 +;; lghi %r2, 0 +;; clgr %r7, %r5 +;; locgrh %r4, %r2 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r2 +;; algfi %r4, 4294901764 +;; jle 6 ; trap +;; lg %r5, 8(%r3) +;; ag %r2, 0(%r3) +;; llilh %r3, 65535 +;; agr %r2, %r3 +;; lghi %r3, 0 +;; clgr %r4, %r5 +;; locgrh %r2, %r3 +;; lrv %r2, 0(%r2) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..47c415c4fc --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r12, %r15, 96(%r15) +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r5, 8(%r4) +;; lgr %r13, %r2 +;; ag %r13, 0(%r4) +;; lghi %r12, 0 +;; clgr %r2, %r5 +;; locgrhe %r13, %r12 +;; stc %r3, 0(%r13) +;; jg label1 +;; block1: +;; lmg %r12, %r15, 96(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lg %r5, 8(%r3) +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; lghi %r3, 0 +;; clgr %r2, %r5 +;; locgrhe %r4, %r3 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..d5aac8b75a --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r6, %r15, 48(%r15) +;; unwind SaveReg { clobber_offset: 48, reg: p6i } +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; lghi %r4, -4097 +;; ag %r4, 8(%r5) +;; lgr %r6, %r2 +;; ag %r6, 0(%r5) +;; aghik %r5, %r6, 4096 +;; lghi %r14, 0 +;; clgr %r2, %r4 +;; locgrh %r5, %r14 +;; stc %r3, 0(%r5) +;; jg label1 +;; block1: +;; lmg %r6, %r15, 48(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; lghi %r3, -4097 +;; lgr %r5, %r4 +;; ag %r3, 8(%r5) +;; lgr %r4, %r2 +;; ag %r4, 0(%r5) +;; aghi %r4, 4096 +;; lghi %r5, 0 +;; clgr %r2, %r3 +;; locgrh %r4, %r5 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..aa670baf35 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,89 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r7, %r15, 56(%r15) +;; unwind SaveReg { clobber_offset: 56, reg: p7i } +;; unwind SaveReg { clobber_offset: 64, reg: p8i } +;; unwind SaveReg { clobber_offset: 72, reg: p9i } +;; unwind SaveReg { clobber_offset: 80, reg: p10i } +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r7, %r2 +;; algfi %r7, 4294901761 +;; jle 6 ; trap +;; lg %r5, 8(%r4) +;; ag %r2, 0(%r4) +;; llilh %r4, 65535 +;; agrk %r4, %r2, %r4 +;; lghi %r2, 0 +;; clgr %r7, %r5 +;; locgrh %r4, %r2 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; lmg %r7, %r15, 56(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r2 +;; algfi %r4, 4294901761 +;; jle 6 ; trap +;; lg %r5, 8(%r3) +;; ag %r2, 0(%r3) +;; llilh %r3, 65535 +;; agr %r2, %r3 +;; lghi %r3, 0 +;; clgr %r4, %r5 +;; locgrh %r2, %r3 +;; llc %r2, 0(%r2) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..0352554864 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; clgfi %r4, 268435452 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r5) +;; strv %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; clgfi %r3, 268435452 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r4) +;; lrv %r2, 0(%r3,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..cbe5c2fa53 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,75 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; clgfi %r4, 268431356 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; lghi %r2, 4096 +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; clgfi %r3, 268431356 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r5 +;; ag %r3, 0(%r4) +;; lghi %r5, 4096 +;; lrv %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..08ecbb1705 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..d348bb77dd --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; clgfi %r4, 268435455 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r5) +;; stc %r3, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r4, %r3 +;; llgfr %r3, %r2 +;; clgfi %r3, 268435455 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r5, 0(%r4) +;; llc %r2, 0(%r3,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..5dc326dd5f --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,75 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; clgfi %r4, 268431359 +;; jgnh label1 ; jg label3 +;; block1: +;; ag %r4, 0(%r5) +;; lghi %r2, 4096 +;; stc %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; clgfi %r3, 268431359 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r4, %r5 +;; ag %r3, 0(%r4) +;; lghi %r5, 4096 +;; llc %r2, 0(%r5,%r3) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b1906ca85a --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..3bb17bc044 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,69 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lgr %r2, %r4 +;; lgr %r4, %r5 +;; ag %r4, 0(%r2) +;; lghi %r2, 0 +;; clgfi %r5, 268435452 +;; locgrh %r4, %r2 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lgr %r4, %r5 +;; ag %r4, 0(%r3) +;; lghi %r2, 0 +;; clgfi %r5, 268435452 +;; locgrh %r4, %r2 +;; lrv %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..51a78e8faf --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; aghi %r5, 4096 +;; lghi %r4, 0 +;; clgfi %r2, 268431356 +;; locgrh %r5, %r4 +;; strv %r3, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; aghik %r5, %r4, 4096 +;; lghi %r3, 0 +;; clgfi %r2, 268431356 +;; locgrh %r5, %r3 +;; lrv %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..d8f39931ca --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..9c8438dc43 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,69 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lgr %r2, %r4 +;; lgr %r4, %r5 +;; ag %r4, 0(%r2) +;; lghi %r2, 0 +;; clgfi %r5, 268435455 +;; locgrh %r4, %r2 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r5, %r2 +;; lgr %r4, %r5 +;; ag %r4, 0(%r3) +;; lghi %r2, 0 +;; clgfi %r5, 268435455 +;; locgrh %r4, %r2 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..8419285e14 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; aghi %r5, 4096 +;; lghi %r4, 0 +;; clgfi %r2, 268431359 +;; locgrh %r5, %r4 +;; stc %r3, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; llgfr %r2, %r2 +;; lgr %r4, %r2 +;; ag %r4, 0(%r3) +;; aghik %r5, %r4, 4096 +;; lghi %r3, 0 +;; clgfi %r2, 268431359 +;; locgrh %r5, %r3 +;; llc %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..9291d34ee5 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..4ba00626fc --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,62 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lg %r5, 0(%r5) +;; strv %r3, 0(%r4,%r5) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lg %r4, 0(%r5) +;; lrv %r2, 0(%r3,%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..794a157276 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lgr %r2, %r5 +;; ag %r4, 0(%r2) +;; lghi %r5, 4096 +;; strv %r3, 0(%r5,%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lgr %r2, %r5 +;; ag %r3, 0(%r2) +;; lghi %r4, 4096 +;; lrv %r2, 0(%r4,%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ae231d7760 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..b6b14039a0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,62 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lg %r5, 0(%r5) +;; stc %r3, 0(%r4,%r5) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lg %r4, 0(%r5) +;; llc %r2, 0(%r3,%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..bbeb3ae418 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lgr %r2, %r5 +;; ag %r4, 0(%r2) +;; lghi %r5, 4096 +;; stc %r3, 0(%r5,%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lgr %r2, %r5 +;; ag %r3, 0(%r2) +;; lghi %r4, 4096 +;; llc %r2, 0(%r4,%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e20bfe70df --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..baba30b88d --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,62 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lg %r5, 0(%r5) +;; strv %r3, 0(%r4,%r5) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lg %r4, 0(%r5) +;; lrv %r2, 0(%r3,%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..e76eae59fe --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lgr %r2, %r5 +;; ag %r4, 0(%r2) +;; lghi %r5, 4096 +;; strv %r3, 0(%r5,%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lgr %r2, %r5 +;; ag %r3, 0(%r2) +;; lghi %r4, 4096 +;; lrv %r2, 0(%r4,%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..bda2d224e0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a704c05009 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,62 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lg %r5, 0(%r5) +;; stc %r3, 0(%r4,%r5) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lg %r4, 0(%r5) +;; llc %r2, 0(%r3,%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..94614dc1c6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r4 +;; llgfr %r4, %r2 +;; lgr %r2, %r5 +;; ag %r4, 0(%r2) +;; lghi %r5, 4096 +;; stc %r3, 0(%r5,%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r3 +;; llgfr %r3, %r2 +;; lgr %r2, %r5 +;; ag %r3, 0(%r2) +;; lghi %r4, 4096 +;; llc %r2, 0(%r4,%r3) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..99282dbdc4 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..103dac7c8a --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435452 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435452 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r3) +;; lrv %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..700942042c --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431356 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r2, 4096 +;; strv %r3, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431356 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 4096 +;; lrv %r2, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..3e74432605 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..4f77252b96 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435455 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; stc %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435455 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r3) +;; llc %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..8b6494f223 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431359 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r2, 4096 +;; stc %r3, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431359 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 4096 +;; llc %r2, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f6265c4a60 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..149ebbf708 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,73 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r11, %r15, 88(%r15) +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r11, %r2 +;; ag %r11, 0(%r4) +;; lghi %r5, 0 +;; clgfi %r2, 268435452 +;; locgrh %r11, %r5 +;; strv %r3, 0(%r11) +;; jg label1 +;; block1: +;; lmg %r11, %r15, 88(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 0 +;; clgfi %r2, 268435452 +;; locgrh %r5, %r4 +;; lrv %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..49c8fd7465 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431356 +;; locgrh %r4, %r5 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431356 +;; locgrh %r4, %r5 +;; lrv %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ce99d89d16 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..42a29ea5cc --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,73 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r11, %r15, 88(%r15) +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r11, %r2 +;; ag %r11, 0(%r4) +;; lghi %r5, 0 +;; clgfi %r2, 268435455 +;; locgrh %r11, %r5 +;; stc %r3, 0(%r11) +;; jg label1 +;; block1: +;; lmg %r11, %r15, 88(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 0 +;; clgfi %r2, 268435455 +;; locgrh %r5, %r4 +;; llc %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..e25567fab8 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431359 +;; locgrh %r4, %r5 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431359 +;; locgrh %r4, %r5 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..12c007b40c --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..666eccb08d --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435452 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; strv %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435452 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r3) +;; lrv %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..41733bb2fb --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431356 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r2, 4096 +;; strv %r3, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431356 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 4096 +;; lrv %r2, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ca723b335a --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..4b59b9dfe9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435455 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r4) +;; stc %r3, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268435455 +;; jgnh label1 ; jg label3 +;; block1: +;; lg %r4, 0(%r3) +;; llc %r2, 0(%r2,%r4) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..0b60c069b9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,72 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431359 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; lghi %r2, 4096 +;; stc %r3, 0(%r2,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; clgfi %r2, 268431359 +;; jgnh label1 ; jg label3 +;; block1: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 4096 +;; llc %r2, 0(%r4,%r5) +;; jg label2 +;; block2: +;; br %r14 +;; block3: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..93a0dc186e --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..024c9e9a70 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,73 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r11, %r15, 88(%r15) +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r11, %r2 +;; ag %r11, 0(%r4) +;; lghi %r5, 0 +;; clgfi %r2, 268435452 +;; locgrh %r11, %r5 +;; strv %r3, 0(%r11) +;; jg label1 +;; block1: +;; lmg %r11, %r15, 88(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 0 +;; clgfi %r2, 268435452 +;; locgrh %r5, %r4 +;; lrv %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..11510f6c0e --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431356 +;; locgrh %r4, %r5 +;; strv %r3, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431356 +;; locgrh %r4, %r5 +;; lrv %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..59a8051782 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..13e684dc79 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,73 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; stmg %r11, %r15, 88(%r15) +;; unwind SaveReg { clobber_offset: 88, reg: p11i } +;; unwind SaveReg { clobber_offset: 96, reg: p12i } +;; unwind SaveReg { clobber_offset: 104, reg: p13i } +;; unwind SaveReg { clobber_offset: 112, reg: p14i } +;; unwind SaveReg { clobber_offset: 120, reg: p15i } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r11, %r2 +;; ag %r11, 0(%r4) +;; lghi %r5, 0 +;; clgfi %r2, 268435455 +;; locgrh %r11, %r5 +;; stc %r3, 0(%r11) +;; jg label1 +;; block1: +;; lmg %r11, %r15, 88(%r15) +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; lghi %r4, 0 +;; clgfi %r2, 268435455 +;; locgrh %r5, %r4 +;; llc %r2, 0(%r5) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..cf12a221d7 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r4) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431359 +;; locgrh %r4, %r5 +;; stc %r3, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; lgr %r5, %r2 +;; ag %r5, 0(%r3) +;; aghik %r4, %r5, 4096 +;; lghi %r5, 0 +;; clgfi %r2, 268431359 +;; locgrh %r4, %r5 +;; llc %r2, 0(%r4) +;; jg label1 +;; block1: +;; br %r14 \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f9ef026723 --- /dev/null +++ b/cranelift/filetests/filetests/isa/s390x/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,50 @@ +;;! target = "s390x" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap +;; +;; function u0:1: +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 160, offset_downward_to_clobbers: 0 } +;; unwind StackAlloc { size: 0 } +;; block0: +;; trap \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..67d55374ef --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4, %r11 +;; addq %r11, 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; movl %esi, 0(%rdi,%r10,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4, %r11 +;; addq %r11, 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; movl 0(%rsi,%r10,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..517ab1c010 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4100, %r11 +;; addq %r11, 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; movl %esi, 4096(%rdi,%r10,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4100, %r11 +;; addq %r11, 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; movl 4096(%rsi,%r10,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..dc19682cb1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,90 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; addq %rdi, const(0), %rdi +;; movl %esi, 0(%rdi,%r11,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; addq %rsi, const(0), %rsi +;; movl 0(%rsi,%r11,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a381266d67 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r9d +;; movq 8(%rdx), %r10 +;; cmpq %r10, %r9 +;; jb label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movb %sil, 0(%r11,%r9,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r9d +;; movq 8(%rsi), %r10 +;; cmpq %r10, %r9 +;; jb label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movzbq 0(%r11,%r9,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..68984a056c --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4097, %r11 +;; addq %r11, 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; movb %sil, 4096(%rdi,%r10,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4097, %r11 +;; addq %r11, 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; movzbq 4096(%rsi,%r10,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..58d4b3f7bb --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,90 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; addq %rdi, const(0), %rdi +;; movb %sil, 0(%rdi,%r11,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; addq %rsi, const(0), %rsi +;; movzbq 0(%rsi,%r11,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..ff83546c3f --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r11, %r11 +;; movl %esi, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rsi, %rax +;; movl %edi, %esi +;; movabsq $-4, %rdi +;; movq %rax, %rcx +;; addq %rdi, 8(%rcx), %rdi +;; movq %rsi, %r11 +;; addq %r11, 0(%rcx), %r11 +;; xorq %rax, %rax, %rax +;; cmpq %rdi, %rsi +;; cmovnbeq %rax, %r11, %r11 +;; movl 0(%r11), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..8bc688f269 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4100, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r11, %r11 +;; movl %esi, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4100, %rax +;; addq %rax, 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rdi +;; cmovnbeq %rsi, %r11, %r11 +;; movl 0(%r11), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f4f79fff1c --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movl %esi, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movl 0(%r8), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..f27f915a6e --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,80 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq 8(%rdx), %rdi +;; movq %r11, %r10 +;; addq %r10, 0(%rdx), %r10 +;; xorq %rax, %rax, %rax +;; cmpq %rdi, %r11 +;; cmovnbq %rax, %r10, %r10 +;; movb %sil, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq 8(%rsi), %rdi +;; movq %r11, %r10 +;; addq %r10, 0(%rsi), %r10 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rdi, %r11 +;; cmovnbq %rsi, %r10, %r10 +;; movzbq 0(%r10), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..f10feb9cb8 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4097, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r11, %r11 +;; movb %sil, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4097, %rax +;; addq %rax, 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rdi +;; cmovnbeq %rsi, %r11, %r11 +;; movzbq 0(%r11), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..c68204b5d2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movb %sil, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movzbq 0(%r8), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..e658bff1e7 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4, %r11 +;; addq %r11, 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; movl %esi, 0(%rdi,%r10,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4, %r11 +;; addq %r11, 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; movl 0(%rsi,%r10,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..cdf5b03b0a --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4100, %r11 +;; addq %r11, 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; movl %esi, 4096(%rdi,%r10,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4100, %r11 +;; addq %r11, 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; movl 4096(%rsi,%r10,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..c40782e6ee --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,90 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; addq %rdi, const(0), %rdi +;; movl %esi, 0(%rdi,%r11,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; addq %rsi, const(0), %rsi +;; movl 0(%rsi,%r11,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a123e10ebf --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r9d +;; movq 8(%rdx), %r10 +;; cmpq %r10, %r9 +;; jb label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movb %sil, 0(%r11,%r9,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r9d +;; movq 8(%rsi), %r10 +;; cmpq %r10, %r9 +;; jb label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movzbq 0(%r11,%r9,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..5d67d34eb0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4097, %r11 +;; addq %r11, 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; movb %sil, 4096(%rdi,%r10,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movabsq $-4097, %r11 +;; addq %r11, 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; movzbq 4096(%rsi,%r10,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..fe4b262894 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,90 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rdi +;; addq %rdi, const(0), %rdi +;; movb %sil, 0(%rdi,%r11,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; cmpq %rax, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %rsi +;; addq %rsi, const(0), %rsi +;; movzbq 0(%rsi,%r11,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..d8c802c7f5 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r11, %r11 +;; movl %esi, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rsi, %rax +;; movl %edi, %esi +;; movabsq $-4, %rdi +;; movq %rax, %rcx +;; addq %rdi, 8(%rcx), %rdi +;; movq %rsi, %r11 +;; addq %r11, 0(%rcx), %r11 +;; xorq %rax, %rax, %rax +;; cmpq %rdi, %rsi +;; cmovnbeq %rax, %r11, %r11 +;; movl 0(%r11), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..e9cc1c1033 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4100, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r11, %r11 +;; movl %esi, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4100, %rax +;; addq %rax, 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rdi +;; cmovnbeq %rsi, %r11, %r11 +;; movl 0(%r11), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f4ffb0d0f1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movl %esi, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movl 0(%r8), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..8bfbcc818c --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,80 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq 8(%rdx), %rdi +;; movq %r11, %r10 +;; addq %r10, 0(%rdx), %r10 +;; xorq %rax, %rax, %rax +;; cmpq %rdi, %r11 +;; cmovnbq %rax, %r10, %r10 +;; movb %sil, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq 8(%rsi), %rdi +;; movq %r11, %r10 +;; addq %r10, 0(%rsi), %r10 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rdi, %r11 +;; cmovnbq %rsi, %r10, %r10 +;; movzbq 0(%r10), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..a5d43ce9c3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,84 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4097, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r11, %r11 +;; movb %sil, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %edi +;; movabsq $-4097, %rax +;; addq %rax, 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, $4096, %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rdi +;; cmovnbeq %rsi, %r11, %r11 +;; movzbq 0(%r11), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..a67a3975ab --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movb %sil, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq %r8, %rdi +;; addq %rdi, const(1), %rdi +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, const(0), %r8 +;; xorq %rcx, %rcx, %rcx +;; cmpq %rax, %rdi +;; cmovnbeq %rcx, %r8, %r8 +;; movzbq 0(%r8), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..6b52c348d0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r9 +;; addq %r9, 8(%rdx), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movl %esi, 0(%r11,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r9 +;; addq %r9, 8(%rsi), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movl 0(%r11,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..ddf835c198 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4100, %r9 +;; addq %r9, 8(%rdx), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movl %esi, 4096(%r11,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4100, %r9 +;; addq %r9, 8(%rsi), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movl 4096(%r11,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..6bc72abffb --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rax +;; addq %rax, const(0), %rax +;; movl %esi, 0(%rax,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; movl 0(%r11,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..ee6fd6ef4b --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,80 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rdx), %r8 +;; cmpq %r8, %rdi +;; jb label1; j label3 +;; block1: +;; movq 0(%rdx), %r10 +;; movb %sil, 0(%r10,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rsi), %r8 +;; cmpq %r8, %rdi +;; jb label1; j label3 +;; block1: +;; movq 0(%rsi), %r10 +;; movzbq 0(%r10,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..944ffc8459 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4097, %r9 +;; addq %r9, 8(%rdx), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movb %sil, 4096(%r11,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4097, %r9 +;; addq %r9, 8(%rsi), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movzbq 4096(%r11,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..72295b90f1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rax +;; addq %rax, const(0), %rax +;; movb %sil, 0(%rax,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; movzbq 0(%r11,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..4c5cc6a3ff --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,80 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r11 +;; addq %r11, 8(%rdx), %r11 +;; movq %rdi, %r10 +;; addq %r10, 0(%rdx), %r10 +;; xorq %rax, %rax, %rax +;; cmpq %r11, %rdi +;; cmovnbeq %rax, %r10, %r10 +;; movl %esi, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r11 +;; addq %r11, 8(%rsi), %r11 +;; movq %rdi, %r10 +;; addq %r10, 0(%rsi), %r10 +;; xorq %rsi, %rsi, %rsi +;; cmpq %r11, %rdi +;; cmovnbeq %rsi, %r10, %r10 +;; movl 0(%r10), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..6a22741691 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,83 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4100, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r10 +;; addq %r10, 0(%rdx), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rax, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movl %esi, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rsi, %rax +;; movabsq $-4100, %rsi +;; addq %rsi, 8(%rax), %rsi +;; movq %rdi, %r10 +;; addq %r10, 0(%rax), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rsi, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movl 0(%r10), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..0a1c3e7e4e --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rdi, %rdi, %rdi +;; cmpq %rax, %rcx +;; cmovnbeq %rdi, %r11, %r11 +;; movl %esi, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rcx +;; cmovnbeq %rsi, %r11, %r11 +;; movl 0(%r11), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..e9a4360095 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rdx), %r10 +;; movq %rdi, %r9 +;; addq %r9, 0(%rdx), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq %r10, %rdi +;; cmovnbq %r11, %r9, %r9 +;; movb %sil, 0(%r9) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rsi), %r10 +;; movq %rdi, %r9 +;; addq %r9, 0(%rsi), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq %r10, %rdi +;; cmovnbq %r11, %r9, %r9 +;; movzbq 0(%r9), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..7e1de03d11 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,83 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4097, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r10 +;; addq %r10, 0(%rdx), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rax, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movb %sil, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rsi, %rax +;; movabsq $-4097, %rsi +;; addq %rsi, 8(%rax), %rsi +;; movq %rdi, %r10 +;; addq %r10, 0(%rax), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rsi, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movzbq 0(%r10), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b297445176 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rdi, %rdi, %rdi +;; cmpq %rax, %rcx +;; cmovnbeq %rdi, %r11, %r11 +;; movb %sil, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rcx +;; cmovnbeq %rsi, %r11, %r11 +;; movzbq 0(%r11), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..4694fb7a63 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r9 +;; addq %r9, 8(%rdx), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movl %esi, 0(%r11,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r9 +;; addq %r9, 8(%rsi), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movl 0(%r11,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..1fcce759bf --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4100, %r9 +;; addq %r9, 8(%rdx), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movl %esi, 4096(%r11,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4100, %r9 +;; addq %r9, 8(%rsi), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movl 4096(%r11,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ecfcfcfbe7 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rax +;; addq %rax, const(0), %rax +;; movl %esi, 0(%rax,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; movl 0(%r11,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..76e2fa5c4d --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,80 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rdx), %r8 +;; cmpq %r8, %rdi +;; jb label1; j label3 +;; block1: +;; movq 0(%rdx), %r10 +;; movb %sil, 0(%r10,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rsi), %r8 +;; cmpq %r8, %rdi +;; jb label1; j label3 +;; block1: +;; movq 0(%rsi), %r10 +;; movzbq 0(%r10,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..c3c7ce729b --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,82 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4097, %r9 +;; addq %r9, 8(%rdx), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r11 +;; movb %sil, 4096(%r11,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4097, %r9 +;; addq %r9, 8(%rsi), %r9 +;; cmpq %r9, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; movzbq 4096(%r11,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ac025ee3d0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,88 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %rax +;; addq %rax, const(0), %rax +;; movb %sil, 0(%rax,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r10 +;; addq %r10, const(1), %r10 +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %r11 +;; cmpq %r11, %r10 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; movzbq 0(%r11,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..8dfbd5d9b9 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,80 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r11 +;; addq %r11, 8(%rdx), %r11 +;; movq %rdi, %r10 +;; addq %r10, 0(%rdx), %r10 +;; xorq %rax, %rax, %rax +;; cmpq %r11, %rdi +;; cmovnbeq %rax, %r10, %r10 +;; movl %esi, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4, %r11 +;; addq %r11, 8(%rsi), %r11 +;; movq %rdi, %r10 +;; addq %r10, 0(%rsi), %r10 +;; xorq %rsi, %rsi, %rsi +;; cmpq %r11, %rdi +;; cmovnbeq %rsi, %r10, %r10 +;; movl 0(%r10), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..7e7b969287 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,83 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4100, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r10 +;; addq %r10, 0(%rdx), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rax, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movl %esi, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rsi, %rax +;; movabsq $-4100, %rsi +;; addq %rsi, 8(%rax), %rsi +;; movq %rdi, %r10 +;; addq %r10, 0(%rax), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rsi, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movl 0(%r10), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..6368789603 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rdi, %rdi, %rdi +;; cmpq %rax, %rcx +;; cmovnbeq %rdi, %r11, %r11 +;; movl %esi, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rcx +;; cmovnbeq %rsi, %r11, %r11 +;; movl 0(%r11), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..de89255511 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rdx), %r10 +;; movq %rdi, %r9 +;; addq %r9, 0(%rdx), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq %r10, %rdi +;; cmovnbq %r11, %r9, %r9 +;; movb %sil, 0(%r9) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq 8(%rsi), %r10 +;; movq %rdi, %r9 +;; addq %r9, 0(%rsi), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq %r10, %rdi +;; cmovnbq %r11, %r9, %r9 +;; movzbq 0(%r9), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..ba1cf00550 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,83 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movabsq $-4097, %rax +;; addq %rax, 8(%rdx), %rax +;; movq %rdi, %r10 +;; addq %r10, 0(%rdx), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rax, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movb %sil, 0(%r10) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rsi, %rax +;; movabsq $-4097, %rsi +;; addq %rsi, 8(%rax), %rsi +;; movq %rdi, %r10 +;; addq %r10, 0(%rax), %r10 +;; addq %r10, $4096, %r10 +;; xorq %r11, %r11, %r11 +;; cmpq %rsi, %rdi +;; cmovnbeq %r11, %r10, %r10 +;; movzbq 0(%r10), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..003dd6aa85 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,86 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rdx), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rdx), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rdi, %rdi, %rdi +;; cmpq %rax, %rcx +;; cmovnbeq %rdi, %r11, %r11 +;; movb %sil, 0(%r11) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %rcx +;; addq %rcx, const(1), %rcx +;; jnb ; ud2 heap_oob ; +;; movq 8(%rsi), %rax +;; movq %rdi, %r11 +;; addq %r11, 0(%rsi), %r11 +;; addq %r11, const(0), %r11 +;; xorq %rsi, %rsi, %rsi +;; cmpq %rax, %rcx +;; cmovnbeq %rsi, %r11, %r11 +;; movzbq 0(%r11), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..4d8188f659 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268435452, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r10 +;; movl %esi, 0(%r10,%r8,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268435452, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r10 +;; movl 0(%r10,%r8,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..6318fe1333 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268431356, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r10 +;; movl %esi, 4096(%r10,%r8,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268431356, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r10 +;; movl 4096(%r10,%r8,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..82fd676183 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..485c4a62b2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268435455, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r10 +;; movb %sil, 0(%r10,%r8,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268435455, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r10 +;; movzbq 0(%r10,%r8,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..8bd5424d93 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268431359, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r10 +;; movb %sil, 4096(%r10,%r8,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; cmpq $268431359, %r8 +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r10 +;; movzbq 4096(%r10,%r8,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..4c670d2293 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..917ca1f6c3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movq %r10, %r9 +;; addq %r9, 0(%rdx), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq $268435452, %r10 +;; cmovnbeq %r11, %r9, %r9 +;; movl %esi, 0(%r9) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movq %r10, %r9 +;; addq %r9, 0(%rsi), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq $268435452, %r10 +;; cmovnbeq %r11, %r9, %r9 +;; movl 0(%r9), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..2f434668a1 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %r9 +;; addq %r9, 0(%rdx), %r9 +;; addq %r9, $4096, %r9 +;; xorq %r10, %r10, %r10 +;; cmpq $268431356, %r11 +;; cmovnbeq %r10, %r9, %r9 +;; movl %esi, 0(%r9) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %r9 +;; addq %r9, 0(%rsi), %r9 +;; addq %r9, $4096, %r9 +;; xorq %r10, %r10, %r10 +;; cmpq $268431356, %r11 +;; cmovnbeq %r10, %r9, %r9 +;; movl 0(%r9), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f34aedba49 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..2b07fb5e44 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movq %r10, %r9 +;; addq %r9, 0(%rdx), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq $268435455, %r10 +;; cmovnbeq %r11, %r9, %r9 +;; movb %sil, 0(%r9) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r10d +;; movq %r10, %r9 +;; addq %r9, 0(%rsi), %r9 +;; xorq %r11, %r11, %r11 +;; cmpq $268435455, %r10 +;; cmovnbeq %r11, %r9, %r9 +;; movzbq 0(%r9), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..7b8d88b480 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,78 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %r9 +;; addq %r9, 0(%rdx), %r9 +;; addq %r9, $4096, %r9 +;; xorq %r10, %r10, %r10 +;; cmpq $268431359, %r11 +;; cmovnbeq %r10, %r9, %r9 +;; movb %sil, 0(%r9) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r11d +;; movq %r11, %r9 +;; addq %r9, 0(%rsi), %r9 +;; addq %r9, $4096, %r9 +;; xorq %r10, %r10, %r10 +;; cmpq $268431359, %r11 +;; cmovnbeq %r10, %r9, %r9 +;; movzbq 0(%r9), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..7e5c5846cb --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..d45f5525a3 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movl %esi, 0(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movl 0(%r9,%r8,1), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..4bf94389cc --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movl %esi, 4096(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movl 4096(%r9,%r8,1), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..e5018d5705 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..5c8e5a3b36 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movb %sil, 0(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movzbq 0(%r9,%r8,1), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..3abcc96daa --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movb %sil, 4096(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movzbq 4096(%r9,%r8,1), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..9f28854909 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..df3b5c4e35 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movl %esi, 0(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movl 0(%r9,%r8,1), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..22ca45d736 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movl %esi, 4096(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movl 4096(%r9,%r8,1), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..3a4534773e --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..d49f324df5 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movb %sil, 0(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movzbq 0(%r9,%r8,1), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..9174a582cd --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,68 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rdx), %r9 +;; movb %sil, 4096(%r9,%r8,1) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movl %edi, %r8d +;; movq 0(%rsi), %r9 +;; movzbq 4096(%r9,%r8,1), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..a05818211f --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..4e113ab943 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435452, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movl %esi, 0(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435452, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movl 0(%r9,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..2f10cc0275 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431356, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movl %esi, 4096(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431356, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movl 4096(%r9,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..594e6ca2a6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..bb80b06f8f --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435455, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movb %sil, 0(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435455, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movzbq 0(%r9,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..00faf7898c --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431359, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movb %sil, 4096(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431359, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movzbq 4096(%r9,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..d503a444d6 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..628ec6c1eb --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435452, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl %esi, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435452, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl 0(%r8), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..cb65508f60 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431356, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl %esi, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431356, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl 0(%r8), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..b6cff5cd1f --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..08cb5cfb23 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435455, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movb %sil, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435455, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movzbq 0(%r8), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..d706afe92e --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431359, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movb %sil, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431359, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movzbq 0(%r8), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..5f0763931e --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..58e75c5b6f --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435452, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movl %esi, 0(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435452, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movl 0(%r9,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..03ae09f05c --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431356, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movl %esi, 4096(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431356, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movl 4096(%r9,%rdi,1), %eax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..1c2b921734 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..c3be251955 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435455, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movb %sil, 0(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268435455, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movzbq 0(%r9,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..297179a0ff --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431359, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rdx), %r9 +;; movb %sil, 4096(%r9,%rdi,1) +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; cmpq $268431359, %rdi +;; jbe label1; j label3 +;; block1: +;; movq 0(%rsi), %r9 +;; movzbq 4096(%r9,%rdi,1), %rax +;; jmp label2 +;; block2: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; block3: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..361b9da270 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..a5a642ca76 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435452, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl %esi, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435452, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl 0(%r8), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..9758a1e0c8 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431356, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl %esi, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431356, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movl 0(%r8), %eax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..dd2838ae77 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a936fe47fe --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,74 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435455, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movb %sil, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268435455, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movzbq 0(%r8), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..29284edfc2 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,76 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rdx), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431359, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movb %sil, 0(%r8) +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; movq %rdi, %r8 +;; addq %r8, 0(%rsi), %r8 +;; addq %r8, $4096, %r8 +;; xorq %r9, %r9, %r9 +;; cmpq $268431359, %rdi +;; cmovnbeq %r9, %r8, %r8 +;; movzbq 0(%r8), %rax +;; jmp label1 +;; block1: +;; movq %rbp, %rsp +;; popq %rbp +;; ret \ No newline at end of file diff --git a/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..5a363f190e --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/wasm/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,54 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = true +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob +;; +;; function u0:1: +;; pushq %rbp +;; unwind PushFrameRegs { offset_upward_to_caller_sp: 16 } +;; movq %rsp, %rbp +;; unwind DefineNewFrame { offset_upward_to_caller_sp: 16, offset_downward_to_clobbers: 0 } +;; block0: +;; ud2 heap_oob \ No newline at end of file diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_no_spectre.clif deleted file mode 100644 index a30c50f14c..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_yes_spectre.clif deleted file mode 100644 index 2a307ef6a8..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_no_spectre.clif deleted file mode 100644 index cdecf0016b..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_yes_spectre.clif deleted file mode 100644 index a0d022f7c1..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_yes_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_no_spectre.clif deleted file mode 100644 index f4ef93d8e9..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_yes_spectre.clif deleted file mode 100644 index 8516f69f0c..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_no_spectre.clif deleted file mode 100644 index 8a942f91ad..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_yes_spectre.clif deleted file mode 100644 index 3e4d36efda..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_yes_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - gv2 = load.i64 notrap aligned gv0+8 - heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0xffff_ffff, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_no_spectre.clif deleted file mode 100644 index 98a35c1e82..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_yes_spectre.clif deleted file mode 100644 index a3e3e5b9cb..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_no_spectre.clif deleted file mode 100644 index 5c275ea6a9..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_yes_spectre.clif deleted file mode 100644 index 53cf941394..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i32_yes_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i32, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i32 - -block0(v0: i64, v1: i32, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i32, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i32 - fn0 = %do_store(i64, i32, i32) - -block0(v0: i64, v1: i32, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_no_spectre.clif deleted file mode 100644 index 1dd2ecc6f6..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_yes_spectre.clif deleted file mode 100644 index 829f837a37..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_no_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_no_spectre.clif deleted file mode 100644 index 383294b79a..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_no_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=false - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_yes_spectre.clif b/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_yes_spectre.clif deleted file mode 100644 index 59a53ae265..0000000000 --- a/cranelift/filetests/filetests/runtests/heap_load_store_static_i64_yes_guards_yes_spectre.clif +++ /dev/null @@ -1,41 +0,0 @@ -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=true - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, i64, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i64 - -block0(v0: i64, v1: i64, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, i64, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - - heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0xffff_ffff, index_type i64 - fn0 = %do_store(i64, i64, i32) - -block0(v0: i64, v1: i64, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd diff --git a/cranelift/filetests/filetests/runtests/make-heap-load-store-tests.sh b/cranelift/filetests/filetests/runtests/make-heap-load-store-tests.sh deleted file mode 100755 index a224d65f80..0000000000 --- a/cranelift/filetests/filetests/runtests/make-heap-load-store-tests.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash - -# This script generates the `heap_load_store_*.clif` test files. -# -# Usage: -# -# $ ./make-heap-load-store-tests.sh - -set -e -cd $(dirname "$0") - -function generate_one_test() { - local kind=$1 - local index_type=$2 - local guard=$3 - local spectre=$4 - - local enable_spectre=true - if [[ $spectre == "no" ]]; then - enable_spectre=false - fi - - local have_guards=yes - if [[ $guard == "0" ]]; then - have_guards=no - fi - - local gv2="" - local bound=0x1000 - if [[ $kind == "dynamic" ]]; then - gv2="gv2 = load.i64 notrap aligned gv0+8" - bound=gv2 - fi - - local filename="heap_load_store_${kind}_${index_type}_${have_guards}_guards_${spectre}_spectre.clif" - echo "Generating $filename" - - cat < "$filename" -;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! - -test interpret -test run - -set enable_heap_access_spectre_mitigation=${enable_spectre} - -target x86_64 -target s390x -target aarch64 -target riscv64 - -function %do_store(i64 vmctx, ${index_type}, i32) { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - $gv2 - heap0 = ${kind} gv1, min 0x1000, bound ${bound}, offset_guard ${guard}, index_type ${index_type} - -block0(v0: i64, v1: ${index_type}, v2: i32): - heap_store.i32 heap0 little v1+4, v2 - return -} - -function %test(i64 vmctx, ${index_type}, i32) -> i32 { - gv0 = vmctx - gv1 = load.i64 notrap aligned gv0+0 - $gv2 - heap0 = ${kind} gv1, min 0x1000, bound ${bound}, offset_guard ${guard}, index_type ${index_type} - fn0 = %do_store(i64, ${index_type}, i32) - -block0(v0: i64, v1: ${index_type}, v2: i32): - call fn0(v0, v1, v2) - v3 = heap_load.i32 heap0 little v1+4 - return v3 -} -; heap: ${kind}, size=0x1000, ptr=vmctx+0, bound=vmctx+8 -; run: %test(0, 0) == 0 -; run: %test(0, -1) == -1 -; run: %test(16, 1) == 1 -; run: %test(16, -1) == -1 -; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd -EOF -} - -for spectre in "yes" "no"; do - for guard in "0" "0xffff_ffff"; do - for index_type in "i32" "i64"; do - for kind in "static" "dynamic"; do - generate_one_test $kind $index_type $guard $spectre - done - done - done -done diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..a3e74b5778 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..0fdfd2b22f --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f53457f7d8 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..944a54c93e --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..4fa30f1bf2 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..fdef6cfd54 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..8732f777a3 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..f6272a02d2 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..08d288e487 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..9fbb235443 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..95b57803de --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..91d4d6c3fb --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..8e3ef5bf35 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..e23d476c62 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f5b846b1fe --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..e7d543c245 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..05b6f6cee2 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f93c4b9b12 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..2664b0b366 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..23d2e8c9df --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..577596c704 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..04e038a61f --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..70751fea1e --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..0aae2568d0 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..4e7ce64428 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..09ce20f1b0 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..55e27a601d --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..c6df56d56c --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..9bd55d0161 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..3d8ec18e95 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..abc1591361 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..a38bd7b22c --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..77d6acd328 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..4df1dd1c4f --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..b8b5062c1a --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..aa0c3ac9ec --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..5521e6f10c --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..4bede29713 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..15d574bbc6 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..5bbc8088ab --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..9e7de1e8fa --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..02f755ff4a --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..1c7c2969a5 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..7f3ad93fea --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ef15b90f3e --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..40e2f7c7ac --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..7cb107f641 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..7d53b4a757 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_dynamic_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,70 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! [globals.heap_bound] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 8, readonly = true } +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "dynamic", bound = "heap_bound" } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0+8 +;; gv2 = load.i64 notrap aligned readonly gv0 +;; heap0 = dynamic gv2, min 0x0001_0000, bound gv1, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..0ff0702b4c --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..5e7a99e6bd --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..1626de9cd6 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..a6f8bb444b --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..09ccc2238f --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..bc62c76e94 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..aa142955f4 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..dc3e06c9c8 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..efdcd28da3 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..1e287eab6e --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..b935485212 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..043979d842 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..b4a3555d12 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..ac62d8c1b1 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..af531a6115 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..3592850e54 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..fc2b36ff72 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..48b5c73ae5 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..26f9b06764 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..64184b6850 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..7dbec666b1 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..accd04ab24 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..3860d842f7 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..a823b76bd3 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i32_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i32" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i32 1) + + (func (export "do_store") (param i32 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i32) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i32, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i32, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i32 +;; +;; block0(v0: i32, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..431e3270c5 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..fde4a14b57 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..ddcc9d3edb --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..914439d6de --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..62b702688f --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..2055957e70 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..ab69327111 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..06fac2c15e --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..9a7cea73a0 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..b65344116e --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..fcabe8cb27 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..08c7889dea --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0 +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..be2c8ab03a --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..f47c13485b --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..c49eec3477 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..3449b83faf --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..87f1ff2bee --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..92102ed2b1 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_no_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=false'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat new file mode 100644 index 0000000000..45a9f7e7f1 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0040 store little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 4 +;; @0048 v4 = load.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat new file mode 100644 index 0000000000..02fd250965 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0040 store little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 4 +;; @0049 v4 = load.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..f85b234ea7 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i32_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @0040 store little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 4 +;; @004c v4 = load.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat new file mode 100644 index 0000000000..c775300cb9 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0040 istore8 little heap v1, v3 +;; @0043 jump block1 +;; +;; block1: +;; @0043 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0048 v3 = heap_addr.i64 heap0, v0, 0, 1 +;; @0048 v4 = uload8.i32 little heap v3 +;; @004b jump block1(v4) +;; +;; block1(v2: i32): +;; @004b return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat new file mode 100644 index 0000000000..0a5bd59485 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0x1000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0x1000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0x1000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0040 istore8 little heap v1, v3 +;; @0044 jump block1 +;; +;; block1: +;; @0044 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @0049 v3 = heap_addr.i64 heap0, v0, 4096, 1 +;; @0049 v4 = uload8.i32 little heap v3 +;; @004d jump block1(v4) +;; +;; block1(v2: i32): +;; @004d return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat new file mode 100644 index 0000000000..add0d6b608 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/load_store_static_kind_i64_index_0xffffffff_guard_yes_spectre_i8_access_0xffff0000_offset.wat @@ -0,0 +1,66 @@ +;;! target = "x86_64" +;;! +;;! settings = ['enable_heap_access_spectre_mitigation=true'] +;;! +;;! compile = false +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +;;! # (no heap_bound global for static heaps) +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = 0xffffffff +;;! index_type = "i64" +;;! style = { kind = "static", bound = 0x10000000 } + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory i64 1) + + (func (export "do_store") (param i64 i32) + local.get 0 + local.get 1 + i32.store8 offset=0xffff0000) + + (func (export "do_load") (param i64) (result i32) + local.get 0 + i32.load8_u offset=0xffff0000)) + +;; function u0:0(i64, i32, i64 vmctx) fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i32, v2: i64): +;; @0040 v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @0040 istore8 little heap v1, v3 +;; @0047 jump block1 +;; +;; block1: +;; @0047 return +;; } +;; +;; function u0:1(i64, i64 vmctx) -> i32 fast { +;; gv0 = vmctx +;; gv1 = load.i64 notrap aligned readonly gv0 +;; heap0 = static gv1, min 0x0001_0000, bound 0x1000_0000, offset_guard 0xffff_ffff, index_type i64 +;; +;; block0(v0: i64, v1: i64): +;; @004c v3 = heap_addr.i64 heap0, v0, 0xffff_0000, 1 +;; @004c v4 = uload8.i32 little heap v3 +;; @0053 jump block1(v4) +;; +;; block1(v2: i32): +;; @0053 return v2 +;; } \ No newline at end of file diff --git a/cranelift/filetests/filetests/wasm/load-store/make-load-store-tests.sh b/cranelift/filetests/filetests/wasm/load-store/make-load-store-tests.sh new file mode 100755 index 0000000000..a4b1d1ae03 --- /dev/null +++ b/cranelift/filetests/filetests/wasm/load-store/make-load-store-tests.sh @@ -0,0 +1,134 @@ +#!/usr/bin/env bash + +# This script generates the `load_store_*.clif` test files. +# +# Usage: +# +# $ ./make-load-store-tests.sh + +set -e +cd $(dirname "$0") + +function main { + for spectre in "yes" "no"; do + for guard in "0" "0xffffffff"; do + for index_type in "i32" "i64"; do + for kind in "static" "dynamic"; do + for access_type in "i32" "i8"; do + for offset in "0" "0x1000" "0xffff0000"; do + generate_one_test $kind $index_type $guard $spectre $access_type $offset x86_64 false + for target in "x86_64" "aarch64" "s390x" "riscv64"; do + generate_one_test $kind $index_type $guard $spectre $access_type $offset $target true + done + done + done + done + done + done + done + echo "Done!" +} + +function generate_one_test() { + local kind=$1 + local index_type=$2 + local guard=$3 + local spectre=$4 + local access_type=$5 + local offset=$6 + local target=$7 + local compile=$8 + + local filename="load_store_${kind}_kind_${index_type}_index_${guard}_guard_${spectre}_spectre_${access_type}_access_${offset}_offset.wat" + if [[ $compile == "true" ]]; then + local target_dir=${target} + if [[ $target == "x86_64" ]]; then + target_dir="x64" + fi + filename="../../isa/${target_dir}/wasm/${filename}" + fi + echo "Generating $filename..." + + local enable_spectre=true + if [[ $spectre == "no" ]]; then + enable_spectre=false + fi + local settings="['enable_heap_access_spectre_mitigation=$enable_spectre']" + + local store_op= + local load_op= + case $access_type in + "i32") + store_op="i32.store" + load_op="i32.load" + ;; + "i8") + store_op="i32.store8" + load_op="i32.load8_u" + ;; + esac + + local bound_global="" + local style="" + case $kind in + "dynamic") + bound_global=$(cat < "$filename" +;;! target = "${target}" +;;! +;;! settings = ${settings} +;;! +;;! compile = ${compile} +;;! +;;! [globals.vmctx] +;;! type = "i64" +;;! vmctx = true +;;! +;;! [globals.heap_base] +;;! type = "i64" +;;! load = { base = "vmctx", offset = 0, readonly = true } +;;! +${bound_global} +;;! +;;! [[heaps]] +;;! base = "heap_base" +;;! min_size = 0x10000 +;;! offset_guard_size = ${guard} +;;! index_type = "${index_type}" +;;! style = ${style} + +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!! +;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +(module + (memory ${index_type} 1) + + (func (export "do_store") (param ${index_type} i32) + local.get 0 + local.get 1 + ${store_op} offset=${offset}) + + (func (export "do_load") (param ${index_type}) (result i32) + local.get 0 + ${load_op} offset=${offset})) + +;; TODO: run with the 'CRANELIFT_TEST_BLESS=1' env var set to update this test's +;; expected output. +EOF +} + +main diff --git a/cranelift/filetests/src/runner.rs b/cranelift/filetests/src/runner.rs index f844f4c388..5b86f020ed 100644 --- a/cranelift/filetests/src/runner.rs +++ b/cranelift/filetests/src/runner.rs @@ -127,7 +127,7 @@ impl TestRunner { // This recursive search tries to minimize statting in a directory hierarchy containing // mostly test cases. // - // - Directory entries with a "clif" extension are presumed to be test case files. + // - Directory entries with a "clif" or "wat" extension are presumed to be test case files. // - Directory entries with no extension are presumed to be subdirectories. // - Anything else is ignored. // @@ -160,7 +160,7 @@ impl TestRunner { // Recognize directories and tests by extension. // Yes, this means we ignore directories with '.' in their name. match path.extension().and_then(OsStr::to_str) { - Some("clif") => self.push_test(path), + Some("clif" | "wat") => self.push_test(path), Some(_) => {} None => self.push_dir(path), } diff --git a/cranelift/filetests/src/test_wasm.rs b/cranelift/filetests/src/test_wasm.rs index a6cb47b2da..782a79a3cd 100644 --- a/cranelift/filetests/src/test_wasm.rs +++ b/cranelift/filetests/src/test_wasm.rs @@ -29,25 +29,41 @@ pub fn run(path: &Path, wat: &str) -> Result<()> { .validate() .context("test configuration is malformed")?; - let wasm = wat::parse_str(wat).context("failed to parse the test WAT")?; - wasmparser::validate(&wasm).context("test WAT failed to validate")?; - let parsed = cranelift_reader::parse_sets_and_triple(&config.settings, &config.target) .context("invalid ISA target or Cranelift settings")?; - let fisa = parsed.as_fisa(); + let flags_or_isa = parsed.as_fisa(); ensure!( - fisa.isa.is_some(), + flags_or_isa.isa.is_some(), "Running `.wat` tests requires specifying an ISA" ); + let isa = flags_or_isa.isa.unwrap(); - let mut env = ModuleEnv::new(fisa.isa.as_ref().unwrap().frontend_config(), config); + let mut env = ModuleEnv::new(isa, config.clone()); + + let wasm = wat::parse_str(wat).context("failed to parse the test WAT")?; + let mut validator = wasmparser::Validator::new_with_features( + cranelift_wasm::ModuleEnvironment::wasm_features(&env), + ); + validator + .validate_all(&wasm) + .context("test WAT failed to validate")?; cranelift_wasm::translate_module(&wasm, &mut env) .context("failed to translate the test case into CLIF")?; let mut actual = String::new(); for (_index, func) in env.inner.info.function_bodies.iter() { - writeln!(&mut actual, "{}", func.display()).unwrap(); + if config.compile { + let mut ctx = cranelift_codegen::Context::for_function(func.clone()); + ctx.set_disasm(true); + let code = ctx + .compile(isa) + .map_err(|e| crate::pretty_anyhow_error(&e.func, e.inner))?; + writeln!(&mut actual, "function {}:", func.name).unwrap(); + writeln!(&mut actual, "{}", code.disasm.as_ref().unwrap()).unwrap(); + } else { + writeln!(&mut actual, "{}", func.display()).unwrap(); + } } let actual = actual.trim(); log::debug!("=== actual ===\n{actual}"); diff --git a/cranelift/filetests/src/test_wasm/config.rs b/cranelift/filetests/src/test_wasm/config.rs index ec14780b97..c6baf217cd 100644 --- a/cranelift/filetests/src/test_wasm/config.rs +++ b/cranelift/filetests/src/test_wasm/config.rs @@ -15,6 +15,9 @@ pub struct TestConfig { #[serde(default)] pub target: String, + #[serde(default)] + pub compile: bool, + #[serde(default)] pub settings: Vec, diff --git a/cranelift/filetests/src/test_wasm/env.rs b/cranelift/filetests/src/test_wasm/env.rs index 7debdb3a8d..fd1f184439 100644 --- a/cranelift/filetests/src/test_wasm/env.rs +++ b/cranelift/filetests/src/test_wasm/env.rs @@ -7,7 +7,10 @@ use std::collections::{BTreeMap, HashSet}; use super::config::TestConfig; use cranelift::prelude::EntityRef; -use cranelift_codegen::{ir, isa::TargetFrontendConfig}; +use cranelift_codegen::{ + ir, + isa::{TargetFrontendConfig, TargetIsa}, +}; use cranelift_wasm::{ DummyEnvironment, FuncEnvironment, FuncIndex, ModuleEnvironment, TargetEnvironment, }; @@ -15,12 +18,19 @@ use cranelift_wasm::{ pub struct ModuleEnv { pub inner: DummyEnvironment, pub config: TestConfig, + pub heap_access_spectre_mitigation: bool, } impl ModuleEnv { - pub fn new(frontend_config: TargetFrontendConfig, config: TestConfig) -> Self { - let inner = DummyEnvironment::new(frontend_config, config.debug_info); - Self { inner, config } + pub fn new(target_isa: &dyn TargetIsa, config: TestConfig) -> Self { + let inner = DummyEnvironment::new(target_isa.frontend_config(), config.debug_info); + Self { + inner, + config, + heap_access_spectre_mitigation: target_isa + .flags() + .enable_heap_access_spectre_mitigation(), + } } } @@ -67,6 +77,14 @@ impl<'data> ModuleEnvironment<'data> for ModuleEnv { Ok(()) } + fn wasm_features(&self) -> wasmparser::WasmFeatures { + wasmparser::WasmFeatures { + memory64: true, + multi_memory: true, + ..self.inner.wasm_features() + } + } + // ================================================================ // ====== Everything below here is delegated to `self.inner` ====== // ================================================================