Page MenuHomeFreeBSD

Make it possible to re-evaluate cpu_features.
ClosedPublic

Authored by kib on Jan 4 2018, 10:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 16, 9:25 PM
Unknown Object (File)
Thu, May 2, 2:49 AM
Unknown Object (File)
Wed, May 1, 5:18 AM
Unknown Object (File)
Mon, Apr 29, 2:59 PM
Unknown Object (File)
Mon, Apr 29, 1:41 PM
Unknown Object (File)
Sun, Apr 28, 5:13 AM
Unknown Object (File)
Mar 12 2024, 9:11 AM
Unknown Object (File)
Mar 12 2024, 9:10 AM
Subscribers

Details

Summary

Add cpuctl(4) ioctl CPUCTL_EVAL_CPU_FEATURES which forces re-read of cpu_features, cpu_features2, cpu_stdext_features, and std_stdext_features2.

The intent is to allow the kernel to see the changes in the CPU features after micocode update. Of course, the update is not atomic across variables and not synchronized with readers. See the man page warning as well.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jilles added inline comments.
sys/x86/include/ifunc.h
1 ↗(On Diff #37536)

This file does not seem to belong to this patch.

sys/x86/include/x86_var.h
122

Is there still a call to identify_cpu() in hammer_time() in sys/amd64/amd64/machdep.c?

sys/x86/iommu/intel_utils.c
371 ↗(On Diff #37536)

Does this hunk belong to the patch to re-evaluate cpu_features?

usr.sbin/cpucontrol/cpucontrol.8
86–87

The .Bk needs a matching .Ek after what should be kept on a line.

155

"The kernel"

usr.sbin/cpucontrol/cpucontrol.c
353

The error message is incorrect since the actual open is for reading and writing.

Remove leaked chunks from the bigger patch.

Noted by: emaste

This revision is now accepted and ready to land.Jan 4 2018, 10:55 PM
rpokala added inline comments.
sys/x86/x86/identcpu.c
1388

Why was this disabled on i386 before? Why is it okay on i386 now?

kib marked 4 inline comments as done.Jan 4 2018, 11:06 PM
kib added inline comments.
sys/x86/include/x86_var.h
122

It is yet another mistake in generating the patch. It is extracted from the bigger changeset.

usr.sbin/cpucontrol/cpucontrol.8
86–87

Does this mean that the whole SYNOPSIS markup is wrong ?

Edit manpage, including syntax and markup.
Fix error message.
Hopefully extract all needed chunks, and removed irrelevant (try 2).

This revision now requires review to proceed.Jan 4 2018, 11:07 PM
sys/x86/x86/identcpu.c
1388

Because it was not called. locore.S handled it.

Now it is used on i386 as well.

usr.sbin/cpucontrol/cpucontrol.8
86–87

Hmm, I notice that .Bk/.Ek are used inconsistently across man pages. To me, it seems reasonable to omit it for the new entry or to do it like for the other entries so as not to "fix" something which is uncertain (note that some synopses in other man pages are longer than a line). However, if this renders properly I do not object.

usr.sbin/cpucontrol/cpucontrol.8
86–87

I check the man page markup by proof-reading them using the rich format.

This revision is now accepted and ready to land.Jan 5 2018, 6:41 PM
This revision was automatically updated to reflect the committed changes.