No public description
PiperOrigin-RevId: 649650330
Change-Id: Ia3bcc2d68be240485cfd0bcf8efc3714f8199c8e
diff --git a/cheriot/cheriot_load_filter.cc b/cheriot/cheriot_load_filter.cc
index 5d56bef..8ef1ca9 100644
--- a/cheriot/cheriot_load_filter.cc
+++ b/cheriot/cheriot_load_filter.cc
@@ -33,11 +33,15 @@
revocation_base_(revocation_base) {
cap_reg_ = new CheriotRegister(nullptr, "filter_cap");
db_ = db_factory_.Allocate<uint32_t>(1);
+ db_->Set<uint32_t>(0, 0);
+ db_->set_latency(0);
cap_reg_->SetDataBuffer(db_);
db_->DecRef();
// Allocate data buffers used in loads/stores.
db_ = db_factory_.Allocate<uint8_t>(CheriotRegister::kCapabilitySizeInBytes);
+ db_->set_latency(0);
tag_db_ = db_factory_.Allocate<uint8_t>(1);
+ tag_db_->set_latency(0);
cap_address_ = base_;
}
diff --git a/cheriot/cheriot_register.cc b/cheriot/cheriot_register.cc
index 11dc8cb..d964e33 100644
--- a/cheriot/cheriot_register.cc
+++ b/cheriot/cheriot_register.cc
@@ -197,7 +197,8 @@
uint64_t t_hi = top_bits < base_bits ? 1 : 0;
uint64_t c_b = 0 - a_hi;
uint64_t c_t = t_hi - a_hi;
- uint64_t a_top = address() >> (exponent_ + 9);
+ uint64_t address64 = address();
+ uint64_t a_top = address64 >> (exponent_ + 9);
uint64_t base = ((a_top + c_b) << (exponent_ + 9)) | (base_bits << exponent_);
base &= 0xffff'ffff;
uint64_t top = ((a_top + c_t) << (exponent_ + 9)) | (top_bits << exponent_);
diff --git a/cheriot/cheriot_test_rig.cc b/cheriot/cheriot_test_rig.cc
index ae9d3a7..c794a9c 100644
--- a/cheriot/cheriot_test_rig.cc
+++ b/cheriot/cheriot_test_rig.cc
@@ -341,6 +341,8 @@
ep_pc.rvfi_pc_wdata = next_pc;
ep_metadata.rvfi_order = counter_num_instructions_.GetValue();
ep_metadata.rvfi_valid = 1;
+ ep_metadata.rvfi_padding[0] = 0;
+ ep_metadata.rvfi_padding[1] = 0;
pcc_->set_address(next_pc);
inst->DecRef();
ep_v2.trace_size = sizeof(ep_v2);
diff --git a/cheriot/test/cheriot_load_filter_test.cc b/cheriot/test/cheriot_load_filter_test.cc
index f9f6009..232ccd6 100644
--- a/cheriot/test/cheriot_load_filter_test.cc
+++ b/cheriot/test/cheriot_load_filter_test.cc
@@ -60,7 +60,7 @@
// Test fixture to provide convenience methods and objects for the test.
class CheriotLoadFilterTest : public ::testing::Test {
public:
- CheriotLoadFilterTest() : cap_reg_(nullptr, "dummy") {
+ CheriotLoadFilterTest() : counter_("dummy", 0), cap_reg_(nullptr, "dummy") {
db_ = db_factory_.Allocate<uint32_t>(1);
cap_reg_.SetDataBuffer(db_);
cap_reg_.ResetNull();
@@ -82,7 +82,12 @@
revoke_loads_.push_back(address);
}));
db_ = db_factory_.Allocate<uint32_t>(2);
+ db_->Set<uint32_t>(0, 0);
+ db_->Set<uint32_t>(1, 0);
+ db_->set_latency(0);
tag_db_ = db_factory_.Allocate<uint8_t>(1);
+ tag_db_->Set<uint8_t>(0, 0);
+ tag_db_->set_latency(0);
counter_.SetIsEnabled(/*is_enabled=*/true);
}
diff --git a/cheriot/test_rig_packets.h b/cheriot/test_rig_packets.h
index 53a5bc2..651c6bb 100644
--- a/cheriot/test_rig_packets.h
+++ b/cheriot/test_rig_packets.h
@@ -153,7 +153,8 @@
uint8_t rvfi_rs2_addr;
// Padding to make the size a multiple of 8 bytes.
uint8_t padding[5];
- ExecutionPacketExtInteger() : magic{'i', 'n', 't', '-', 'd', 'a', 't', 'a'} {}
+ ExecutionPacketExtInteger()
+ : magic{'i', 'n', 't', '-', 'd', 'a', 't', 'a'}, padding{0, 0, 0, 0, 0} {}
};
struct ExecutionPacketExtMemAccess {