Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kvm without module?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
siaton
n00b
n00b


Joined: 15 Oct 2013
Posts: 16

PostPosted: Sun Jan 05, 2014 8:08 pm    Post subject: kvm without module? Reply with quote

I tried to use kvm/qemu but qemu complains about missing kvm support. In fact there is no /dev/kvm although my processor supports hw virtualisation:

Quote:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 15
Model: 67
Stepping: 3
CPU MHz: 2799.957
BogoMIPS: 5600.30
Virtualization: AMD-V
L1d cache: 64K
L1i cache: 64K
L2 cache: 1024K
NUMA node0 CPU(s): 0,1


I have disabled module loading in my hardened 3.10 kernel but activated KVM support:

Quote:
CONFIG_KVM_GUEST=y
CONFIG_HAVE_KVM=y


Just wondering if KVM is only available through loading the appropriate kernel module - in my case probably kvm_amd.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31341
Location: 56N 3W

PostPosted: Sun Jan 05, 2014 9:07 pm    Post subject: Reply with quote

siaton,

You need to get KVM support on the host (bare hardware) before you can start a Virtual Machine.

Code:
/usr/src/linux $ grep KVM .config
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM=y
CONFIG_KVM_AMD=y
CONFIG_KVM_DEVICE_ASSIGNMENT=y

To get the best out of KVM, you need the VIRTIO drivers. This avoids the use of emulated hardware.
Code:
usr/src/linux $ grep VIRT .config
CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_VIRT_TO_BUS=y
CONFIG_VIRTIO_BLK=m
# CONFIG_VIRTIO_NET is not set
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_SND_VIRTUOSO is not set
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO=m
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MMIO=m
# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set
# CONFIG_DEBUG_VIRTUAL is not set
CONFIG_VIRTUALIZATION=y


I have 4 or 5 kvms running an a HP Microserver. I can post the .config files for the bare hardware and a KVM if you like.
Its all gentoo-hardened
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
siaton
n00b
n00b


Joined: 15 Oct 2013
Posts: 16

PostPosted: Tue Jan 07, 2014 7:44 pm    Post subject: Reply with quote

Please let me know your host/guest config files.

I didn't saw the KVM options you mentioned in my kernel config (3.10). I guess something went wrong when I used "make oldconfig".

Thanks for the hint.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31341
Location: 56N 3W

PostPosted: Tue Jan 07, 2014 8:35 pm    Post subject: Reply with quote

siaton,

This is the bare metal config.

I seem to be having VM problems. They all work but none of them want to run wgetpaste
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
guoyingshou
n00b
n00b


Joined: 08 Jan 2014
Posts: 2

PostPosted: Wed Jan 08, 2014 4:24 am    Post subject: I don't see CONFIG_KVM_INTEL entry in my .config file Reply with quote

I'm using gentoo-sources-3.10.25, my CHOST is CHOST="x86_64-pc-linux-gnu".

After make menuconfig, under [*] Virtualization ---> , there is only one item configurable: <M> Host kernel accelerator for virtio net.

In the document http://wiki.gentoo.org/wiki/QEMU, there seems to have more configurable items:

<*> KVM for Intel processors support
<*> KVM for AMD processors support
...

However, my menuconfig misses the said items.

Can anyone help me figure out what's wrong with my kernel?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31341
Location: 56N 3W

PostPosted: Wed Jan 08, 2014 9:14 pm    Post subject: Reply with quote

guoyingshou,

I'm all AMD and I have
Code:
  │ ┌────────────────────────────────────────────────────────────────────────┐ │ 
  │ │    --- Virtualization                                                  │ │ 
  │ │    <*>   Kernel-based Virtual Machine (KVM) support                    │ │ 
  │ │    <*>     KVM for AMD processors support                              │ │ 
  │ │    [*]     KVM legacy PCI device assignment support                    │ │ 
  │ │    <M>   Host kernel accelerator for virtio net


