Page MenuHomeFreeBSD

cpucontrol: fix debugging for family on AMD cpus and add useful debugging.
ClosedPublic

Authored by sbruno on May 25 2018, 5:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 8 2024, 11:41 PM
Unknown Object (File)
Mar 8 2024, 11:41 PM
Unknown Object (File)
Mar 8 2024, 11:38 AM
Unknown Object (File)
Mar 8 2024, 11:24 AM
Unknown Object (File)
Jan 5 2024, 10:43 AM
Unknown Object (File)
Dec 20 2023, 2:18 AM
Unknown Object (File)
Nov 10 2023, 3:04 AM
Unknown Object (File)
Nov 1 2023, 6:44 AM
Subscribers

Details

Summary

I noted that the display of family wasn't displaying correctly for AMD cpus

Diff Detail

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

Event Timeline

LGTM modulo my first comment.

usr.sbin/cpucontrol/amd10h.c
142 ↗(On Diff #43000)

IIRC, extfamily bits are valid IFF family == 0xF. Which is handled by the macro in sys/. Would it be possible to just include the <machine/specialreg.h> and use the CPUID_TO_FAMILY() macro?

If we're merging the family and extfamily fields, we probably don't need to print extfamily too.

151 ↗(On Diff #43000)

Thanks!

This revision is now accepted and ready to land.May 25 2018, 5:26 PM
sbruno added inline comments.
usr.sbin/cpucontrol/amd10h.c
142 ↗(On Diff #43000)

We already include <machine/specialreg.h> So this should be converted! let me take a stab at it.

I don't think we're merging the family/extfamily fields here. Are we? I'm not looking at the AMD SDM btw, just noted that the family was being displayed "wrong".

usr.sbin/cpucontrol/amd10h.c
142 ↗(On Diff #43000)

Yep, this change is merging the family and extfamily fields — which is good, it’s closer to what users expect. Eg 17h is encoded as family=F + extfamily=something. Check CPUID_TO_FAMILY() for similarity with the shifts and masks printed here.

This revision was automatically updated to reflect the committed changes.