• Home
  • Raw
  • Download

Lines Matching refs:entry

157 	struct kvm_cpuid_entry2 *e, *entry;  in cpuid_fix_nx_cap()  local
159 entry = NULL; in cpuid_fix_nx_cap()
163 entry = e; in cpuid_fix_nx_cap()
167 if (entry && (entry->edx & F(NX)) && !is_efer_nx()) { in cpuid_fix_nx_cap()
168 entry->edx &= ~F(NX); in cpuid_fix_nx_cap()
279 static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function, in do_cpuid_1_ent() argument
282 entry->function = function; in do_cpuid_1_ent()
283 entry->index = index; in do_cpuid_1_ent()
284 cpuid_count(entry->function, entry->index, in do_cpuid_1_ent()
285 &entry->eax, &entry->ebx, &entry->ecx, &entry->edx); in do_cpuid_1_ent()
286 entry->flags = 0; in do_cpuid_1_ent()
289 static int __do_cpuid_ent_emulated(struct kvm_cpuid_entry2 *entry, in __do_cpuid_ent_emulated() argument
294 entry->eax = 7; in __do_cpuid_ent_emulated()
298 entry->ecx = F(MOVBE); in __do_cpuid_ent_emulated()
302 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; in __do_cpuid_ent_emulated()
304 entry->ecx = F(RDPID); in __do_cpuid_ent_emulated()
310 entry->function = func; in __do_cpuid_ent_emulated()
311 entry->index = index; in __do_cpuid_ent_emulated()
316 static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, in __do_cpuid_ent() argument
415 do_cpuid_1_ent(entry, function, index); in __do_cpuid_ent()
420 entry->eax = min(entry->eax, (u32)0xd); in __do_cpuid_ent()
423 entry->edx &= kvm_cpuid_1_edx_x86_features; in __do_cpuid_ent()
424 cpuid_mask(&entry->edx, CPUID_1_EDX); in __do_cpuid_ent()
425 entry->ecx &= kvm_cpuid_1_ecx_x86_features; in __do_cpuid_ent()
426 cpuid_mask(&entry->ecx, CPUID_1_ECX); in __do_cpuid_ent()
429 entry->ecx |= F(X2APIC); in __do_cpuid_ent()
436 int t, times = entry->eax & 0xff; in __do_cpuid_ent()
438 entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; in __do_cpuid_ent()
439 entry->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT; in __do_cpuid_ent()
444 do_cpuid_1_ent(&entry[t], function, 0); in __do_cpuid_ent()
445 entry[t].flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; in __do_cpuid_ent()
454 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; in __do_cpuid_ent()
460 cache_type = entry[i - 1].eax & 0x1f; in __do_cpuid_ent()
463 do_cpuid_1_ent(&entry[i], function, i); in __do_cpuid_ent()
464 entry[i].flags |= in __do_cpuid_ent()
471 entry->eax = 0x4; /* allow ARAT */ in __do_cpuid_ent()
472 entry->ebx = 0; in __do_cpuid_ent()
473 entry->ecx = 0; in __do_cpuid_ent()
474 entry->edx = 0; in __do_cpuid_ent()
477 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; in __do_cpuid_ent()
480 entry->ebx &= kvm_cpuid_7_0_ebx_x86_features; in __do_cpuid_ent()
481 cpuid_mask(&entry->ebx, CPUID_7_0_EBX); in __do_cpuid_ent()
483 entry->ebx |= F(TSC_ADJUST); in __do_cpuid_ent()
484 entry->ecx &= kvm_cpuid_7_0_ecx_x86_features; in __do_cpuid_ent()
485 cpuid_mask(&entry->ecx, CPUID_7_ECX); in __do_cpuid_ent()
488 entry->ecx &= ~F(PKU); in __do_cpuid_ent()
490 entry->edx &= kvm_cpuid_7_0_edx_x86_features; in __do_cpuid_ent()
491 cpuid_mask(&entry->edx, CPUID_7_EDX); in __do_cpuid_ent()
494 entry->edx |= F(SPEC_CTRL); in __do_cpuid_ent()
496 entry->edx |= F(INTEL_STIBP); in __do_cpuid_ent()
498 entry->edx |= F(SPEC_CTRL_SSBD); in __do_cpuid_ent()
503 entry->edx |= F(ARCH_CAPABILITIES); in __do_cpuid_ent()
505 entry->ebx = 0; in __do_cpuid_ent()
506 entry->ecx = 0; in __do_cpuid_ent()
507 entry->edx = 0; in __do_cpuid_ent()
509 entry->eax = 0; in __do_cpuid_ent()
537 entry->eax = eax.full; in __do_cpuid_ent()
538 entry->ebx = cap.events_mask; in __do_cpuid_ent()
539 entry->ecx = 0; in __do_cpuid_ent()
540 entry->edx = edx.full; in __do_cpuid_ent()
547 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; in __do_cpuid_ent()
553 level_type = entry[i - 1].ecx & 0xff00; in __do_cpuid_ent()
556 do_cpuid_1_ent(&entry[i], function, i); in __do_cpuid_ent()
557 entry[i].flags |= in __do_cpuid_ent()
567 entry->eax &= supported; in __do_cpuid_ent()
568 entry->ebx = xstate_required_size(supported, false); in __do_cpuid_ent()
569 entry->ecx = entry->ebx; in __do_cpuid_ent()
570 entry->edx &= supported >> 32; in __do_cpuid_ent()
571 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; in __do_cpuid_ent()
580 do_cpuid_1_ent(&entry[i], function, idx); in __do_cpuid_ent()
582 entry[i].eax &= kvm_cpuid_D_1_eax_x86_features; in __do_cpuid_ent()
583 cpuid_mask(&entry[i].eax, CPUID_D_1_EAX); in __do_cpuid_ent()
584 entry[i].ebx = 0; in __do_cpuid_ent()
585 if (entry[i].eax & (F(XSAVES)|F(XSAVEC))) in __do_cpuid_ent()
586 entry[i].ebx = in __do_cpuid_ent()
590 if (entry[i].eax == 0 || !(supported & mask)) in __do_cpuid_ent()
592 if (WARN_ON_ONCE(entry[i].ecx & 1)) in __do_cpuid_ent()
595 entry[i].ecx = 0; in __do_cpuid_ent()
596 entry[i].edx = 0; in __do_cpuid_ent()
597 entry[i].flags |= in __do_cpuid_ent()
607 entry->eax = KVM_CPUID_FEATURES; in __do_cpuid_ent()
608 entry->ebx = sigptr[0]; in __do_cpuid_ent()
609 entry->ecx = sigptr[1]; in __do_cpuid_ent()
610 entry->edx = sigptr[2]; in __do_cpuid_ent()
614 entry->eax = (1 << KVM_FEATURE_CLOCKSOURCE) | in __do_cpuid_ent()
624 entry->eax |= (1 << KVM_FEATURE_STEAL_TIME); in __do_cpuid_ent()
626 entry->ebx = 0; in __do_cpuid_ent()
627 entry->ecx = 0; in __do_cpuid_ent()
628 entry->edx = 0; in __do_cpuid_ent()
631 entry->eax = min(entry->eax, 0x8000001a); in __do_cpuid_ent()
634 entry->edx &= kvm_cpuid_8000_0001_edx_x86_features; in __do_cpuid_ent()
635 cpuid_mask(&entry->edx, CPUID_8000_0001_EDX); in __do_cpuid_ent()
636 entry->ecx &= kvm_cpuid_8000_0001_ecx_x86_features; in __do_cpuid_ent()
637 cpuid_mask(&entry->ecx, CPUID_8000_0001_ECX); in __do_cpuid_ent()
641 entry->edx &= (1 << 8); in __do_cpuid_ent()
643 entry->edx &= boot_cpu_data.x86_power; in __do_cpuid_ent()
644 entry->eax = entry->ebx = entry->ecx = 0; in __do_cpuid_ent()
647 unsigned g_phys_as = (entry->eax >> 16) & 0xff; in __do_cpuid_ent()
648 unsigned virt_as = max((entry->eax >> 8) & 0xff, 48U); in __do_cpuid_ent()
649 unsigned phys_as = entry->eax & 0xff; in __do_cpuid_ent()
653 entry->eax = g_phys_as | (virt_as << 8); in __do_cpuid_ent()
654 entry->edx = 0; in __do_cpuid_ent()
660 entry->ebx |= F(AMD_IBPB); in __do_cpuid_ent()
662 entry->ebx |= F(AMD_IBRS); in __do_cpuid_ent()
664 entry->ebx |= F(VIRT_SSBD); in __do_cpuid_ent()
665 entry->ebx &= kvm_cpuid_8000_0008_ebx_x86_features; in __do_cpuid_ent()
666 cpuid_mask(&entry->ebx, CPUID_8000_0008_EBX); in __do_cpuid_ent()
673 entry->ebx |= F(VIRT_SSBD); in __do_cpuid_ent()
677 entry->ecx = entry->edx = 0; in __do_cpuid_ent()
686 entry->eax = min(entry->eax, 0xC0000004); in __do_cpuid_ent()
689 entry->edx &= kvm_cpuid_C000_0001_edx_x86_features; in __do_cpuid_ent()
690 cpuid_mask(&entry->edx, CPUID_C000_0001_EDX); in __do_cpuid_ent()
698 entry->eax = entry->ebx = entry->ecx = entry->edx = 0; in __do_cpuid_ent()
702 kvm_x86_ops->set_supported_cpuid(function, entry); in __do_cpuid_ent()
712 static int do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 func, in do_cpuid_ent() argument
719 return __do_cpuid_ent_emulated(entry, func, idx, nent, maxnent); in do_cpuid_ent()
721 return __do_cpuid_ent(entry, func, idx, nent, maxnent); in do_cpuid_ent()