Skip to content

Commit 350b8e0

Browse files
committed
Some fixes
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent fa91c42 commit 350b8e0

File tree

6 files changed

+4
-31
lines changed

6 files changed

+4
-31
lines changed

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(mshv3)]
18-
extern crate mshv_ioctls;
19-
2017
use std::array::TryFromSliceError;
2118
use std::cell::{BorrowError, BorrowMutError};
2219
use std::convert::Infallible;

src/hyperlight_host/src/hypervisor/hyperv_linux.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@ use mshv_bindings::DebugRegisters;
2424
use mshv_bindings::hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT;
2525
use mshv_bindings::{
2626
hv_message_type, hv_message_type_HVMSG_GPA_INTERCEPT, hv_message_type_HVMSG_UNMAPPED_GPA,
27-
hv_message_type_HVMSG_X64_HALT, hv_message_type_HVMSG_X64_IO_PORT_INTERCEPT, hv_register_assoc,
28-
hv_register_name_HV_X64_REGISTER_RIP, hv_register_value, mshv_user_mem_region,
29-
};
30-
#[cfg(mshv3)]
31-
use mshv_bindings::{
27+
hv_message_type_HVMSG_X64_HALT, hv_message_type_HVMSG_X64_IO_PORT_INTERCEPT,
3228
hv_partition_property_code_HV_PARTITION_PROPERTY_SYNTHETIC_PROC_FEATURES,
33-
hv_partition_synthetic_processor_features,
29+
hv_partition_synthetic_processor_features, hv_register_assoc,
30+
hv_register_name_HV_X64_REGISTER_RIP, hv_register_value, mshv_user_mem_region,
3431
};
3532
use mshv_ioctls::{Mshv, VcpuFd, VmFd};
3633
use tracing::{Span, instrument};
@@ -71,7 +68,6 @@ impl MshvVm {
7168
.as_ref()
7269
.map_err(|e| new_error!("Failed to create MSHV instance: {}", e))?;
7370
let pr = Default::default();
74-
#[cfg(mshv3)]
7571
let vm_fd = {
7672
// It's important to avoid create_vm() and explicitly use
7773
// create_vm_with_args() with an empty arguments structure

src/hyperlight_host/src/hypervisor/regs/fpu.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
#[cfg(mshv3)]
17-
extern crate mshv_bindings;
18-
#[cfg(mshv3)]
19-
extern crate mshv_ioctls;
2016

2117
#[cfg(target_os = "windows")]
2218
use std::collections::HashSet;

src/hyperlight_host/src/hypervisor/regs/special_regs.rs

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

17-
#[cfg(mshv3)]
18-
extern crate mshv_bindings;
19-
#[cfg(mshv3)]
20-
extern crate mshv_ioctls;
21-
2217
#[cfg(target_os = "windows")]
2318
use std::collections::HashSet;
2419

src/hyperlight_host/src/hypervisor/regs/standard_regs.rs

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

17-
#[cfg(mshv3)]
18-
extern crate mshv_bindings;
19-
#[cfg(mshv3)]
20-
extern crate mshv_ioctls;
21-
2217
#[cfg(kvm)]
2318
use kvm_bindings::kvm_regs;
2419
#[cfg(mshv3)]

src/hyperlight_host/src/mem/memory_region.rs

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

17-
#[cfg(mshv3)]
18-
extern crate mshv_bindings;
19-
#[cfg(mshv3)]
20-
extern crate mshv_ioctls;
21-
2217
use std::ops::Range;
2318

2419
use bitflags::bitflags;
@@ -30,9 +25,8 @@ use kvm_bindings::{KVM_MEM_READONLY, kvm_userspace_memory_region};
3025
#[cfg(mshv3)]
3126
use mshv_bindings::{
3227
MSHV_SET_MEM_BIT_EXECUTABLE, MSHV_SET_MEM_BIT_UNMAP, MSHV_SET_MEM_BIT_WRITABLE,
28+
hv_x64_memory_intercept_message, mshv_user_mem_region,
3329
};
34-
#[cfg(mshv3)]
35-
use mshv_bindings::{hv_x64_memory_intercept_message, mshv_user_mem_region};
3630
#[cfg(target_os = "windows")]
3731
use windows::Win32::System::Hypervisor::{self, WHV_MEMORY_ACCESS_TYPE};
3832

0 commit comments

Comments
 (0)