Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Fix cpuid maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
memN0ps committed Feb 26, 2024
1 parent 3558ac5 commit 3d3f931
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hypervisor/src/intel/vmexit/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ pub fn handle_init_signal(guest_registers: &mut GuestRegisters) -> ExitType {
// Execute CPUID instruction on the host and retrieve the result
//
let leaf = CpuidLeaf::FeatureInformation;
let cpuid_result = cpuid!(leaf);
let extended_model_id = (cpuid_result.edx >> 16) & 0xF;
let sub_leaf = guest_registers.rcx;
let cpuid_result = cpuid!(leaf, sub_leaf);
let extended_model_id = cpuid_result.ecx;
guest_registers.rdx = 0x600 | ((extended_model_id as u64) << 16);
guest_registers.rax = 0x0;
guest_registers.rbx = 0x0;
Expand Down

0 comments on commit 3d3f931

Please sign in to comment.