Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 61 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ capstone = "0.13"
cfg-if = "1.0.4"
comfy-table = "7.2.1"
const_format = "0.2"
cranelift = "0.120.2"
cranelift-jit = "0.120.1"
cranelift-module = "0.120.1"
cranelift-native = "0.120.2"
cranelift = "0.126.1"
cranelift-jit = "0.126.1"
cranelift-module = "0.126.1"
cranelift-native = "0.126.1"
ed25519-dalek = "2.2.0"
elf = "0.8.0"
enum-tag = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion durable-storage/src/merkle_layer/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Avl {
}

/// Creates an in order iterator for the nodes in the tree
pub(super) fn iter(&self) -> AvlIterator {
pub(super) fn iter(&self) -> AvlIterator<'_> {
match &self.root {
None => AvlIterator {
stack: vec![],
Expand Down
2 changes: 1 addition & 1 deletion kernels/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.88.0"
channel = "1.89.0"
components = ["rustfmt", "clippy"]
targets = ["riscv64gc-unknown-linux-musl"]
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.88.0"
channel = "1.89.0"
components = ["rustfmt", "clippy"]
6 changes: 1 addition & 5 deletions src/riscv/lib/src/jit/builder/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use cranelift::codegen::Context;
use cranelift::codegen::ir::BlockArg;
use cranelift::prelude::AbiParam;
use cranelift::prelude::Block;
use cranelift::prelude::EntityRef;
use cranelift::prelude::FunctionBuilder;
use cranelift::prelude::FunctionBuilderContext;
use cranelift::prelude::InstBuilder;
Expand Down Expand Up @@ -49,8 +48,6 @@ use crate::parser::instruction::InstrWidth;
use crate::state_context::StateContext;
use crate::state_context::projection::MachineCoreProjection;

const STEPS_REMAINING_VAR_ID: usize = 0;

/// Builder for an instruction sequence
pub struct SequenceBuilder<'jit, MC: MemoryConfig> {
/// Target configuration for the JIT module
Expand Down Expand Up @@ -151,8 +148,7 @@ impl<'jit, MC: MemoryConfig> SequenceBuilder<'jit, MC> {
Pointer::<ExceptionCode>::from_raw(raw_value)
};

let steps_remaining = Variable::new(STEPS_REMAINING_VAR_ID);
builder.declare_var(steps_remaining, I64);
let steps_remaining = builder.declare_var(I64);

// Assign the passed in `max_steps` to the `steps_remaining` variable.
builder.def_var(steps_remaining, max_steps_param.to_value());
Expand Down
1 change: 1 addition & 0 deletions src/riscv/lib/src/jit/state_access/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub(crate) trait StackAddressable {
kind: StackSlotKind::ExplicitSlot,
size: Self::SIZE,
align_shift: Self::ALIGN_SHIFT,
key: None,
};
}

Expand Down
34 changes: 17 additions & 17 deletions src/riscv/lib/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ impl<MC> kernel_loader::Memory for Program<'_, MC> {

// If there is a chunk before [paddr] then we need to check if that
// chunk potentially overlaps with the location we want to write.
if let Some((&prev_paddr, prev_bytes)) = self.segments.range_mut(..paddr).last() {
if (paddr as usize) < (prev_paddr as usize) + prev_bytes.len() {
// If there is an overlap, we simply shrink the existing chunk.
// This eliminates the overlap on the left side given we would
// have overridden that section anyway.
prev_bytes.to_mut().resize((paddr - prev_paddr) as usize, 0);
}
if let Some((&prev_paddr, prev_bytes)) = self.segments.range_mut(..paddr).last()
&& (paddr as usize) < (prev_paddr as usize) + prev_bytes.len()
{
// If there is an overlap, we simply shrink the existing chunk.
// This eliminates the overlap on the left side given we would
// have overridden that section anyway.
prev_bytes.to_mut().resize((paddr - prev_paddr) as usize, 0);
}

// If there is a chunk at or after [paddr] then we need to check if that
Expand Down Expand Up @@ -80,18 +80,18 @@ impl<MC> kernel_loader::Memory for Program<'_, MC> {
// This means there either is or isn't a chunk to be written to at the
// exact address `paddr` and no overlaps would occur.

if let Some(chunk) = self.segments.get_mut(&paddr) {
if chunk.len() >= bytes.len() {
// There is a chunk at this exact address, and it has space to
// be written to.
chunk.to_mut()[..bytes.len()].copy_from_slice(bytes);
return Ok(());
}

// We don't need an else case here because the code below deals with
// overriding the entire chunk already.
if let Some(chunk) = self.segments.get_mut(&paddr)
&& chunk.len() >= bytes.len()
{
// There is a chunk at this exact address, and it has space to
// be written to.
chunk.to_mut()[..bytes.len()].copy_from_slice(bytes);
return Ok(());
}

// We don't need an else case here because the code below deals with
// overriding the entire chunk already.

self.segments.insert(paddr, Cow::Owned(bytes.to_owned()));

Ok(())
Expand Down
Loading
Loading