qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

accel: Move Xen accelerator code under accel/xen/

This code is not related to hardware emulation.
Move it under accel/ with the other hypervisors.

Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200508100222.7112-1-philmd@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Philippe Mathieu-Daudé and committed by
Paolo Bonzini
da278d58 23accdf1

+63 -26
+2
MAINTAINERS
··· 440 440 L: xen-devel@lists.xenproject.org 441 441 S: Supported 442 442 F: */xen* 443 + F: accel/xen/* 443 444 F: hw/9pfs/xen-9p* 444 445 F: hw/char/xen_console.c 445 446 F: hw/display/xenfb.c ··· 453 454 F: hw/pci-host/xen_igd_pt.c 454 455 F: include/hw/block/dataplane/xen* 455 456 F: include/hw/xen/ 457 + F: include/sysemu/xen.h 456 458 F: include/sysemu/xen-mapcache.h 457 459 458 460 Guest CPU Cores (HAXM)
+1
accel/Makefile.objs
··· 2 2 obj-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_POSIX)) += qtest.o 3 3 obj-$(CONFIG_KVM) += kvm/ 4 4 obj-$(CONFIG_TCG) += tcg/ 5 + obj-$(CONFIG_XEN) += xen/ 5 6 obj-y += stubs/
+1
accel/xen/Makefile.objs
··· 1 + obj-y += xen-all.o
+1 -1
hw/acpi/piix4.c
··· 30 30 #include "hw/acpi/acpi.h" 31 31 #include "sysemu/runstate.h" 32 32 #include "sysemu/sysemu.h" 33 + #include "sysemu/xen.h" 33 34 #include "qapi/error.h" 34 35 #include "qemu/range.h" 35 36 #include "exec/address-spaces.h" ··· 41 42 #include "hw/mem/nvdimm.h" 42 43 #include "hw/acpi/memory_hotplug.h" 43 44 #include "hw/acpi/acpi_dev_interface.h" 44 - #include "hw/xen/xen.h" 45 45 #include "migration/vmstate.h" 46 46 #include "hw/core/cpu.h" 47 47 #include "trace.h"
+1
hw/i386/pc.c
··· 57 57 #include "sysemu/tcg.h" 58 58 #include "sysemu/numa.h" 59 59 #include "sysemu/kvm.h" 60 + #include "sysemu/xen.h" 60 61 #include "sysemu/qtest.h" 61 62 #include "sysemu/reset.h" 62 63 #include "sysemu/runstate.h"
+1
hw/i386/pc_piix.c
··· 53 53 #include "cpu.h" 54 54 #include "qapi/error.h" 55 55 #include "qemu/error-report.h" 56 + #include "sysemu/xen.h" 56 57 #ifdef CONFIG_XEN 57 58 #include <xen/hvm/hvm_info_table.h> 58 59 #include "hw/xen/xen_pt.h"
+1
hw/i386/pc_q35.c
··· 36 36 #include "hw/rtc/mc146818rtc.h" 37 37 #include "hw/xen/xen.h" 38 38 #include "sysemu/kvm.h" 39 + #include "sysemu/xen.h" 39 40 #include "hw/kvm/clock.h" 40 41 #include "hw/pci-host/q35.h" 41 42 #include "hw/qdev-properties.h"
+1
hw/i386/xen/xen-hvm.c
··· 28 28 #include "qemu/range.h" 29 29 #include "sysemu/runstate.h" 30 30 #include "sysemu/sysemu.h" 31 + #include "sysemu/xen.h" 31 32 #include "sysemu/xen-mapcache.h" 32 33 #include "trace.h" 33 34 #include "exec/address-spaces.h"
+1
hw/i386/xen/xen_platform.c
··· 33 33 #include "hw/xen/xen-legacy-backend.h" 34 34 #include "trace.h" 35 35 #include "exec/address-spaces.h" 36 + #include "sysemu/xen.h" 36 37 #include "sysemu/block-backend.h" 37 38 #include "qemu/error-report.h" 38 39 #include "qemu/module.h"
+1
hw/isa/piix3.c
··· 28 28 #include "hw/irq.h" 29 29 #include "hw/isa/isa.h" 30 30 #include "hw/xen/xen.h" 31 + #include "sysemu/xen.h" 31 32 #include "sysemu/sysemu.h" 32 33 #include "sysemu/reset.h" 33 34 #include "sysemu/runstate.h"
+1
hw/pci/msix.c
··· 19 19 #include "hw/pci/msix.h" 20 20 #include "hw/pci/pci.h" 21 21 #include "hw/xen/xen.h" 22 + #include "sysemu/xen.h" 22 23 #include "migration/qemu-file-types.h" 23 24 #include "migration/vmstate.h" 24 25 #include "qemu/range.h"
+1 -1
hw/xen/Makefile.objs
··· 1 1 # xen backend driver support 2 - common-obj-$(CONFIG_XEN) += xen-legacy-backend.o xen_devconfig.o xen_pvdev.o xen-common.o xen-bus.o xen-bus-helper.o xen-backend.o 2 + common-obj-$(CONFIG_XEN) += xen-legacy-backend.o xen_devconfig.o xen_pvdev.o xen-bus.o xen-bus-helper.o xen-backend.o 3 3 4 4 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o 5 5 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o
+8
hw/xen/xen-common.c accel/xen/xen-all.c
··· 16 16 #include "hw/xen/xen_pt.h" 17 17 #include "chardev/char.h" 18 18 #include "sysemu/accel.h" 19 + #include "sysemu/xen.h" 19 20 #include "sysemu/runstate.h" 20 21 #include "migration/misc.h" 21 22 #include "migration/global_state.h" ··· 30 31 #define DPRINTF(fmt, ...) \ 31 32 do { } while (0) 32 33 #endif 34 + 35 + static bool xen_allowed; 36 + 37 + bool xen_enabled(void) 38 + { 39 + return xen_allowed; 40 + } 33 41 34 42 xc_interface *xen_xc; 35 43 xenforeignmemory_handle *xen_fmem;
+1 -1
include/exec/ram_addr.h
··· 21 21 22 22 #ifndef CONFIG_USER_ONLY 23 23 #include "cpu.h" 24 - #include "hw/xen/xen.h" 24 + #include "sysemu/xen.h" 25 25 #include "sysemu/tcg.h" 26 26 #include "exec/ramlist.h" 27 27 #include "exec/ramblock.h"
-11
include/hw/xen/xen.h
··· 20 20 extern enum xen_mode xen_mode; 21 21 extern bool xen_domid_restrict; 22 22 23 - extern bool xen_allowed; 24 - 25 - static inline bool xen_enabled(void) 26 - { 27 - return xen_allowed; 28 - } 29 - 30 23 int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num); 31 24 void xen_piix3_set_irq(void *opaque, int irq_num, int level); 32 25 void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len); ··· 38 31 void xenstore_store_pv_console_info(int i, struct Chardev *chr); 39 32 40 33 void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory); 41 - 42 - void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, 43 - struct MemoryRegion *mr, Error **errp); 44 - void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length); 45 34 46 35 void xen_register_framebuffer(struct MemoryRegion *mr); 47 36
+38
include/sysemu/xen.h
··· 1 + /* 2 + * QEMU Xen support 3 + * 4 + * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 + * See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef SYSEMU_XEN_H 9 + #define SYSEMU_XEN_H 10 + 11 + #ifdef CONFIG_XEN 12 + 13 + bool xen_enabled(void); 14 + 15 + #ifndef CONFIG_USER_ONLY 16 + void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length); 17 + void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, 18 + struct MemoryRegion *mr, Error **errp); 19 + #endif 20 + 21 + #else /* !CONFIG_XEN */ 22 + 23 + #define xen_enabled() 0 24 + #ifndef CONFIG_USER_ONLY 25 + static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) 26 + { 27 + /* nothing */ 28 + } 29 + static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, 30 + MemoryRegion *mr, Error **errp) 31 + { 32 + g_assert_not_reached(); 33 + } 34 + #endif 35 + 36 + #endif /* CONFIG_XEN */ 37 + 38 + #endif
+1 -1
migration/savevm.c
··· 28 28 29 29 #include "qemu/osdep.h" 30 30 #include "hw/boards.h" 31 - #include "hw/xen/xen.h" 32 31 #include "net/net.h" 33 32 #include "migration.h" 34 33 #include "migration/snapshot.h" ··· 59 58 #include "sysemu/replay.h" 60 59 #include "sysemu/runstate.h" 61 60 #include "sysemu/sysemu.h" 61 + #include "sysemu/xen.h" 62 62 #include "qjson.h" 63 63 #include "migration/colo.h" 64 64 #include "qemu/bitmap.h"
+1 -1
softmmu/vl.c
··· 36 36 #include "sysemu/runstate.h" 37 37 #include "sysemu/seccomp.h" 38 38 #include "sysemu/tcg.h" 39 + #include "sysemu/xen.h" 39 40 40 41 #include "qemu/error-report.h" 41 42 #include "qemu/sockets.h" ··· 178 179 static NotifierList machine_init_done_notifiers = 179 180 NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers); 180 181 181 - bool xen_allowed; 182 182 uint32_t xen_domid; 183 183 enum xen_mode xen_mode = XEN_EMULATE; 184 184 bool xen_domid_restrict;
-9
stubs/xen-hvm.c
··· 35 35 return 0; 36 36 } 37 37 38 - void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, 39 - Error **errp) 40 - { 41 - } 42 - 43 38 qemu_irq *xen_interrupt_controller_init(void) 44 39 { 45 40 return NULL; 46 41 } 47 42 48 43 void xen_register_framebuffer(MemoryRegion *mr) 49 - { 50 - } 51 - 52 - void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) 53 44 { 54 45 } 55 46
+1 -1
target/i386/cpu.c
··· 29 29 #include "sysemu/reset.h" 30 30 #include "sysemu/hvf.h" 31 31 #include "sysemu/cpus.h" 32 + #include "sysemu/xen.h" 32 33 #include "kvm_i386.h" 33 34 #include "sev_i386.h" 34 35 ··· 54 55 #include "hw/i386/topology.h" 55 56 #ifndef CONFIG_USER_ONLY 56 57 #include "exec/address-spaces.h" 57 - #include "hw/xen/xen.h" 58 58 #include "hw/i386/apic_internal.h" 59 59 #include "hw/boards.h" 60 60 #endif