cpuctl.4freebsd

Langue: en

Autres versions - même langue

Version: 361868 (ubuntu - 24/10/10)

Section: 4 (Pilotes et protocoles réseau)


BSD mandoc

NAME

cpuctl - cpuctl pseudo device

SYNOPSIS

To compile this driver into the kernel, place the following lines in your kernel configuration file:
device cpuctl

Alternatively, to load the driver as a module at boot time, place the following in loader.conf5:

 cpuctl_load="YES"
 

DESCRIPTION

The special device /dev/cpuctl presents interface to the system CPU. It provides functionality to retrieve CPUID information, read/write machine specific registers (MSR) and perform CPU firmware updates.

For each CPU present in the system, the special device /dev/cpuctl%d with the appropriate index will be created. For multicore CPUs such a special device will be created for each core.

Currently, only i386 and amd64 processors are supported.

IOCTL INTERFACE

All of the supported operations are invoked using the ioctl(2) system call. Currently, the following ioctls are defined:
CPUCTL_RDMSR Fa cpuctl_msr_args_t *args
CPUCTL_WRMSR Fa cpuctl_msr_args_t *args
Read/write CPU machine specific register. The Vt cpuctl_msr_args_t structure is defined in In sys/cpuctl.h as:
 typedef struct {
         int             msr;    /* MSR to read */
         uint64_t        data;
 } cpuctl_msr_args_t;
 
CPUCTL_MSRSBIT Fa cpuctl_msr_args_t *args
CPUCTL_MSRCBIT Fa cpuctl_msr_args_t *args
Set/clear MSR bits according to the mask given in the data field.
CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args
Retrieve CPUID information. Arguments are supplied in the following struct:
 typedef struct {
         int             level;  /* CPUID level */
         uint32_t        data[4];
 } cpuctl_cpuid_args_t;
 

The level field indicates the CPUID level to retrieve information for, while the data field is used to store the received CPUID data.

CPUCTL_UPDATE cpuctl_update_args_t *args
Update CPU firmware (microcode). The structure is defined in In sys/cpuctl.h as:
 typedef struct {
         void    *data;
         size_t  size;
 } cpuctl_update_args_t;
 

The data field should point to the firmware image of size size

For additional information refer to cpuctl.h

RETURN VALUES

Bq Er ENXIO
The operation requested is not supported by the device (e.g. unsupported architecture or the CPU is disabled)
Bq Er EINVAL
Incorrect request was supplied, or microcode image is not correct.
Bq Er ENOMEM
No physical memory was available to complete the request.
Bq Er EFAULT
The firmware image address points outside the process address space.

FILES

/dev/cpuctl

SEE ALSO

hwpmc(4), cpucontrol(8)

HISTORY

The driver first appeared in Fx 7.2 .

BUGS

Yes, probably, report if any.

AUTHORS

The module and this manual page were written by An Stanislav Sedov Aq stas@FreeBSD.org .