Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvm port to a 5.15? #54

Closed
asia-makai opened this issue Sep 27, 2022 · 12 comments
Closed

kvm port to a 5.15? #54

asia-makai opened this issue Sep 27, 2022 · 12 comments

Comments

@asia-makai
Copy link

Hi,

I have tried to compile kvm on Ubuntu 22.04. I'm not sure if it's possible without downgrading a loooot.
I wanted to ask if you have by any chance ported the VMI extensions to 5.15?

Thank you!

@Wenzel
Copy link
Member

Wenzel commented Sep 27, 2022

Hi @asia-makai,
I manage to compile this old 5.4 kernel on Ubuntu 22.04, with a few hacks.
Tell me what issue you are running into

@asia-makai
Copy link
Author

asia-makai commented Sep 27, 2022

I've already added a few #pragma to gently ask gcc not to complain too much..
I'm not sure about this problem though:

  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK     include/generated/compile.h
  AS      arch/x86/entry/thunk_64.o
arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table
make[2]: *** [scripts/Makefile.build:348: arch/x86/entry/thunk_64.o] Error 1
make[2]: *** Deleting file 'arch/x86/entry/thunk_64.o'
make[1]: *** [scripts/Makefile.build:500: arch/x86/entry] Error 2
make: *** [Makefile:1690: arch/x86] Error 2

Thanks a million @Wenzel!

@x1tan
Copy link

x1tan commented Sep 27, 2022

It could be possible that you need to downgrade binutils, since the version shipped by Ubuntu 22.04 is too new for the relatively old 5.4 kernel [1].

1: https://www.spinics.net/lists/kernel/msg3797871.html

@asia-makai
Copy link
Author

asia-makai commented Sep 27, 2022

@x1tan Oops, I see.. that's what I've feared. Downgrading binutils causes a domino effect, doesn't it? I.e., won't I end up downgrading half of my packages, incl gcc? Thanks!

@Wenzel
Copy link
Member

Wenzel commented Sep 27, 2022

so by googling the error I stumbled upon this thread:
https://lore.kernel.org/lkml/YAlUUBs2qPIqLgCt@xps-13-7390/T/

Which mentions kernel preemption and playing with the config, I managed to build the kernel on ubuntu 22.04:

./scripts/config --enable PREEMPT

Not sure why it works at this point, didn't dig in, but it's a workaround.

@asia-makai
Copy link
Author

asia-makai commented Sep 30, 2022

Thanks @Wenzel!

I've made further steps, so that it compiles. (Options below). Then I had to disable secure boot in my BIOS (to avoid signing the kernel), but it panics... Have you seen that one with your Ubuntu 22.04 by any chance?

IMG_2922

My config script:

make distclean
make olddefconfig
./scripts/config --enable KVM
./scripts/config --enable KVM_INTEL
./scripts/config --enable KVM_AMD
./scripts/config --enable KVM_INTROSPECTION
./scripts/config --disable TRANSPARENT_HUGEPAGE
./scripts/config --enable REMOTE_MAPPING
./scripts/config --enable PREEMPT


# https://askubuntu.com/questions/1329538/compiling-the-kernel-5-11-11
./scripts/config --disable SYSTEM_TRUSTED_KEYS
./scripts/config --disable SYSTEM_REVOCATION_KEYS

./scripts/config --disable DEBUG_INFO_BTF

@Wenzel
Copy link
Member

Wenzel commented Sep 30, 2022

Are you using XFS as the main partition filesystem by any chance ?

I think i remember having this issue, and the problem was related to a driver fs driver (not present by default on 5.4 kernel, but present on newer ones, which explains why it won't boot)

Have a look at that and regenerate the initramfs

@asia-makai
Copy link
Author

@Wenzel yes, you've seen it all! Impressive :) Thank you! I'll dig further.

@asia-makai
Copy link
Author

I had ext4. It boots now @Wenzel!

Other things I had to do:

  • change COMPRESS to gzip in /etc/initramfs-tools/initramfs.conf,
  • disable RAID in bios (and enable AHCI instead).

I'll see if i manage to get network connection ;)

But I fear that I'll need to port your work to a more recent kernel... Do you have a recommendation or just a meld/diff? (I used to intensively play with a Nitro-like system, but this was 7 years ago ;)) Thank you

@Wenzel
Copy link
Member

Wenzel commented Oct 3, 2022

Awesome news !
Thanks for the tips 👍
Now waiting for your pull requests 💪

Regarding rebasing the patches, that's huge task that you are undertaking, so be careful :)

You might to have a chat with @adlazar on the Slack channel about this.

@asia-makai
Copy link
Author

Thank you for your help! :)

@netanelc305
Copy link

How you deal with new hardware? I encounter a lot of drivers issues since the kernel is old

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants