Determine CPU vendor
(&self)
| 160 | /// Determine CPU vendor |
| 161 | /// |
| 162 | fn get_cpu_vendor(&self) -> CpuVendor { |
| 163 | #[allow(unused_unsafe)] |
| 164 | // SAFETY: not actually unsafe, but considered unsafe by current stable |
| 165 | unsafe { |
| 166 | let leaf = x86_64::__cpuid(0x0); |
| 167 | |
| 168 | if leaf.ebx == 0x756e_6547 && leaf.ecx == 0x6c65_746e && leaf.edx == 0x4965_6e69 { |
| 169 | // Vendor string GenuineIntel |
| 170 | CpuVendor::Intel |
| 171 | } else if leaf.ebx == 0x6874_7541 && leaf.ecx == 0x444d_4163 && leaf.edx == 0x6974_6e65 |
| 172 | { |
| 173 | // Vendor string AuthenticAMD |
| 174 | CpuVendor::AMD |
| 175 | } else { |
| 176 | // Not known yet, the corresponding manufacturer manual should contain the |
| 177 | // necessary info. See also https://wiki.osdev.org/CPUID#CPU_Vendor_ID_String |
| 178 | CpuVendor::default() |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | /// This function enables the AMX related TILECFG and TILEDATA state components for guests. |
| 184 | /// |
no outgoing calls
no test coverage detected