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

refer to FWCfgState explicitly

Currently some places use pointer-to-void even though they mean
pointer-to-FWCfgState. Clean them up.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Laszlo Ersek and committed by
Michael S. Tsirkin
a88b362c edf9735e

+33 -29
+1 -1
hw/acpi/piix4.c
··· 447 447 448 448 i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, 449 449 qemu_irq sci_irq, qemu_irq smi_irq, 450 - int kvm_enabled, void *fw_cfg) 450 + int kvm_enabled, FWCfgState *fw_cfg) 451 451 { 452 452 PCIDevice *dev; 453 453 PIIX4PMState *s;
+1 -1
hw/core/loader.c
··· 733 733 return 0; 734 734 } 735 735 736 - void rom_set_fw(void *f) 736 + void rom_set_fw(FWCfgState *f) 737 737 { 738 738 fw_cfg = f; 739 739 }
+1 -1
hw/i386/multiboot.c
··· 124 124 s->mb_mods_count++; 125 125 } 126 126 127 - int load_multiboot(void *fw_cfg, 127 + int load_multiboot(FWCfgState *fw_cfg, 128 128 FILE *f, 129 129 const char *kernel_filename, 130 130 const char *initrd_filename,
+3 -1
hw/i386/multiboot.h
··· 1 1 #ifndef QEMU_MULTIBOOT_H 2 2 #define QEMU_MULTIBOOT_H 3 3 4 - int load_multiboot(void *fw_cfg, 4 + #include "hw/nvram/fw_cfg.h" 5 + 6 + int load_multiboot(FWCfgState *fw_cfg, 5 7 FILE *f, 6 8 const char *kernel_filename, 7 9 const char *initrd_filename,
+12 -12
hw/i386/pc.c
··· 595 595 return x86_cpu_apic_id_from_index(max_cpus - 1) + 1; 596 596 } 597 597 598 - static void *bochs_bios_init(void) 598 + static FWCfgState *bochs_bios_init(void) 599 599 { 600 - void *fw_cfg; 600 + FWCfgState *fw_cfg; 601 601 uint8_t *smbios_table; 602 602 size_t smbios_len; 603 603 uint64_t *numa_fw_cfg; ··· 674 674 return size; 675 675 } 676 676 677 - static void load_linux(void *fw_cfg, 677 + static void load_linux(FWCfgState *fw_cfg, 678 678 const char *kernel_filename, 679 679 const char *initrd_filename, 680 680 const char *kernel_cmdline, ··· 1012 1012 } 1013 1013 } 1014 1014 1015 - void *pc_memory_init(MemoryRegion *system_memory, 1016 - const char *kernel_filename, 1017 - const char *kernel_cmdline, 1018 - const char *initrd_filename, 1019 - ram_addr_t below_4g_mem_size, 1020 - ram_addr_t above_4g_mem_size, 1021 - MemoryRegion *rom_memory, 1022 - MemoryRegion **ram_memory) 1015 + FWCfgState *pc_memory_init(MemoryRegion *system_memory, 1016 + const char *kernel_filename, 1017 + const char *kernel_cmdline, 1018 + const char *initrd_filename, 1019 + ram_addr_t below_4g_mem_size, 1020 + ram_addr_t above_4g_mem_size, 1021 + MemoryRegion *rom_memory, 1022 + MemoryRegion **ram_memory) 1023 1023 { 1024 1024 int linux_boot, i; 1025 1025 MemoryRegion *ram, *option_rom_mr; 1026 1026 MemoryRegion *ram_below_4g, *ram_above_4g; 1027 - void *fw_cfg; 1027 + FWCfgState *fw_cfg; 1028 1028 1029 1029 linux_boot = (kernel_filename != NULL); 1030 1030
+1 -1
hw/i386/pc_piix.c
··· 89 89 MemoryRegion *pci_memory; 90 90 MemoryRegion *rom_memory; 91 91 DeviceState *icc_bridge; 92 - void *fw_cfg = NULL; 92 + FWCfgState *fw_cfg = NULL; 93 93 94 94 icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE); 95 95 object_property_add_child(qdev_get_machine(), "icc-bridge",
+1 -1
hw/sparc/sun4m.c
··· 831 831 qemu_irq *cpu_halt; 832 832 unsigned long kernel_size; 833 833 DriveInfo *fd[MAX_FD]; 834 - void *fw_cfg; 834 + FWCfgState *fw_cfg; 835 835 unsigned int num_vsimms; 836 836 837 837 /* init CPUs */
+1 -1
hw/sparc64/sun4u.c
··· 818 818 qemu_irq *ivec_irqs, *pbm_irqs; 819 819 DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; 820 820 DriveInfo *fd[MAX_FD]; 821 - void *fw_cfg; 821 + FWCfgState *fw_cfg; 822 822 823 823 /* init CPUs */ 824 824 cpu = cpu_devinit(cpu_model, hwdef);
+10 -9
include/hw/i386/pc.h
··· 8 8 #include "hw/block/fdc.h" 9 9 #include "net/net.h" 10 10 #include "hw/i386/ioapic.h" 11 + #include "hw/nvram/fw_cfg.h" 11 12 12 13 /* PC-style peripherals (also used by other machines). */ 13 14 ··· 80 81 void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge); 81 82 void pc_hot_add_cpu(const int64_t id, Error **errp); 82 83 void pc_acpi_init(const char *default_dsdt); 83 - void *pc_memory_init(MemoryRegion *system_memory, 84 - const char *kernel_filename, 85 - const char *kernel_cmdline, 86 - const char *initrd_filename, 87 - ram_addr_t below_4g_mem_size, 88 - ram_addr_t above_4g_mem_size, 89 - MemoryRegion *rom_memory, 90 - MemoryRegion **ram_memory); 84 + FWCfgState *pc_memory_init(MemoryRegion *system_memory, 85 + const char *kernel_filename, 86 + const char *kernel_cmdline, 87 + const char *initrd_filename, 88 + ram_addr_t below_4g_mem_size, 89 + ram_addr_t above_4g_mem_size, 90 + MemoryRegion *rom_memory, 91 + MemoryRegion **ram_memory); 91 92 qemu_irq *pc_allocate_cpu_irq(void); 92 93 DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); 93 94 void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ··· 111 112 112 113 i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, 113 114 qemu_irq sci_irq, qemu_irq smi_irq, 114 - int kvm_enabled, void *fw_cfg); 115 + int kvm_enabled, FWCfgState *fw_cfg); 115 116 void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr); 116 117 117 118 /* hpet.c */
+2 -1
include/hw/loader.h
··· 1 1 #ifndef LOADER_H 2 2 #define LOADER_H 3 3 #include "qapi/qmp/qdict.h" 4 + #include "hw/nvram/fw_cfg.h" 4 5 5 6 /* loader.c */ 6 7 int get_image_size(const char *filename); ··· 30 31 int rom_add_elf_program(const char *name, void *data, size_t datasize, 31 32 size_t romsize, hwaddr addr); 32 33 int rom_load_all(void); 33 - void rom_set_fw(void *f); 34 + void rom_set_fw(FWCfgState *f); 34 35 int rom_copy(uint8_t *dest, hwaddr addr, size_t size); 35 36 void *rom_ptr(hwaddr addr); 36 37 void do_info_roms(Monitor *mon, const QDict *qdict);