Skip to content

Commit 3bbd8b4

Browse files
committed
Remove mshv2 feature from Hyperlight
- This removes CI builds and tests for mshv2 feature - Removes mshv2 special handling of VMs Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent e0d762d commit 3bbd8b4

File tree

16 files changed

+25
-135
lines changed

16 files changed

+25
-135
lines changed

.github/workflows/Benchmarks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: true
2020
matrix:
21-
hypervisor: [hyperv, 'hyperv-ws2025', mshv, mshv3, kvm] # hyperv,hyperv-ws2025 are windows, mshv, mshv3 and kvm are linux
21+
hypervisor: [hyperv, 'hyperv-ws2025', mshv3, kvm] # hyperv,hyperv-ws2025 are windows, mshv3 and kvm are linux
2222
cpu: [amd, intel]
2323
config: [release]
2424
runs-on: ${{ fromJson(
@@ -66,7 +66,7 @@ jobs:
6666
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767

6868
- name: Run Benchmarks
69-
run: just bench-ci main ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
69+
run: just bench-ci main
7070

7171
- uses: actions/upload-artifact@v4
7272
with:

.github/workflows/CreateRelease.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ jobs:
146146
# kvm
147147
tar -zcvf benchmarks_Linux_kvm_amd.tar.gz benchmarks_Linux_kvm_amd
148148
tar -zcvf benchmarks_Linux_kvm_intel.tar.gz benchmarks_Linux_kvm_intel
149-
# mshv2
150-
tar -zcvf benchmarks_Linux_mshv_intel.tar.gz benchmarks_Linux_mshv_intel
151-
tar -zcvf benchmarks_Linux_mshv_amd.tar.gz benchmarks_Linux_mshv_amd
152149
# mshv3
153150
tar -zcvf benchmarks_Linux_mshv3_amd.tar.gz benchmarks_Linux_mshv3_amd
154151
tar -zcvf benchmarks_Linux_mshv3_intel.tar.gz benchmarks_Linux_mshv3_intel
@@ -173,8 +170,6 @@ jobs:
173170
benchmarks_Windows_hyperv_intel.tar.gz \
174171
benchmarks_Linux_kvm_amd.tar.gz \
175172
benchmarks_Linux_kvm_intel.tar.gz \
176-
benchmarks_Linux_mshv_intel.tar.gz \
177-
benchmarks_Linux_mshv_amd.tar.gz \
178173
benchmarks_Linux_mshv3_amd.tar.gz \
179174
benchmarks_Linux_mshv3_intel.tar.gz \
180175
hyperlight-guest-c-api-linux.tar.gz \
@@ -191,8 +186,6 @@ jobs:
191186
benchmarks_Windows_hyperv_intel.tar.gz \
192187
benchmarks_Linux_kvm_amd.tar.gz \
193188
benchmarks_Linux_kvm_intel.tar.gz \
194-
benchmarks_Linux_mshv_intel.tar.gz \
195-
benchmarks_Linux_mshv_amd.tar.gz \
196189
benchmarks_Linux_mshv3_amd.tar.gz \
197190
benchmarks_Linux_mshv3_intel.tar.gz \
198191
hyperlight-guest-c-api-linux.tar.gz \

.github/workflows/ValidatePullRequest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: true
4949
matrix:
50-
hypervisor: [hyperv, 'hyperv-ws2025', mshv, mshv3, kvm]
50+
hypervisor: [hyperv, 'hyperv-ws2025', mshv3, kvm]
5151
cpu: [amd, intel]
5252
config: [debug, release]
5353
uses: ./.github/workflows/dep_rust.yml

.github/workflows/dep_rust.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
# use these commands in favor of build-and-move-c-guests to avoid building both configs
133133
just build-c-guests ${{ inputs.config }}
134134
just move-c-guests ${{ inputs.config }}
135-
135+
136136
- name: Build
137137
run: just build ${{ inputs.config }}
138138
env:
@@ -144,10 +144,10 @@ jobs:
144144
TARGET_TRIPLE: ${{ inputs.target_triple }}
145145
run: |
146146
# with default features
147-
just test ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
147+
just test ${{ inputs.config }}
148148
149149
# with only one driver enabled (driver mshv/kvm feature is ignored on windows)
150-
just test ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || inputs.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
150+
just test ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
151151
152152
# make sure certain cargo features compile
153153
just check
@@ -171,29 +171,29 @@ jobs:
171171
CARGO_TERM_COLOR: always
172172
RUST_LOG: debug
173173
TARGET_TRIPLE: ${{ inputs.target_triple }}
174-
run: just run-rust-examples-linux ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
174+
run: just run-rust-examples-linux ${{ inputs.config }}
175175

176176
- name: Run Rust Gdb tests
177177
env:
178178
CARGO_TERM_COLOR: always
179179
RUST_LOG: debug
180180
TARGET_TRIPLE: ${{ inputs.target_triple }}
181-
run: just test-rust-gdb-debugging ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
181+
run: just test-rust-gdb-debugging ${{ inputs.config }}
182182

183183
- name: Run Rust Crashdump tests
184184
env:
185185
CARGO_TERM_COLOR: always
186186
RUST_LOG: debug
187187
TARGET_TRIPLE: ${{ inputs.target_triple }}
188-
run: just test-rust-crashdump ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
188+
run: just test-rust-crashdump ${{ inputs.config }}
189189

190190
- name: Run Rust Tracing tests - linux
191191
if: runner.os == 'Linux'
192192
env:
193193
CARGO_TERM_COLOR: always
194194
RUST_LOG: debug
195195
TARGET_TRIPLE: ${{ inputs.target_triple }}
196-
run: just test-rust-tracing ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}
196+
run: just test-rust-tracing ${{ inputs.config }}
197197

198198
- name: Download benchmarks from "latest"
199199
run: just bench-download ${{ runner.os }} ${{ inputs.hypervisor }} ${{ inputs.cpu}} dev-latest # compare to prerelease
@@ -204,5 +204,5 @@ jobs:
204204

205205
- name: Run benchmarks
206206
run: |
207-
just bench-ci main ${{ inputs.hypervisor == 'mshv' && 'mshv2' || ''}}
207+
just bench-ci main
208208
if: ${{ inputs.config == 'release' && inputs.target_triple == '' }}

Cargo.lock

Lines changed: 3 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Justfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ clean-rust:
7878
# convenience recipe to run all tests with the given target and features (similar to CI)
7979
test-like-ci config=default-target hypervisor="kvm":
8080
@# with default features
81-
just test {{config}} {{ if hypervisor == "mshv" {"mshv2"} else {""} }}
81+
just test {{config}}
8282

8383
@# with only one driver enabled + build-metadata + init-paging
84-
just test {{config}} build-metadata,init-paging,{{ if hypervisor == "mshv" {"mshv2"} else if hypervisor == "mshv3" {"mshv3"} else {"kvm"} }}
84+
just test {{config}} build-metadata,init-paging,{{ if hypervisor == "mshv3" {"mshv3"} else {"kvm"} }}
8585

8686
@# make sure certain cargo features compile
8787
just check
@@ -93,7 +93,7 @@ test-like-ci config=default-target hypervisor="kvm":
9393
just test-rust-crashdump {{config}}
9494

9595
@# test the tracing related features
96-
{{ if os() == "linux" { "just test-rust-tracing " + config + " " + if hypervisor == "mshv" { "mshv2" } else if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
96+
{{ if os() == "linux" { "just test-rust-tracing " + config + " " + if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
9797

9898
like-ci config=default-target hypervisor="kvm":
9999
@# Ensure up-to-date Cargo.lock
@@ -130,19 +130,19 @@ like-ci config=default-target hypervisor="kvm":
130130
{{ if os() == "windows" { "just run-rust-examples " + config } else { "" } }}
131131

132132
@# Run Rust examples - linux
133-
{{ if os() == "linux" { "just run-rust-examples-linux " + config + " " + if hypervisor == "mshv" { "mshv2" } else if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
133+
{{ if os() == "linux" { "just run-rust-examples-linux " + config + " " + if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
134134

135135
@# Run Rust Gdb tests
136-
just test-rust-gdb-debugging {{ config }} {{ if hypervisor == "mshv" { "mshv2" } else if hypervisor == "mshv3" { "mshv3" } else { "kvm" } }}
136+
just test-rust-gdb-debugging {{ config }} {{ if hypervisor == "mshv3" { "mshv3" } else { "kvm" } }}
137137

138138
@# Run Rust Crashdump tests
139-
just test-rust-crashdump {{config}} {{ if hypervisor == "mshv" { "mshv2" } else if hypervisor == "mshv3" { "mshv3" } else { "kvm" } }}
139+
just test-rust-crashdump {{config}} {{ if hypervisor == "mshv3" { "mshv3" } else { "kvm" } }}
140140

141141
@# Run Rust Tracing tests - linux
142-
{{ if os() == "linux" { "just test-rust-tracing " + config + " " + if hypervisor == "mshv" { "mshv2" } else if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
142+
{{ if os() == "linux" { "just test-rust-tracing " + config + " " + if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
143143

144144
@# Run benchmarks
145-
{{ if config == "release" { "just bench-ci main " + if hypervisor == "mshv" { "mshv2" } else if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
145+
{{ if config == "release" { "just bench-ci main " + if hypervisor == "mshv3" { "mshv3" } else { "kvm" } } else { "" } }}
146146

147147
# runs all tests
148148
test target=default-target features="": (test-unit target features) (test-isolated target features) (test-integration "rust" target features) (test-integration "c" target features) (test-doc target features)
@@ -178,7 +178,6 @@ test-compilation-no-default-features target=default-target:
178178
{{ if os() == "windows" { cargo-cmd + " check -p hyperlight-host --no-default-features" } else { "" } }}
179179
@# Linux should succeed with a hypervisor driver but without init-paging
180180
{{ if os() == "linux" { cargo-cmd + " check -p hyperlight-host --no-default-features --features kvm" } else { "" } }} {{ target-triple-flag }}
181-
{{ if os() == "linux" { cargo-cmd + " check -p hyperlight-host --no-default-features --features mshv2" } else { "" } }} {{ target-triple-flag }}
182181
{{ if os() == "linux" { cargo-cmd + " check -p hyperlight-host --no-default-features --features mshv3" } else { "" } }} {{ target-triple-flag }}
183182

184183
# runs tests that exercise gdb debugging

src/hyperlight_host/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ lazy_static = "1.4.0"
7777
[target.'cfg(unix)'.dependencies]
7878
kvm-bindings = { version = "0.14", features = ["fam-wrappers"], optional = true }
7979
kvm-ioctls = { version = "0.24", optional = true }
80-
mshv-bindings2 = { package="mshv-bindings", version = "=0.2.1", optional = true }
81-
mshv-ioctls2 = { package="mshv-ioctls", version = "=0.2.1", optional = true}
8280
mshv-bindings3 = { package="mshv-bindings", version = "0.6.1", optional = true }
8381
mshv-ioctls3 = { package="mshv-ioctls", version = "0.6.1", optional = true}
8482

@@ -135,8 +133,6 @@ crashdump = ["dep:chrono"]
135133
trace_guest = ["dep:opentelemetry", "dep:tracing-opentelemetry", "dep:hyperlight-guest-tracing", "hyperlight-common/trace_guest"]
136134
mem_profile = [ "trace_guest", "dep:framehop", "dep:fallible-iterator", "hyperlight-common/mem_profile" ]
137135
kvm = ["dep:kvm-bindings", "dep:kvm-ioctls"]
138-
# This feature is deprecated in favor of mshv3
139-
mshv2 = ["dep:mshv-bindings2", "dep:mshv-ioctls2"]
140136
mshv3 = ["dep:mshv-bindings3", "dep:mshv-ioctls3"]
141137
# This enables easy debug in the guest
142138
gdb = ["dep:gdbstub", "dep:gdbstub_arch"]

src/hyperlight_host/build.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,17 @@ fn main() -> Result<()> {
8686
}
8787

8888
// Makes #[cfg(kvm)] == #[cfg(all(feature = "kvm", target_os = "linux"))]
89-
// and #[cfg(mshv)] == #[cfg(all(any(feature = "mshv2", feature = "mshv3"), target_os = "linux"))].
89+
// and #[cfg(mshv)] == #[cfg(all(feature = "mshv3", target_os = "linux"))].
9090
// Essentially the kvm and mshv features are ignored on windows as long as you use #[cfg(kvm)] and not #[cfg(feature = "kvm")].
9191
// You should never use #[cfg(feature = "kvm")] or #[cfg(feature = "mshv")] in the codebase.
9292
cfg_aliases::cfg_aliases! {
9393
gdb: { all(feature = "gdb", debug_assertions) },
9494
kvm: { all(feature = "kvm", target_os = "linux") },
95-
mshv: { all(any(feature = "mshv2", feature = "mshv3"), target_os = "linux") },
95+
mshv: { all(feature = "mshv3", target_os = "linux") },
9696
crashdump: { all(feature = "crashdump") },
9797
// print_debug feature is aliased with debug_assertions to make it only available in debug-builds.
9898
print_debug: { all(feature = "print_debug", debug_assertions) },
99-
// the following features are mutually exclusive but rather than enforcing that here we are enabling mshv2 to override mshv3 when both are enabled
100-
// because mshv3 is in the default feature set we want to allow users to enable mshv2 without having to set --no-default-features and the re-enable
101-
// the other features they want.
102-
mshv2: { all(feature = "mshv2", target_os = "linux") },
103-
mshv3: { all(feature = "mshv3", not(feature="mshv2"), target_os = "linux") },
99+
mshv3: { all(feature = "mshv3", target_os = "linux") },
104100
}
105101

106102
#[cfg(feature = "build-metadata")]

src/hyperlight_host/examples/guest-debugging/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ mod tests {
136136

137137
write_cmds_file(&cmd_file_path, cmd).expect("Failed to write gdb commands to file");
138138

139-
#[cfg(mshv2)] // mshv3 is a default feature is mutually exclusive with the mshv2 feature
140-
let features = "gdb,mshv2";
141-
#[cfg(not(mshv2))]
142139
let features = "gdb";
143140

144141
// build it before running to avoid a race condition below

src/hyperlight_host/src/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
#[cfg(mshv2)]
18-
extern crate mshv_ioctls2 as mshv_ioctls;
19-
2017
#[cfg(mshv3)]
2118
extern crate mshv_ioctls3 as mshv_ioctls;
2219

0 commit comments

Comments
 (0)