Provides the ability for the guest to communicate with user-provided code inside QEMU itself.
This backdoor communication channel is based on using instructions, as opposed to methods based on MMIO/PIO or virtproxy/virtagent. Then, these instructions are redirected to a set of user-provided routines, which are expected to be in the static library "libbackdoor.a", identified by the "--with-backdoor" configuration parameter. The advantages of this method are: * Minimal setup for the guest. Can be used with a simple library using LD_PRELOAD, or simply adding calls to the macros in "backdoor/guest.h". * Low-overhead. Using instructions does not go through any OS abstraction, not even for the setup of the communication channel. * Non-intrusive wrt OS. It can be used on any OS without prior modifications. When possible, this will overload unused/meaningless instructions in order to let the modified guest application to run natively without errors (e.g., using the CPUID instruction in x86 systems). v2: Rebase onto latest QEMU version (d33ea50a958b2e050d2b28e5f17e3b55e91c6d74). Signed-off-by: Lluís Vilanova <vilan...@ac.upc.edu> --- Lluís Vilanova (6): [arm m68k] move helpers.h to helper.h backdoor: handle config-time activation backdoor: declare host-side backdoor helpers backdoor: declare guest-side interface macros backdoor: [i386] provide and implement intruction-based backdoor interface backdoor: add a simple example .gitignore | 1 Makefile.target | 40 +++ backdoor/examples/print/README | 13 + backdoor/examples/print/guest/Makefile | 7 backdoor/examples/print/guest/test.c | 33 ++ backdoor/examples/print/host/Makefile | 13 + backdoor/examples/print/host/printcb.c | 36 +++ backdoor/guest.h | 54 ++++ backdoor/helper.h | 21 + configure | 21 + target-arm/helper.c | 2 target-arm/helper.h | 450 ++++++++++++++++++++++++++++++++ target-arm/helpers.h | 450 -------------------------------- target-arm/iwmmxt_helper.c | 2 target-arm/neon_helper.c | 2 target-arm/op_helper.c | 2 target-arm/translate.c | 6 target-i386/cpuid.c | 27 ++ target-i386/helper.h | 4 target-i386/translate.c | 4 target-m68k/helper.c | 2 target-m68k/helper.h | 54 ++++ target-m68k/helpers.h | 54 ---- target-m68k/op_helper.c | 2 target-m68k/translate.c | 6 25 files changed, 786 insertions(+), 520 deletions(-) create mode 100644 backdoor/examples/print/README create mode 100644 backdoor/examples/print/guest/Makefile create mode 100644 backdoor/examples/print/guest/test.c create mode 100644 backdoor/examples/print/host/Makefile create mode 100644 backdoor/examples/print/host/printcb.c create mode 100644 backdoor/guest.h create mode 100644 backdoor/helper.h create mode 100644 target-arm/helper.h delete mode 100644 target-arm/helpers.h create mode 100644 target-m68k/helper.h delete mode 100644 target-m68k/helpers.h