Page MenuHomeFreeBSD

bhyvectl: Address compiler warnings and bump WARNS
ClosedPublic

Authored by markj on Mar 1 2023, 2:57 PM.
Tags
None
Referenced Files
F109051580: D38839.diff
Fri, Jan 31, 4:10 AM
Unknown Object (File)
Mon, Jan 27, 5:04 PM
Unknown Object (File)
Dec 13 2024, 12:21 AM
Unknown Object (File)
Nov 6 2024, 4:14 PM
Unknown Object (File)
Sep 24 2024, 3:01 PM
Unknown Object (File)
Sep 24 2024, 10:23 AM
Unknown Object (File)
Sep 16 2024, 11:52 PM
Unknown Object (File)
Sep 16 2024, 9:42 PM

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