Machine state register
Encyclopedia
Machine state register, also known as model specific register (MSR) is a feature Intel implemented in their X86 and X86-64
X86-64
x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets. x86-64 also provides 64-bit general purpose registers and numerous other...

 family processors which provides the option to control and receive information regarding the CPU performance. All the MSRs registers handle only system functions and cannot be accessible by application programs.

The CPU uses Read from Model-Specific Register and Write to Model-Specific Register instructions which are used in turn to modify or read from the MSR registers.
The operating system usually modifies the MSR registers during the early staging of the boot process.
Common example is the SYSENTER (both Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 and Windows use it), which is also known as the Fast System Call.
Simple example from Linux, when code needs to get services from the kernel using the SYSENTER the operating system reads the SYSENTER_CS_MSR, SYSENTER_EIP_MSR, SS (Stack Segment) is being set to the sum of (SYSENTER_CS_MSR+8) and SYSENTER_ESP_MSR registers and jump directly into Ring0 (Kernel) instead of using int 80 (old method and much slower) to call the system call handler.
Linux kernel source provides some MSR registers values which can found in /usr/src/linux/include/asm/msr.h:

#define MSR_IA32_SYSENTER_CS 0x174

#define MSR_IA32_SYSENTER_ESP 0x175

#define MSR_IA32_SYSENTER_EIP 0x176

PowerPC

Most PowerPC
PowerPC
PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...

 chips switch endianness
Endianness
In computing, the term endian or endianness refers to the ordering of individually addressable sub-components within the representation of a larger data item as stored in external memory . Each sub-component in the representation has a unique degree of significance, like the place value of digits...

via a bit in the MSR (Machine State Register).
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK