kvm: implement Hyper-V enlightenments correctly to allow running HyperV on KVM#11213
kvm: implement Hyper-V enlightenments correctly to allow running HyperV on KVM#11213yadvr wants to merge 2 commits intoapache:4.20from
Conversation
This implements Hyper-V enlightenments as per the RHEL docs: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/configuring_and_managing_windows_virtual_machines/optimizing-windows-virtual-machines#enabling-hyper-v-enlightenments This is enabled only when the guest OS is set to Windows PV. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11213 +/- ##
============================================
+ Coverage 16.14% 16.52% +0.38%
- Complexity 13256 13613 +357
============================================
Files 5656 5657 +1
Lines 497893 511363 +13470
Branches 60374 66501 +6127
============================================
+ Hits 80394 84519 +4125
- Misses 408539 417608 +9069
- Partials 8960 9236 +276
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| 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"); |
There was a problem hiding this comment.
looks like this could be a bit cleaner as a switch statement:
String key = e.getKey();
feaBuilder.append("<");
feaBuilder.append(key);
switch (key) {
case “spinlocks”:
feaBuilder.append(" state='" + e.getValue() + "' retries='" + getRetries() + "'/>\n”);
break;
case “vendor_id”:
feaBuilder.append(" state='" + e.getValue() + "' value='KVM Hv'/>\n");
break;
case “stimer”:
feaBuilder.append(" state='" + e.getValue() + "'><direct state='" + e.getValue() + "'/></stimer>\n");
break;
default:
feaBuilder.append(" state='" + e.getValue() + "'/>\n”);
}
There was a problem hiding this comment.
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.
if these have no results we can merge them on recomendation of redhat, but further effort along this line seems mute to me.
|
@vishesh92 @weizhouapache this doesn't address the console performance like I originally thought, should I keep it open or close this? cc @DaanHoogland |
|
@blueorangutan package |
| hyv.setFeature("reenlightenment", true); | ||
| hyv.setFeature("stimer", true); | ||
| hyv.setFeature("ipi", true); | ||
| hyv.setFeature("evmcs", true); |
There was a problem hiding this comment.
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.
hyperv on non-intel-like processors is maybe not so big an issue. We can
- surround with extra code,
- add docs
- never mind that possibility
- drop this PR
I am leaning to the higher numbers, here.
There was a problem hiding this comment.
This is not about hyper-v, this is about hyper-v emulation on KVM itself. This PR isn't necessary given Vishesh's comments.
|
Closing on @vishesh92 's remarks, also the original issue was console slowness which was fixed by other PR. |
|
Still doesn't work :( |
This implements Hyper-V enlightenments as per the RHEL docs: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/configuring_and_managing_windows_virtual_machines/optimizing-windows-virtual-machines#enabling-hyper-v-enlightenments
This is enabled only when the guest OS is set to Windows PV.
This PR is followup of findings and improvements from #10650 (comment)
Tested on: ACS 4.20.1 with Ubuntu 22.04/KVM with Windows 10 ISO, installed Windows 10 VM
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity