Page MenuHomeFreeBSD

wrmsr_early_safe(9)
ClosedPublic

Authored by kib on Sep 18 2025, 10:02 PM.
Tags
None
Referenced Files
F138036922: D52607.id162554.diff
Fri, Nov 28, 9:57 AM
Unknown Object (File)
Wed, Nov 26, 12:58 AM
Unknown Object (File)
Sun, Nov 23, 8:23 PM
Unknown Object (File)
Tue, Nov 4, 1:43 AM
Unknown Object (File)
Tue, Nov 4, 1:42 AM
Unknown Object (File)
Tue, Nov 4, 1:42 AM
Unknown Object (File)
Tue, Nov 4, 1:42 AM
Unknown Object (File)
Tue, Nov 4, 1:41 AM
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 Skipped
Unit
Tests Skipped

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.Sep 24 2025, 12:38 PM