History log of /src/sys/amd64/include/pcb.h (Results 1 – 25 of 410)
Revision Date Author Comments
# 24038d69 09-Feb-2026 Konstantin Belousov <kib@FreeBSD.org>

Revert "pcb.h: mark struct pcb to be preserved"

kgdb only uses the marked fields from dumppcb for initial frame
reconstruction.

This reverts commit 8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3.


# 8f23665f 06-Feb-2026 Minsoo Choo <minsoochoo0122@proton.me>

pcb.h: mark struct pcb to be preserved

There are programs that depend on this structure (e.g. kernel debuggers)
that breaks when the ABI changes.

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.m

pcb.h: mark struct pcb to be preserved

There are programs that depend on this structure (e.g. kernel debuggers)
that breaks when the ABI changes.

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55149

show more ...


# 68ba38da 19-May-2025 Konstantin Belousov <kib@FreeBSD.org>

amd64: add pcb_tlsbase

This is a value for TLS base that would be explicitly set by user.
It is forced into the fsbase register on entry to signal handler, making
TLS in the handler usable even if u

amd64: add pcb_tlsbase

This is a value for TLS base that would be explicitly set by user.
It is forced into the fsbase register on entry to signal handler, making
TLS in the handler usable even if userspace uses segmentation.

Reported and tested: Alex S <iwtcex@gmail.com>
Tested by: pho
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50482

show more ...


# 5f7ac491 09-Feb-2024 Konstantin Belousov <kib@FreeBSD.org>

amd64 pcb.h: use 4 hex digits for pcb flags

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 2ff63af9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .h pattern

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/


# e4062350 14-Oct-2020 Konstantin Belousov <kib@FreeBSD.org>

Fix for mis-interpretation of PCB_KERNFPU.

RIght now PCB_KERNFPU is used both as indication that kernel prepared
hardware FPU context to use and that the thread is fpu-kern
thread. This also breaks

Fix for mis-interpretation of PCB_KERNFPU.

RIght now PCB_KERNFPU is used both as indication that kernel prepared
hardware FPU context to use and that the thread is fpu-kern
thread. This also breaks fpu_kern_enter(FPU_KERN_NOCTX), since
fpu_kern_leave() then clears PCB_KERNFPU.

Introduce new flag PCB_KERNFPU_THR which indicates that the thread is
fpu-kern. Do not clear PCB_KERNFPU if fpu-kern thread leaves noctx
fpu region.

Reported and tested by: jhb (amd64)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25511

show more ...


# 20795e25 26-Oct-2019 Konstantin Belousov <kib@FreeBSD.org>

Provide dummy definition of the amd64 struct pcb for -m32 compilation.

I do not see a need in the proper x86/include/pcb.h header.

Reported and tested by: antoine
MFC after: 1 week


# 68ba38da 19-May-2025 Konstantin Belousov <kib@FreeBSD.org>

amd64: add pcb_tlsbase

This is a value for TLS base that would be explicitly set by user.
It is forced into the fsbase register on entry to signal handler, making
TLS in the handler usable even if u

amd64: add pcb_tlsbase

This is a value for TLS base that would be explicitly set by user.
It is forced into the fsbase register on entry to signal handler, making
TLS in the handler usable even if userspace uses segmentation.

Reported and tested: Alex S <iwtcex@gmail.com>
Tested by: pho
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50482

show more ...


# 5f7ac491 09-Feb-2024 Konstantin Belousov <kib@FreeBSD.org>

amd64 pcb.h: use 4 hex digits for pcb flags

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 2ff63af9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .h pattern

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/


# e4062350 14-Oct-2020 Konstantin Belousov <kib@FreeBSD.org>

Fix for mis-interpretation of PCB_KERNFPU.

RIght now PCB_KERNFPU is used both as indication that kernel prepared
hardware FPU context to use and that the thread is fpu-kern
thread. This also breaks

Fix for mis-interpretation of PCB_KERNFPU.

