qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Some linux kernel with KAISER/KPTI patch can't work under q


From: lepton
Subject: [Qemu-devel] Some linux kernel with KAISER/KPTI patch can't work under qemu + haxm.
Date: Thu, 4 Jan 2018 14:08:57 -0800

It seems for some reason, some linux kernel with KAISER/KPTI patch can't
work with qemu + haxm.
The mainline kernel from Linus is fine. But the patch to 4.4/4.10 doesn't
work.

I am not familiar with HAXM and KPTI either. so not sure if this is a qemu
bug or KPTI bug or haxm bug.

The same kernel works fine under qemu + kvm.

This is the way to reproduce it:

1. Download qemu for windows, follow instructions here:

https://www.qemu.org/2017/11/22/haxm-usage-windows/

2. Build a kernel with KAISER/KPTI,  I am using kernel here:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/log/?h=linux-4.4.y
Or follow instruction here to build a 4.10 kernel:
https://github.com/IAIK/KAISER/tree/master/KAISER

3. Build an ext2 image which has a simple init:
dd of=img count=8192 bs=4096 if=/dev/zero
mke2fs img
gcc --static -o init init.c
debugfs -R "write init init" -w img
cat init.c
#include <stdio.h>
#include <time.h>

int main()
{
        while(1) {
                printf("This is init %d\n", time(NULL));
                sleep(3600);
        }
}

4. copy kernel and disk image generated from 3 to windows and run it:
qemu-system-x86_64.exe -kernel bzImage -hda img -append "init=/init
root=/dev/sda" -serial stdio -accel hax

You will see kernel panic or "vpu shutdown reqeust" to qemu.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]