Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Same kernel version module update
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
ladmental
n00b
n00b


Joined: 26 Jun 2021
Posts: 5

PostPosted: Sat Jul 17, 2021 9:17 pm    Post subject: Same kernel version module update Reply with quote

Hello everyone.

Having asked people around and read a bunch of Gentoo Wiki articles on the topic, I am still not able to overcome the problem in short described as inability to build the same kernel version but with new modules. Let me explain.
As I need KVM and Nouveau support on my machine, obviously I had to load modules required for those technologies' support as advised in the Wiki. However, once I run virt-install, it complains about not finding KVM support on my machine. Some troubleshooting led me to the fact that nothing KVM needs is loaded into my kernel:
Code:
localhost ~ # lsmod | grep -i kvm
localhost ~ #
localhost ~ # grep -i kvm /proc/config.gz
localhost ~ #

Same thing with Nouveau.

My setup:
Kernel version is 5.10.27-gentoo-x86_64.
Necessary modules are configured in the /usr/src/linux directory.
Code:
localhost ~ # grep -i kvm /usr/src/linux/.config
CONFIG_KVM_GUEST=y
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_HAVE_KVM_NO_POLL=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM=y
CONFIG_KVM_INTEL=y
CONFIG_KVM_AMD=m
# CONFIG_KVM_AMD_SEV is not set
CONFIG_KVM_MMU_AUDIT=y
CONFIG_PTP_1588_CLOCK_KVM=m
CONFIG_DRM_I915_GVT_KVMGT=m
localhost ~ # grep -i nouveau /usr/src/linux/.config
CONFIG_DRM_NOUVEAU=y
# CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT is not set
CONFIG_NOUVEAU_DEBUG=5
CONFIG_NOUVEAU_DEBUG_DEFAULT=3
# CONFIG_NOUVEAU_DEBUG_MMU is not set
# CONFIG_NOUVEAU_DEBUG_PUSH is not set
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
# CONFIG_DRM_NOUVEAU_SVM is not set

Kernel symlink:
Code:
localhost ~ # eselect kernel list
Available kernel symlink targets:
  [1]   linux-5.10.27-gentoo *


What I attempted to overcome the problem:
1. Load KVM-related modules via modprobe:
Code:
localhost ~ # modprobe kvm
localhost ~ # modprobe kvm_intel

Although did not error out, this has not changed anything as neither /proc/config.gz nor lsmod started showing those KVM modules.
2. Rebuild kernel. As you have seen above, I already have necessary modules activated in the .config file, so there is no need to go through menuconfig again.
Code:
mount -U "UUID-OF-MY-BOOT-PARTITION" /boot
cd /usr/src/linux
make -j6 && make -j6 modules_install && make -j6 install && emerge @module-rebuild && genkernel --luks --lvm --no-zfs --kernel-config=/usr/src/linux/.config initramfs

I then backed up and removed all files in /boot with ".old" in names. Did not follow up with grub-mkconfig because 1) grub.cfg points to the files without ".old" already and 2) kernel version has not changed.
Next, I shut the machine down completely, started it again, logged in, and ran lsmod | grep -i kvm just to see if anything has changed. Unfortunately, nothing has.

Have a feeling that I am missing something significant. If so, what exactly?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Jul 17, 2021 9:24 pm    Post subject: Reply with quote

ladmental,

Welcome to Gentoo.

Code:
/proc/config.gz
tells you about the kernel you are running.
Code:
/usr/src/linux/.config
is the kernel you are working on.

They need not be the same kernel.

What does
Code:
uname -a
tell?
Code:
$ uname -a
Linux NeddySeagoon_Static 5.12.13-gentoo #1 SMP PREEMPT Fri Jun 25 14:53:48 BST 2021 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux


The date and time are the build time of the running kernel.
Think about when you last built your kernel ... does it look right or are you running an old kernel?
_________________
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
ladmental
n00b
n00b


Joined: 26 Jun 2021
Posts: 5

PostPosted: Sat Jul 17, 2021 9:31 pm    Post subject: Reply with quote

Thanks for a quick reply.

Quite sure I am running the just updated kernel:
Code:
localhost ~ # uname -a
Linux localhost 5.10.27-gentoo-x86_64 #2 SMP Sat Jul 17 15:05:21 EDT 2021 x86_64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz GenuineIntel GNU/Linux
localhost ~ # ls -l /usr/src/linux/.config
-rw-r--r-- 1 root root 223562 Jul 17 14:39 /usr/src/linux/.config

# Just in case there is a mismatch for whatever reason:
localhost ~ # ls -l /usr/src/linux-5.10.27-gentoo/.config
-rw-r--r-- 1 root root 223562 Jul 17 14:39 /usr/src/linux-5.10.27-gentoo/.config
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Jul 17, 2021 9:51 pm    Post subject: Reply with quote

Code:
CONFIG_KVM=y
CONFIG_KVM_INTEL=y

You built these into kernel, therefore lsmod will not show them.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Jul 17, 2021 9:52 pm    Post subject: Reply with quote

ladmental,

That all looks good.

What does
Code:
ls -l /boot
show?
Both with /boot mounted and without.

What do you have in /boot/grub/grub.cfg ?


You don't need to do
Code:
mount -U "UUID-OF-MY-BOOT-PARTITION" /boot

Code:
mount /boot
will consult /etc/fstab for the missing information.
_________________
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
ladmental
n00b
n00b


Joined: 26 Jun 2021
Posts: 5

PostPosted: Sat Jul 17, 2021 10:11 pm    Post subject: Reply with quote

Jaglover's suggestion made me try to run virt-install as root rather than regular user (even though that user is a member of libvirt group and I followed the Wiki QEMU guide). Surprisingly, it worked flawlessly and virt-install did not complain about KVM being unavailable. Will have to get to the bottom of this permission issue in some other thread to not start an offtopic discussion.
Question: using NeddySeagoon's comment about /usr/src/linux/.config being the kernel I am working on, would it be correct to assume that in case there is a need to see what modules kernel is running regardless if they are built in or not, I am to review .config (on condition that currently running kernel was built using it, of course)? If not, what is the option to see all kernel components?

At this point, I think that my problem is resolved and I did everything right. However, I will respond to NeddySeagoon's latest post for completeness sake.
Code:
localhost ~ # ls -l /boot
total 8
drwxr-xr-x 2 root root 4096 Jun 25 16:07 efi
drwxr-xr-x 2 root root 4096 Jul  1 00:55 grub
localhost ~ # mount /boot
localhost ~ # ls -l /boot
total 28652
-rwxr-xr-x 1 root root   223562 Jul 17 15:47 config-5.10.27-gentoo-x86_64
drwxr-xr-x 3 root root     4096 Jun 26 01:23 efi
drwxr-xr-x 6 root root     4096 Jul 17 15:18 grub
-rwxr-xr-x 1 root root 12662180 Jul 17 15:47 initramfs-5.10.27-gentoo-x86_64.img
-rwxr-xr-x 1 root root  5592056 Jul 17 15:47 System.map-5.10.27-gentoo-x86_64
-rwxr-xr-x 1 root root 10844032 Jul 17 15:47 vmlinuz-5.10.27-gentoo-x86_64


Since grub.cfg is quite large, I will not paste it here in full. Instead, here is the "boot into Gentoo" menu item part:
Code:
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-17517a9b-ea4a-4bbe-b25a-ff8ef36ef2c1' {
   load_video
   if [ "x$grub_platform" = xefi ]; then
      set gfxpayload=keep
   fi
   insmod gzio
   insmod part_gpt
   insmod fat
   search --no-floppy --fs-uuid --set=root 34CE-9848
   echo   'Loading Linux 5.10.27-gentoo-x86_64 ...'
   linux   /vmlinuz-5.10.27-gentoo-x86_64 root=/dev/mapper/vg1-root ro dolvm crypt_root=UUID=a0262a46-3c37-463b-8577-45eccb512b60 root_trim=yes rootdelay=3
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-5.10.27-gentoo-x86_64.img
}


Thanks a lot for your help!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Jul 17, 2021 10:16 pm    Post subject: Reply with quote

ladmental wrote:
Question: using NeddySeagoon's comment about /usr/src/linux/.config being the kernel I am working on, would it be correct to assume that in case there is a need to see what modules kernel is running regardless if they are built in or not, I am to review .config (on condition that currently running kernel was built using it, of course)?

Correct. Although there may be out-of-kernel modules which obviously won't be in .config. For instance, if Realtek NIC driver is built using net-misc/r8168.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Jul 17, 2021 10:25 pm    Post subject: Reply with quote

ladmental,

I had it mind that you could have had several Grub menu entries to start Gentoo and were choosing the wrong one.
I am unaware of a command to show all of the loaded kernel modules.
Not all 'modules' can be built as loadable modules.

However, its not an error to modprobe something that is built in. Modprobe does nothing and returns success. That's just as it does with an already loaded module.
If the module was not loaded, modprobe loads it or reports an error.

My /dev/kvm node looks like
Code:
$ ls /dev/kvm -l
crw-rw---- 1 root kvm 10, 232 Dec 30  2017 /dev/kvm

udev should have a rule to set the group ownership but I don't have udev.
_________________
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
ladmental
n00b
n00b


Joined: 26 Jun 2021
Posts: 5

PostPosted: Sat Jul 17, 2021 10:55 pm    Post subject: Reply with quote

Looks like I missed the step in which one is to add a regular user to group kvm for virt-install to have KVM acceleration available without root privileges.
Thanks again.
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