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)
Oct 21 2024, 3:49 AM
Unknown Object (File)
Sep 18 2024, 9:04 AM
Unknown Object (File)
Sep 18 2024, 5:32 AM
Unknown Object (File)
Sep 5 2024, 7:24 AM
Unknown Object (File)
Aug 30 2024, 6:59 AM
Unknown Object (File)
Aug 21 2024, 8:47 AM
Unknown Object (File)
Aug 21 2024, 8:47 AM
Unknown Object (File)
Aug 21 2024, 8:47 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 Passed
Unit
No Test Coverage
Build Status
Buildable 16843
Build 16722: arc lint + arc unit

Event Timeline

LGTM modulo my first comment.

usr.sbin/cpucontrol/amd10h.c
142

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

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

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

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.