Skip to content

Commit 0f8bd29

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

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

nexus/src/app/instance_platform/cpu_platform.rs

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

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

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

583+
// Same as with initial Milan profiles, `rdseed` is not supported by the
584+
// virt stack, so we should hide it from guests for now.
585+
leaf.set_rdseed(false);
586+
568587
// Turin supports the TSC_ADJUST MSR but guest plumbing is not present for
569588
// it and it's not clear what a guest would productively do with it anyway.
570589
leaf.set_tsc_adjust_msr(false);
@@ -1036,11 +1055,11 @@ mod test {
10361055
// guests.
10371056
const TURIN_V1_CPUID: [CpuidEntry; 26] = [
10381057
cpuid_leaf!(0x0, 0x0000000D, 0x68747541, 0x444D4163, 0x69746E65),
1039-
cpuid_leaf!(0x1, 0x00A00F11, 0x00000800, 0xF6D83203, 0x078BFBFF),
1058+
cpuid_leaf!(0x1, 0x00B00F21, 0x00000800, 0xF6D83203, 0x078BFBFF),
10401059
cpuid_leaf!(0x5, 0x00000000, 0x00000000, 0x00000000, 0x00000000),
10411060
cpuid_leaf!(0x6, 0x00000004, 0x00000000, 0x00000000, 0x00000000),
10421061
cpuid_subleaf!(
1043-
0x7, 0x0, 0x00000001, 0xF1BF03A9, 0x00005F42, 0x00000110
1062+
0x7, 0x0, 0x00000001, 0xF1BB03A9, 0x00005F42, 0x00000110
10441063
),
10451064
cpuid_subleaf!(
10461065
0x7, 0x1, 0x00000030, 0x00000000, 0x00000000, 0x00000000

0 commit comments

Comments
 (0)