qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] How to inject interrupts and modify memory in QEMU from ext


From: Ciro Santilli
Subject: [Qemu-devel] How to inject interrupts and modify memory in QEMU from external asynchronous interfaces like QMP and QAPI?
Date: Tue, 30 May 2017 07:16:46 +0100

I want to create models for external hardware devices.

If interrupts generation and memory modification were possible with
serialized asynchronous APIs like QMP / QAPI, then I would be able to:

- write the models in any language I want
- not need to patch QEMU source code, and keep all my changes off tree

I'm aware of in-tree devices as explained at:
https://stackoverflow.com/questions/28315265/how-to-add-a-new-device-in-qemu-source-code
which are the traditional way of doing things.

What I've found so far:

- interrupts: could only find NMI generation with the `nmi` monitor command
- IO ports: IO possible with `i` and `o` monitor commands, so I'm fine there
- main memory:
    - the ideal solution would be to map memory to host directly, but
that seems hard:
        - 
<http://kvm.vger.kernel.narkive.com/rto1dDqn/sharing-variables-memory-between-host-and-guest>
        - <https://www.linux-kvm.org/images/e/e8/0.11.Nahanni-CamMacdonell.pdf>
        - <http://www.fp7-save.eu/papers/SCALCOM2016.pdf>
    - memory read is possible through the `x` and `xp` monitor commands
    - could not find how to write to memory with monitor commands. But
I think the GDB API supports, so it should not be too hard to
implement.

The closest working piece of code I could find was:
<https://github.com/texane/vpcie> , which serializes PCI on both
sides, and sends it through QEMU's TCP API. But this is more
inefficient, and requires extra setup on both guest and host.

Also asked on Stack Overflow:
https://stackoverflow.com/questions/44254790/how-to-inject-interrupts-and-modify-memory-in-qemu-from-external-asynchronous-in



reply via email to

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