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)
Tue, Aug 11, 10:30 AM
Unknown Object (File)
Tue, Aug 11, 3:39 AM
Unknown Object (File)
Sat, Aug 8, 9:04 PM
Unknown Object (File)
Sat, Aug 8, 6:30 PM
Unknown Object (File)
Fri, Aug 7, 2:57 PM
Unknown Object (File)
Fri, Aug 7, 4:10 AM
Unknown Object (File)
Wed, Aug 5, 2:30 AM
Unknown Object (File)
Tue, Aug 4, 7:17 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.