HP-UX 11i Version 2 Release Notes (October 2003)

Libraries and Programming
Thread Context
Chapter 9
233
Summary of Change
The code responsible for saving and restoring register state on entry to the kernel via
interruption (bubbleup) or syscall (syscallinit) and at context switch time (save/resume,
setjmp/longjmp) has been revised to improve performance and support minor changes to
the runtime architecture.
Changes to the code include the following:
Protection Key Registers saved/restored on context switch
Lazy FP implementation: Most floating-point (FP) registers now saved in pcb rather
than save_state. To improve syscall and interruption performance, the task of saving
and restoring the state of 120 of the 128 FP registers has shifted from code executed
when a thread enters and leaves the kernel (bubbleup and syscallinit) to code
that is executed if and when the processor switches to a different thread
(save/resume).
New scratch registers supported: The Itanium-based Runtime Architecture was
revised to designate ar.csd and ar.ssd as scratch registers reserved for future use.
These registers are now treated like scratch registers by the operating system.
(Previouslyany values stored in these registers were lost when a processor switched
from one thread to another. No existing code should use these registers.)
Save_state, pcb, and label structures changed: To support the changes listed above,
the names and order of fields in these structures have changed. New fields have
been added for the new scratch registers and some unused fields have been removed.
The bulk of the FP registers are now stored in the pcb rather than the save_state.
(f6-f11 remain in the save_state because the kernel may use them.)
Support engineers need to be aware of these changes when examining register state
using q4 or other kernel debuggers.
Impact
The only customer-visible change (aside from performance improvement) is the support
for ar.csd and ar.ssd as scratch registers.
Compatibility
These data structures and functions are kernel internals. No release-to-release
compatibility is promised.
Applications using the uc_access interfaces to access register state saved in a signal
context (ucontext_t) are unaffected. Note that several system libraries including
libpthread, libc, libuca, aries, and pa_boot* must match the kernel to maintain
compatibility. You can't mix and match pre/post HP-UX 11i v2 kernels and libraries.
Performance
This change results in a small performance improvement (~7%). The improvement
varies with workload. Threads that do not use the FP registers but do make a lot of
syscalls or context switch a lot will see more improvement than threads that use the FP
registers or run uninterrupted on a CPU.