-
Notifications
You must be signed in to change notification settings - Fork 1.2k
kvm: implement Hyper-V enlightenments correctly #11213
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,7 +334,18 @@ public static class HyperVEnlightenmentFeatureDef { | |
enum Enlight { | ||
RELAX("relaxed"), | ||
VAPIC("vapic"), | ||
SPIN("spinlocks"); | ||
SPIN("spinlocks"), | ||
VENDOR_ID("vendor_id"), | ||
VPINDEX("vpindex"), | ||
RUNTIME("runtime"), | ||
SYNIC("synic"), | ||
FREQ("frequencies"), | ||
RESET("reset"), | ||
TLBFLUSH("tlbflush"), | ||
REENLIGHTEN("reenlightenment"), | ||
STIMER("stimer"), | ||
IPI("ipi"), | ||
EVMCS("evmcs"); | ||
|
||
private final String featureName; | ||
Enlight(String featureName) { this.featureName = featureName; } | ||
|
@@ -379,10 +390,13 @@ public String toString() { | |
feaBuilder.append("<"); | ||
feaBuilder.append(e.getKey()); | ||
|
||
if(e.getKey().equals("spinlocks")) feaBuilder.append(" state='" + e.getValue() + "' retries='" + getRetries() + "'"); | ||
else feaBuilder.append(" state='" + e.getValue() + "'"); | ||
if (e.getKey().equals("spinlocks")) feaBuilder.append(" state='" + e.getValue() + "' retries='" + getRetries() + "'"); | ||
else if (e.getKey().equals("vendor_id")) feaBuilder.append(" state='" + e.getValue() + "' value='KVM Hv'"); | ||
else if (e.getKey().equals("stimer")) feaBuilder.append(" state='" + e.getValue() + "'><direct state='" + e.getValue() + "'/>"); | ||
else feaBuilder.append(" state='" + e.getValue() + "'"); | ||
|
||
feaBuilder.append("/>\n"); | ||
if (e.getKey().equals("stimer")) feaBuilder.append("</stimer>\n"); | ||
else feaBuilder.append("/>\n"); | ||
Comment on lines
390
to
+399
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like this could be a bit cleaner as a switch statement:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree - in fact the whole class could use refactoring. For my purpose, unfortunately these changes made no visible impact on console performance #10650 (comment) I won't have time to refactor this today or later, but you and others are welcome to collaborate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if these have no results we can merge them on recomendation of redhat, but further effort along this line seems mute to me. |
||
} | ||
feaBuilder.append("</hyperv>\n"); | ||
return feaBuilder.toString(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the docs "This feature is exclusive to Intel processors.". So, this could potentially cause issues with non-intel processors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hyperv on non-intel-like processors is maybe not so big an issue. We can
I am leaning to the higher numbers, here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not about hyper-v, this is about hyper-v emulation on KVM itself. This PR isn't necessary given Vishesh's comments.