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
F105879437: D13770.id37535.diff
Sun, Dec 22, 1:03 AM
Unknown Object (File)
Tue, Dec 10, 5:04 PM
Unknown Object (File)
Wed, Dec 4, 10:54 PM
Unknown Object (File)
Nov 3 2024, 11:34 PM
Unknown Object (File)
Nov 2 2024, 1:52 AM
Unknown Object (File)
Sep 23 2024, 10:24 PM
Unknown Object (File)
Sep 23 2024, 12:14 PM
Unknown Object (File)
Sep 23 2024, 6:24 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.