[prev in list] [next in list] [prev in thread] [next in thread] 

List:       illumos-developer
Subject:    [developer] Review: 16466 cpuid_pass_ucode() may return without calling cpuid_scan_security()
From:       Hans Rosenfeld <rosenfeld () grumpf ! hope-2000 ! org>
Date:       2024-04-11 9:59:58
Message-ID: Zhe08_-HSOHwuaLr () grumpf ! hope-2000 ! org
[Download RAW message or body]

Hi,

please review this small this small fix for the x86 cpuid feature
detection code:

https://code.illumos.org/c/illumos-gate/+/3418
https://www.illumos.org/issues/16466

I've refactored cpuid_pass_ucode() to use a switch() statement instead
of chained if-else, making sure that the only part of the code that can
return before cpuid_scan_security() is called is the default case
(unknown CPU vendor).

I've so far only tested this on my old AMD Bulldozer system. My
understanding of the code is that this refactoring doesn't negatively
affect more modern systems, while at the same time older systems are
safe because cpuid_scan_security() contains its own checks.


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown

------------------------------------------
illumos: illumos-developer
Permalink: https://illumos.topicbox.com/groups/developer/T0d6ef20ffc78a5be-M9c9d2beef711aeacae200f3b
Delivery options: https://illumos.topicbox.com/groups/developer/subscription
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic