Skip to content

Commit f34e225

Browse files
committed
Use Turin F/M/S, keep hiding rdseed for now
1 parent d5727cc commit f34e225

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

nexus/src/app/instance_platform/cpu_platform.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,28 @@ pub fn turin_v1() -> CpuIdDump {
561561

562562
let mut cpuid = CpuId::with_cpuid_reader(baseline);
563563

564+
let mut leaf =
565+
cpuid.get_feature_info().expect("baseline Milan defines leaf 1");
566+
567+
// Set up EAX: Family 1Ah model 2h stepping 1.
568+
leaf.set_extended_family_id(0x0B);
569+
leaf.set_base_family_id(0x0F);
570+
leaf.set_base_model_id(0x02);
571+
leaf.set_stepping_id(0x01);
572+
573+
// EBX, ECX, EDX are all unchanged from Milan (same cache line flush size,
574+
// leaf 1 features are unchanged)
575+
576+
cpuid.set_feature_info(Some(leaf)).expect("can set leaf 1");
577+
564578
let mut leaf = cpuid
565579
.get_extended_feature_info()
566580
.expect("baseline Milan defines leaf 7");
567581

582+
// Same as with initial Milan profiles, `rdseed` is not supported by the
583+
// virt stack, so we should hide it from guests for now.
584+
leaf.set_rdseed(false);
585+
568586
// Turin supports the TSC_ADJUST MSR but guest plumbing is not present for
569587
// it and it's not clear what a guest would productively do with it anyway.
570588
leaf.set_tsc_adjust_msr(false);
@@ -1036,11 +1054,11 @@ mod test {
10361054
// guests.
10371055
const TURIN_V1_CPUID: [CpuidEntry; 26] = [
10381056
cpuid_leaf!(0x0, 0x0000000D, 0x68747541, 0x444D4163, 0x69746E65),
1039-
cpuid_leaf!(0x1, 0x00A00F11, 0x00000800, 0xF6D83203, 0x078BFBFF),
1057+
cpuid_leaf!(0x1, 0x00B00F21, 0x00000800, 0xF6D83203, 0x078BFBFF),
10401058
cpuid_leaf!(0x5, 0x00000000, 0x00000000, 0x00000000, 0x00000000),
10411059
cpuid_leaf!(0x6, 0x00000004, 0x00000000, 0x00000000, 0x00000000),
10421060
cpuid_subleaf!(
1043-
0x7, 0x0, 0x00000001, 0xF1BF03A9, 0x00005F42, 0x00000110
1061+
0x7, 0x0, 0x00000001, 0xF1BB03A9, 0x00005F42, 0x00000110
10441062
),
10451063
cpuid_subleaf!(
10461064
0x7, 0x1, 0x00000030, 0x00000000, 0x00000000, 0x00000000

0 commit comments

Comments
 (0)