RIght now PCB_KERNFPU is used both as indication that kernel prepared
hardware FPU context to use and that the thread is fpu-kern
thread. This also breaks fpu_kern_enter(FPU_KERN_NOCTX), since
fpu_kern_leave() then clears PCB_KERNFPU.

Introduce new flag PCB_KERNFPU_THR which indicates that the thread is
fpu-kern. Do not clear PCB_KERNFPU if fpu-kern thread leaves noctx
fpu region.

Reported and tested by: jhb (amd64)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25511

show more ...


# 20795e25 26-Oct-2019 Konstantin Belousov <kib@FreeBSD.org>

Provide dummy definition of the amd64 struct pcb for -m32 compilation.

I do not see a need in the proper x86/include/pcb.h header.

Reported and tested by: antoine
MFC after: 1 week


# b4dfc9d7 19-Jan-2018 Konstantin Belousov <kib@FreeBSD.org>

PTI: Trap if we returned to userspace with kernel (full) page table
still active.

Map userspace portion of VA in the PTI kernel-mode page table as
non-executable. This way, if we ever miss reloading

PTI: Trap if we returned to userspace with kernel (full) page table
still active.

Map userspace portion of VA in the PTI kernel-mode page table as
non-executable. This way, if we ever miss reloading ucr3 into %cr3 on
the return to usermode, the process traps instead of executing in
potentially vulnerable setup. Catch the condition of such trap and
verify user-mode %cr3, which is saved by page fault handler.

I peek this trick in some article about Linux implementation.

Reviewed by: alc, markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 12 days
DIfferential revision: https://reviews.freebsd.org/D13956

show more ...


# 82725ba9 23-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325999 through r326131.


# 51369649 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for

sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

show more ...


# b754c279 13-Sep-2017 Navdeep Parhar <np@FreeBSD.org>

MFH @ r323558.


# 1be4c195 25-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

MFhead@r322870


# 3e902b3d 21-Aug-2017 Konstantin Belousov <kib@FreeBSD.org>

Make WRFSBASE and WRGSBASE instructions functional.

Right now, we enable the CR4.FSGSBASE bit on CPUs which support the
facility (Ivy and later), to allow usermode to read fs and gs bases
without sy

Make WRFSBASE and WRGSBASE instructions functional.

Right now, we enable the CR4.FSGSBASE bit on CPUs which support the
facility (Ivy and later), to allow usermode to read fs and gs bases
without syscalls. This bit also controls the write access to bases
from userspace, but WRFSBASE and WRGSBASE instructions currently
cannot be used, because return path from both exceptions or interrupts
overrides bases with the values from pcb.

Supporting the instructions is useful because this means that usermode
can implement green-threads completely in userspace without issuing
syscalls to change all of the machine context.

Support is implemented by saving the fs base and user gs base when
PCB_FULL_IRET flag is set. The flag is set on the context switch,
which potentially causes clobber of the bases due to activation of
another context, and when explicit modification of the user context by
a syscall or exception handler is performed. In particular, the patch
moves setting of the flag before syscalls change context.

The changes to doreti_exit and PUSH_FRAME to clear PCB_FULL_IRET on
entry from userspace can be considered a bug fixes on its own.

Reviewed by: jhb (previous version)
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D12023

show more ...


# 348238db 01-Mar-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r314420 through r314481.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96

show more ...


# 93badfa1 16-Sep-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r305687 through r305890.


# cf1c4776 11-Sep-2016 Konstantin Belousov <kib@FreeBSD.org>

Add FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64.

The flag specifies that the block which uses FPU must be executed in
critical section, i.e. take no context switches, and does not

Add FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64.

The flag specifies that the block which uses FPU must be executed in
critical section, i.e. take no context switches, and does not need an
FPU save area during the execution.

It is intended to be applied around fast and short code pathes where
save area allocation is impossible or undesirable, due to context or
due to the relative cost of calculation vs. allocation.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

show more ...


# b626f5a7 04-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH r289384-r293170

Sponsored by: The FreeBSD Foundation


12345678910>>...17