2 * Kernel-based Virtual Machine driver for Linux
3 * cpuid support routines
5 * derived from arch/x86/kvm/x86.c
7 * Copyright 2011 Red Hat, Inc. and/or its affiliates.
8 * Copyright IBM Corporation, 2008
10 * This work is licensed under the terms of the GNU GPL, version 2. See
11 * the COPYING file in the top-level directory.
15 #include <linux/kvm_host.h>
16 #include <linux/module.h>
17 #include <linux/vmalloc.h>
18 #include <linux/uaccess.h>
20 #include <asm/xsave.h>
26 int kvm_update_cpuid(struct kvm_vcpu
*vcpu
)
28 struct kvm_cpuid_entry2
*best
;
29 struct kvm_lapic
*apic
= vcpu
->arch
.apic
;
31 best
= kvm_find_cpuid_entry(vcpu
, 1, 0);
35 /* Update OSXSAVE bit */
36 if (cpu_has_xsave
&& best
->function
== 0x1) {
37 best
->ecx
&= ~(bit(X86_FEATURE_OSXSAVE
));
38 if (kvm_read_cr4_bits(vcpu
, X86_CR4_OSXSAVE
))
39 best
->ecx
|= bit(X86_FEATURE_OSXSAVE
);
43 if (best
->ecx
& bit(X86_FEATURE_TSC_DEADLINE_TIMER
))
44 apic
->lapic_timer
.timer_mode_mask
= 3 << 17;
46 apic
->lapic_timer
.timer_mode_mask
= 1 << 17;
49 /* The existing code assumes virtual address is 48-bit in the canonical
50 * address checks; exit if it is ever changed */
51 best
= kvm_find_cpuid_entry(vcpu
, 0x80000008, 0);
52 if (best
&& ((best
->eax
& 0xff00) >> 8) != 48 &&
53 ((best
->eax
& 0xff00) >> 8) != 0)
56 kvm_pmu_cpuid_update(vcpu
);
60 static int is_efer_nx(void)
62 unsigned long long efer
= 0;
64 rdmsrl_safe(MSR_EFER
, &efer
);
65 return efer
& EFER_NX
;
68 static void cpuid_fix_nx_cap(struct kvm_vcpu
*vcpu
)
71 struct kvm_cpuid_entry2
*e
, *entry
;
74 for (i
= 0; i
< vcpu
->arch
.cpuid_nent
; ++i
) {
75 e
= &vcpu
->arch
.cpuid_entries
[i
];
76 if (e
->function
== 0x80000001) {
81 if (entry
&& (entry
->edx
& (1 << 20)) && !is_efer_nx()) {
82 entry
->edx
&= ~(1 << 20);
83 printk(KERN_INFO
"kvm: guest NX capability removed\n");
87 /* when an old userspace process fills a new kernel module */
88 int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu
*vcpu
,
89 struct kvm_cpuid
*cpuid
,
90 struct kvm_cpuid_entry __user
*entries
)
93 struct kvm_cpuid_entry
*cpuid_entries
;
96 if (cpuid
->nent
> KVM_MAX_CPUID_ENTRIES
)
99 cpuid_entries
= vmalloc(sizeof(struct kvm_cpuid_entry
) * cpuid
->nent
);
103 if (copy_from_user(cpuid_entries
, entries
,
104 cpuid
->nent
* sizeof(struct kvm_cpuid_entry
)))
106 for (i
= 0; i
< cpuid
->nent
; i
++) {
107 vcpu
->arch
.cpuid_entries
[i
].function
= cpuid_entries
[i
].function
;
108 vcpu
->arch
.cpuid_entries
[i
].eax
= cpuid_entries
[i
].eax
;
109 vcpu
->arch
.cpuid_entries
[i
].ebx
= cpuid_entries
[i
].ebx
;
110 vcpu
->arch
.cpuid_entries
[i
].ecx
= cpuid_entries
[i
].ecx
;
111 vcpu
->arch
.cpuid_entries
[i
].edx
= cpuid_entries
[i
].edx
;
112 vcpu
->arch
.cpuid_entries
[i
].index
= 0;
113 vcpu
->arch
.cpuid_entries
[i
].flags
= 0;
114 vcpu
->arch
.cpuid_entries
[i
].padding
[0] = 0;
115 vcpu
->arch
.cpuid_entries
[i
].padding
[1] = 0;
116 vcpu
->arch
.cpuid_entries
[i
].padding
[2] = 0;
118 vcpu
->arch
.cpuid_nent
= cpuid
->nent
;
119 cpuid_fix_nx_cap(vcpu
);
120 kvm_apic_set_version(vcpu
);
121 kvm_x86_ops
->cpuid_update(vcpu
);
122 r
= kvm_update_cpuid(vcpu
);
125 vfree(cpuid_entries
);
130 int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu
*vcpu
,
131 struct kvm_cpuid2
*cpuid
,
132 struct kvm_cpuid_entry2 __user
*entries
)
137 if (cpuid
->nent
> KVM_MAX_CPUID_ENTRIES
)
140 if (copy_from_user(&vcpu
->arch
.cpuid_entries
, entries
,
141 cpuid
->nent
* sizeof(struct kvm_cpuid_entry2
)))
143 vcpu
->arch
.cpuid_nent
= cpuid
->nent
;
144 kvm_apic_set_version(vcpu
);
145 kvm_x86_ops
->cpuid_update(vcpu
);
146 r
= kvm_update_cpuid(vcpu
);
151 int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu
*vcpu
,
152 struct kvm_cpuid2
*cpuid
,
153 struct kvm_cpuid_entry2 __user
*entries
)
158 if (cpuid
->nent
< vcpu
->arch
.cpuid_nent
)
161 if (copy_to_user(entries
, &vcpu
->arch
.cpuid_entries
,
162 vcpu
->arch
.cpuid_nent
* sizeof(struct kvm_cpuid_entry2
)))
167 cpuid
->nent
= vcpu
->arch
.cpuid_nent
;
171 static void cpuid_mask(u32
*word
, int wordnum
)
173 *word
&= boot_cpu_data
.x86_capability
[wordnum
];
176 static void do_cpuid_1_ent(struct kvm_cpuid_entry2
*entry
, u32 function
,
179 entry
->function
= function
;
180 entry
->index
= index
;
181 cpuid_count(entry
->function
, entry
->index
,
182 &entry
->eax
, &entry
->ebx
, &entry
->ecx
, &entry
->edx
);
186 static bool supported_xcr0_bit(unsigned bit
)
188 u64 mask
= ((u64
)1 << bit
);
190 return mask
& (XSTATE_FP
| XSTATE_SSE
| XSTATE_YMM
) & host_xcr0
;
193 #define F(x) bit(X86_FEATURE_##x)
195 static int do_cpuid_ent(struct kvm_cpuid_entry2
*entry
, u32 function
,
196 u32 index
, int *nent
, int maxnent
)
199 unsigned f_nx
= is_efer_nx() ? F(NX
) : 0;
201 unsigned f_gbpages
= (kvm_x86_ops
->get_lpage_level() == PT_PDPE_LEVEL
)
203 unsigned f_lm
= F(LM
);
205 unsigned f_gbpages
= 0;
208 unsigned f_rdtscp
= kvm_x86_ops
->rdtscp_supported() ? F(RDTSCP
) : 0;
209 unsigned f_invpcid
= kvm_x86_ops
->invpcid_supported() ? F(INVPCID
) : 0;
212 const u32 kvm_supported_word0_x86_features
=
213 F(FPU
) | F(VME
) | F(DE
) | F(PSE
) |
214 F(TSC
) | F(MSR
) | F(PAE
) | F(MCE
) |
215 F(CX8
) | F(APIC
) | 0 /* Reserved */ | F(SEP
) |
216 F(MTRR
) | F(PGE
) | F(MCA
) | F(CMOV
) |
217 F(PAT
) | F(PSE36
) | 0 /* PSN */ | F(CLFLSH
) |
218 0 /* Reserved, DS, ACPI */ | F(MMX
) |
219 F(FXSR
) | F(XMM
) | F(XMM2
) | F(SELFSNOOP
) |
220 0 /* HTT, TM, Reserved, PBE */;
221 /* cpuid 0x80000001.edx */
222 const u32 kvm_supported_word1_x86_features
=
223 F(FPU
) | F(VME
) | F(DE
) | F(PSE
) |
224 F(TSC
) | F(MSR
) | F(PAE
) | F(MCE
) |
225 F(CX8
) | F(APIC
) | 0 /* Reserved */ | F(SYSCALL
) |
226 F(MTRR
) | F(PGE
) | F(MCA
) | F(CMOV
) |
227 F(PAT
) | F(PSE36
) | 0 /* Reserved */ |
228 f_nx
| 0 /* Reserved */ | F(MMXEXT
) | F(MMX
) |
229 F(FXSR
) | F(FXSR_OPT
) | f_gbpages
| f_rdtscp
|
230 0 /* Reserved */ | f_lm
| F(3DNOWEXT
) | F(3DNOW
);
232 const u32 kvm_supported_word4_x86_features
=
233 F(XMM3
) | F(PCLMULQDQ
) | 0 /* DTES64, MONITOR */ |
234 0 /* DS-CPL, VMX, SMX, EST */ |
235 0 /* TM2 */ | F(SSSE3
) | 0 /* CNXT-ID */ | 0 /* Reserved */ |
236 F(FMA
) | F(CX16
) | 0 /* xTPR Update, PDCM */ |
237 F(PCID
) | 0 /* Reserved, DCA */ | F(XMM4_1
) |
238 F(XMM4_2
) | F(X2APIC
) | F(MOVBE
) | F(POPCNT
) |
239 0 /* Reserved*/ | F(AES
) | F(XSAVE
) | 0 /* OSXSAVE */ | F(AVX
) |
241 /* cpuid 0x80000001.ecx */
242 const u32 kvm_supported_word6_x86_features
=
243 F(LAHF_LM
) | F(CMP_LEGACY
) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
244 F(CR8_LEGACY
) | F(ABM
) | F(SSE4A
) | F(MISALIGNSSE
) |
245 F(3DNOWPREFETCH
) | F(OSVW
) | 0 /* IBS */ | F(XOP
) |
246 0 /* SKINIT, WDT, LWP */ | F(FMA4
) | F(TBM
);
248 /* cpuid 0xC0000001.edx */
249 const u32 kvm_supported_word5_x86_features
=
250 F(XSTORE
) | F(XSTORE_EN
) | F(XCRYPT
) | F(XCRYPT_EN
) |
251 F(ACE2
) | F(ACE2_EN
) | F(PHE
) | F(PHE_EN
) |
255 const u32 kvm_supported_word9_x86_features
=
256 F(FSGSBASE
) | F(BMI1
) | F(HLE
) | F(AVX2
) | F(SMEP
) |
257 F(BMI2
) | F(ERMS
) | f_invpcid
| F(RTM
);
259 /* all calls to cpuid_count() should be made on the same cpu */
264 if (*nent
>= maxnent
)
267 do_cpuid_1_ent(entry
, function
, index
);
272 entry
->eax
= min(entry
->eax
, (u32
)0xd);
275 entry
->edx
&= kvm_supported_word0_x86_features
;
276 cpuid_mask(&entry
->edx
, 0);
277 entry
->ecx
&= kvm_supported_word4_x86_features
;
278 cpuid_mask(&entry
->ecx
, 4);
279 /* we support x2apic emulation even if host does not support
280 * it since we emulate x2apic in software */
281 entry
->ecx
|= F(X2APIC
);
283 /* function 2 entries are STATEFUL. That is, repeated cpuid commands
284 * may return different values. This forces us to get_cpu() before
285 * issuing the first command, and also to emulate this annoying behavior
286 * in kvm_emulate_cpuid() using KVM_CPUID_FLAG_STATE_READ_NEXT */
288 int t
, times
= entry
->eax
& 0xff;
290 entry
->flags
|= KVM_CPUID_FLAG_STATEFUL_FUNC
;
291 entry
->flags
|= KVM_CPUID_FLAG_STATE_READ_NEXT
;
292 for (t
= 1; t
< times
; ++t
) {
293 if (*nent
>= maxnent
)
296 do_cpuid_1_ent(&entry
[t
], function
, 0);
297 entry
[t
].flags
|= KVM_CPUID_FLAG_STATEFUL_FUNC
;
302 /* function 4 has additional index. */
306 entry
->flags
|= KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
307 /* read more entries until cache_type is zero */
309 if (*nent
>= maxnent
)
312 cache_type
= entry
[i
- 1].eax
& 0x1f;
315 do_cpuid_1_ent(&entry
[i
], function
, i
);
317 KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
323 entry
->flags
|= KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
324 /* Mask ebx against host capability word 9 */
326 entry
->ebx
&= kvm_supported_word9_x86_features
;
327 cpuid_mask(&entry
->ebx
, 9);
328 // TSC_ADJUST is emulated
329 entry
->ebx
|= F(TSC_ADJUST
);
339 case 0xa: { /* Architectural Performance Monitoring */
340 struct x86_pmu_capability cap
;
341 union cpuid10_eax eax
;
342 union cpuid10_edx edx
;
344 perf_get_x86_pmu_capability(&cap
);
347 * Only support guest architectural pmu on a host
348 * with architectural pmu.
351 memset(&cap
, 0, sizeof(cap
));
353 eax
.split
.version_id
= min(cap
.version
, 2);
354 eax
.split
.num_counters
= cap
.num_counters_gp
;
355 eax
.split
.bit_width
= cap
.bit_width_gp
;
356 eax
.split
.mask_length
= cap
.events_mask_len
;
358 edx
.split
.num_counters_fixed
= cap
.num_counters_fixed
;
359 edx
.split
.bit_width_fixed
= cap
.bit_width_fixed
;
360 edx
.split
.reserved
= 0;
362 entry
->eax
= eax
.full
;
363 entry
->ebx
= cap
.events_mask
;
365 entry
->edx
= edx
.full
;
368 /* function 0xb has additional index. */
372 entry
->flags
|= KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
373 /* read more entries until level_type is zero */
375 if (*nent
>= maxnent
)
378 level_type
= entry
[i
- 1].ecx
& 0xff00;
381 do_cpuid_1_ent(&entry
[i
], function
, i
);
383 KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
391 entry
->flags
|= KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
392 for (idx
= 1, i
= 1; idx
< 64; ++idx
) {
393 if (*nent
>= maxnent
)
396 do_cpuid_1_ent(&entry
[i
], function
, idx
);
397 if (entry
[i
].eax
== 0 || !supported_xcr0_bit(idx
))
400 KVM_CPUID_FLAG_SIGNIFCANT_INDEX
;
406 case KVM_CPUID_SIGNATURE
: {
407 static const char signature
[12] = "KVMKVMKVM\0\0";
408 const u32
*sigptr
= (const u32
*)signature
;
409 entry
->eax
= KVM_CPUID_FEATURES
;
410 entry
->ebx
= sigptr
[0];
411 entry
->ecx
= sigptr
[1];
412 entry
->edx
= sigptr
[2];
415 case KVM_CPUID_FEATURES
:
416 entry
->eax
= (1 << KVM_FEATURE_CLOCKSOURCE
) |
417 (1 << KVM_FEATURE_NOP_IO_DELAY
) |
418 (1 << KVM_FEATURE_CLOCKSOURCE2
) |
419 (1 << KVM_FEATURE_ASYNC_PF
) |
420 (1 << KVM_FEATURE_PV_EOI
) |
421 (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT
) |
422 (1 << KVM_FEATURE_PV_UNHALT
);
425 entry
->eax
|= (1 << KVM_FEATURE_STEAL_TIME
);
432 entry
->eax
= min(entry
->eax
, 0x8000001a);
435 entry
->edx
&= kvm_supported_word1_x86_features
;
436 cpuid_mask(&entry
->edx
, 1);
437 entry
->ecx
&= kvm_supported_word6_x86_features
;
438 cpuid_mask(&entry
->ecx
, 6);
440 case 0x80000007: /* Advanced power management */
441 /* invariant TSC is CPUID.80000007H:EDX[8] */
442 entry
->edx
&= (1 << 8);
443 /* mask against host */
444 entry
->edx
&= boot_cpu_data
.x86_power
;
445 entry
->eax
= entry
->ebx
= entry
->ecx
= 0;
448 unsigned g_phys_as
= (entry
->eax
>> 16) & 0xff;
449 unsigned virt_as
= max((entry
->eax
>> 8) & 0xff, 48U);
450 unsigned phys_as
= entry
->eax
& 0xff;
454 entry
->eax
= g_phys_as
| (virt_as
<< 8);
455 entry
->ebx
= entry
->edx
= 0;
459 entry
->ecx
= entry
->edx
= 0;
465 /*Add support for Centaur's CPUID instruction*/
467 /*Just support up to 0xC0000004 now*/
468 entry
->eax
= min(entry
->eax
, 0xC0000004);
471 entry
->edx
&= kvm_supported_word5_x86_features
;
472 cpuid_mask(&entry
->edx
, 5);
474 case 3: /* Processor serial number */
475 case 5: /* MONITOR/MWAIT */
476 case 6: /* Thermal management */
481 entry
->eax
= entry
->ebx
= entry
->ecx
= entry
->edx
= 0;
485 kvm_x86_ops
->set_supported_cpuid(function
, entry
);
497 struct kvm_cpuid_param
{
501 bool (*qualifier
)(const struct kvm_cpuid_param
*param
);
504 static bool is_centaur_cpu(const struct kvm_cpuid_param
*param
)
506 return boot_cpu_data
.x86_vendor
== X86_VENDOR_CENTAUR
;
509 int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2
*cpuid
,
510 struct kvm_cpuid_entry2 __user
*entries
)
512 struct kvm_cpuid_entry2
*cpuid_entries
;
513 int limit
, nent
= 0, r
= -E2BIG
, i
;
515 static const struct kvm_cpuid_param param
[] = {
516 { .func
= 0, .has_leaf_count
= true },
517 { .func
= 0x80000000, .has_leaf_count
= true },
518 { .func
= 0xC0000000, .qualifier
= is_centaur_cpu
, .has_leaf_count
= true },
519 { .func
= KVM_CPUID_SIGNATURE
},
520 { .func
= KVM_CPUID_FEATURES
},
525 if (cpuid
->nent
> KVM_MAX_CPUID_ENTRIES
)
526 cpuid
->nent
= KVM_MAX_CPUID_ENTRIES
;
528 cpuid_entries
= vmalloc(sizeof(struct kvm_cpuid_entry2
) * cpuid
->nent
);
533 for (i
= 0; i
< ARRAY_SIZE(param
); i
++) {
534 const struct kvm_cpuid_param
*ent
= ¶m
[i
];
536 if (ent
->qualifier
&& !ent
->qualifier(ent
))
539 r
= do_cpuid_ent(&cpuid_entries
[nent
], ent
->func
, ent
->idx
,
545 if (!ent
->has_leaf_count
)
548 limit
= cpuid_entries
[nent
- 1].eax
;
549 for (func
= ent
->func
+ 1; func
<= limit
&& nent
< cpuid
->nent
&& r
== 0; ++func
)
550 r
= do_cpuid_ent(&cpuid_entries
[nent
], func
, ent
->idx
,
558 if (copy_to_user(entries
, cpuid_entries
,
559 nent
* sizeof(struct kvm_cpuid_entry2
)))
565 vfree(cpuid_entries
);
570 static int move_to_next_stateful_cpuid_entry(struct kvm_vcpu
*vcpu
, int i
)
572 struct kvm_cpuid_entry2
*e
= &vcpu
->arch
.cpuid_entries
[i
];
573 int j
, nent
= vcpu
->arch
.cpuid_nent
;
575 e
->flags
&= ~KVM_CPUID_FLAG_STATE_READ_NEXT
;
576 /* when no next entry is found, the current entry[i] is reselected */
577 for (j
= i
+ 1; ; j
= (j
+ 1) % nent
) {
578 struct kvm_cpuid_entry2
*ej
= &vcpu
->arch
.cpuid_entries
[j
];
579 if (ej
->function
== e
->function
) {
580 ej
->flags
|= KVM_CPUID_FLAG_STATE_READ_NEXT
;
584 return 0; /* silence gcc, even though control never reaches here */
587 /* find an entry with matching function, matching index (if needed), and that
588 * should be read next (if it's stateful) */
589 static int is_matching_cpuid_entry(struct kvm_cpuid_entry2
*e
,
590 u32 function
, u32 index
)
592 if (e
->function
!= function
)
594 if ((e
->flags
& KVM_CPUID_FLAG_SIGNIFCANT_INDEX
) && e
->index
!= index
)
596 if ((e
->flags
& KVM_CPUID_FLAG_STATEFUL_FUNC
) &&
597 !(e
->flags
& KVM_CPUID_FLAG_STATE_READ_NEXT
))
602 struct kvm_cpuid_entry2
*kvm_find_cpuid_entry(struct kvm_vcpu
*vcpu
,
603 u32 function
, u32 index
)
606 struct kvm_cpuid_entry2
*best
= NULL
;
608 for (i
= 0; i
< vcpu
->arch
.cpuid_nent
; ++i
) {
609 struct kvm_cpuid_entry2
*e
;
611 e
= &vcpu
->arch
.cpuid_entries
[i
];
612 if (is_matching_cpuid_entry(e
, function
, index
)) {
613 if (e
->flags
& KVM_CPUID_FLAG_STATEFUL_FUNC
)
614 move_to_next_stateful_cpuid_entry(vcpu
, i
);
621 EXPORT_SYMBOL_GPL(kvm_find_cpuid_entry
);
623 int cpuid_maxphyaddr(struct kvm_vcpu
*vcpu
)
625 struct kvm_cpuid_entry2
*best
;
627 best
= kvm_find_cpuid_entry(vcpu
, 0x80000000, 0);
628 if (!best
|| best
->eax
< 0x80000008)
630 best
= kvm_find_cpuid_entry(vcpu
, 0x80000008, 0);
632 return best
->eax
& 0xff;
638 * If no match is found, check whether we exceed the vCPU's limit
639 * and return the content of the highest valid _standard_ leaf instead.
640 * This is to satisfy the CPUID specification.
642 static struct kvm_cpuid_entry2
* check_cpuid_limit(struct kvm_vcpu
*vcpu
,
643 u32 function
, u32 index
)
645 struct kvm_cpuid_entry2
*maxlevel
;
647 maxlevel
= kvm_find_cpuid_entry(vcpu
, function
& 0x80000000, 0);
648 if (!maxlevel
|| maxlevel
->eax
>= function
)
650 if (function
& 0x80000000) {
651 maxlevel
= kvm_find_cpuid_entry(vcpu
, 0, 0);
655 return kvm_find_cpuid_entry(vcpu
, maxlevel
->eax
, index
);
658 void kvm_cpuid(struct kvm_vcpu
*vcpu
, u32
*eax
, u32
*ebx
, u32
*ecx
, u32
*edx
)
660 u32 function
= *eax
, index
= *ecx
;
661 struct kvm_cpuid_entry2
*best
;
663 best
= kvm_find_cpuid_entry(vcpu
, function
, index
);
666 best
= check_cpuid_limit(vcpu
, function
, index
);
674 *eax
= *ebx
= *ecx
= *edx
= 0;
676 EXPORT_SYMBOL_GPL(kvm_cpuid
);
678 void kvm_emulate_cpuid(struct kvm_vcpu
*vcpu
)
680 u32 function
, eax
, ebx
, ecx
, edx
;
682 function
= eax
= kvm_register_read(vcpu
, VCPU_REGS_RAX
);
683 ecx
= kvm_register_read(vcpu
, VCPU_REGS_RCX
);
684 kvm_cpuid(vcpu
, &eax
, &ebx
, &ecx
, &edx
);
685 kvm_register_write(vcpu
, VCPU_REGS_RAX
, eax
);
686 kvm_register_write(vcpu
, VCPU_REGS_RBX
, ebx
);
687 kvm_register_write(vcpu
, VCPU_REGS_RCX
, ecx
);
688 kvm_register_write(vcpu
, VCPU_REGS_RDX
, edx
);
689 kvm_x86_ops
->skip_emulated_instruction(vcpu
);
690 trace_kvm_cpuid(function
, eax
, ebx
, ecx
, edx
);
692 EXPORT_SYMBOL_GPL(kvm_emulate_cpuid
);