diff --git a/src/aarch64.rs b/src/aarch64.rs index d6869d9a..18d3e33a 100644 --- a/src/aarch64.rs +++ b/src/aarch64.rs @@ -117,7 +117,7 @@ pub enum ARM64Instruction { LogicalRegister(ARM64InstructionLogicalShiftedRegister), AddSubRegister(ARM64InstructionLogicalShiftedRegister), AddSubImm(ARM64InstructionAddSubImm), - ConditionalBranch(ARM64InstructionConditonalBranch), + ConditionalBranch(ARM64InstructionConditionalBranch), LogicalImm(ARM64InstructionLogicalImm), BitfieldImm(ARM64InstructionLogicalImm), MovWideImm(ARM64InstructionWideImm), @@ -255,7 +255,7 @@ impl Default for ARM64InstructionWideImm { } #[derive(Copy, Clone)] -pub struct ARM64InstructionConditonalBranch { +pub struct ARM64InstructionConditionalBranch { pub cond: u8, // 4 bits pub imm19: i32, // offset from current instruction, divided by 4 } @@ -819,7 +819,7 @@ impl ARM64Instruction { // WARNING: You need to divide the byte offset by 4 before passing as imm19 #[must_use] pub fn b_cond(cond: Condition, imm19: i32) -> Self { - Self::ConditionalBranch(ARM64InstructionConditonalBranch { + Self::ConditionalBranch(ARM64InstructionConditionalBranch { cond: cond as u8, imm19, }) diff --git a/src/elf.rs b/src/elf.rs index 640073c3..c65b8527 100644 --- a/src/elf.rs +++ b/src/elf.rs @@ -44,8 +44,8 @@ pub enum ElfError { /// Entrypoint out of bounds #[error("Entrypoint out of bounds")] EntrypointOutOfBounds, - /// Invaid entrypoint - #[error("Invaid entrypoint")] + /// Invalid entrypoint + #[error("Invalid entrypoint")] InvalidEntrypoint, /// Failed to get section #[error("Failed to get section {0}")] @@ -68,7 +68,7 @@ pub enum ElfError { /// Incompatible ELF: wrong ABI #[error("Incompatible ELF: wrong ABI")] WrongAbi, - /// Incompatible ELF: wrong mchine + /// Incompatible ELF: wrong machine #[error("Incompatible ELF: wrong machine")] WrongMachine, /// Incompatible ELF: wrong class diff --git a/src/elf_parser/mod.rs b/src/elf_parser/mod.rs index e6795c9a..b6501c66 100644 --- a/src/elf_parser/mod.rs +++ b/src/elf_parser/mod.rs @@ -30,7 +30,7 @@ pub enum ElfParserError { /// Section or symbol name is too long #[error("Section or symbol name `{0}` is longer than `{1}` bytes")] StringTooLong(String, usize), - /// An index or memory range does exeed its boundaries + /// An index or memory range does exceed its boundaries #[error("value out of bounds")] OutOfBounds, /// The size isn't valid diff --git a/src/jit.rs b/src/jit.rs index d0a17180..45c438f9 100644 --- a/src/jit.rs +++ b/src/jit.rs @@ -264,7 +264,7 @@ enum RuntimeEnvironmentSlot { MemoryMapping = 28, } -/* Explaination of the Instruction Meter +/* Explanation of the Instruction Meter The instruction meter serves two purposes: First, measure how many BPF instructions are executed (profiling) and second, limit this number by stopping the program with an exception diff --git a/src/memory_region.rs b/src/memory_region.rs index dbd876fb..e0ebfe61 100644 --- a/src/memory_region.rs +++ b/src/memory_region.rs @@ -15,14 +15,14 @@ use std::{ ptr::{self, copy_nonoverlapping}, }; -/* Explaination of the Gapped Memory +/* Explanation of the Gapped Memory The MemoryMapping supports a special mapping mode which is used for the stack MemoryRegion. In this mode the backing address space of the host is sliced in power-of-two aligned frames. The exponent of this alignment is specified in vm_gap_shift. Then the virtual address space of the guest is spread out in a way which leaves gapes, the same size as the frames, in between the frames. This effectively doubles the size of the guests virtual address space. - But the acutual mapped memory stays the same, as the gaps are not mapped and accessing them + But the actual mapped memory stays the same, as the gaps are not mapped and accessing them results in an AccessViolation. Guest: frame 0 | gap 0 | frame 1 | gap 1 | frame 2 | gap 2 | ...