Skip to content

Conversation

mayank-microsoft
Copy link

@mayank-microsoft mayank-microsoft commented Apr 21, 2025

OpenTMK framework for testing guest-based scenarios with a HCL.

feat: opentmk init

feat: opentmk init

feat: opentmk init

feat: opentmk init

feat: opentmk init

feat: opentmk init

feat: init 1

feat: init 2

feat: init 1

feat: opentmk

feat: opentmk init 3

feat: opentmk init 4

feat: opentmk init 4
edition.workspace = true
rust-version.workspace = true

[dependencies]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: sort and switch to dotted syntax for crates that don't need features. Also move all crates to be workspaced.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smalis-msft There is one issue where I want to use the serde package with default features off as I want to use a no_std env. Should I disable the feature in workspace?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you'll have to.

Copy link
Contributor

@smalis-msft smalis-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies if I'm repeating something I said in the previous review, there's a lot of code here and it's been a little while.

Also, you'll need to run cargo xtask fmt and have it succeed on this code before it can be merged.

That all said, this is shaping up really really nicely. Please don't let the large number of comments discourage you, I'm really happy with how this is shaping up.


[[package]]
name = "spin"
version = "0.10.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we unify on the same version of spin that lazy_static is pulling in, so we only have the one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will work on versioning and package related changes as I resolve the merge conflicts.

@mayank-microsoft mayank-microsoft marked this pull request as ready for review August 27, 2025 18:52
@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 18:52
@mayank-microsoft mayank-microsoft requested review from a team as code owners August 27, 2025 18:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces the OpenTMK (Open Testing and Measurement Kit) framework, a Rust-based test harness for hypervisor functionality testing within UEFI environments. The framework provides comprehensive testing capabilities for VTL (Virtual Trust Level) operations, virtual processor management, memory protections, and TPM interactions.

Key changes:

  • Complete OpenTMK framework implementation with platform abstraction layer
  • New nostd_spin_channel crate for no_std communication
  • Comprehensive test suite covering hypervisor operations and security scenarios

Reviewed Changes

Copilot reviewed 43 out of 46 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
support/nostd_spin_channel/ New no_std channel implementation for inter-VP communication
opentmk/src/ Core OpenTMK framework with platform traits and hypervisor context
opentmk/src/tests/ Test suite for VTL operations, memory protection, and TPM functionality
opentmk/src/arch/ Architecture-specific implementations for x86_64 and aarch64
Cargo.toml Workspace configuration updates to include new crates
Comments suppressed due to low confidence (1)

opentmk/src/tests/hyperv/hv_processor.rs:1

  • Inconsistency in the assertion: the code checks that vp_count equals 4 but the error message says it 'should be 8'. Either the expected value or the message is incorrect.
use hvdef::Vtl;

@@ -29,6 +29,7 @@ HYPERCALL_PAGE:
/// input/output pages are not being concurrently used elsewhere. For fast
/// hypercalls, the caller must ensure that there are no output words so that
/// there is no register corruption.
#[inline(never)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I need to remove this.

@@ -0,0 +1,4 @@
imports_granularity = "Item" # Expands `use foo::{bar, baz};` into separate `use` lines
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to go away, although if these options are stabilized they could move to our root rustfmt.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants