[Top][All Lists]

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

Re: [Qemu-discuss] Test device driver of new machine in qemu by syzkalle

From: 韩雨哲
Subject: Re: [Qemu-discuss] Test device driver of new machine in qemu by syzkaller
Date: Thu, 12 Jan 2017 05:50:31 +0000

Thanks for your reply!
I have found that qemu uses tcg to translate target code.
Now my problem is that I only want to fuzz test the syscalls to cover logic and process in the driver code, but I don't care what the device returns or even if the device exists. And then with qemu I can run the tests distributed in a server cluster or cloud.
Can I run into the driver without emulate the device strictly? What can I do to emulate the devices as simple as possible?
Peter Maydell <address@hidden>于2017年1月12日 周四上午1:24写道:
On 11 January 2017 at 12:55, 韩雨哲 <address@hidden> wrote:
> Hi,all:
> I am trying to test the device driver and related syscalls in arm64
> qemu.There are some problems:
> 1.The kernel cannot run when I set "machine" to "virt" and load my own dtb
> file.

Why do you want to do that? Generally for the 'virt' machine
you should just let QEMU autogenerate the DTB, which it does
by default.

> I added some trace print in the qemu source code, and I can see that qemu
> has loaded all the images and prepared vcpus and mem, and then it hang up in
> "main_loop".
> Is there a tool I can use to debug the qemu, see if vcpu is running to load
> kernel and where the error occurs?

"Appears to just hang" almost always means "QEMU is running
fine but your guest has crashed or gone into a loop without
getting round to producing any output". Debug is as usual for
initial kernel bringup on hardware (ie very painful).

> 2.I compiled the qemu with "enable-kvm",but it seems that
> the kvm related  source codes are not compiled into the
> executable file. I doubt which virtualization hypervisor
> does it used?

--enable-kvm is for KVM. You will need to be running on an
ARM host machine to use it, though (just as KVM for x86
only works for x86 guests on x86 hosts).

> 3.Can I make a dts file contains my own devices to load in
> qemu and trigger the device driver?

Unless you also write code in QEMU to actually emulate those
devices, then there's no point having the device tree file
claim that they exist, because all that will happen is that
the kernel will try to probe empty space and fall over.
(If you write the code in QEMU to implement the devices then you
can also write the code that puts the info in the device
tree for them.) NB: for PCI devices and similar pluggable
and probeable busses, you don't need to describe them in
the dts at all -- the kernel will just scan the PCI bus.

-- PMM

reply via email to

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