Page MenuHomeFreeBSD

bhyvectl: Address compiler warnings and bump WARNS
ClosedPublic

Authored by markj on Mar 1 2023, 2:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 14, 4:42 PM
Unknown Object (File)
Mon, Jun 23, 3:49 PM
Unknown Object (File)
Sat, Jun 21, 8:08 PM
Unknown Object (File)
May 24 2025, 7:06 PM
Unknown Object (File)
May 23 2025, 7:06 PM
Unknown Object (File)
May 18 2025, 2:58 PM
Unknown Object (File)
May 18 2025, 12:54 AM
Unknown Object (File)
May 13 2025, 6:01 AM

Details

Summary

Avoid unaligned accesses in cpu_vendor_intel() and address a few other
nits. No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50080
Build 46972: arc lint + arc unit

Event Timeline

markj requested review of this revision.Mar 1 2023, 2:57 PM
This revision is now accepted and ready to land.Mar 1 2023, 4:35 PM
jhb added a subscriber: jhb.
jhb added inline comments.
usr.sbin/bhyvectl/bhyvectl.c
661

I think more correct would be to do something along the lines of:

u_int v[3];

...
v[0] = regs[1];
v[1] = regs[3];
v[2] = regs[2];

if (memcmp(v, "GenuineIntel", sizeof(v)) == 0)

etc. It is always a 12 byte comparison and doesn't vary based on the vendor string length. Instead, vendors always adopt a 12 byte string as their signature.

corvink added a subscriber: corvink.

I'd prefer Johns approach.

markj marked an inline comment as done.

Apply jhb's suggestion.

This revision now requires review to proceed.Mar 2 2023, 6:09 PM
This revision is now accepted and ready to land.Mar 3 2023, 6:59 AM