Lines Matching refs:regs
236 unsigned int regs[4]; in cpuid_apply_runtime_reg_state() local
274 cpuid_count(func, index, regs); in cpuid_apply_runtime_reg_state()
284 *ebx = regs[1]; in cpuid_apply_runtime_reg_state()
326 *ebx = regs[1]; in cpuid_apply_runtime_reg_state()
332 *ebx = regs[1]; in cpuid_apply_runtime_reg_state()
370 uint32_t regs[4] = { *rax, 0, *rcx, 0 }; in vcpu_emulate_cpuid() local
376 legacy_emulate_cpuid(vm, vcpuid, ®s[0], ®s[1], ®s[2], in vcpu_emulate_cpuid()
377 ®s[3]); in vcpu_emulate_cpuid()
397 regs[0] = ent->vce_eax; in vcpu_emulate_cpuid()
398 regs[1] = ent->vce_ebx; in vcpu_emulate_cpuid()
399 regs[2] = ent->vce_ecx; in vcpu_emulate_cpuid()
400 regs[3] = ent->vce_edx; in vcpu_emulate_cpuid()
404 cpuid_apply_runtime_reg_state(vm, vcpuid, func, index, ®s[0], in vcpu_emulate_cpuid()
405 ®s[1], ®s[2], ®s[3]); in vcpu_emulate_cpuid()
408 *rax = regs[0]; in vcpu_emulate_cpuid()
409 *rbx = regs[1]; in vcpu_emulate_cpuid()
410 *rcx = regs[2]; in vcpu_emulate_cpuid()
411 *rdx = regs[3]; in vcpu_emulate_cpuid()
554 unsigned int func, regs[4], logical_cpus = 0, param; in legacy_emulate_cpuid() local
596 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
599 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
606 regs[1] &= (AMDFEID_CLZERO | AMDFEID_IRPERF | in legacy_emulate_cpuid()
625 regs[2] = (width << AMDID_COREID_SIZE_SHIFT) | in legacy_emulate_cpuid()
631 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
636 regs[2] &= ~AMDID2_SVM; in legacy_emulate_cpuid()
642 regs[2] &= ~AMDID2_PCXC; in legacy_emulate_cpuid()
643 regs[2] &= ~AMDID2_PNXC; in legacy_emulate_cpuid()
644 regs[2] &= ~AMDID2_PTSCEL2I; in legacy_emulate_cpuid()
649 regs[2] &= ~AMDID2_IBS; in legacy_emulate_cpuid()
652 regs[2] &= ~AMDID2_NODE_ID; in legacy_emulate_cpuid()
655 regs[2] &= ~AMDID2_OSVW; in legacy_emulate_cpuid()
658 regs[2] &= ~AMDID2_MWAITX; in legacy_emulate_cpuid()
668 regs[2] &= ~AMDID2_TCE; in legacy_emulate_cpuid()
669 regs[3] &= ~AMDID_FFXSR; in legacy_emulate_cpuid()
676 regs[3] &= ~AMDID_RDTSCP; in legacy_emulate_cpuid()
680 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
691 regs[0] = 0; in legacy_emulate_cpuid()
692 regs[1] = 0; in legacy_emulate_cpuid()
693 regs[2] = 0; in legacy_emulate_cpuid()
703 regs[3] &= AMDPM_TSC_INVARIANT; in legacy_emulate_cpuid()
712 regs[3] |= AMDPM_TSC_INVARIANT; in legacy_emulate_cpuid()
752 regs[0] = 0; in legacy_emulate_cpuid()
753 regs[1] = 0; in legacy_emulate_cpuid()
756 regs[0] = (logical_cpus << 14) | (1 << 8) | in legacy_emulate_cpuid()
758 regs[1] = func > 0 ? _CACHE_LINE_SIZE - 1 : 0; in legacy_emulate_cpuid()
760 regs[2] = 0; in legacy_emulate_cpuid()
761 regs[3] = 0; in legacy_emulate_cpuid()
774 regs[0] = vcpu_id; in legacy_emulate_cpuid()
776 regs[1] = (threads << 8) | in legacy_emulate_cpuid()
782 regs[2] = 0; in legacy_emulate_cpuid()
783 regs[3] = 0; in legacy_emulate_cpuid()
787 do_cpuid(1, regs); in legacy_emulate_cpuid()
795 regs[1] &= ~(CPUID_LOCAL_APIC_ID); in legacy_emulate_cpuid()
796 regs[1] |= (vcpu_id << CPUID_0000_0001_APICID_SHIFT); in legacy_emulate_cpuid()
802 regs[2] &= ~(CPUID2_VMX | CPUID2_EST | CPUID2_TM2); in legacy_emulate_cpuid()
803 regs[2] &= ~(CPUID2_SMX); in legacy_emulate_cpuid()
805 regs[2] |= CPUID2_HV; in legacy_emulate_cpuid()
808 regs[2] |= CPUID2_X2APIC; in legacy_emulate_cpuid()
810 regs[2] &= ~CPUID2_X2APIC; in legacy_emulate_cpuid()
816 if (!(regs[2] & CPUID2_OSXSAVE)) in legacy_emulate_cpuid()
817 regs[2] &= ~CPUID2_XSAVE; in legacy_emulate_cpuid()
823 regs[2] &= ~CPUID2_MON; in legacy_emulate_cpuid()
828 regs[2] &= ~CPUID2_PDCM; in legacy_emulate_cpuid()
833 regs[2] &= ~CPUID2_TSCDLT; in legacy_emulate_cpuid()
838 regs[3] &= ~(CPUID_ACPI | CPUID_TM); in legacy_emulate_cpuid()
843 regs[3] &= ~CPUID_DS; in legacy_emulate_cpuid()
851 regs[3] |= (CPUID_MCA | CPUID_MCE | CPUID_MTRR); in legacy_emulate_cpuid()
856 regs[1] &= ~CPUID_HTT_CORES; in legacy_emulate_cpuid()
857 regs[1] |= (logical_cpus & 0xff) << 16; in legacy_emulate_cpuid()
858 regs[3] |= CPUID_HTT; in legacy_emulate_cpuid()
862 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
864 if (regs[0] || regs[1] || regs[2] || regs[3]) { in legacy_emulate_cpuid()
867 regs[0] &= 0x3ff; in legacy_emulate_cpuid()
868 regs[0] |= (cores - 1) << 26; in legacy_emulate_cpuid()
877 level = (regs[0] >> 5) & 0x7; in legacy_emulate_cpuid()
880 regs[0] |= (logical_cpus - 1) << 14; in legacy_emulate_cpuid()
885 regs[0] = 0; in legacy_emulate_cpuid()
886 regs[1] = 0; in legacy_emulate_cpuid()
887 regs[2] = 0; in legacy_emulate_cpuid()
888 regs[3] = 0; in legacy_emulate_cpuid()
892 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
895 regs[0] = 0; in legacy_emulate_cpuid()
900 regs[1] &= CPUID_STDEXT_FSGSBASE | in legacy_emulate_cpuid()
914 regs[2] &= CPUID_STDEXT2_VAES | in legacy_emulate_cpuid()
916 regs[3] &= CPUID_STDEXT3_MD_CLEAR; in legacy_emulate_cpuid()
922 regs[1] |= CPUID_STDEXT_INVPCID; in legacy_emulate_cpuid()
927 regs[0] = CPUTPM1_ARAT; in legacy_emulate_cpuid()
928 regs[1] = 0; in legacy_emulate_cpuid()
929 regs[2] = 0; in legacy_emulate_cpuid()
930 regs[3] = 0; in legacy_emulate_cpuid()
938 regs[0] = 0; in legacy_emulate_cpuid()
939 regs[1] = 0; in legacy_emulate_cpuid()
940 regs[2] = 0; in legacy_emulate_cpuid()
941 regs[3] = 0; in legacy_emulate_cpuid()
972 regs[0] = width & 0x1f; in legacy_emulate_cpuid()
973 regs[1] = logical_cpus & 0xffff; in legacy_emulate_cpuid()
974 regs[2] = (level << 8) | (param & 0xff); in legacy_emulate_cpuid()
975 regs[3] = x2apic_id; in legacy_emulate_cpuid()
977 regs[0] = 0; in legacy_emulate_cpuid()
978 regs[1] = 0; in legacy_emulate_cpuid()
979 regs[2] = 0; in legacy_emulate_cpuid()
980 regs[3] = 0; in legacy_emulate_cpuid()
987 regs[0] = 0; in legacy_emulate_cpuid()
988 regs[1] = 0; in legacy_emulate_cpuid()
989 regs[2] = 0; in legacy_emulate_cpuid()
990 regs[3] = 0; in legacy_emulate_cpuid()
994 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
1008 regs[0] &= limits->xcr0_allowed; in legacy_emulate_cpuid()
1009 regs[2] = limits->xsave_max_size; in legacy_emulate_cpuid()
1010 regs[3] &= (limits->xcr0_allowed >> 32); in legacy_emulate_cpuid()
1014 regs[0] &= CPUID_EXTSTATE_XSAVEOPT; in legacy_emulate_cpuid()
1015 regs[1] = 0; in legacy_emulate_cpuid()
1016 regs[2] = 0; in legacy_emulate_cpuid()
1017 regs[3] = 0; in legacy_emulate_cpuid()
1026 regs[0] = 0; in legacy_emulate_cpuid()
1027 regs[1] = 0; in legacy_emulate_cpuid()
1028 regs[2] = 0; in legacy_emulate_cpuid()
1029 regs[3] = 0; in legacy_emulate_cpuid()
1047 regs[0] = 0; in legacy_emulate_cpuid()
1048 regs[1] = 0; in legacy_emulate_cpuid()
1049 regs[2] = 0; in legacy_emulate_cpuid()
1050 regs[3] = 0; in legacy_emulate_cpuid()
1059 regs[0] = 0; in legacy_emulate_cpuid()
1060 regs[1] = 0; in legacy_emulate_cpuid()
1061 regs[2] = 0; in legacy_emulate_cpuid()
1062 regs[3] = 0; in legacy_emulate_cpuid()
1066 regs[0] = CPUID_VM_HIGH; in legacy_emulate_cpuid()
1067 bcopy(bhyve_id, ®s[1], 4); in legacy_emulate_cpuid()
1068 bcopy(bhyve_id + 4, ®s[2], 4); in legacy_emulate_cpuid()
1069 bcopy(bhyve_id + 8, ®s[3], 4); in legacy_emulate_cpuid()
1078 cpuid_count(func, param, regs); in legacy_emulate_cpuid()
1082 *eax = regs[0]; in legacy_emulate_cpuid()
1083 *ebx = regs[1]; in legacy_emulate_cpuid()
1084 *ecx = regs[2]; in legacy_emulate_cpuid()
1085 *edx = regs[3]; in legacy_emulate_cpuid()