qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Some linux kernel with KAISER/KPTI patch can't work under qemu + haxm.
@ 2018-01-04 22:08 lepton
  0 siblings, 0 replies; only message in thread
From: lepton @ 2018-01-04 22:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-04 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04 22:08 [Qemu-devel] Some linux kernel with KAISER/KPTI patch can't work under qemu + haxm lepton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).