You are not logged in.

#1 2017-03-10 15:30:55

apetresc
Member
From: Toronto, Canada
Registered: 2017-01-26
Posts: 14
Website

Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

So, my understanding is that the VT extensions that some Intel/AMD processors have can only be used by one hypervisor at a time. My question is, what sequence of events leads to a hypervisor "acquiring" the VT "lock" (I have no idea if this is the right terminology), and when is that lock "released"?

For example, if the kvm and kvm_intel modules are loaded at boot, but with nothing actually using them (like qemu), and then I run VMWare Player (which loads the vmmon kernel module), and start a VMWare VM, is that VMWare VM using VT? Or did KVM hog it? If I were to `modprobe -r kvm_intel kvm`, and then restart the VMWare VM, would that be enough to release and re-acquire VT? Or do I basically have to blacklist kvm and kvm_intel from ever being loaded, in modprobe.conf?

Alternatively, is there a way to just get visibility into whether VMWare thinks it is using VT or not?

Offline

#2 2017-03-10 21:03:18

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

I can't answer your question, but the solution is to only have one hypervisor installed at a time. Why would you need more?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-03-10 22:56:42

apetresc
Member
From: Toronto, Canada
Registered: 2017-01-26
Posts: 14
Website

Re: Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

slithery wrote:

I can't answer your question, but the solution is to only have one hypervisor installed at a time. Why would you need more?

I'd be fine with that, but the KVM modules seem to be installed in the default kernel in core/linux. That's why I'm asking, to know if I need to blacklist kvm and kvm_intel in modprobe.conf or if I can just let it be.

Offline

#4 2017-03-11 16:39:53

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,925

Re: Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

The majority of Kernel modules can be unloaded when needed.

The output below makes clear that all kvm related modules on AL are built als module and can be removed with rrmod if needed.
just leave them alone.

$ zcat /proc/config.gz | grep -i kvm
CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
CONFIG_DRM_I915_GVT_KVMGT=m
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_MMU_AUDIT=y
CONFIG_KVM_DEVICE_ASSIGNMENT=y
$ 

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2017-03-11 16:46:11

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

AFAIK the kvm modules are only loaded if specifically enabled, if you haven't done this then VMware will run OK.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2017-03-11 17:38:51

apetresc
Member
From: Toronto, Canada
Registered: 2017-01-26
Posts: 14
Website

Re: Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

Lone_Wolf wrote:

The output below makes clear that all kvm related modules on AL are built als module and can be removed with rrmod if needed.
just leave them alone.

Thanks for the reply smile Yes, unloading them before running VMWare (and thus loading vmmon) is exactly what I've been doing. I know they can be unloaded (though I'm using `modprobe -r` instead, I assume that's basically the same thing). My main question was: does unloading KVM with `modprobe -r` release the VT lock, or no?

slithery wrote:

AFAIK the kvm modules are only loaded if specifically enabled, if you haven't done this then VMware will run OK.

I might be forgetting something, but I'm 90% sure the KVM modules on (both of) my machines were loaded by default after installing Arch, none of the packages I queried seemed to require it.

Offline

#7 2017-03-11 17:53:28

apetresc
Member
From: Toronto, Canada
Registered: 2017-01-26
Posts: 14
Website

Re: Does KVM 'reserve' VT extensions at module load-time or at VM runtime?

I think I may have answered the second part of my question: by looking at the VMWare log that is co-located with the VMDK itself, I can see:

2017-03-11T09:25:31.040-05:00| vcpu-0| I125: Intel VT: VPID enabled.
2017-03-11T09:25:31.040-05:00| vcpu-0| I125: Intel VT enabled.

for both vcpu's I enabled for that VM. This is on a boot that I had KVM blacklisted on, so I can just experiment with un-blacklisting it, `modprobe -r kvm_intel kvm` manually, and then booting up VMWare and checking the log for that. So that should settle it.

Offline

Board footer

Powered by FluxBB