Page MenuHomeFreeBSD

D53210.diff
No OneTemporary

D53210.diff

diff --git a/sys/amd64/vmm/vmm_cpuid.c b/sys/amd64/vmm/vmm_cpuid.c
--- a/sys/amd64/vmm/vmm_cpuid.c
+++ b/sys/amd64/vmm/vmm_cpuid.c
@@ -6,7 +6,7 @@
*
* Copyright 2014 Pluribus Networks Inc.
* Copyright 2018 Joyent, Inc.
- * Copyright 2022 Oxide Computer Company
+ * Copyright 2024 Oxide Computer Company
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -538,7 +538,7 @@
goto default_leaf;
/*
- * Similar to Intel, generate a ficticious cache
+ * Similar to Intel, generate a fictitious cache
* topology for the guest with L3 shared by the
* package, and L1 and L2 local to a core.
*/
@@ -567,10 +567,15 @@
break;
}
- logical_cpus = MIN(0xfff, logical_cpus - 1);
- regs[0] = (logical_cpus << 14) | (1 << 8) |
- (level << 5) | func;
- regs[1] = func > 0 ? CACHE_LINE_SIZE - 1 : 0;
+ if (level == 0) {
+ regs[0] = 0;
+ regs[1] = 0;
+ } else {
+ logical_cpus = MIN(0xfff, logical_cpus - 1);
+ regs[0] = (logical_cpus << 14) | (1 << 8) |
+ (level << 5) | func;
+ regs[1] = func > 0 ? CACHE_LINE_SIZE - 1 : 0;
+ }
/*
* ecx: Number of cache ways for non-fully

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 21, 5:46 PM (15 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31302073
Default Alt Text
D53210.diff (1 KB)

Event Timeline