History log of /freebsd-10-stable/sys/dev/cpuctl/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
315972 26-Mar-2017 kib

MFC r315588:
Update the list of cpudev ioctls which require write access.

308802 18-Nov-2016 kib

MFC r308538:
Increase the max allowed size of the microcode update blob for x86.

308761 17-Nov-2016 avg

MFC r308218: Add support for microcode update on newer AMD CPUs (10h+)

308482 10-Nov-2016 avg

MFC r308225: dev/cpuctl: put debug output under CPUCTL_DEBUG rather than DEBUG

302136 23-Jun-2016 kib

MFC r301962:
Always allow loading of cpuctl(4).

276271 27-Dec-2014 kib

MFC r275960:
Increase allowed size of the microcode blob to 32KB.

268157 02-Jul-2014 kib

MFC r267651 (by attilio):
Add the possibility to specify ecx when performing cpuid calls.

MFC r267673:
Restore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID.

MFC r267814:
Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void.

263357 19-Mar-2014 kib

MFC r263080:
Use correct types for sizeof() in the calculations for the malloc(9) sizes.

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255439 10-Sep-2013 kib

Call free() on the pointer returned from malloc().

Reported and tested by: Oliver Pinter <oliver.pntr@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Approved by: re (delphij)


254191 10-Aug-2013 kib

Match malloc(9) calls with free(9), not contigfree(9). Also remove
unneeded checks for NULL, free(9) can handle NULL pointers on its own,
and the regions were allocated with M_WAITOK flag as well.

Reported and tested by: Larry Rosenman <ler@lerctr.org>
MFC after: 1 week


252597 03-Jul-2013 rpaulo

Increase the microcode max size to 16K to accomodate more recent Intel
firmware.


252592 03-Jul-2013 rpaulo

Typos in comments.


242565 04-Nov-2012 avg

cpuctl_do_cpuid: explicitly use ecx=0 for cpuid call

... instead of whatever random value may happen to be in the register.
ecx is important to some cpuid leaves.

To do: extend cpuctl interface to provide for ecx value parameter.

MFC after: 5 days


228436 12-Dec-2011 fabient

Add VIA microde update support to cpuctl(4) and cpucontrol(8).

Support have been tested with X2 CPU and QuadCore CPU.

MFC after: 1 month


195189 30-Jun-2009 stas

- Add support to atomically set/clear individual bits of a MSR register
via cpuctl(4) driver. Two new CPUCTL_MSRSBIT and CPUCTL_MSRCBIT ioctl(2)
calls treat the data field of the argument struct passed as a mask
and set/clear bits of the MSR register according to the mask value.
- Allow user to perform atomic bitwise AND and OR operaions on MSR registers
via cpucontrol(8) utility. Two new operations ("&=" and "|=") have been
added. The first one applies bitwise AND operaion between the current
contents of the MSR register and the mask, and the second performs bitwise
OR. The argument can be optionally prefixed with "~" inversion operator.
This allows one to mimic the "clear bit" behavior by using the command
like this:
cpucontrol -m 0x10&=~0x02 # clear the second bit of TSC MSR

Inversion operator support in all modes (assignment, OR, AND).

Approved by: re (kib)
MFC after: 1 month


195081 26-Jun-2009 stas

- Don't zero data field in case of MSR write operation. Before this change
the value written to MSR register was always 0 regardless of value passed
by user.
- Use proper data pointer when performing AMD microcode update. Previously,
the pointer to user-space data has been provided instead, which is totally
incorrect.

Approved by: re (kib)
MFC after: 1 week


183397 27-Sep-2008 ed

Replace all calls to minor() with dev2unit().

After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by: kib


182628 01-Sep-2008 ed

Remove unneeded D_NEEDMINOR from cpuctl(4).

The D_NEEDMINOR flag was introduced for drivers that do not actually
depend on storing a device unit/minor number, but require the ability to
address the cdevs by this number, which is used by clone_create().

The cpuctl(4) driver sets D_NEEDMINOR, even though it doesn't use the
clone_create() API. Remove the flag, because maybe we want to get rid of
it somewhere in the far future.


181430 08-Aug-2008 stas

- Add cpuctl(4) pseudo-device driver to provide access to some low-level
features of CPUs like reading/writing machine-specific registers,
retrieving cpuid data, and updating microcode.
- Add cpucontrol(8) utility, that provides userland access to
the features of cpuctl(4).
- Add subsequent manpages.

The cpuctl(4) device operates as follows. The pseudo-device node cpuctlX
is created for each cpu present in the systems. The pseudo-device minor
number corresponds to the cpu number in the system. The cpuctl(4) pseudo-
device allows a number of ioctl to be preformed, namely RDMSR/WRMSR/CPUID
and UPDATE. The first pair alows the caller to read/write machine-specific
registers from the correspondent CPU. cpuid data could be retrieved using
the CPUID call, and microcode updates are applied via UPDATE.

The permissions are inforced based on the pseudo-device file permissions.
RDMSR/CPUID will be allowed when the caller has read access to the device
node, while WRMSR/UPDATE will be granted only when the node is opened
for writing. There're also a number of priv(9) checks.

The cpucontrol(8) utility is intened to provide userland access to
the cpuctl(4) device features. The utility also allows one to apply
cpu microcode updates.

Currently only Intel and AMD cpus are supported and were tested.

Approved by: kib
Reviewed by: rpaulo, cokane, Peter Jeremy
MFC after: 1 month