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)
Mar 12 2024, 9:11 AM
Unknown Object (File)
Mar 12 2024, 9:10 AM
Unknown Object (File)
Mar 12 2024, 9:10 AM
Unknown Object (File)
Mar 12 2024, 9:10 AM
Unknown Object (File)
Mar 12 2024, 9:10 AM
Unknown Object (File)
Mar 12 2024, 9:10 AM
Unknown Object (File)
Mar 8 2024, 5:27 AM
Unknown Object (File)
Feb 24 2024, 7:02 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #37536)

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
81–82 ↗(On Diff #37536)

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

154 ↗(On Diff #37536)

"The kernel"

usr.sbin/cpucontrol/cpucontrol.c
353 ↗(On Diff #37536)

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 ↗(On Diff #37539)

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 ↗(On Diff #37536)

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

usr.sbin/cpucontrol/cpucontrol.8
81–82 ↗(On Diff #37536)

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 ↗(On Diff #37539)

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

Now it is used on i386 as well.

usr.sbin/cpucontrol/cpucontrol.8
81–82 ↗(On Diff #37536)

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
81–82 ↗(On Diff #37536)

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.