Skip to content

Commit 84d5995

Browse files
committed
Revert "refactor(vmm): Error if subleaf >= 2 given for leaf 0xB"
This reverts commit 68e7a4c. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent fbf24fe commit 84d5995

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/vmm/src/cpu_config/x86_64/cpuid/normalize.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ pub enum ExtendedTopologyError {
6969
NumLogicalProcs(u32, CheckedAssignError),
7070
/// Failed to set right-shift bits (CPUID.(EAX=0xB,ECX={0}):EAX[4:0]): {1}
7171
RightShiftBits(u32, CheckedAssignError),
72-
/// Unexpected subleaf: {0}
73-
UnexpectedSubleaf(u32)
7472
}
7573

7674
/// Error type for setting leaf 0x80000006 of Cpuid::normalize().
@@ -372,11 +370,9 @@ impl super::Cpuid {
372370
.map_err(|err| ExtendedTopologyError::DomainType(index, err))?;
373371
}
374372
_ => {
375-
// KVM no longer returns any subleaf numbers greater than 0. The patch was
376-
// merged in v6.2 and backported to v5.10. Subleaves >= 2 should not be
377-
// included.
378-
// https://github.com/torvalds/linux/commit/45e966fcca03ecdcccac7cb236e16eea38cc18af
379-
return Err(ExtendedTopologyError::UnexpectedSubleaf(index));
373+
// We expect here as this is an extremely rare case that is unlikely to ever
374+
// occur.
375+
subleaf.result.ecx = index;
380376
}
381377
}
382378
} else {

0 commit comments

Comments
 (0)