Return 'GenuineIntel' as vendor string
This commit is contained in:
parent
ced3f6a4a8
commit
9ee21a0309
@ -12,6 +12,10 @@ const _ECX_EPB_SHIFT: u32 = 3; // "Energy Performance Bias" bit.
|
|||||||
const _ECX_HYPERVISOR_SHIFT: u32 = 31; // Flag to be set when the cpu is running on a hypervisor.
|
const _ECX_HYPERVISOR_SHIFT: u32 = 31; // Flag to be set when the cpu is running on a hypervisor.
|
||||||
const _EDX_HTT_SHIFT: u32 = 28; // Hyper Threading Enabled.
|
const _EDX_HTT_SHIFT: u32 = 28; // Hyper Threading Enabled.
|
||||||
|
|
||||||
|
const INTEL_EBX: u32 = u32::from_le_bytes([b'G', b'e', b'n', b'u']);
|
||||||
|
const INTEL_EDX: u32 = u32::from_le_bytes([b'i', b'n', b'e', b'I']);
|
||||||
|
const INTEL_ECX: u32 = u32::from_le_bytes([b'n', b't', b'e', b'l']);
|
||||||
|
|
||||||
pub fn setup_cpuid(vcpu: &KvmVcpu) -> Result<()> {
|
pub fn setup_cpuid(vcpu: &KvmVcpu) -> Result<()> {
|
||||||
let mut cpuid = kvm_get_supported_cpuid(vcpu.sys_raw_fd())?;
|
let mut cpuid = kvm_get_supported_cpuid(vcpu.sys_raw_fd())?;
|
||||||
let cpu_id = 0u32; // first vcpu
|
let cpu_id = 0u32; // first vcpu
|
||||||
@ -19,9 +23,9 @@ pub fn setup_cpuid(vcpu: &KvmVcpu) -> Result<()> {
|
|||||||
for e in &mut cpuid {
|
for e in &mut cpuid {
|
||||||
match e.function {
|
match e.function {
|
||||||
0 => {
|
0 => {
|
||||||
e.ebx = 0x67627553;
|
e.ebx = INTEL_EBX;
|
||||||
e.ecx = 0x20487020;
|
e.ecx = INTEL_ECX;
|
||||||
e.edx = 0x68706172;
|
e.edx = INTEL_EDX;
|
||||||
}
|
}
|
||||||
1 => {
|
1 => {
|
||||||
if e.index == 0 {
|
if e.index == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user