The help says
Code:
  ┌────────────────────── KVM for AMD processors support ──────────────────────┐
  │ CONFIG_KVM_AMD:                                                            │ 
  │                                                                            │ 
  │ Provides support for KVM on AMD processors equipped with the AMD-V         │ 
  │ (SVM) extensions.                                                          │ 
  │                                                                            │ 
  │ To compile this as a module, choose M here: the module                     │ 
  │ will be called kvm-amd.                                                    │ 
  │                                                                            │ 
  │ Symbol: KVM_AMD [=y]                                                       │ 
  │ Type  : tristate                                                           │ 
  │ Prompt: KVM for AMD processors support                                     │ 
  │   Location:                                                                │ 
  │     -> Virtualization (VIRTUALIZATION [=y])                                │ 
  │       -> Kernel-based Virtual Machine (KVM) support (KVM [=y])             │ 
  │   Defined at arch/x86/kvm/Kconfig:67                                       │ 
  │   Depends on: VIRTUALIZATION [=y] && KVM [=y]

Unless the Depends on: evaluates to true, tho option will be hidden.

If I cheat a little and use maxe xconfig, so I can see hidden options, I can get
Code:
KVM for Intel processors support (KVM_INTEL)

CONFIG_KVM_INTEL:

Provides support for KVM on Intel processors equipped with the VT
extensions.

To compile this as a module, choose M here: the module
will be called kvm-intel.

Symbol: KVM_INTEL [=n]
Type : tristate
Prompt: KVM for Intel processors support
Location:
-> Virtualization (VIRTUALIZATION [=y])
-> Kernel-based Virtual Machine (KVM) support (KVM [=y])
Defined at arch/x86/kvm/Kconfig:55
Depends on: VIRTUALIZATION [=y] && KVM [=y] && CPU_SUP_INTEL [=n]

Notice that CPU_SUP_INTEL [=n], so the KVM for Intel processors support menu item does not appear for me.

It looks as if you have KVM off. Its help says
Code:
Kernel-based Virtual Machine (KVM) support (KVM)

CONFIG_KVM:

Support hosting fully virtualized guest machines using hardware
virtualization extensions. You will need a fairly recent
processor equipped with virtualization extensions. You will also
need to select one or more of the processor modules below.

This module provides access to the hardware capabilities through
a character device node named /dev/kvm.

To compile this as a module, choose M here: the module
will be called kvm.

If unsure, say N.

Symbol: KVM [=y]
Type : tristate
Prompt: Kernel-based Virtual Machine (KVM) support
Location:
-> Virtualization (VIRTUALIZATION [=y])
Defined at arch/x86/kvm/Kconfig:20
Depends on: VIRTUALIZATION [=y] && HAVE_KVM [=y] && HIGH_RES_TIMERS [=y] && NET [=y]
Selects: PREEMPT_NOTIFIERS [=y] && MMU_NOTIFIER [=y] && ANON_INODES [=y] && HAVE_KVM_IRQCHIP [=y] && HAVE_KVM_IRQ_ROUTING [=y] && HAVE_KVM_EVENTFD [=y] && KVM_APIC_ARCHITECTURE [=y] && KVM_ASYNC_PF [=y] && USER_RETURN_NOTIFIER [=y] && KVM_MMIO [=y] && TASKSTATS [=y] && TASK_DELAY_ACCT [=y] && PERF_EVENTS [=y] && HAVE_KVM_MSI [=y] && HAVE_KVM_CPU_RELAX_INTERCEPT [=y]

Likewise, if its depens on is false, it will be hidden, so check Depends on: VIRTUALIZATION [=y] && HAVE_KVM [=y] && HIGH_RES_TIMERS [=y] && NET [=y]. My guess is that you are missing HIGH_RES_TIMERS.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
guoyingshou
n00b
n00b


Joined: 08 Jan 2014
Posts: 2

PostPosted: Thu Jan 09, 2014 3:05 am    Post subject: Reply with quote

NeddySeagoon,

Thanks for your help. My case is exactly as you point out that I missed HIGH_RES_TIMERS. As soon as I enabled it, the missing kvm_intel appears.

Best,

guoyingshou
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum