Skip to content

Commit 1f66dca

Browse files
authored
Run spell checks on the repo (#58)
* Run spell checks on the repo Signed-off-by: Tomasz Andrzejak <[email protected]> * Fix typo in `GuestPanicContext` Signed-off-by: Tomasz Andrzejak <[email protected]> --------- Signed-off-by: Tomasz Andrzejak <[email protected]>
1 parent 22b6795 commit 1f66dca

32 files changed

+60
-48
lines changed

.github/workflows/ValidatePullRequest.yml

+7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ jobs:
5050
max_total_time: 300 # 5 minutes in seconds
5151
docs_only: ${{needs.docs-pr.outputs.docs-only}}
5252
secrets: inherit
53+
spelling:
54+
name: spell check with typos
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Spell Check Repo
59+
uses: crate-ci/typos@master
5360

5461
#####
5562
# start build-on-windows

Justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ run-rust-examples target=default-target: (build-rust target)
154154
cargo run --profile={{ if target == "debug" { "dev" } else { target } }} --example metrics --features "function_call_metrics"
155155
{{ set-trace-env-vars }} cargo run --profile={{ if target == "debug" { "dev" } else { target } }} --example logging
156156

157-
# The two tracing eamples are flaky on windows so we run them on linux only for now, need to figure out why as they run fine locally on windows
157+
# The two tracing examples are flaky on windows so we run them on linux only for now, need to figure out why as they run fine locally on windows
158158
run-rust-examples-linux target=default-target: (build-rust target) (run-rust-examples target)
159159
{{ set-trace-env-vars }} cargo run --profile={{ if target == "debug" { "dev" } else { target } }} --example tracing
160160
{{ set-trace-env-vars }} cargo run --profile={{ if target == "debug" { "dev" } else { target } }} --example tracing --features "function_call_metrics"

NOTICE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ under the standard MIT terms.
197197
All other files which have no copyright comments are original works
198198
produced specifically for use as part of this library, written either
199199
by Rich Felker, the main author of the library, or by one or more
200-
contibutors listed above. Details on authorship of individual files
200+
contributors listed above. Details on authorship of individual files
201201
can be found in the git version control history of the project. The
202202
omission of copyright and license comments in each file is in the
203203
interest of source tree size.

src/hyperlight_common/src/flatbuffer_wrappers/guest_log_level.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl From<&LogLevel> for FbLogLevel {
8585

8686
impl From<&LogLevel> for Level {
8787
// There is a test (sandbox::outb::tests::test_log_outb_log) which emits trace record as logs
88-
// which causes a panic when this function is instrumeneted as the logger is contained in refcell and
88+
// which causes a panic when this function is instrumented as the logger is contained in refcell and
8989
// instrumentation ends up causing a double mutborrow. So this is not instrumented.
9090
//TODO: instrument this once we fix the test
9191
fn from(val: &LogLevel) -> Level {

src/hyperlight_host/benches/benchmarks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn sandbox_benchmark(c: &mut Criterion) {
106106

107107
// Benchmarks the time to create a new uninintialized sandbox.
108108
// Does **not** include the time to drop the sandbox.
109-
group.bench_function("create_uninitalized_sandbox", |b| {
109+
group.bench_function("create_uninitialized_sandbox", |b| {
110110
b.iter_with_large_drop(create_uninit_sandbox);
111111
});
112112

src/hyperlight_host/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub enum HyperlightError {
227227
#[error("Failed To Convert Parameter Value {0:?} to {1:?}")]
228228
ParameterValueConversionFailure(ParameterValue, &'static str),
229229

230-
/// a failure occured processing a PE file
230+
/// a failure occurred processing a PE file
231231
#[error("Failure processing PE File {0:?}")]
232232
PEFileProcessingFailure(#[from] goblin::error::Error),
233233

src/hyperlight_host/src/func/call_ctx.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl MultiUseGuestCallContext {
5656
///
5757
/// Every call to a guest function through this method will be made with the same "context"
5858
/// meaning that the guest state resulting from any previous call will be present/osbservable
59-
/// by the guest funcation called.
59+
/// by the guest function called.
6060
///
6161
/// If you want to reset state, call `finish()` on this `MultiUseGuestCallContext`
6262
/// and get a new one from the resulting `MultiUseSandbox`
@@ -89,9 +89,9 @@ impl MultiUseGuestCallContext {
8989
/// Note that this method is pub(crate) and does not reset the state of the
9090
/// sandbox.
9191
///
92-
/// It is intended to be used when evolving a MutliUseSandbox to a new state
92+
/// It is intended to be used when evolving a MultiUseSandbox to a new state
9393
/// and is not intended to be called publicly. It allows the state of the guest to be altered
94-
/// during the eveolution of one sandbox state to another, enabling the new state created
94+
/// during the evolution of one sandbox state to another, enabling the new state created
9595
/// to be captured and stored in the Sandboxes state stack.
9696
///
9797
pub(crate) fn finish_no_reset(self) -> MultiUseSandbox {

src/hyperlight_host/src/hypervisor/hypervisor_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ fn set_up_hypervisor_partition(
837837
// debug build without in-process feature
838838
log_then_return!("In-process mode requires `inprocess` cargo feature");
839839
} else {
840-
log_then_return!("In-process mode requires `inprocess` cargo feature and is only avaiable on debug-builds");
840+
log_then_return!("In-process mode requires `inprocess` cargo feature and is only available on debug-builds");
841841
}
842842
}
843843
} else {

src/hyperlight_host/src/hypervisor/kvm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl KVMDriver {
103103
})?;
104104

105105
let mut vcpu_fd = vm_fd.create_vcpu(0)?;
106-
Self::setup_inital_sregs(&mut vcpu_fd, pml4_addr)?;
106+
Self::setup_initial_sregs(&mut vcpu_fd, pml4_addr)?;
107107

108108
let rsp_gp = GuestPtr::try_from(RawPtr::from(rsp))?;
109109
Ok(Self {
@@ -117,7 +117,7 @@ impl KVMDriver {
117117
}
118118

119119
#[instrument(err(Debug), skip_all, parent = Span::current(), level = "Trace")]
120-
fn setup_inital_sregs(vcpu_fd: &mut VcpuFd, pml4_addr: u64) -> Result<()> {
120+
fn setup_initial_sregs(vcpu_fd: &mut VcpuFd, pml4_addr: u64) -> Result<()> {
121121
// setup paging and IA-32e (64-bit) mode
122122
let mut sregs = vcpu_fd.get_sregs()?;
123123
sregs.cr3 = pml4_addr;

src/hyperlight_host/src/hypervisor/metrics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ mod tests {
109109
/// Marking this test as ignored means that running `cargo test` will not
110110
/// run it. This will allow a developer who runs that command
111111
/// from their workstation to be successful without needing to know about
112-
/// test interdependencies. This test will, however, be run explcitly as a
112+
/// test interdependencies. This test will, however, be run explicitly as a
113113
/// part of the CI pipeline.
114114
fn test_metrics() {
115115
let iter: HypervisorMetricIter = HypervisorMetric::iter();
@@ -151,7 +151,7 @@ mod tests {
151151
/// Marking this test as ignored means that running `cargo test` will not
152152
/// run it. This will allow a developer who runs that command
153153
/// from their workstation to be successful without needing to know about
154-
/// test interdependencies. This test will, however, be run explcitly as a
154+
/// test interdependencies. This test will, however, be run explicitly as a
155155
/// part of the CI pipeline.
156156
fn test_gather_metrics() {
157157
lazy_static! {

src/hyperlight_host/src/hypervisor/surrogate_process_manager.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@ fn ensure_surrogate_process_exe() -> Result<()> {
307307
if p.exists() {
308308
// check to see if sha's match and if not delete the file so we'll extract
309309
// the embedded file below.
310-
let embeded_file_sha = sha256::digest(exe.data.as_ref());
310+
let embedded_file_sha = sha256::digest(exe.data.as_ref());
311311
let file_on_disk_sha = sha256::try_digest(&p)?;
312312

313-
if embeded_file_sha != file_on_disk_sha {
313+
if embedded_file_sha != file_on_disk_sha {
314314
println!(
315315
"sha of embedded surrorate '{}' does not match sha of file on disk '{}' - deleting surrogate binary at {}",
316-
embeded_file_sha,
316+
embedded_file_sha,
317317
file_on_disk_sha,
318318
&surrogate_process_path.display()
319319
);

src/hyperlight_host/src/mem/exe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use super::pe::pe_info::PEInfo;
2424
use super::ptr_offset::Offset;
2525
use crate::Result;
2626

27-
// This is used extremely infrequently, so being unusally large for PE
27+
// This is used extremely infrequently, so being unusually large for PE
2828
// files _really_ doesn't matter, and probably isn't really worth the
2929
// cost of an indirection.
3030
#[allow(clippy::large_enum_variant)]

src/hyperlight_host/src/mem/layout.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ impl SandboxMemoryLayout {
515515
/// Get the offset in guest memory to the output data pointer.
516516
#[instrument(skip_all, parent = Span::current(), level= "Trace")]
517517
fn get_output_data_pointer_offset(&self) -> usize {
518-
// This field is immedaitely after the output data size field,
518+
// This field is immediately after the output data size field,
519519
// which is a `u64`.
520520
self.get_output_data_size_offset() + size_of::<u64>()
521521
}
@@ -626,7 +626,7 @@ impl SandboxMemoryLayout {
626626
#[instrument(skip_all, parent = Span::current(), level= "Trace")]
627627
pub(crate) fn get_guest_panic_context_buffer_pointer_offset(&self) -> usize {
628628
// The guest panic data pointer is immediately after the guest
629-
// panic data size field in the `GuestPanicCOntext` data which is a `u64`
629+
// panic data size field in the `GuestPanicContext` data which is a `u64`
630630
self.get_guest_panic_context_size_offset() + size_of::<u64>()
631631
}
632632

@@ -715,7 +715,7 @@ impl SandboxMemoryLayout {
715715
stack_size: usize,
716716
heap_size: usize,
717717
) -> usize {
718-
// Get the conigured memory size (assume each section is 4K aligned)
718+
// Get the configured memory size (assume each section is 4K aligned)
719719

720720
let mut total_mapped_memory_size: usize = round_up_to(code_size, PAGE_SIZE_USIZE);
721721
total_mapped_memory_size += round_up_to(stack_size, PAGE_SIZE_USIZE);

src/hyperlight_host/src/mem/loaded_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl LoadedLib {
5757
let mut lock = LOADED_LIB.lock().unwrap();
5858
if lock.upgrade().is_some() {
5959
// An owning copy of the loaded library still exists somewhere,
60-
// we can't load a new libary yet
60+
// we can't load a new library yet
6161
log_then_return!("LoadedLib: Only one guest binary can be loaded at any single time");
6262
}
6363
let inner = Arc::new(LoadedLibInner::load(path)?);

src/hyperlight_host/src/mem/mgr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ where
207207
PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_NX
208208
}
209209
// The guard page is marked RW and User so that if it gets written to we can detect it in the host
210-
// If/When we implement an interupt handler for page faults in the guest then we can remove this access and handle things properly there
210+
// If/When we implement an interrupt handler for page faults in the guest then we can remove this access and handle things properly there
211211
MemoryRegionType::GuardPage => {
212212
PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_NX
213213
}
@@ -585,7 +585,7 @@ impl SandboxMemoryManager<HostSharedMemory> {
585585
// addresses that are valid are in its own address space.
586586
//
587587
// When executing in-process, maniulating this pointer could cause the
588-
// host to execute arbitary functions.
588+
// host to execute arbitrary functions.
589589
let guest_ptr = GuestPtr::try_from(RawPtr::from(guest_dispatch_function_ptr))?;
590590
guest_ptr.absolute()
591591
}

src/hyperlight_host/src/mem/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub mod layout;
2929
pub(super) mod loaded_lib;
3030
/// memory regions to be mapped inside a vm
3131
pub mod memory_region;
32-
/// Functionality taht wraps a `SandboxMemoryLayout` and a
32+
/// Functionality that wraps a `SandboxMemoryLayout` and a
3333
/// `SandboxMemoryConfig` to mutate a sandbox's memory as necessary.
3434
pub mod mgr;
3535
/// Functionality to read and mutate a PE file in a structured manner.

src/hyperlight_host/src/mem/pe/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
/// Extends goblin to suport base relocations in PE file
17+
/// Extends goblin to support base relocations in PE file
1818
pub(super) mod base_relocations;
1919
/// PE file headers
2020
pub(super) mod headers;

src/hyperlight_host/src/mem/shared_mem.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ impl ExclusiveSharedMemory {
560560
/// Convert the ExclusiveSharedMemory, which may be freely
561561
/// modified, into a GuestSharedMemory, which may be somewhat
562562
/// freely modified (mostly by the guest), and a HostSharedMemory,
563-
/// which may only make certain kinds of acceses that do not race
563+
/// which may only make certain kinds of accesses that do not race
564564
/// in the presence of malicious code inside the guest mutating
565565
/// the GuestSharedMemory.
566566
pub fn build(self) -> (HostSharedMemory, GuestSharedMemory) {
@@ -1095,7 +1095,7 @@ mod tests {
10951095
/// Marking this test as ignored means that running `cargo test` will not
10961096
/// run it. This feature will allow a developer who runs that command
10971097
/// from their workstation to be successful without needing to know about
1098-
/// test interdependencies. This test will, however, be run explcitly as a
1098+
/// test interdependencies. This test will, however, be run explicitly as a
10991099
/// part of the CI pipeline.
11001100
#[test]
11011101
#[ignore]

src/hyperlight_host/src/metrics/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub fn set_metrics_registry(registry: &'static Registry) -> Result<()> {
243243
REGISTRY
244244
.set(registry)
245245
// This should be impossible
246-
.map_err(|e| new_error!("Registry alread set : {0:?}", e))
246+
.map_err(|e| new_error!("Registry already set : {0:?}", e))
247247
}
248248
}
249249
}
@@ -259,7 +259,7 @@ fn get_histogram_opts(name: &str, help: &str, buckets: Vec<f64>) -> HistogramOpt
259259
opts.buckets(buckets)
260260
}
261261

262-
/// Provides functionaility to help with testing Hyperlight Metrics
262+
/// Provides functionality to help with testing Hyperlight Metrics
263263
pub mod tests {
264264
use std::collections::HashSet;
265265

@@ -281,11 +281,11 @@ pub mod tests {
281281
fn enum_has_variant_for_all_metrics() {
282282
let metric_definitions = Self::get_metric_definitions().iter();
283283
for metric_definition in metric_definitions {
284-
let metric_defintion_name = metric_definition.name;
284+
let metric_definition_name = metric_definition.name;
285285
assert!(
286-
Self::get_enum_variant_names().contains(&metric_defintion_name),
286+
Self::get_enum_variant_names().contains(&metric_definition_name),
287287
"Metric Definition Name {} not found",
288-
metric_defintion_name,
288+
metric_definition_name,
289289
);
290290
}
291291
}

src/hyperlight_host/src/sandbox/initialized_multi_use.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl MultiUseSandbox {
9191
/// `MultiUseGuestCallContext` is guaranteed mutual exclusion for calling
9292
/// functions within the sandbox. This guarantee is enforced at compile
9393
/// time, and no locks, atomics, or any other mutual exclusion mechanisms
94-
/// are used at rumtime.
94+
/// are used at runtime.
9595
///
9696
/// If you have called this function, have a `MultiUseGuestCallContext`,
9797
/// and wish to "return" it to a `MultiUseSandbox`, call the `finish`
@@ -238,7 +238,7 @@ where
238238
/// An implementation such as HyperlightJs or HyperlightWasm can use this to call guest functions to load JS or WASM code and then evolve the sandbox causing state to be captured.
239239
/// The new MultiUseSandbox can then be used to call guest functions to execute the loaded code.
240240
///
241-
/// The evolve function creates a new MutliUseCallContext which is then passed to a callback function allowing the
241+
/// The evolve function creates a new MultiUseCallContext which is then passed to a callback function allowing the
242242
/// callback function to call guest functions as part of the evolve process, once the callback function is complete
243243
/// the context is finished using a crate internal method that does not restore the prior state of the Sanbbox.
244244
/// It then creates a mew memory snapshot on the snapshot stack and returns the MultiUseSandbox

src/hyperlight_host/src/sandbox/initialized_single_use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl SingleUseSandbox {
7676
}
7777

7878
/// Create a new `SingleUseCallContext` . The main purpose of the
79-
/// a SingleUseSandbox is to allow mutiple calls to guest functions from within a callback function.
79+
/// a SingleUseSandbox is to allow multiple calls to guest functions from within a callback function.
8080
///
8181
/// Since this function consumes `self`, the returned
8282
/// `SingleUseGuestCallContext` is guaranteed mutual exclusion for calling

src/hyperlight_host/src/sandbox/metrics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
/*!
18-
This modue contains the definitions and implementations of the metrics used by the sandbox module
18+
This module contains the definitions and implementations of the metrics used by the sandbox module
1919
*/
2020
use std::collections::HashMap;
2121
use std::sync::Once;
@@ -150,7 +150,7 @@ mod tests {
150150
/// Marking this test as ignored means that running `cargo test` will not
151151
/// run it. This feature will allow a developer who runs that command
152152
/// from their workstation to be successful without needing to know about
153-
/// test interdependencies. This test will, however, be run explcitly as a
153+
/// test interdependencies. This test will, however, be run explicitly as a
154154
/// part of the CI pipeline.
155155
fn test_metrics() {
156156
let iter: SandboxMetricIter = SandboxMetric::iter();
@@ -226,7 +226,7 @@ mod tests {
226226
assert_eq!(histogram.get_sample_sum(&label_vals).unwrap(), 1.0);
227227
}
228228
_ => {
229-
panic!("metric is not an IntGauge,IntCounterVec or HistorgamVec");
229+
panic!("metric is not an IntGauge,IntCounterVec or HistogramVec");
230230
}
231231
},
232232
Err(e) => {
@@ -242,7 +242,7 @@ mod tests {
242242
/// Marking this test as ignored means that running `cargo test` will not
243243
/// run it. This feature will allow a developer who runs that command
244244
/// from their workstation to be successful without needing to know about
245-
/// test interdependencies. This test will, however, be run explcitly as a
245+
/// test interdependencies. This test will, however, be run explicitly as a
246246
/// part of the CI pipeline.
247247
fn test_gather_metrics() {
248248
lazy_static! {

src/hyperlight_host/src/sandbox/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mod run_options;
4444
/// Functionality for creating uninitialized sandboxes, manipulating them,
4545
/// and converting them to initialized sandboxes.
4646
pub mod uninitialized;
47-
/// Functionality for properly converting `UninitailizedSandbox`es to
47+
/// Functionality for properly converting `UninitializedSandbox`es to
4848
/// initialized `Sandbox`es.
4949
pub(crate) mod uninitialized_evolve;
5050

src/hyperlight_host/src/sandbox/outb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ mod tests {
322322
// this test is ignored because it is incompatible with other tests , specifically those which require a logger for tracing
323323
// marking this test as ignored means that running `cargo test` will not run this test but will allow a developer who runs that command
324324
// from their workstation to be successful without needed to know about test interdependencies
325-
// this test will be run explcitly as a part of the CI pipeline
325+
// this test will be run explicitly as a part of the CI pipeline
326326
#[ignore]
327327
#[test]
328328
fn test_trace_outb_log() {

src/hyperlight_host/src/sandbox/uninitialized.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ mod tests {
856856
// this test is ignored because it is incompatible with other tests , specifically those which require a logger for tracing
857857
// marking this test as ignored means that running `cargo test` will not run this test but will allow a developer who runs that command
858858
// from their workstation to be successful without needed to know about test interdependencies
859-
// this test will be run explcitly as a part of the CI pipeline
859+
// this test will be run explicitly as a part of the CI pipeline
860860
#[ignore]
861861
fn test_trace_trace() {
862862
TestLogger::initialize_log_tracer();

src/hyperlight_host/src/sandbox_state/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
/// The standarized `Sandbox` trait and the ways it ban be transitioned
17+
/// The standardized `Sandbox` trait and the ways it ban be transitioned
1818
/// to a different `Sandbox` trait
1919
pub mod sandbox;
2020
/// Metadata about transitions between `Sandbox` states

0 commit comments

Comments
 (0)