Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress unimplemented MSR related warnings #1611

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brendabrandy
Copy link

While using bhyve on intel machines, if certain MSRs are unimplemented, the bhyve console is spammed with these messages:

rdmsr to register 0x684 on vcpu 1
rdmsr to register 0x6c4 on vcpu 1
rdmsr to register 0x683 on vcpu 1
rdmsr to register 0x6c3 on vcpu 1
rdmsr to register 0x682 on vcpu 1
rdmsr to register 0x6c2 on vcpu 1
rdmsr to register 0x681 on vcpu 1
rdmsr to register 0x6c1 on vcpu 1
rdmsr to register 0x680 on vcpu 1
rdmsr to register 0x6c0 on vcpu 1
Password:
Login incorrect
login:
login:
login:
login: rdmsr to register 0x1c9 on vcpu 0
rdmsr to register 0x1dd on vcpu 0
rdmsr to register 0x1de on vcpu 0
rdmsr to register 0x68f on vcpu 0
rdmsr to register 0x6cf on vcpu 0
rdmsr to register 0x68e on vcpu 0
rdmsr to register 0x6ce on vcpu 0
rdmsr to register 0x68d on vcpu 0
rdmsr to register 0x6cd on vcpu 0
rdmsr to register 0x68c on vcpu 0
rdmsr to register 0x6cc on vcpu 0
rdmsr to register 0x68b on vcpu 0
rdmsr to register 0x6cb on vcpu 0
rdmsr to register 0x68a on vcpu 0
rdmsr to register 0x6ca on vcpu 0
rdmsr to register 0x689 on vcpu 0
rdmsr to register 0x6c9 on vcpu 0
rdmsr to register 0x688 on vcpu 0
rdmsr to register 0x6c8 on vcpu 0
rdmsr to register 0x687 on vcpu 0
rdmsr to register 0x6c7 on vcpu 0
rdmsr to register 0x686 on vcpu 0

This does not interfere with the normal operation of bhyve (since I can run the image), and there are already options to ignore unimplmented MSRs and continue (-w) But the warning messages makes it difficult to use the console. A new option -q is created to suppress the rdmsr and wrmsr messages.

@brendabrandy brendabrandy requested a review from bsdjhb as a code owner March 11, 2025 23:32
@@ -96,6 +97,7 @@ bhyve_usage(int code)
#ifdef BHYVE_SNAPSHOT
" -r: path to checkpoint file\n"
#endif
" -q: disable verbose MSR print out\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably not add a new top-level option as there are already several, and -q is pretty generic. I think having it just settable via '-o' is fine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the feedback, i made it settable via o instead now, and added the corresponding entries in the man pages

@@ -63,6 +63,7 @@ bhyve_init_config(void)
set_config_bool("acpi_tables_in_memory", true);
set_config_value("memory.size", "256M");
set_config_bool("x86.strictmsr", true);
set_config_bool("x86.verbosemsr", true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can actually default it to false, only developers probably care and for users it is just annoying spam.

Copy link
Author

@brendabrandy brendabrandy Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to false now

@@ -295,6 +295,13 @@ To map a 4 vCPU guest to host CPUs 12-15:
.Bd -literal
-p 0:12 -p 1:13 -p 2:14 -p 3:15
.Ed
.It Fl q
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't do -q, we should still document this in bhyve_config.5 which describes all the config nodes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated this as well!

@ocochard
Copy link
Member

Tested with and without the -o x86.verbosemsr=true and it is working great: Thanks

@brendabrandy brendabrandy requested a review from bsdjhb March 17, 2025 16:37
@bsdjhb
Copy link
Member

bsdjhb commented Mar 18, 2025

The change looks good to me. Can you rebase it and collapse it down to a single commit with an updated log message?

@brendabrandy
Copy link
Author

The change looks good to me. Can you rebase it and collapse it down to a single commit with an updated log message?

Thanks for the review! I rebased and squashed those commits, but it looks like the jenkins build failed with "Monthly compute limit exceeded error". Can we still merge or should I kick off the build again somehow

When using bhyve on x86, rdmsr and wrmsr emits a lot of warnings
when dealing with unimplemented MSR. An option x86.verbosemsr is
created to control these warnings. By default, the MSR related
warnings are suppressed to avoid spamming the console.

Sponsored by: Netflix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants