Page MenuHomeFreeBSD

wrmsr_early_safe(9)
ClosedPublic

Authored by kib on Thu, Sep 18, 10:02 PM.
Tags
None
Referenced Files
F132445383: D52607.id162345.diff
Fri, Oct 17, 12:27 AM
F132403153: D52607.id162554.diff
Thu, Oct 16, 3:30 PM
Unknown Object (File)
Tue, Oct 14, 2:33 AM
Unknown Object (File)
Sat, Oct 11, 11:09 AM
Unknown Object (File)
Thu, Oct 9, 7:56 PM
Unknown Object (File)
Thu, Oct 9, 7:56 PM
Unknown Object (File)
Thu, Oct 9, 7:56 PM
Unknown Object (File)
Thu, Oct 9, 7:56 PM
Subscribers

Details

Summary

The variant of wrmsr_safe(9) that might work before IDT and curpcb are initialized. Assumes BSP, and that all APs are parked.

Before calling wrmsr_early_safe(), the wrmsr_early_safe_start() should be called, afterward wrmsr_early_safe_end() restores the #gp IDT slot.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I have created a patch D52643 on top of this one. We have successfully tested it. At boot this message is observed:

Copyright (c) 1992-2025 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 15.0-PRERELEASE NCD-9043-AMD-microcode-kib-n7648-9bbf40e9a419 RED1 amd64
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
VT(efifb): resolution 800x600
CPU microcode: load failed. BIOS updated advised
CPU: AMD EPYC 8124P 16-Core Processor                (2450.12-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0xaa0f02  Family=0x19  Model=0xa0  Stepping=2

I'm not sure our patches are going to compile on i386. IMHO, we need this to make a priority for 15.0-RELEASE.

kib edited the summary of this revision. (Show Details)

Re-use idt0 for early IDT, removing restriction that the boot is UEFI. Now early_safe() should work regardless of the boot method.

This revision is now accepted and ready to land.Wed, Sep 24, 12:38 PM