[Bug 192487] cpucontrol uses unsafe procedure to detect current microcode version

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Mar 2 16:07:51 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192487

Mitchell Horne <mhorne063 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mhorne063 at gmail.com

--- Comment #2 from Mitchell Horne <mhorne063 at gmail.com> ---
This procedure is not handled by either the cpucontrol or cpupdate utilities
but instead by the underlying driver cpuctl. Inspection of the cpuctl code
shows that this is being handled properly in the update_intel() function.

sys/dev/cpuctl/cpuctl.c starting at line 366:

  critical_enter();
  rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current microcode revision. */

  /*
   * Perform update.
   */
  wrmsr_safe(MSR_BIOS_UPDT_TRIG, (uintptr_t)(ptr));
  wrmsr_safe(MSR_BIOS_SIGN, 0);

  /*
   * Serialize instruction flow.        
   */
  do_cpuid(0, tmp);
  critical_exit();
  rdmsr_safe(MSR_BIOS_SIGN, &rev1); /* Get new microcode revision. */

The section of the SDM mentioned defines a procedure to safely determine the
signature after a microcode update but it doesn't seem to be necessary to
perform it each time the MSR is queried.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list