Hi Nobotu,
thanks for this high quality bug report.

I'm glad that running "rmmod kvm_intel && modprobe kvm_intel" later worked for 
you.
I was having different thoughts on this separated in the sections below ...

---

The obvious solution that is true for most kind initialization issues
would be to reboot after install which also works reliable. I'm only not
suggesting this as a real fix I generally dislike reboots :-)

---

Unfortunately the postinst isn't allowed to "wait a while until it
resolves" so I'm not going that way. Surely we could do a fast non
sleeping loop, but that will not make it reliable which is what you'd
want. After all you already know that with your manual reload you
already can enable it.

Could you give it a try if a (almost) non sleeping retry will fix your issue 
"statistically reliable"?
We'd know then a bit more about the size of that race window.
Let me know if you need my help for a custom build with that.

Heads up - this surely won't be an SRU on its own.
For something not really supported I'd not want to trigger everyone to download 
a new version. But there are enough that we could tuck it along.


---

Please be reminded that strictly speaking and in general nested is "as
good as possible but not supported" [1]. But that never stopped us from
helping as much as possible.


Things got much better going forward in regard to nested support and I'm 
confident that it might be supported soon and then also enabled by default in 
the module which will eliminate all of this potential toggle issue.
That will is available quite some time for AMD (>2.6.32) and be available with 
kernel >4.20 [2] for Intel as the default. And since then it got even more 
stable, so for Bionic if using nested consider using the HWE kernels.

---

There is another option which is to stay at 4.15 but override the default.
You could obviously drop in an /etc/modprobe.d/*.conf before kvm_intel is ever 
loaded.
Even earlier you can set kernel commandline kvm_intel.nested=1 which will flip 
the default from 0 to 1 and avoid later races.

That is part of controlling your deployment, but might be an option if
upgrading to the HWE kernel isn't a valid option for you.

---

I think the best options you have in order are:
1. using the HWE kernel this is available right now and will work right away (I 
prefer that as you also get plenty of fixes for nested).
2. control your deployment by overriding the default as kernel commandline. 
That will also make sure that it is 1 right from the beginning.
3. reboot after install, silly but effective and for some people it might be 
preferred
3. We can try the retry loop approach but I'm not really convinced of it, and 
after all the SRU team might even like it less and reject it.

Let me know what you think and if #1 or #2 will work for you.
If you insist on trying #4 let me know if you need my support for a test build.


P.S. since >=Cosmic had a recent enough kernel I'll mark it Fix released but 
add a Bionic task.

[1]: 
https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/qemu-system-x86.README.Debian?h=ubuntu/bionic-devel
[2]: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1e58e5e59148916fa43444a406335a990783fb78

** Changed in: qemu (Ubuntu)
       Status: New => Incomplete

** Changed in: qemu (Ubuntu)
       Status: Incomplete => Fix Released

** Also affects: qemu (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Changed in: qemu (Ubuntu Bionic)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1853465

Title:
  Inconsistent nested KVM status with race conditions across multiple
  hosts: rmmod: ERROR: Module kvm_intel is in use

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1853465/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to