Merge ~paelzer/ubuntu/+source/qemu:fix-1587065-guest-agent-double-freeze into ubuntu/+source/qemu:ubuntu/xenial-devel

Proposed by Christian Ehrhardt 
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: 5a7643209862ade765d95292f760f54850f83ce8
Proposed branch: ~paelzer/ubuntu/+source/qemu:fix-1587065-guest-agent-double-freeze
Merge into: ubuntu/+source/qemu:ubuntu/xenial-devel
Diff against target: 1348211 lines (+1323907/-0)
4047 files modified
debian/changelog (+8/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch (+44/-0)
dump.c (+1714/-0)
exec.c (+3618/-0)
fpu/softfloat-macros.h (+793/-0)
fpu/softfloat-specialize.h (+1236/-0)
fpu/softfloat.c (+7722/-0)
fsdev/Makefile.objs (+12/-0)
fsdev/file-op-9p.h (+150/-0)
fsdev/qemu-fsdev-dummy.c (+22/-0)
fsdev/qemu-fsdev-opts.c (+85/-0)
fsdev/qemu-fsdev.c (+101/-0)
fsdev/qemu-fsdev.h (+48/-0)
fsdev/virtfs-proxy-helper.c (+1166/-0)
fsdev/virtfs-proxy-helper.texi (+63/-0)
fsdev/virtio-9p-marshal.c (+322/-0)
fsdev/virtio-9p-marshal.h (+90/-0)
gdb-xml/aarch64-core.xml (+46/-0)
gdb-xml/aarch64-fpu.xml (+86/-0)
gdb-xml/arm-core.xml (+31/-0)
gdb-xml/arm-neon.xml (+88/-0)
gdb-xml/arm-vfp.xml (+29/-0)
gdb-xml/arm-vfp3.xml (+45/-0)
gdb-xml/cf-core.xml (+29/-0)
gdb-xml/cf-fp.xml (+22/-0)
gdb-xml/power-altivec.xml (+57/-0)
gdb-xml/power-core.xml (+49/-0)
gdb-xml/power-fpu.xml (+44/-0)
gdb-xml/power-spe.xml (+45/-0)
gdb-xml/power64-core.xml (+49/-0)
gdb-xml/s390-acr.xml (+26/-0)
gdb-xml/s390-cr.xml (+26/-0)
gdb-xml/s390-fpr.xml (+27/-0)
gdb-xml/s390-virt.xml (+18/-0)
gdb-xml/s390-vx.xml (+59/-0)
gdb-xml/s390x-core64.xml (+28/-0)
gdbstub.c (+1789/-0)
hmp-commands-info.hx (+795/-0)
hmp-commands.hx (+1760/-0)
hmp.c (+2380/-0)
hmp.h (+135/-0)
hw/9pfs/Makefile.objs (+9/-0)
hw/9pfs/codir.c (+168/-0)
hw/9pfs/cofile.c (+275/-0)
hw/9pfs/cofs.c (+364/-0)
hw/9pfs/coxattr.c (+107/-0)
hw/9pfs/virtio-9p-coth.c (+41/-0)
hw/9pfs/virtio-9p-coth.h (+99/-0)
hw/9pfs/virtio-9p-device.c (+192/-0)
hw/9pfs/virtio-9p-handle.c (+708/-0)
hw/9pfs/virtio-9p-local.c (+1280/-0)
hw/9pfs/virtio-9p-posix-acl.c (+185/-0)
hw/9pfs/virtio-9p-proxy.c (+1219/-0)
hw/9pfs/virtio-9p-proxy.h (+95/-0)
hw/9pfs/virtio-9p-synth.c (+573/-0)
hw/9pfs/virtio-9p-synth.h (+54/-0)
hw/9pfs/virtio-9p-xattr-user.c (+128/-0)
hw/9pfs/virtio-9p-xattr.c (+164/-0)
hw/9pfs/virtio-9p-xattr.h (+120/-0)
hw/9pfs/virtio-9p.c (+3300/-0)
hw/9pfs/virtio-9p.h (+394/-0)
hw/Makefile.objs (+37/-0)
hw/acpi/Makefile.objs (+7/-0)
hw/acpi/acpi_interface.c (+15/-0)
hw/acpi/aml-build.c (+1215/-0)
hw/acpi/bios-linker-loader.c (+159/-0)
hw/acpi/core.c (+710/-0)
hw/acpi/cpu_hotplug.c (+76/-0)
hw/acpi/ich9.c (+484/-0)
hw/acpi/memory_hotplug.c (+307/-0)
hw/acpi/pcihp.c (+334/-0)
hw/acpi/piix4.c (+643/-0)
hw/acpi/tco.c (+264/-0)
hw/alpha/Makefile.objs (+1/-0)
hw/alpha/alpha_sys.h (+21/-0)
hw/alpha/dp264.c (+179/-0)
hw/alpha/pci.c (+91/-0)
hw/alpha/typhoon.c (+956/-0)
hw/arm/Makefile.objs (+17/-0)
hw/arm/allwinner-a10.c (+138/-0)
hw/arm/armv7m.c (+261/-0)
hw/arm/boot.c (+865/-0)
hw/arm/collie.c (+67/-0)
hw/arm/cubieboard.c (+83/-0)
hw/arm/digic.c (+121/-0)
hw/arm/digic_boards.c (+157/-0)
hw/arm/exynos4210.c (+383/-0)
hw/arm/exynos4_boards.c (+183/-0)
hw/arm/fsl-imx25.c (+308/-0)
hw/arm/fsl-imx31.c (+282/-0)
hw/arm/gumstix.c (+158/-0)
hw/arm/highbank.c (+475/-0)
hw/arm/imx25_pdk.c (+154/-0)
hw/arm/integratorcp.c (+679/-0)
hw/arm/kzm.c (+148/-0)
hw/arm/mainstone.c (+197/-0)
hw/arm/musicpal.c (+1747/-0)
hw/arm/netduino2.c (+52/-0)
hw/arm/nseries.c (+1452/-0)
hw/arm/omap1.c (+4079/-0)
hw/arm/omap2.c (+2687/-0)
hw/arm/omap_sx1.c (+254/-0)
hw/arm/palm.c (+278/-0)
hw/arm/pxa2xx.c (+2353/-0)
hw/arm/pxa2xx_gpio.c (+356/-0)
hw/arm/pxa2xx_pic.c (+337/-0)
hw/arm/realview.c (+471/-0)
hw/arm/spitz.c (+1176/-0)
hw/arm/stellaris.c (+1473/-0)
hw/arm/stm32f205_soc.c (+161/-0)
hw/arm/strongarm.c (+1659/-0)
hw/arm/strongarm.h (+68/-0)
hw/arm/sysbus-fdt.c (+247/-0)
hw/arm/tosa.c (+301/-0)
hw/arm/versatilepb.c (+453/-0)
hw/arm/vexpress.c (+805/-0)
hw/arm/virt-acpi-build.c (+725/-0)
hw/arm/virt.c (+1199/-0)
hw/arm/xilinx_zynq.c (+315/-0)
hw/arm/xlnx-ep108.c (+77/-0)
hw/arm/xlnx-zynqmp.c (+323/-0)
hw/arm/z2.c (+381/-0)
hw/audio/Makefile.objs (+18/-0)
hw/audio/ac97.c (+1430/-0)
hw/audio/adlib.c (+384/-0)
hw/audio/cs4231.c (+186/-0)
hw/audio/cs4231a.c (+707/-0)
hw/audio/es1370.c (+1075/-0)
hw/audio/fmopl.c (+1394/-0)
hw/audio/fmopl.h (+174/-0)
hw/audio/gus.c (+313/-0)
hw/audio/gusemu.h (+105/-0)
hw/audio/gusemu_hal.c (+554/-0)
hw/audio/gusemu_mixer.c (+240/-0)
hw/audio/gustate.h (+132/-0)
hw/audio/hda-codec-common.h (+456/-0)
hw/audio/hda-codec.c (+731/-0)
hw/audio/intel-hda-defs.h (+717/-0)
hw/audio/intel-hda.c (+1343/-0)
hw/audio/intel-hda.h (+72/-0)
hw/audio/lm4549.c (+335/-0)
hw/audio/lm4549.h (+43/-0)
hw/audio/marvell_88w8618.c (+306/-0)
hw/audio/milkymist-ac97.c (+348/-0)
hw/audio/pcspk.c (+213/-0)
hw/audio/pl041.c (+649/-0)
hw/audio/pl041.h (+135/-0)
hw/audio/pl041.hx (+81/-0)
hw/audio/sb16.c (+1422/-0)
hw/audio/wm8750.c (+722/-0)
hw/block/Makefile.objs (+15/-0)
hw/block/block.c (+91/-0)
hw/block/cdrom.c (+155/-0)
hw/block/dataplane/Makefile.objs (+1/-0)
hw/block/dataplane/virtio-blk.c (+331/-0)
hw/block/dataplane/virtio-blk.h (+30/-0)
hw/block/ecc.c (+90/-0)
hw/block/fdc.c (+2541/-0)
hw/block/hd-geometry.c (+165/-0)
hw/block/m25p80.c (+711/-0)
hw/block/nand.c (+799/-0)
hw/block/nvme.c (+972/-0)
hw/block/nvme.h (+712/-0)
hw/block/onenand.c (+848/-0)
hw/block/pflash_cfi01.c (+954/-0)
hw/block/pflash_cfi02.c (+795/-0)
hw/block/tc58128.c (+180/-0)
hw/block/virtio-blk.c (+1023/-0)
hw/block/xen_blkif.h (+115/-0)
hw/block/xen_disk.c (+1122/-0)
hw/bt/Makefile.objs (+3/-0)
hw/bt/core.c (+144/-0)
hw/bt/hci-csr.c (+454/-0)
hw/bt/hci.c (+2269/-0)
hw/bt/hid.c (+553/-0)
hw/bt/l2cap.c (+1365/-0)
hw/bt/sdp.c (+978/-0)
hw/char/Makefile.objs (+29/-0)
hw/char/cadence_uart.c (+536/-0)
hw/char/debugcon.c (+140/-0)
hw/char/digic-uart.c (+197/-0)
hw/char/escc.c (+1053/-0)
hw/char/etraxfs_ser.c (+253/-0)
hw/char/exynos4210_uart.c (+674/-0)
hw/char/grlib_apbuart.c (+298/-0)
hw/char/imx_serial.c (+366/-0)
hw/char/ipoctal232.c (+603/-0)
hw/char/lm32_juart.c (+164/-0)
hw/char/lm32_uart.c (+304/-0)
hw/char/mcf_uart.c (+307/-0)
hw/char/milkymist-uart.c (+255/-0)
hw/char/omap_uart.c (+187/-0)
hw/char/parallel.c (+643/-0)
hw/char/pl011.c (+342/-0)
hw/char/sclpconsole-lm.c (+383/-0)
hw/char/sclpconsole.c (+285/-0)
hw/char/serial-isa.c (+145/-0)
hw/char/serial-pci.c (+274/-0)
hw/char/serial.c (+972/-0)
hw/char/sh_serial.c (+408/-0)
hw/char/spapr_vty.c (+245/-0)
hw/char/stm32f2xx_usart.c (+232/-0)
hw/char/virtio-console.c (+217/-0)
hw/char/virtio-serial-bus.c (+1131/-0)
hw/char/xen_console.c (+305/-0)
hw/char/xilinx_uartlite.c (+248/-0)
hw/core/Makefile.objs (+17/-0)
hw/core/empty_slot.c (+102/-0)
hw/core/fw-path-provider.c (+52/-0)
hw/core/hotplug.c (+59/-0)
hw/core/irq.c (+158/-0)
hw/core/loader.c (+1088/-0)
hw/core/machine.c (+512/-0)
hw/core/nmi.c (+104/-0)
hw/core/null-machine.c (+29/-0)
hw/core/platform-bus.c (+252/-0)
hw/core/ptimer.c (+231/-0)
hw/core/qdev-properties-system.c (+425/-0)
hw/core/qdev-properties.c (+1111/-0)
hw/core/qdev.c (+1363/-0)
hw/core/stream.c (+32/-0)
hw/core/sysbus.c (+369/-0)
hw/core/uboot_image.h (+158/-0)
hw/cpu/Makefile.objs (+5/-0)
hw/cpu/a15mpcore.c (+156/-0)
hw/cpu/a9mpcore.c (+190/-0)
hw/cpu/arm11mpcore.c (+172/-0)
hw/cpu/realview_mpcore.c (+139/-0)
hw/cris/Makefile.objs (+2/-0)
hw/cris/axis_dev88.c (+361/-0)
hw/cris/boot.c (+98/-0)
hw/cris/boot.h (+15/-0)
hw/display/Makefile.objs (+44/-0)
hw/display/ads7846.c (+177/-0)
hw/display/blizzard.c (+986/-0)
hw/display/blizzard_template.h (+146/-0)
hw/display/cg3.c (+397/-0)
hw/display/cirrus_vga.c (+3089/-0)
hw/display/cirrus_vga_rop.h (+207/-0)
hw/display/cirrus_vga_rop2.h (+281/-0)
hw/display/exynos4210_fimd.c (+1951/-0)
hw/display/framebuffer.c (+124/-0)
hw/display/framebuffer.h (+65/-0)
hw/display/g364fb.c (+558/-0)
hw/display/jazz_led.c (+311/-0)
hw/display/milkymist-tmu2.c (+494/-0)
hw/display/milkymist-vgafb.c (+353/-0)
hw/display/milkymist-vgafb_template.h (+74/-0)
hw/display/omap_dss.c (+1090/-0)
hw/display/omap_lcd_template.h (+175/-0)
hw/display/omap_lcdc.c (+419/-0)
hw/display/pl110.c (+538/-0)
hw/display/pl110_template.h (+399/-0)
hw/display/pxa2xx_lcd.c (+1064/-0)
hw/display/pxa2xx_template.h (+447/-0)
hw/display/qxl-logger.c (+275/-0)
hw/display/qxl-render.c (+297/-0)
hw/display/qxl.c (+2357/-0)
hw/display/qxl.h (+174/-0)
hw/display/sm501.c (+1455/-0)
hw/display/sm501_template.h (+145/-0)
hw/display/ssd0303.c (+330/-0)
hw/display/ssd0323.c (+401/-0)
hw/display/tc6393xb.c (+596/-0)
hw/display/tc6393xb_template.h (+72/-0)
hw/display/tcx.c (+1103/-0)
hw/display/vga-helpers.h (+439/-0)
hw/display/vga-isa-mm.c (+142/-0)
hw/display/vga-isa.c (+105/-0)
hw/display/vga-pci.c (+386/-0)
hw/display/vga.c (+2252/-0)
hw/display/vga.h (+159/-0)
hw/display/vga_int.h (+228/-0)
hw/display/virtio-gpu-3d.c (+598/-0)
hw/display/virtio-gpu-pci.c (+76/-0)
hw/display/virtio-gpu.c (+1044/-0)
hw/display/virtio-vga.c (+182/-0)
hw/display/vmware_vga.c (+1368/-0)
hw/display/xenfb.c (+1014/-0)
hw/dma/Makefile.objs (+13/-0)
hw/dma/etraxfs_dma.c (+781/-0)
hw/dma/i82374.c (+175/-0)
hw/dma/i8257.c (+599/-0)
hw/dma/omap_dma.c (+2102/-0)
hw/dma/pl080.c (+422/-0)
hw/dma/pl330.c (+1666/-0)
hw/dma/puv3_dma.c (+113/-0)
hw/dma/pxa2xx_dma.c (+575/-0)
hw/dma/rc4030.c (+841/-0)
hw/dma/soc_dma.c (+366/-0)
hw/dma/sparc32_dma.c (+322/-0)
hw/dma/sun4m_iommu.c (+392/-0)
hw/dma/xilinx_axidma.c (+674/-0)
hw/gpio/Makefile.objs (+8/-0)
hw/gpio/imx_gpio.c (+341/-0)
hw/gpio/max7310.c (+217/-0)
hw/gpio/mpc8xxx.c (+217/-0)
hw/gpio/omap_gpio.c (+808/-0)
hw/gpio/pl061.c (+367/-0)
hw/gpio/puv3_gpio.c (+145/-0)
hw/gpio/zaurus.c (+301/-0)
hw/i2c/Makefile.objs (+8/-0)
hw/i2c/bitbang_i2c.c (+252/-0)
hw/i2c/bitbang_i2c.h (+14/-0)
hw/i2c/core.c (+245/-0)
hw/i2c/exynos4210_i2c.c (+336/-0)
hw/i2c/imx_i2c.c (+335/-0)
hw/i2c/omap_i2c.c (+504/-0)
hw/i2c/pm_smbus.c (+227/-0)
hw/i2c/smbus.c (+361/-0)
hw/i2c/smbus_eeprom.c (+158/-0)
hw/i2c/smbus_ich9.c (+129/-0)
hw/i2c/versatile_i2c.c (+113/-0)
hw/i386/Makefile.objs (+40/-0)
hw/i386/acpi-build.c (+1940/-0)
hw/i386/acpi-build.h (+9/-0)
hw/i386/acpi-dsdt-cpu-hotplug.dsl (+90/-0)
hw/i386/acpi-dsdt-dbug.dsl (+41/-0)
hw/i386/acpi-dsdt-hpet.dsl (+48/-0)
hw/i386/acpi-dsdt-isa.dsl (+117/-0)
hw/i386/acpi-dsdt-mem-hotplug.dsl (+171/-0)
hw/i386/acpi-dsdt.dsl (+303/-0)
hw/i386/acpi-dsdt.hex.generated (+2972/-0)
hw/i386/intel_iommu.c (+2024/-0)
hw/i386/intel_iommu_internal.h (+389/-0)
hw/i386/kvm/Makefile.objs (+1/-0)
hw/i386/kvm/apic.c (+218/-0)
hw/i386/kvm/clock.c (+195/-0)
hw/i386/kvm/i8254.c (+335/-0)
hw/i386/kvm/i8259.c (+162/-0)
hw/i386/kvm/ioapic.c (+178/-0)
hw/i386/kvm/pci-assign.c (+1900/-0)
hw/i386/kvmvapic.c (+860/-0)
hw/i386/multiboot.c (+371/-0)
hw/i386/multiboot.h (+14/-0)
hw/i386/pc.c (+1985/-0)
hw/i386/pc_piix.c (+1059/-0)
hw/i386/pc_q35.c (+487/-0)
hw/i386/pc_sysfw.c (+251/-0)
hw/i386/pci-assign-load-rom.c (+87/-0)
hw/i386/q35-acpi-dsdt.dsl (+436/-0)
hw/i386/q35-acpi-dsdt.hex.generated (+7610/-0)
hw/i386/xen/Makefile.objs (+1/-0)
hw/i386/xen/xen_apic.c (+98/-0)
hw/i386/xen/xen_platform.c (+453/-0)
hw/i386/xen/xen_pvdevice.c (+135/-0)
hw/ide/Makefile.objs (+12/-0)
hw/ide/ahci.c (+1808/-0)
hw/ide/ahci.h (+405/-0)
hw/ide/atapi.c (+1369/-0)
hw/ide/cmd646.c (+434/-0)
hw/ide/core.c (+2776/-0)
hw/ide/ich.c (+190/-0)
hw/ide/internal.h (+599/-0)
hw/ide/isa.c (+134/-0)
hw/ide/macio.c (+636/-0)
hw/ide/microdrive.c (+637/-0)
hw/ide/mmio.c (+183/-0)
hw/ide/pci.c (+497/-0)
hw/ide/pci.h (+76/-0)
hw/ide/piix.c (+305/-0)
hw/ide/qdev.c (+367/-0)
hw/ide/via.c (+235/-0)
hw/input/Makefile.objs (+19/-0)
hw/input/adb.c (+595/-0)
hw/input/hid.c (+611/-0)
hw/input/lm832x.c (+524/-0)
hw/input/milkymist-softusb.c (+317/-0)
hw/input/pckbd.c (+594/-0)
hw/input/pl050.c (+205/-0)
hw/input/ps2.c (+807/-0)
hw/input/pxa2xx_keypad.c (+334/-0)
hw/input/stellaris_input.c (+87/-0)
hw/input/tsc2005.c (+593/-0)
hw/input/tsc210x.c (+1271/-0)
hw/input/virtio-input-hid.c (+515/-0)
hw/input/virtio-input-host.c (+189/-0)
hw/input/virtio-input.c (+293/-0)
hw/input/vmmouse.c (+303/-0)
hw/intc/Makefile.objs (+32/-0)
hw/intc/allwinner-a10-pic.c (+212/-0)
hw/intc/apic.c (+905/-0)
hw/intc/apic_common.c (+449/-0)
hw/intc/arm_gic.c (+1315/-0)
hw/intc/arm_gic_common.c (+288/-0)
hw/intc/arm_gic_kvm.c (+605/-0)
hw/intc/arm_gicv2m.c (+192/-0)
hw/intc/arm_gicv3_common.c (+140/-0)
hw/intc/arm_gicv3_kvm.c (+149/-0)
hw/intc/armv7m_nvic.c (+578/-0)
hw/intc/etraxfs_pic.c (+193/-0)
hw/intc/exynos4210_combiner.c (+458/-0)
hw/intc/exynos4210_gic.c (+471/-0)
hw/intc/gic_internal.h (+103/-0)
hw/intc/grlib_irqmp.c (+374/-0)
hw/intc/heathrow_pic.c (+213/-0)
hw/intc/i8259.c (+523/-0)
hw/intc/i8259_common.c (+162/-0)
hw/intc/imx_avic.c (+362/-0)
hw/intc/ioapic.c (+273/-0)
hw/intc/ioapic_common.c (+178/-0)
hw/intc/lm32_pic.c (+203/-0)
hw/intc/omap_intc.c (+667/-0)
hw/intc/openpic.c (+1662/-0)
hw/intc/openpic_kvm.c (+294/-0)
hw/intc/pl190.c (+292/-0)
hw/intc/puv3_intc.c (+140/-0)
hw/intc/realview_gic.c (+87/-0)
hw/intc/s390_flic.c (+99/-0)
hw/intc/s390_flic_kvm.c (+434/-0)
hw/intc/sh_intc.c (+512/-0)
hw/intc/slavio_intctl.c (+471/-0)
hw/intc/vgic_common.h (+35/-0)
hw/intc/xics.c (+1084/-0)
hw/intc/xics_kvm.c (+508/-0)
hw/intc/xilinx_intc.c (+201/-0)
hw/ipack/Makefile.objs (+2/-0)
hw/ipack/ipack.c (+119/-0)
hw/ipack/tpci200.c (+656/-0)
hw/isa/Makefile.objs (+8/-0)
hw/isa/apm.c (+102/-0)
hw/isa/i82378.c (+144/-0)
hw/isa/isa-bus.c (+298/-0)
hw/isa/lpc_ich9.c (+747/-0)
hw/isa/pc87312.c (+402/-0)
hw/isa/piix4.c (+139/-0)
hw/isa/vt82c686.c (+511/-0)
hw/lm32/Makefile.objs (+3/-0)
hw/lm32/lm32.h (+29/-0)
hw/lm32/lm32_boards.c (+331/-0)
hw/lm32/lm32_hwsetup.h (+179/-0)
hw/lm32/milkymist-hw.h (+208/-0)
hw/lm32/milkymist.c (+219/-0)
hw/m68k/Makefile.objs (+4/-0)
hw/m68k/an5206.c (+98/-0)
hw/m68k/dummy_m68k.c (+81/-0)
hw/m68k/mcf5206.c (+548/-0)
hw/m68k/mcf5208.c (+304/-0)
hw/m68k/mcf_intc.c (+168/-0)
hw/mem/Makefile.objs (+1/-0)
hw/mem/pc-dimm.c (+464/-0)
hw/microblaze/Makefile.objs (+3/-0)
hw/microblaze/boot.c (+211/-0)
hw/microblaze/boot.h (+12/-0)
hw/microblaze/petalogix_ml605_mmu.c (+216/-0)
hw/microblaze/petalogix_s3adsp1800_mmu.c (+134/-0)
hw/mips/Makefile.objs (+5/-0)
hw/mips/addr.c (+39/-0)
hw/mips/cputimer.c (+162/-0)
hw/mips/gt64xxx_pci.c (+1260/-0)
hw/mips/mips_fulong2e.c (+390/-0)
hw/mips/mips_int.c (+78/-0)
hw/mips/mips_jazz.c (+388/-0)
hw/mips/mips_malta.c (+1223/-0)
hw/mips/mips_mipssim.c (+240/-0)
hw/mips/mips_r4k.c (+307/-0)
hw/misc/Makefile.objs (+43/-0)
hw/misc/a9scu.c (+152/-0)
hw/misc/applesmc.c (+279/-0)
hw/misc/arm11scu.c (+100/-0)
hw/misc/arm_integrator_debug.c (+99/-0)
hw/misc/arm_l2x0.c (+198/-0)
hw/misc/arm_sysctl.c (+656/-0)
hw/misc/cbus.c (+618/-0)
hw/misc/debugexit.c (+76/-0)
hw/misc/eccmemctl.c (+344/-0)
hw/misc/edu.c (+408/-0)
hw/misc/exynos4210_pmu.c (+502/-0)
hw/misc/imx_ccm.c (+271/-0)
hw/misc/ivshmem.c (+1203/-0)
hw/misc/macio/Makefile.objs (+3/-0)
hw/misc/macio/cuda.c (+825/-0)
hw/misc/macio/mac_dbdma.c (+766/-0)
hw/misc/macio/macio.c (+447/-0)
hw/misc/max111x.c (+214/-0)
hw/misc/milkymist-hpdmc.c (+174/-0)
hw/misc/milkymist-pfpu.c (+548/-0)
hw/misc/mst_fpga.c (+266/-0)
hw/misc/omap_clk.c (+1264/-0)
hw/misc/omap_gpmc.c (+896/-0)
hw/misc/omap_l4.c (+163/-0)
hw/misc/omap_sdrc.c (+168/-0)
hw/misc/omap_tap.c (+117/-0)
hw/misc/pc-testdev.c (+207/-0)
hw/misc/pci-testdev.c (+330/-0)
hw/misc/puv3_pm.c (+153/-0)
hw/misc/pvpanic.c (+143/-0)
hw/misc/sga.c (+67/-0)
hw/misc/slavio_misc.c (+517/-0)
hw/misc/stm32f2xx_syscfg.c (+160/-0)
hw/misc/tmp105.c (+272/-0)
hw/misc/tmp105.h (+47/-0)
hw/misc/vmport.c (+181/-0)
hw/misc/zynq-xadc.c (+302/-0)
hw/misc/zynq_slcr.c (+458/-0)
hw/moxie/Makefile.objs (+2/-0)
hw/moxie/moxiesim.c (+156/-0)
hw/net/Makefile.objs (+43/-0)
hw/net/allwinner_emac.c (+533/-0)
hw/net/cadence_gem.c (+1254/-0)
hw/net/dp8393x.c (+910/-0)
hw/net/e1000.c (+1953/-0)
hw/net/e1000_regs.h (+908/-0)
hw/net/eepro100.c (+2114/-0)
hw/net/etraxfs_eth.c (+646/-0)
hw/net/fsl_etsec/etsec.c (+456/-0)
hw/net/fsl_etsec/etsec.h (+176/-0)
hw/net/fsl_etsec/miim.c (+146/-0)
hw/net/fsl_etsec/registers.c (+295/-0)
hw/net/fsl_etsec/registers.h (+320/-0)
hw/net/fsl_etsec/rings.c (+653/-0)
hw/net/imx_fec.c (+709/-0)
hw/net/lan9118.c (+1398/-0)
hw/net/lance.c (+183/-0)
hw/net/mcf_fec.c (+534/-0)
hw/net/milkymist-minimac2.c (+540/-0)
hw/net/mipsnet.c (+286/-0)
hw/net/ne2000-isa.c (+151/-0)
hw/net/ne2000.c (+789/-0)
hw/net/ne2000.h (+39/-0)
hw/net/opencores_eth.c (+764/-0)
hw/net/pcnet-pci.c (+374/-0)
hw/net/pcnet.c (+1760/-0)
hw/net/pcnet.h (+67/-0)
hw/net/rocker/qmp-norocker.c (+50/-0)
hw/net/rocker/rocker.c (+1549/-0)
hw/net/rocker/rocker.h (+84/-0)
hw/net/rocker/rocker_desc.c (+373/-0)
hw/net/rocker/rocker_desc.h (+53/-0)
hw/net/rocker/rocker_fp.c (+263/-0)
hw/net/rocker/rocker_fp.h (+53/-0)
hw/net/rocker/rocker_hw.h (+493/-0)
hw/net/rocker/rocker_of_dpa.c (+2625/-0)
hw/net/rocker/rocker_of_dpa.h (+22/-0)
hw/net/rocker/rocker_tlv.h (+244/-0)
hw/net/rocker/rocker_world.c (+106/-0)
hw/net/rocker/rocker_world.h (+60/-0)
hw/net/rtl8139.c (+3509/-0)
hw/net/smc91c111.c (+824/-0)
hw/net/spapr_llan.c (+569/-0)
hw/net/stellaris_enet.c (+503/-0)
hw/net/vhost_net.c (+496/-0)
hw/net/virtio-net.c (+1868/-0)
hw/net/vmware_utils.h (+143/-0)
hw/net/vmxnet3.c (+2591/-0)
hw/net/vmxnet3.h (+759/-0)
hw/net/vmxnet_debug.h (+115/-0)
hw/net/vmxnet_rx_pkt.c (+186/-0)
hw/net/vmxnet_rx_pkt.h (+176/-0)
hw/net/vmxnet_tx_pkt.c (+580/-0)
hw/net/vmxnet_tx_pkt.h (+148/-0)
hw/net/xen_nic.c (+421/-0)
hw/net/xgmac.c (+432/-0)
hw/net/xilinx_axienet.c (+1082/-0)
hw/net/xilinx_ethlite.c (+273/-0)
hw/nvram/Makefile.objs (+5/-0)
hw/nvram/ds1225y.c (+169/-0)
hw/nvram/eeprom93xx.c (+336/-0)
hw/nvram/fw_cfg.c (+979/-0)
hw/nvram/mac_nvram.c (+214/-0)
hw/nvram/spapr_nvram.c (+248/-0)
hw/openrisc/Makefile.objs (+2/-0)
hw/openrisc/cputimer.c (+111/-0)
hw/openrisc/openrisc_sim.c (+143/-0)
hw/openrisc/pic_cpu.c (+60/-0)
hw/pci-bridge/Makefile.objs (+7/-0)
hw/pci-bridge/dec.c (+161/-0)
hw/pci-bridge/dec.h (+10/-0)
hw/pci-bridge/i82801b11.c (+109/-0)
hw/pci-bridge/ioh3420.c (+221/-0)
hw/pci-bridge/ioh3420.h (+6/-0)
hw/pci-bridge/pci_bridge_dev.c (+257/-0)
hw/pci-bridge/pci_expander_bridge.c (+286/-0)
hw/pci-bridge/xio3130_downstream.c (+209/-0)
hw/pci-bridge/xio3130_downstream.h (+11/-0)
hw/pci-bridge/xio3130_upstream.c (+182/-0)
hw/pci-bridge/xio3130_upstream.h (+10/-0)
hw/pci-host/Makefile.objs (+18/-0)
hw/pci-host/apb.c (+875/-0)
hw/pci-host/bonito.c (+857/-0)
hw/pci-host/gpex.c (+154/-0)
hw/pci-host/grackle.c (+168/-0)
hw/pci-host/pam.c (+69/-0)
hw/pci-host/piix.c (+882/-0)
hw/pci-host/ppce500.c (+550/-0)
hw/pci-host/prep.c (+402/-0)
hw/pci-host/q35.c (+559/-0)
hw/pci-host/uninorth.c (+523/-0)
hw/pci-host/versatile.c (+548/-0)
hw/pci/Makefile.objs (+9/-0)
hw/pci/msi.c (+400/-0)
hw/pci/msix.c (+612/-0)
hw/pci/pci-stub.c (+36/-0)
hw/pci/pci.c (+2511/-0)
hw/pci/pci_bridge.c (+419/-0)
hw/pci/pci_host.c (+206/-0)
hw/pci/pcie.c (+647/-0)
hw/pci/pcie_aer.c (+1038/-0)
hw/pci/pcie_host.c (+146/-0)
hw/pci/pcie_port.c (+178/-0)
hw/pci/shpc.c (+720/-0)
hw/pci/slotid_cap.c (+45/-0)
hw/pcmcia/Makefile.objs (+2/-0)
hw/pcmcia/pcmcia.c (+24/-0)
hw/pcmcia/pxa2xx.c (+264/-0)
hw/ppc/Makefile.objs (+23/-0)
hw/ppc/e500-ccsr.h (+17/-0)
hw/ppc/e500.c (+1081/-0)
hw/ppc/e500.h (+29/-0)
hw/ppc/e500plat.c (+68/-0)
hw/ppc/mac.h (+186/-0)
hw/ppc/mac_newworld.c (+530/-0)
hw/ppc/mac_oldworld.c (+373/-0)
hw/ppc/mpc8544_guts.c (+140/-0)
hw/ppc/mpc8544ds.c (+60/-0)
hw/ppc/ppc.c (+1339/-0)
hw/ppc/ppc405.h (+81/-0)
hw/ppc/ppc405_boards.c (+660/-0)
hw/ppc/ppc405_uc.c (+2551/-0)
hw/ppc/ppc440_bamboo.c (+299/-0)
hw/ppc/ppc4xx_devs.c (+734/-0)
hw/ppc/ppc4xx_pci.c (+392/-0)
hw/ppc/ppc_booke.c (+365/-0)
hw/ppc/ppce500_spin.c (+224/-0)
hw/ppc/prep.c (+674/-0)
hw/ppc/spapr.c (+2463/-0)
hw/ppc/spapr_drc.c (+802/-0)
hw/ppc/spapr_events.c (+596/-0)
hw/ppc/spapr_hcall.c (+1058/-0)
hw/ppc/spapr_iommu.c (+511/-0)
hw/ppc/spapr_pci.c (+1843/-0)
hw/ppc/spapr_pci_vfio.c (+280/-0)
hw/ppc/spapr_rng.c (+186/-0)
hw/ppc/spapr_rtas.c (+769/-0)
hw/ppc/spapr_rtc.c (+211/-0)
hw/ppc/spapr_vio.c (+705/-0)
hw/ppc/virtex_ml507.c (+306/-0)
hw/s390x/Makefile.objs (+13/-0)
hw/s390x/css.c (+1571/-0)
hw/s390x/css.h (+111/-0)
hw/s390x/event-facility.c (+447/-0)
hw/s390x/ipl.c (+296/-0)
hw/s390x/ipl.h (+53/-0)
hw/s390x/s390-pci-bus.c (+618/-0)
hw/s390x/s390-pci-bus.h (+253/-0)
hw/s390x/s390-pci-inst.c (+844/-0)
hw/s390x/s390-pci-inst.h (+289/-0)
hw/s390x/s390-skeys-kvm.c (+75/-0)
hw/s390x/s390-skeys.c (+415/-0)
hw/s390x/s390-virtio-bus.c (+758/-0)
hw/s390x/s390-virtio-bus.h (+186/-0)
hw/s390x/s390-virtio-ccw.c (+318/-0)
hw/s390x/s390-virtio-hcall.c (+40/-0)
hw/s390x/s390-virtio.c (+373/-0)
hw/s390x/s390-virtio.h (+32/-0)
hw/s390x/sclp.c (+615/-0)
hw/s390x/sclpcpu.c (+100/-0)
hw/s390x/sclpquiesce.c (+142/-0)
hw/s390x/virtio-ccw.c (+1988/-0)
hw/s390x/virtio-ccw.h (+218/-0)
hw/scsi/Makefile.objs (+13/-0)
hw/scsi/esp-pci.c (+529/-0)
hw/scsi/esp.c (+743/-0)
hw/scsi/lsi53c895a.c (+2163/-0)
hw/scsi/megasas.c (+2547/-0)
hw/scsi/mfi.h (+1272/-0)
hw/scsi/scsi-bus.c (+2050/-0)
hw/scsi/scsi-disk.c (+2827/-0)
hw/scsi/scsi-generic.c (+526/-0)
hw/scsi/spapr_vscsi.c (+1301/-0)
hw/scsi/srp.h (+247/-0)
hw/scsi/vhost-scsi.c (+352/-0)
hw/scsi/viosrp.h (+216/-0)
hw/scsi/virtio-scsi-dataplane.c (+322/-0)
hw/scsi/virtio-scsi.c (+1012/-0)
hw/scsi/vmw_pvscsi.c (+1219/-0)
hw/scsi/vmw_pvscsi.h (+434/-0)
hw/sd/Makefile.objs (+8/-0)
hw/sd/milkymist-memcard.c (+316/-0)
hw/sd/omap_mmc.c (+646/-0)
hw/sd/pl181.c (+527/-0)
hw/sd/pxa2xx_mmci.c (+504/-0)
hw/sd/sd.c (+1767/-0)
hw/sd/sdhci-internal.h (+232/-0)
hw/sd/sdhci.c (+1340/-0)
hw/sd/ssi-sd.c (+289/-0)
hw/sh4/Makefile.objs (+4/-0)
hw/sh4/r2d.c (+363/-0)
hw/sh4/sh7750.c (+842/-0)
hw/sh4/sh7750_regnames.c (+97/-0)
hw/sh4/sh7750_regnames.h (+6/-0)
hw/sh4/sh7750_regs.h (+1277/-0)
hw/sh4/sh_pci.c (+204/-0)
hw/sh4/shix.c (+97/-0)
hw/smbios/Makefile.objs (+1/-0)
hw/smbios/smbios.c (+1139/-0)
hw/sparc/Makefile.objs (+1/-0)
hw/sparc/leon3.c (+225/-0)
hw/sparc/sun4m.c (+1593/-0)
hw/sparc64/Makefile.objs (+1/-0)
hw/sparc64/sun4u.c (+1032/-0)
hw/ssi/Makefile.objs (+6/-0)
hw/ssi/omap_spi.c (+373/-0)
hw/ssi/pl022.c (+326/-0)
hw/ssi/ssi.c (+174/-0)
hw/ssi/xilinx_spi.c (+390/-0)
hw/ssi/xilinx_spips.c (+771/-0)
hw/timer/Makefile.objs (+35/-0)
hw/timer/a9gtimer.c (+369/-0)
hw/timer/allwinner-a10-pit.c (+295/-0)
hw/timer/arm_mptimer.c (+300/-0)
hw/timer/arm_timer.c (+410/-0)
hw/timer/cadence_ttc.c (+491/-0)
hw/timer/digic-timer.c (+162/-0)
hw/timer/ds1338.c (+240/-0)
hw/timer/etraxfs_timer.c (+357/-0)
hw/timer/exynos4210_mct.c (+1481/-0)
hw/timer/exynos4210_pwm.c (+425/-0)
hw/timer/exynos4210_rtc.c (+595/-0)
hw/timer/grlib_gptimer.c (+411/-0)
hw/timer/hpet.c (+797/-0)
hw/timer/i8254.c (+383/-0)
hw/timer/i8254_common.c (+306/-0)
hw/timer/imx_epit.c (+345/-0)
hw/timer/imx_gpt.c (+463/-0)
hw/timer/lm32_timer.c (+235/-0)
hw/timer/m48t59.c (+944/-0)
hw/timer/mc146818rtc.c (+965/-0)
hw/timer/milkymist-sysctl.c (+341/-0)
hw/timer/omap_gptimer.c (+487/-0)
hw/timer/omap_synctimer.c (+102/-0)
hw/timer/pl031.c (+269/-0)
hw/timer/puv3_ost.c (+156/-0)
hw/timer/pxa2xx_timer.c (+596/-0)
hw/timer/sh_timer.c (+334/-0)
hw/timer/slavio_timer.c (+434/-0)
hw/timer/stm32f2xx_timer.c (+328/-0)
hw/timer/tusb6010.c (+816/-0)
hw/timer/twl92230.c (+887/-0)
hw/timer/xilinx_timer.c (+265/-0)
hw/tpm/Makefile.objs (+2/-0)
hw/tpm/tpm_int.h (+75/-0)
hw/tpm/tpm_passthrough.c (+541/-0)
hw/tpm/tpm_tis.c (+1099/-0)
hw/tpm/tpm_tis.h (+70/-0)
hw/tpm/tpm_util.c (+126/-0)
hw/tpm/tpm_util.h (+28/-0)
hw/tricore/Makefile.objs (+1/-0)
hw/tricore/tricore_testboard.c (+125/-0)
hw/unicore32/Makefile.objs (+4/-0)
hw/unicore32/puv3.c (+140/-0)
hw/usb/Makefile.objs (+38/-0)
hw/usb/bus.c (+761/-0)
hw/usb/ccid-card-emulated.c (+602/-0)
hw/usb/ccid-card-passthru.c (+413/-0)
hw/usb/ccid.h (+65/-0)
hw/usb/combined-packet.c (+187/-0)
hw/usb/core.c (+794/-0)
hw/usb/desc-msos.c (+238/-0)
hw/usb/desc.c (+804/-0)
hw/usb/desc.h (+245/-0)
hw/usb/dev-audio.c (+702/-0)
hw/usb/dev-bluetooth.c (+579/-0)
hw/usb/dev-hid.c (+881/-0)
hw/usb/dev-hub.c (+594/-0)
hw/usb/dev-mtp.c (+1133/-0)
hw/usb/dev-network.c (+1448/-0)
hw/usb/dev-serial.c (+649/-0)
hw/usb/dev-smartcard-reader.c (+1505/-0)
hw/usb/dev-storage.c (+869/-0)
hw/usb/dev-uas.c (+960/-0)
hw/usb/dev-wacom.c (+385/-0)
hw/usb/hcd-ehci-pci.c (+271/-0)
hw/usb/hcd-ehci-sysbus.c (+229/-0)
hw/usb/hcd-ehci.c (+2533/-0)
hw/usb/hcd-ehci.h (+383/-0)
hw/usb/hcd-musb.c (+1552/-0)
hw/usb/hcd-ohci.c (+2157/-0)
hw/usb/hcd-uhci.c (+1423/-0)
hw/usb/hcd-xhci.c (+3914/-0)
hw/usb/host-legacy.c (+143/-0)
hw/usb/host-libusb.c (+1686/-0)
hw/usb/host-stub.c (+47/-0)
hw/usb/host.h (+44/-0)
hw/usb/libhw.c (+70/-0)
hw/usb/quirks-ftdi-ids.h (+1255/-0)
hw/usb/quirks-pl2303-ids.h (+150/-0)
hw/usb/quirks.c (+53/-0)
hw/usb/quirks.h (+910/-0)
hw/usb/redirect.c (+2517/-0)
hw/vfio/Makefile.objs (+6/-0)
hw/vfio/calxeda-xgmac.c (+55/-0)
hw/vfio/common.c (+1004/-0)
hw/vfio/pci-quirks.c (+1204/-0)
hw/vfio/pci.c (+2685/-0)
hw/vfio/pci.h (+159/-0)
hw/vfio/platform.c (+739/-0)
hw/virtio/Makefile.objs (+8/-0)
hw/virtio/dataplane/Makefile.objs (+1/-0)
hw/virtio/dataplane/vring.c (+526/-0)
hw/virtio/vhost-backend.c (+211/-0)
hw/virtio/vhost-user.c (+637/-0)
hw/virtio/vhost.c (+1264/-0)
hw/virtio/virtio-balloon.c (+465/-0)
hw/virtio/virtio-bus.c (+181/-0)
hw/virtio/virtio-mmio.c (+579/-0)
hw/virtio/virtio-pci.c (+2534/-0)
hw/virtio/virtio-pci.h (+315/-0)
hw/virtio/virtio-rng.c (+267/-0)
hw/virtio/virtio.c (+1803/-0)
hw/watchdog/Makefile.objs (+4/-0)
hw/watchdog/watchdog.c (+152/-0)
hw/watchdog/wdt_diag288.c (+130/-0)
hw/watchdog/wdt_i6300esb.c (+465/-0)
hw/watchdog/wdt_ib700.c (+156/-0)
hw/xen/Makefile.objs (+6/-0)
hw/xen/xen-host-pci-device.c (+406/-0)
hw/xen/xen-host-pci-device.h (+57/-0)
hw/xen/xen_backend.c (+808/-0)
hw/xen/xen_devconfig.c (+175/-0)
hw/xen/xen_pt.c (+961/-0)
hw/xen/xen_pt.h (+332/-0)
hw/xen/xen_pt_config_init.c (+2097/-0)
hw/xen/xen_pt_graphics.c (+272/-0)
hw/xen/xen_pt_msi.c (+644/-0)
hw/xenpv/Makefile.objs (+2/-0)
hw/xenpv/xen_domainbuild.c (+299/-0)
hw/xenpv/xen_domainbuild.h (+13/-0)
hw/xenpv/xen_machine_pv.c (+104/-0)
hw/xtensa/Makefile.objs (+3/-0)
hw/xtensa/bootparam.h (+49/-0)
hw/xtensa/pic_cpu.c (+166/-0)
hw/xtensa/sim.c (+115/-0)
hw/xtensa/xtfpga.c (+512/-0)
include/block/accounting.h (+85/-0)
include/block/aio.h (+445/-0)
include/block/block.h (+640/-0)
include/block/block_int.h (+700/-0)
include/block/blockjob.h (+446/-0)
include/block/nbd.h (+106/-0)
include/block/qapi.h (+46/-0)
include/block/scsi.h (+309/-0)
include/block/snapshot.h (+96/-0)
include/block/thread-pool.h (+37/-0)
include/block/throttle-groups.h (+46/-0)
include/block/write-threshold.h (+64/-0)
include/config.h (+2/-0)
include/crypto/aes.h (+68/-0)
include/crypto/cipher.h (+210/-0)
include/crypto/desrfb.h (+49/-0)
include/crypto/hash.h (+189/-0)
include/crypto/init.h (+29/-0)
include/crypto/tlscreds.h (+68/-0)
include/crypto/tlscredsanon.h (+112/-0)
include/crypto/tlscredsx509.h (+113/-0)
include/crypto/tlssession.h (+322/-0)
include/disas/bfd.h (+492/-0)
include/disas/disas.h (+43/-0)
include/elf.h (+1557/-0)
include/exec/address-spaces.h (+41/-0)
include/exec/cpu-all.h (+288/-0)
include/exec/cpu-common.h (+142/-0)
include/exec/cpu-defs.h (+155/-0)
include/exec/cpu_ldst.h (+441/-0)
include/exec/cpu_ldst_template.h (+184/-0)
include/exec/cpu_ldst_useronly_template.h (+106/-0)
include/exec/cputlb.h (+31/-0)
include/exec/exec-all.h (+408/-0)
include/exec/gdbstub.h (+125/-0)
include/exec/gen-icount.h (+79/-0)
include/exec/helper-gen.h (+72/-0)
include/exec/helper-head.h (+134/-0)
include/exec/helper-proto.h (+40/-0)
include/exec/helper-tcg.h (+49/-0)
include/exec/hwaddr.h (+20/-0)
include/exec/ioport.h (+80/-0)
include/exec/memattrs.h (+49/-0)
include/exec/memory-internal.h (+35/-0)
include/exec/memory.h (+1361/-0)
include/exec/poison.h (+62/-0)
include/exec/ram_addr.h (+292/-0)
include/exec/semihost.h (+62/-0)
include/exec/softmmu-semi.h (+98/-0)
include/exec/tb-hash.h (+51/-0)
include/exec/user/abitypes.h (+66/-0)
include/exec/user/thunk.h (+191/-0)
include/fpu/softfloat.h (+762/-0)
include/glib-compat.h (+237/-0)
include/hw/acpi/acpi-defs.h (+573/-0)
include/hw/acpi/acpi.h (+199/-0)
include/hw/acpi/acpi_dev_interface.h (+43/-0)
include/hw/acpi/aml-build.h (+289/-0)
include/hw/acpi/bios-linker-loader.h (+27/-0)
include/hw/acpi/cpu_hotplug.h (+28/-0)
include/hw/acpi/ich9.h (+80/-0)
include/hw/acpi/memory_hotplug.h (+48/-0)
include/hw/acpi/pc-hotplug.h (+59/-0)
include/hw/acpi/pcihp.h (+80/-0)
include/hw/acpi/piix4.h (+8/-0)
include/hw/acpi/tco.h (+82/-0)
include/hw/acpi/tpm.h (+34/-0)
include/hw/arm/allwinner-a10.h (+42/-0)
include/hw/arm/arm.h (+129/-0)
include/hw/arm/digic.h (+43/-0)
include/hw/arm/exynos4210.h (+137/-0)
include/hw/arm/fdt.h (+34/-0)
include/hw/arm/fsl-imx25.h (+249/-0)
include/hw/arm/fsl-imx31.h (+122/-0)
include/hw/arm/linux-boot-if.h (+43/-0)
include/hw/arm/omap.h (+1015/-0)
include/hw/arm/primecell.h (+12/-0)
include/hw/arm/pxa.h (+191/-0)
include/hw/arm/sharpsl.h (+17/-0)
include/hw/arm/soc_dma.h (+116/-0)
include/hw/arm/stm32f205_soc.h (+57/-0)
include/hw/arm/sysbus-fdt.h (+60/-0)
include/hw/arm/virt-acpi-build.h (+46/-0)
include/hw/arm/virt.h (+70/-0)
include/hw/arm/xlnx-zynqmp.h (+75/-0)
include/hw/audio/audio.h (+10/-0)
include/hw/audio/pcspk.h (+47/-0)
include/hw/block/block.h (+75/-0)
include/hw/block/fdc.h (+26/-0)
include/hw/block/flash.h (+64/-0)
include/hw/boards.h (+156/-0)
include/hw/bt.h (+2180/-0)
include/hw/char/cadence_uart.h (+53/-0)
include/hw/char/digic-uart.h (+47/-0)
include/hw/char/escc.h (+14/-0)
include/hw/char/imx_serial.h (+102/-0)
include/hw/char/lm32_juart.h (+13/-0)
include/hw/char/serial.h (+97/-0)
include/hw/char/stm32f2xx_usart.h (+73/-0)
include/hw/compat.h (+80/-0)
include/hw/cpu/a15mpcore.h (+44/-0)
include/hw/cpu/a9mpcore.h (+39/-0)
include/hw/cpu/arm11mpcore.h (+35/-0)
include/hw/cris/etraxfs.h (+49/-0)
include/hw/cris/etraxfs_dma.h (+34/-0)
include/hw/devices.h (+70/-0)
include/hw/elf_ops.h (+404/-0)
include/hw/empty_slot.h (+7/-0)
include/hw/fw-path-provider.h (+48/-0)
include/hw/gpio/imx_gpio.h (+62/-0)
include/hw/hotplug.h (+92/-0)
include/hw/hw.h (+69/-0)
include/hw/i2c/i2c.h (+86/-0)
include/hw/i2c/imx_i2c.h (+87/-0)
include/hw/i2c/pm_smbus.h (+20/-0)
include/hw/i2c/smbus.h (+83/-0)
include/hw/i386/apic-msidef.h (+30/-0)
include/hw/i386/apic.h (+32/-0)
include/hw/i386/apic_internal.h (+225/-0)
include/hw/i386/ich9.h (+239/-0)
include/hw/i386/intel_iommu.h (+132/-0)
include/hw/i386/ioapic.h (+28/-0)
include/hw/i386/ioapic_internal.h (+110/-0)
include/hw/i386/pc.h (+807/-0)
include/hw/i386/topology.h (+135/-0)
include/hw/ide.h (+33/-0)
include/hw/input/adb.h (+87/-0)
include/hw/input/hid.h (+84/-0)
include/hw/input/ps2.h (+38/-0)
include/hw/intc/allwinner-a10-pic.h (+40/-0)
include/hw/intc/arm_gic.h (+42/-0)
include/hw/intc/arm_gic_common.h (+137/-0)
include/hw/intc/arm_gicv3_common.h (+68/-0)
include/hw/intc/imx_avic.h (+55/-0)
include/hw/intc/realview_gic.h (+28/-0)
include/hw/ipack/ipack.h (+87/-0)
include/hw/irq.h (+65/-0)
include/hw/isa/apm.h (+25/-0)
include/hw/isa/i8259_internal.h (+83/-0)
include/hw/isa/isa.h (+120/-0)
include/hw/isa/pc87312.h (+65/-0)
include/hw/isa/vt82c686.h (+11/-0)
include/hw/kvm/clock.h (+24/-0)
include/hw/lm32/lm32_pic.h (+14/-0)
include/hw/loader.h (+98/-0)
include/hw/m68k/mcf.h (+30/-0)
include/hw/mem/pc-dimm.h (+97/-0)
include/hw/mips/bios.h (+8/-0)
include/hw/mips/cpudevs.h (+17/-0)
include/hw/mips/mips.h (+23/-0)
include/hw/misc/a9scu.h (+31/-0)
include/hw/misc/arm11scu.h (+29/-0)
include/hw/misc/arm_integrator_debug.h (+18/-0)
include/hw/misc/imx_ccm.h (+91/-0)
include/hw/misc/ivshmem.h (+25/-0)
include/hw/misc/stm32f2xx_syscfg.h (+61/-0)
include/hw/misc/tmp105_regs.h (+50/-0)
include/hw/misc/zynq-xadc.h (+46/-0)
include/hw/net/allwinner_emac.h (+173/-0)
include/hw/net/cadence_gem.h (+73/-0)
include/hw/net/imx_fec.h (+113/-0)
include/hw/net/mii.h (+76/-0)
include/hw/nmi.h (+50/-0)
include/hw/nvram/eeprom93xx.h (+40/-0)
include/hw/nvram/fw_cfg.h (+101/-0)
include/hw/nvram/openbios_firmware_abi.h (+75/-0)
include/hw/pci-host/apb.h (+10/-0)
include/hw/pci-host/gpex.h (+56/-0)
include/hw/pci-host/pam.h (+93/-0)
include/hw/pci-host/ppce500.h (+9/-0)
include/hw/pci-host/q35.h (+179/-0)
include/hw/pci-host/spapr.h (+140/-0)
include/hw/pci/msi.h (+51/-0)
include/hw/pci/msix.h (+61/-0)
include/hw/pci/pci-assign.h (+27/-0)
include/hw/pci/pci.h (+772/-0)
include/hw/pci/pci_bridge.h (+70/-0)
include/hw/pci/pci_bus.h (+91/-0)
include/hw/pci/pci_host.h (+73/-0)
include/hw/pci/pci_ids.h (+168/-0)
include/hw/pci/pci_regs.h (+1/-0)
include/hw/pci/pcie.h (+133/-0)
include/hw/pci/pcie_aer.h (+106/-0)
include/hw/pci/pcie_host.h (+81/-0)
include/hw/pci/pcie_port.h (+61/-0)
include/hw/pci/pcie_regs.h (+158/-0)
include/hw/pci/shpc.h (+64/-0)
include/hw/pci/slotid_cap.h (+11/-0)
include/hw/pcmcia.h (+70/-0)
include/hw/platform-bus.h (+57/-0)
include/hw/ppc/mac_dbdma.h (+173/-0)
include/hw/ppc/openpic.h (+32/-0)
include/hw/ppc/ppc.h (+103/-0)
include/hw/ppc/ppc4xx.h (+64/-0)
include/hw/ppc/ppc_e500.h (+6/-0)
include/hw/ppc/spapr.h (+649/-0)
include/hw/ppc/spapr_drc.h (+202/-0)
include/hw/ppc/spapr_vio.h (+148/-0)
include/hw/ppc/xics.h (+170/-0)
include/hw/ptimer.h (+37/-0)
include/hw/qdev-core.h (+404/-0)
include/hw/qdev-dma.h (+10/-0)
include/hw/qdev-properties.h (+228/-0)
include/hw/qdev.h (+8/-0)
include/hw/s390x/adapter.h (+23/-0)
include/hw/s390x/ebcdic.h (+104/-0)
include/hw/s390x/event-facility.h (+198/-0)
include/hw/s390x/s390_flic.h (+79/-0)
include/hw/s390x/sclp.h (+228/-0)
include/hw/s390x/storage-keys.h (+60/-0)
include/hw/scsi/esp.h (+133/-0)
include/hw/scsi/scsi.h (+280/-0)
include/hw/sd/sd.h (+80/-0)
include/hw/sd/sdhci.h (+94/-0)
include/hw/sh4/sh.h (+57/-0)
include/hw/sh4/sh_intc.h (+83/-0)
include/hw/smbios/smbios.h (+269/-0)
include/hw/sparc/grlib.h (+120/-0)
include/hw/sparc/sparc32_dma.h (+12/-0)
include/hw/sparc/sun4m.h (+38/-0)
include/hw/ssi.h (+94/-0)
include/hw/stream.h (+57/-0)
include/hw/sysbus.h (+121/-0)
include/hw/timer/a9gtimer.h (+97/-0)
include/hw/timer/allwinner-a10-pit.h (+67/-0)
include/hw/timer/arm_mptimer.h (+54/-0)
include/hw/timer/digic-timer.h (+46/-0)
include/hw/timer/hpet.h (+84/-0)
include/hw/timer/i8254.h (+75/-0)
include/hw/timer/i8254_internal.h (+84/-0)
include/hw/timer/imx_epit.h (+79/-0)
include/hw/timer/imx_gpt.h (+107/-0)
include/hw/timer/m48t59.h (+34/-0)
include/hw/timer/mc146818rtc.h (+13/-0)
include/hw/timer/mc146818rtc_regs.h (+67/-0)
include/hw/timer/stm32f2xx_timer.h (+101/-0)
include/hw/tricore/tricore.h (+11/-0)
include/hw/unicore32/puv3.h (+49/-0)
include/hw/usb.h (+611/-0)
include/hw/usb/ehci-regs.h (+82/-0)
include/hw/usb/uhci-regs.h (+40/-0)
include/hw/vfio/vfio-calxeda-xgmac.h (+46/-0)
include/hw/vfio/vfio-common.h (+141/-0)
include/hw/vfio/vfio-platform.h (+77/-0)
include/hw/vfio/vfio.h (+9/-0)
include/hw/virtio/dataplane/vring-accessors.h (+75/-0)
include/hw/virtio/dataplane/vring.h (+51/-0)
include/hw/virtio/vhost-backend.h (+107/-0)
include/hw/virtio/vhost-scsi.h (+44/-0)
include/hw/virtio/vhost.h (+88/-0)
include/hw/virtio/virtio-9p.h (+24/-0)
include/hw/virtio/virtio-access.h (+196/-0)
include/hw/virtio/virtio-balloon.h (+48/-0)
include/hw/virtio/virtio-blk.h (+91/-0)
include/hw/virtio/virtio-bus.h (+114/-0)
include/hw/virtio/virtio-gpu.h (+162/-0)
include/hw/virtio/virtio-input.h (+119/-0)
include/hw/virtio/virtio-net.h (+102/-0)
include/hw/virtio/virtio-rng.h (+50/-0)
include/hw/virtio/virtio-scsi.h (+166/-0)
include/hw/virtio/virtio-serial.h (+224/-0)
include/hw/virtio/virtio.h (+292/-0)
include/hw/watchdog/wdt_diag288.h (+36/-0)
include/hw/xen/xen.h (+54/-0)
include/hw/xen/xen_backend.h (+111/-0)
include/hw/xen/xen_common.h (+458/-0)
include/libdecnumber/dconfig.h (+40/-0)
include/libdecnumber/decContext.h (+257/-0)
include/libdecnumber/decDPD.h (+1214/-0)
include/libdecnumber/decNumber.h (+202/-0)
include/libdecnumber/decNumberLocal.h (+665/-0)
include/libdecnumber/dpd/decimal128.h (+100/-0)
include/libdecnumber/dpd/decimal128Local.h (+47/-0)
include/libdecnumber/dpd/decimal32.h (+98/-0)
include/libdecnumber/dpd/decimal64.h (+100/-0)
include/migration/block.h (+23/-0)
include/migration/migration.h (+324/-0)
include/migration/page_cache.h (+86/-0)
include/migration/postcopy-ram.h (+99/-0)
include/migration/qemu-file.h (+332/-0)
include/migration/vmstate.h (+852/-0)
include/monitor/hmp-target.h (+49/-0)
include/monitor/monitor.h (+57/-0)
include/monitor/qdev.h (+17/-0)
include/net/checksum.h (+54/-0)
include/net/eth.h (+347/-0)
include/net/filter.h (+77/-0)
include/net/net.h (+223/-0)
include/net/queue.h (+76/-0)
include/net/slirp.h (+47/-0)
include/net/tap.h (+41/-0)
include/net/vhost-user.h (+17/-0)
include/net/vhost_net.h (+34/-0)
include/qapi/dealloc-visitor.h (+26/-0)
include/qapi/error.h (+229/-0)
include/qapi/opts-visitor.h (+37/-0)
include/qapi/qmp-event.h (+27/-0)
include/qapi/qmp-input-visitor.h (+29/-0)
include/qapi/qmp-output-visitor.h (+28/-0)
include/qapi/qmp/dispatch.h (+58/-0)
include/qapi/qmp/json-lexer.h (+57/-0)
include/qapi/qmp/json-parser.h (+24/-0)
include/qapi/qmp/json-streamer.h (+48/-0)
include/qapi/qmp/qbool.h (+29/-0)
include/qapi/qmp/qdict.h (+80/-0)
include/qapi/qmp/qerror.h (+112/-0)
include/qapi/qmp/qfloat.h (+29/-0)
include/qapi/qmp/qint.h (+28/-0)
include/qapi/qmp/qjson.h (+29/-0)
include/qapi/qmp/qlist.h (+63/-0)
include/qapi/qmp/qobject.h (+118/-0)
include/qapi/qmp/qstring.h (+36/-0)
include/qapi/qmp/types.h (+25/-0)
include/qapi/string-input-visitor.h (+25/-0)
include/qapi/string-output-visitor.h (+26/-0)
include/qapi/util.h (+17/-0)
include/qapi/visitor-impl.h (+69/-0)
include/qapi/visitor.h (+65/-0)
include/qemu-common.h (+504/-0)
include/qemu-io.h (+51/-0)
include/qemu/acl.h (+74/-0)
include/qemu/atomic.h (+269/-0)
include/qemu/bitmap.h (+249/-0)
include/qemu/bitops.h (+433/-0)
include/qemu/bswap.h (+443/-0)
include/qemu/buffer.h (+161/-0)
include/qemu/compatfd.h (+43/-0)
include/qemu/compiler.h (+112/-0)
include/qemu/config-file.h (+33/-0)
include/qemu/coroutine.h (+219/-0)
include/qemu/coroutine_int.h (+54/-0)
include/qemu/crc32c.h (+35/-0)
include/qemu/envlist.h (+22/-0)
include/qemu/error-report.h (+46/-0)
include/qemu/event_notifier.h (+46/-0)
include/qemu/fifo8.h (+160/-0)
include/qemu/fprintf-fn.h (+17/-0)
include/qemu/hbitmap.h (+240/-0)
include/qemu/host-utils.h (+521/-0)
include/qemu/int128.h (+149/-0)
include/qemu/iov.h (+115/-0)
include/qemu/log.h (+185/-0)
include/qemu/main-loop.h (+273/-0)
include/qemu/memfd.h (+26/-0)
include/qemu/mmap-alloc.h (+12/-0)
include/qemu/module.h (+61/-0)
include/qemu/notify.h (+72/-0)
include/qemu/option.h (+138/-0)
include/qemu/option_int.h (+54/-0)
include/qemu/osdep.h (+318/-0)
include/qemu/queue.h (+439/-0)
include/qemu/range.h (+135/-0)
include/qemu/ratelimit.h (+48/-0)
include/qemu/rcu.h (+156/-0)
include/qemu/rcu_queue.h (+134/-0)
include/qemu/readline.h (+63/-0)
include/qemu/rfifolock.h (+54/-0)
include/qemu/seqlock.h (+72/-0)
include/qemu/sockets.h (+125/-0)
include/qemu/thread-posix.h (+36/-0)
include/qemu/thread-win32.h (+34/-0)
include/qemu/thread.h (+65/-0)
include/qemu/throttle.h (+132/-0)
include/qemu/timed-average.h (+64/-0)
include/qemu/timer.h (+1021/-0)
include/qemu/typedefs.h (+93/-0)
include/qemu/uri.h (+113/-0)
include/qemu/xattr.h (+30/-0)
include/qjson.h (+29/-0)
include/qom/cpu.h (+778/-0)
include/qom/object.h (+1574/-0)
include/qom/object_interfaces.h (+75/-0)
include/qom/qom-qobject.h (+42/-0)
include/standard-headers/asm-s390/kvm_virtio.h (+64/-0)
include/standard-headers/asm-s390/virtio-ccw.h (+21/-0)
include/standard-headers/asm-x86/hyperv.h (+260/-0)
include/standard-headers/linux/if_ether.h (+1/-0)
include/standard-headers/linux/input.h (+1203/-0)
include/standard-headers/linux/pci_regs.h (+908/-0)
include/standard-headers/linux/types.h (+2/-0)
include/standard-headers/linux/virtio_9p.h (+44/-0)
include/standard-headers/linux/virtio_balloon.h (+84/-0)
include/standard-headers/linux/virtio_blk.h (+147/-0)
include/standard-headers/linux/virtio_config.h (+64/-0)
include/standard-headers/linux/virtio_console.h (+78/-0)
include/standard-headers/linux/virtio_gpu.h (+316/-0)
include/standard-headers/linux/virtio_ids.h (+45/-0)
include/standard-headers/linux/virtio_input.h (+76/-0)
include/standard-headers/linux/virtio_net.h (+245/-0)
include/standard-headers/linux/virtio_pci.h (+199/-0)
include/standard-headers/linux/virtio_ring.h (+172/-0)
include/standard-headers/linux/virtio_rng.h (+8/-0)
include/standard-headers/linux/virtio_scsi.h (+172/-0)
include/standard-headers/linux/virtio_types.h (+46/-0)
include/sysemu/accel.h (+62/-0)
include/sysemu/arch_init.h (+40/-0)
include/sysemu/balloon.h (+28/-0)
include/sysemu/block-backend.h (+191/-0)
include/sysemu/blockdev.h (+68/-0)
include/sysemu/bt.h (+20/-0)
include/sysemu/char.h (+371/-0)
include/sysemu/cpus.h (+29/-0)
include/sysemu/device_tree.h (+122/-0)
include/sysemu/dma.h (+221/-0)
include/sysemu/dump-arch.h (+28/-0)
include/sysemu/dump.h (+191/-0)
include/sysemu/hostmem.h (+68/-0)
include/sysemu/iothread.h (+39/-0)
include/sysemu/kvm.h (+503/-0)
include/sysemu/kvm_int.h (+39/-0)
include/sysemu/memory_mapping.h (+82/-0)
include/sysemu/numa.h (+36/-0)
include/sysemu/os-posix.h (+54/-0)
include/sysemu/os-win32.h (+132/-0)
include/sysemu/qtest.h (+40/-0)
include/sysemu/replay.h (+120/-0)
include/sysemu/rng-random.h (+22/-0)
include/sysemu/rng.h (+82/-0)
include/sysemu/seccomp.h (+22/-0)
include/sysemu/sysemu.h (+259/-0)
include/sysemu/tpm.h (+45/-0)
include/sysemu/tpm_backend.h (+233/-0)
include/sysemu/tpm_backend_int.h (+43/-0)
include/sysemu/watchdog.h (+43/-0)
include/sysemu/xen-mapcache.h (+56/-0)
include/trace-tcg.h (+7/-0)
include/trace.h (+7/-0)
include/ui/console.h (+442/-0)
include/ui/egl-context.h (+14/-0)
include/ui/egl-helpers.h (+16/-0)
include/ui/gtk.h (+134/-0)
include/ui/input.h (+68/-0)
include/ui/pixel_ops.h (+53/-0)
include/ui/qemu-pixman.h (+80/-0)
include/ui/qemu-spice.h (+91/-0)
include/ui/sdl2.h (+51/-0)
include/ui/shader.h (+15/-0)
include/ui/spice-display.h (+153/-0)
iohandler.c (+121/-0)
ioport.c (+297/-0)
iothread.c (+175/-0)
kvm-all.c (+2361/-0)
kvm-stub.c (+154/-0)
libdecnumber/decContext.c (+433/-0)
libdecnumber/decNumber.c (+8195/-0)
libdecnumber/dpd/decimal128.c (+564/-0)
libdecnumber/dpd/decimal32.c (+489/-0)
libdecnumber/dpd/decimal64.c (+850/-0)
linux-headers/COPYING (+356/-0)
linux-headers/README (+2/-0)
linux-headers/asm-arm/kvm.h (+222/-0)
linux-headers/asm-arm/kvm_para.h (+1/-0)
linux-headers/asm-arm/unistd.h (+448/-0)
linux-headers/asm-arm64/kvm.h (+250/-0)
linux-headers/asm-arm64/kvm_para.h (+1/-0)
linux-headers/asm-arm64/unistd.h (+16/-0)
linux-headers/asm-generic/kvm_para.h (+4/-0)
linux-headers/asm-mips/kvm.h (+208/-0)
linux-headers/asm-mips/kvm_para.h (+5/-0)
linux-headers/asm-mips/unistd.h (+1063/-0)
linux-headers/asm-powerpc/epapr_hcalls.h (+98/-0)
linux-headers/asm-powerpc/kvm.h (+603/-0)
linux-headers/asm-powerpc/kvm_para.h (+97/-0)
linux-headers/asm-powerpc/unistd.h (+392/-0)
linux-headers/asm-s390/kvm.h (+182/-0)
linux-headers/asm-s390/kvm_para.h (+11/-0)
linux-headers/asm-s390/unistd.h (+404/-0)
linux-headers/asm-x86/hyperv.h (+1/-0)
linux-headers/asm-x86/kvm.h (+360/-0)
linux-headers/asm-x86/kvm_para.h (+101/-0)
linux-headers/asm-x86/unistd.h (+15/-0)
linux-headers/asm-x86/unistd_32.h (+377/-0)
linux-headers/asm-x86/unistd_64.h (+330/-0)
linux-headers/asm-x86/unistd_x32.h (+319/-0)
linux-headers/linux/kvm.h (+1272/-0)
linux-headers/linux/kvm_para.h (+32/-0)
linux-headers/linux/psci.h (+90/-0)
linux-headers/linux/userfaultfd.h (+167/-0)
linux-headers/linux/vfio.h (+594/-0)
linux-headers/linux/vhost.h (+172/-0)
linux-headers/linux/virtio_config.h (+1/-0)
linux-headers/linux/virtio_ring.h (+1/-0)
linux-user/Makefile.objs (+7/-0)
linux-user/aarch64/syscall.h (+13/-0)
linux-user/aarch64/syscall_nr.h (+323/-0)
linux-user/aarch64/target_cpu.h (+38/-0)
linux-user/aarch64/target_signal.h (+29/-0)
linux-user/aarch64/target_structs.h (+58/-0)
linux-user/aarch64/termbits.h (+220/-0)
linux-user/alpha/syscall.h (+257/-0)
linux-user/alpha/syscall_nr.h (+446/-0)
linux-user/alpha/target_cpu.h (+36/-0)
linux-user/alpha/target_signal.h (+57/-0)
linux-user/alpha/target_structs.h (+48/-0)
linux-user/alpha/termbits.h (+264/-0)
linux-user/arm/nwfpe/Makefile.objs (+2/-0)
linux-user/arm/nwfpe/double_cpdo.c (+295/-0)
linux-user/arm/nwfpe/extended_cpdo.c (+272/-0)
linux-user/arm/nwfpe/fpa11.c (+237/-0)
linux-user/arm/nwfpe/fpa11.h (+130/-0)
linux-user/arm/nwfpe/fpa11.inl (+50/-0)
linux-user/arm/nwfpe/fpa11_cpdo.c (+112/-0)
linux-user/arm/nwfpe/fpa11_cpdt.c (+381/-0)
linux-user/arm/nwfpe/fpa11_cprt.c (+283/-0)
linux-user/arm/nwfpe/fpopcode.c (+90/-0)
linux-user/arm/nwfpe/fpopcode.h (+390/-0)
linux-user/arm/nwfpe/fpsr.h (+107/-0)
linux-user/arm/nwfpe/single_cpdo.c (+252/-0)
linux-user/arm/syscall.h (+50/-0)
linux-user/arm/syscall_nr.h (+386/-0)
linux-user/arm/target_cpu.h (+48/-0)
linux-user/arm/target_signal.h (+29/-0)
linux-user/arm/target_structs.h (+52/-0)
linux-user/arm/termbits.h (+216/-0)
linux-user/cris/syscall.h (+46/-0)
linux-user/cris/syscall_nr.h (+338/-0)
linux-user/cris/target_cpu.h (+36/-0)
linux-user/cris/target_signal.h (+29/-0)
linux-user/cris/target_structs.h (+58/-0)
linux-user/cris/termbits.h (+213/-0)
linux-user/elfload.c (+3122/-0)
linux-user/errno_defs.h (+141/-0)
linux-user/flat.h (+67/-0)
linux-user/flatload.c (+812/-0)
linux-user/i386/syscall.h (+152/-0)
linux-user/i386/syscall_nr.h (+355/-0)
linux-user/i386/target_cpu.h (+48/-0)
linux-user/i386/target_signal.h (+29/-0)
linux-user/i386/target_structs.h (+58/-0)
linux-user/i386/termbits.h (+226/-0)
linux-user/ioctls.h (+388/-0)
linux-user/linux_loop.h (+95/-0)
linux-user/linuxload.c (+173/-0)
linux-user/m68k-sim.c (+171/-0)
linux-user/m68k/syscall.h (+25/-0)
linux-user/m68k/syscall_nr.h (+351/-0)
linux-user/m68k/target_cpu.h (+40/-0)
linux-user/m68k/target_signal.h (+29/-0)
linux-user/m68k/target_structs.h (+58/-0)
linux-user/m68k/termbits.h (+227/-0)
linux-user/main.c (+4669/-0)
linux-user/microblaze/syscall.h (+56/-0)
linux-user/microblaze/syscall_nr.h (+384/-0)
linux-user/microblaze/target_cpu.h (+35/-0)
linux-user/microblaze/target_signal.h (+29/-0)
linux-user/microblaze/target_structs.h (+58/-0)
linux-user/microblaze/termbits.h (+213/-0)
linux-user/mips/syscall.h (+233/-0)
linux-user/mips/syscall_nr.h (+353/-0)
linux-user/mips/target_cpu.h (+36/-0)
linux-user/mips/target_signal.h (+29/-0)
linux-user/mips/target_structs.h (+48/-0)
linux-user/mips/termbits.h (+245/-0)
linux-user/mips64/syscall.h (+230/-0)
linux-user/mips64/syscall_nr.h (+633/-0)
linux-user/mips64/target_cpu.h (+19/-0)
linux-user/mips64/target_signal.h (+29/-0)
linux-user/mips64/target_structs.h (+2/-0)
linux-user/mips64/termbits.h (+245/-0)
linux-user/mmap.c (+773/-0)
linux-user/openrisc/syscall.h (+29/-0)
linux-user/openrisc/syscall_nr.h (+510/-0)
linux-user/openrisc/target_cpu.h (+38/-0)
linux-user/openrisc/target_signal.h (+26/-0)
linux-user/openrisc/target_structs.h (+58/-0)
linux-user/openrisc/termbits.h (+294/-0)
linux-user/ppc/syscall.h (+75/-0)
linux-user/ppc/syscall_nr.h (+370/-0)
linux-user/ppc/target_cpu.h (+51/-0)
linux-user/ppc/target_signal.h (+29/-0)
linux-user/ppc/target_structs.h (+60/-0)
linux-user/ppc/termbits.h (+236/-0)
linux-user/qemu.h (+447/-0)
linux-user/s390x/syscall.h (+29/-0)
linux-user/s390x/syscall_nr.h (+363/-0)
linux-user/s390x/target_cpu.h (+39/-0)
linux-user/s390x/target_signal.h (+26/-0)
linux-user/s390x/target_structs.h (+63/-0)
linux-user/s390x/termbits.h (+283/-0)
linux-user/sh4/syscall.h (+17/-0)
linux-user/sh4/syscall_nr.h (+374/-0)
linux-user/sh4/target_cpu.h (+35/-0)
linux-user/sh4/target_signal.h (+29/-0)
linux-user/sh4/target_structs.h (+58/-0)
linux-user/sh4/termbits.h (+274/-0)
linux-user/signal.c (+5831/-0)
linux-user/socket.h (+340/-0)
linux-user/sparc/syscall.h (+20/-0)
linux-user/sparc/syscall_nr.h (+311/-0)
linux-user/sparc/target_cpu.h (+44/-0)
linux-user/sparc/target_signal.h (+36/-0)
linux-user/sparc/target_structs.h (+63/-0)
linux-user/sparc/termbits.h (+279/-0)
linux-user/sparc64/syscall.h (+21/-0)
linux-user/sparc64/syscall_nr.h (+343/-0)
linux-user/sparc64/target_cpu.h (+1/-0)
linux-user/sparc64/target_signal.h (+36/-0)
linux-user/sparc64/target_structs.h (+58/-0)
linux-user/sparc64/termbits.h (+279/-0)
linux-user/strace.c (+1618/-0)
linux-user/strace.list (+1544/-0)
linux-user/syscall.c (+10036/-0)
linux-user/syscall_defs.h (+2585/-0)
linux-user/syscall_types.h (+255/-0)
linux-user/target_flat.h (+10/-0)
linux-user/tilegx/syscall.h (+43/-0)
linux-user/tilegx/syscall_nr.h (+324/-0)
linux-user/tilegx/target_cpu.h (+35/-0)
linux-user/tilegx/target_signal.h (+28/-0)
linux-user/tilegx/target_structs.h (+46/-0)
linux-user/tilegx/termbits.h (+274/-0)
linux-user/uaccess.c (+65/-0)
linux-user/uname.c (+169/-0)
linux-user/uname.h (+10/-0)
linux-user/unicore32/syscall.h (+60/-0)
linux-user/unicore32/syscall_nr.h (+371/-0)
linux-user/unicore32/target_cpu.h (+27/-0)
linux-user/unicore32/target_signal.h (+26/-0)
linux-user/unicore32/target_structs.h (+58/-0)
linux-user/unicore32/termbits.h (+2/-0)
linux-user/vm86.c (+495/-0)
linux-user/x86_64/syscall.h (+102/-0)
linux-user/x86_64/syscall_nr.h (+314/-0)
linux-user/x86_64/target_cpu.h (+1/-0)
linux-user/x86_64/target_signal.h (+29/-0)
linux-user/x86_64/target_structs.h (+58/-0)
linux-user/x86_64/termbits.h (+247/-0)
main-loop.c (+522/-0)
memory.c (+2302/-0)
memory_mapping.c (+352/-0)
migration/Makefile.objs (+10/-0)
migration/block.c (+902/-0)
migration/exec.c (+69/-0)
migration/fd.c (+88/-0)
migration/migration.c (+1773/-0)
migration/postcopy-ram.c (+761/-0)
migration/qemu-file-buf.c (+463/-0)
migration/qemu-file-internal.h (+53/-0)
migration/qemu-file-stdio.c (+195/-0)
migration/qemu-file-unix.c (+324/-0)
migration/qemu-file.c (+677/-0)
migration/ram.c (+2544/-0)
migration/rdma.c (+3516/-0)
migration/savevm.c (+2189/-0)
migration/tcp.c (+103/-0)
migration/unix.c (+103/-0)
migration/vmstate.c (+890/-0)
migration/xbzrle.c (+175/-0)
module-common.c (+10/-0)
monitor.c (+4245/-0)
nbd.c (+1500/-0)
net/Makefile.objs (+17/-0)
net/checksum.c (+115/-0)
net/clients.h (+65/-0)
net/dump.c (+354/-0)
net/eth.c (+217/-0)
net/filter-buffer.c (+186/-0)
net/filter.c (+236/-0)
net/hub.c (+354/-0)
net/hub.h (+26/-0)
net/l2tpv3.c (+744/-0)
net/net.c (+1539/-0)
net/netmap.c (+463/-0)
net/queue.c (+278/-0)
net/slirp.c (+805/-0)
net/socket.c (+774/-0)
net/tap-aix.c (+87/-0)
net/tap-bsd.c (+255/-0)
net/tap-haiku.c (+86/-0)
net/tap-linux.c (+314/-0)
net/tap-linux.h (+54/-0)
net/tap-solaris.c (+254/-0)
net/tap-win32.c (+820/-0)
net/tap.c (+930/-0)
net/tap_int.h (+49/-0)
net/util.c (+60/-0)
net/util.h (+32/-0)
net/vde.c (+128/-0)
net/vhost-user.c (+326/-0)
numa.c (+596/-0)
os-posix.c (+336/-0)
os-win32.c (+129/-0)
page_cache.c (+245/-0)
pc-bios/Makefile (+19/-0)
pc-bios/README (+48/-0)
pc-bios/bamboo.dts (+200/-0)
pc-bios/keymaps/ar (+98/-0)
pc-bios/keymaps/bepo (+333/-0)
pc-bios/keymaps/common (+157/-0)
pc-bios/keymaps/cz (+94/-0)
pc-bios/keymaps/da (+120/-0)
pc-bios/keymaps/de (+114/-0)
pc-bios/keymaps/de-ch (+169/-0)
pc-bios/keymaps/en-gb (+119/-0)
pc-bios/keymaps/en-us (+35/-0)
pc-bios/keymaps/es (+105/-0)
pc-bios/keymaps/et (+85/-0)
pc-bios/keymaps/fi (+122/-0)
pc-bios/keymaps/fo (+76/-0)
pc-bios/keymaps/fr (+181/-0)
pc-bios/keymaps/fr-be (+134/-0)
pc-bios/keymaps/fr-ca (+50/-0)
pc-bios/keymaps/fr-ch (+114/-0)
pc-bios/keymaps/hr (+125/-0)
pc-bios/keymaps/hu (+115/-0)
pc-bios/keymaps/is (+139/-0)
pc-bios/keymaps/it (+115/-0)
pc-bios/keymaps/ja (+109/-0)
pc-bios/keymaps/lt (+57/-0)
pc-bios/keymaps/lv (+128/-0)
pc-bios/keymaps/mk (+101/-0)
pc-bios/keymaps/modifiers (+18/-0)
pc-bios/keymaps/nl (+59/-0)
pc-bios/keymaps/nl-be (+3/-0)
pc-bios/keymaps/no (+119/-0)
pc-bios/keymaps/pl (+122/-0)
pc-bios/keymaps/pt (+113/-0)
pc-bios/keymaps/pt-br (+69/-0)
pc-bios/keymaps/ru (+109/-0)
pc-bios/keymaps/sl (+110/-0)
pc-bios/keymaps/sv (+81/-0)
pc-bios/keymaps/th (+131/-0)
pc-bios/keymaps/tr (+123/-0)
pc-bios/optionrom/Makefile (+33/-0)
pc-bios/optionrom/kvmvapic.S (+335/-0)
pc-bios/optionrom/linuxboot.S (+195/-0)
pc-bios/optionrom/multiboot.S (+232/-0)
pc-bios/optionrom/optionrom.h (+152/-0)
pc-bios/qemu.rsrc (+1504/-0)
pc-bios/qemu_logo.svg (+1010/-0)
pc-bios/qemu_logo_no_text.svg (+976/-0)
pc-bios/s390-ccw/Makefile (+28/-0)
pc-bios/s390-ccw/bootmap.c (+701/-0)
pc-bios/s390-ccw/bootmap.h (+550/-0)
pc-bios/s390-ccw/cio.h (+342/-0)
pc-bios/s390-ccw/main.c (+116/-0)
pc-bios/s390-ccw/s390-ccw.h (+146/-0)
pc-bios/s390-ccw/sclp-ascii.c (+82/-0)
pc-bios/s390-ccw/sclp.h (+107/-0)
pc-bios/s390-ccw/start.S (+65/-0)
pc-bios/s390-ccw/virtio.c (+441/-0)
pc-bios/s390-ccw/virtio.h (+208/-0)
pc-bios/spapr-rtas/Makefile (+24/-0)
pc-bios/spapr-rtas/spapr-rtas.S (+37/-0)
po/Makefile (+52/-0)
po/de_DE.po (+85/-0)
po/fr_FR.po (+86/-0)
po/hu.po (+89/-0)
po/it.po (+85/-0)
po/messages.po (+85/-0)
po/tr.po (+88/-0)
po/zh_CN.po (+86/-0)
qapi-schema.json (+3973/-0)
qapi/Makefile.objs (+6/-0)
qapi/block-core.json (+2408/-0)
qapi/block.json (+180/-0)
qapi/common.json (+116/-0)
qapi/crypto.json (+21/-0)
qapi/event.json (+358/-0)
qapi/introspect.json (+289/-0)
qapi/opts-visitor.c (+557/-0)
qapi/qapi-dealloc-visitor.c (+234/-0)
qapi/qapi-util.c (+34/-0)
qapi/qapi-visit-core.c (+319/-0)
qapi/qmp-dispatch.c (+141/-0)
qapi/qmp-event.c (+66/-0)
qapi/qmp-input-visitor.c (+364/-0)
qapi/qmp-output-visitor.c (+253/-0)
qapi/qmp-registry.c (+91/-0)
qapi/rocker.json (+286/-0)
qapi/string-input-visitor.c (+347/-0)
qapi/string-output-visitor.c (+353/-0)
qapi/trace.json (+65/-0)
qdev-monitor.c (+863/-0)
qdict-test-data.txt (+4999/-0)
qemu-bridge-helper.c (+451/-0)
qemu-char.c (+4385/-0)
qemu-doc.texi (+3201/-0)
qemu-ga.texi (+137/-0)
qemu-img-cmds.hx (+77/-0)
qemu-img.c (+3103/-0)
qemu-img.texi (+554/-0)
qemu-io-cmds.c (+2450/-0)
qemu-io.c (+501/-0)
qemu-log.c (+177/-0)
qemu-nbd.c (+778/-0)
qemu-nbd.texi (+85/-0)
qemu-options-wrapper.h (+41/-0)
qemu-options.h (+36/-0)
qemu-options.hx (+3688/-0)
qemu-seccomp.c (+284/-0)
qemu-tech.texi (+699/-0)
qemu-timer.c (+654/-0)
qemu.nsi (+257/-0)
qemu.sasl (+36/-0)
qga/Makefile.objs (+8/-0)
qga/channel-posix.c (+274/-0)
qga/channel-win32.c (+360/-0)
qga/channel.h (+33/-0)
qga/commands-posix.c (+2523/-0)
qga/commands-win32.c (+1376/-0)
qga/commands.c (+463/-0)
qga/guest-agent-command-state.c (+73/-0)
qga/guest-agent-core.h (+50/-0)
qga/installer/qemu-ga.wxs (+185/-0)
qga/main.c (+1403/-0)
qga/qapi-schema.json (+999/-0)
qga/service-win32.c (+192/-0)
qga/service-win32.h (+31/-0)
qga/vss-win32.c (+166/-0)
qga/vss-win32.h (+27/-0)
qga/vss-win32/Makefile.objs (+23/-0)
qga/vss-win32/install.cpp (+465/-0)
qga/vss-win32/provider.cpp (+534/-0)
qga/vss-win32/qga-vss.def (+13/-0)
qga/vss-win32/qga-vss.idl (+20/-0)
qga/vss-win32/requester.cpp (+505/-0)
qga/vss-win32/requester.h (+46/-0)
qga/vss-win32/vss-common.h (+129/-0)
qjson.c (+129/-0)
qmp-commands.hx (+4747/-0)
qmp.c (+744/-0)
qobject/Makefile.objs (+2/-0)
qobject/json-lexer.c (+377/-0)
qobject/json-parser.c (+578/-0)
qobject/json-streamer.c (+125/-0)
qobject/qbool.c (+68/-0)
qobject/qdict.c (+787/-0)
qobject/qfloat.c (+68/-0)
qobject/qint.c (+67/-0)
qobject/qjson.c (+285/-0)
qobject/qlist.c (+169/-0)
qobject/qnull.c (+29/-0)
qobject/qstring.c (+149/-0)
qom/Makefile.objs (+4/-0)
qom/container.c (+52/-0)
qom/cpu.c (+382/-0)
qom/object.c (+2128/-0)
qom/object_interfaces.c (+44/-0)
qom/qom-qobject.c (+44/-0)
qtest.c (+689/-0)
replay/Makefile.objs (+5/-0)
replay/replay-events.c (+279/-0)
replay/replay-input.c (+160/-0)
replay/replay-internal.c (+206/-0)
replay/replay-internal.h (+140/-0)
replay/replay-time.c (+64/-0)
replay/replay.c (+342/-0)
roms/Makefile (+154/-0)
roms/config.seabios-128k (+8/-0)
roms/config.seabios-256k (+3/-0)
roms/config.vga-cirrus (+3/-0)
roms/config.vga-isavga (+3/-0)
roms/config.vga-qxl (+6/-0)
roms/config.vga-stdvga (+3/-0)
roms/config.vga-virtio (+6/-0)
roms/config.vga-vmware (+6/-0)
roms/configure-seabios.sh (+5/-0)
rules.mak (+373/-0)
scripts/acpi_extract.py (+367/-0)
scripts/acpi_extract_preprocess.py (+51/-0)
scripts/analyse-9p-simpletrace.py (+213/-0)
scripts/analyze-migration.py (+610/-0)
scripts/check-qerror.sh (+22/-0)
scripts/checkpatch.pl (+2579/-0)
scripts/cleanup-trace-events.pl (+51/-0)
scripts/cocci-macro-file.h (+119/-0)
scripts/coverity-model.c (+343/-0)
scripts/create_config (+116/-0)
scripts/disas-objdump.pl (+99/-0)
scripts/dump-guest-memory.py (+339/-0)
scripts/extract-vsssdk-headers (+35/-0)
scripts/feature_to_c.sh (+78/-0)
scripts/get_maintainer.pl (+2121/-0)
scripts/gtester-cat (+26/-0)
scripts/hxtool (+105/-0)
scripts/kvm/kvm_flightrecorder (+126/-0)
scripts/kvm/kvm_stat (+646/-0)
scripts/kvm/kvm_stat.texi (+55/-0)
scripts/kvm/vmxcap (+260/-0)
scripts/make-release (+25/-0)
scripts/make_device_config.sh (+30/-0)
scripts/ordereddict.py (+128/-0)
scripts/qapi-commands.py (+329/-0)
scripts/qapi-event.py (+189/-0)
scripts/qapi-introspect.py (+218/-0)
scripts/qapi-types.py (+353/-0)
scripts/qapi-visit.py (+441/-0)
scripts/qapi.py (+1733/-0)
scripts/qemu-binfmt-conf.sh (+72/-0)
scripts/qemu-gdb.py (+47/-0)
scripts/qemu-guest-agent/fsfreeze-hook (+33/-0)
scripts/qemu-guest-agent/fsfreeze-hook.d/mysql-flush.sh.sample (+56/-0)
scripts/qemugdb/__init__.py (+28/-0)
scripts/qemugdb/aio.py (+58/-0)
scripts/qemugdb/coroutine.py (+119/-0)
scripts/qemugdb/mtree.py (+82/-0)
scripts/qmp/qemu-ga-client (+301/-0)
scripts/qmp/qmp (+126/-0)
scripts/qmp/qmp-shell (+425/-0)
scripts/qmp/qmp.py (+236/-0)
scripts/qmp/qom-fuse (+138/-0)
scripts/qmp/qom-get (+67/-0)
scripts/qmp/qom-list (+64/-0)
scripts/qmp/qom-set (+64/-0)
scripts/qmp/qom-tree (+75/-0)
scripts/qtest.py (+71/-0)
scripts/refresh-pxe-roms.sh (+31/-0)
scripts/shaderinclude.pl (+16/-0)
scripts/signrom.py (+40/-0)
scripts/simpletrace.py (+195/-0)
scripts/switch-timer-api (+178/-0)
scripts/texi2pod.pl (+486/-0)
scripts/tracetool.py (+139/-0)
scripts/tracetool/__init__.py (+366/-0)
scripts/tracetool/backend/__init__.py (+123/-0)
scripts/tracetool/backend/dtrace.py (+46/-0)
scripts/tracetool/backend/ftrace.py (+48/-0)
scripts/tracetool/backend/simple.py (+99/-0)
scripts/tracetool/backend/stderr.py (+47/-0)
scripts/tracetool/backend/ust.py (+35/-0)
scripts/tracetool/format/__init__.py (+85/-0)
scripts/tracetool/format/c.py (+28/-0)
scripts/tracetool/format/d.py (+54/-0)
scripts/tracetool/format/events_c.py (+36/-0)
scripts/tracetool/format/events_h.py (+52/-0)
scripts/tracetool/format/h.py (+44/-0)
scripts/tracetool/format/simpletrace_stap.py (+71/-0)
scripts/tracetool/format/stap.py (+61/-0)
scripts/tracetool/format/tcg_h.py (+57/-0)
scripts/tracetool/format/tcg_helper_c.py (+50/-0)
scripts/tracetool/format/tcg_helper_h.py (+50/-0)
scripts/tracetool/format/tcg_helper_wrapper_h.py (+70/-0)
scripts/tracetool/format/ust_events_c.py (+33/-0)
scripts/tracetool/format/ust_events_h.py (+100/-0)
scripts/tracetool/transform.py (+166/-0)
scripts/update-acpi.sh (+4/-0)
scripts/update-linux-headers.sh (+143/-0)
scripts/vmstate-static-checker.py (+424/-0)
slirp/COPYRIGHT (+61/-0)
slirp/Makefile.objs (+3/-0)
slirp/arp_table.c (+89/-0)
slirp/bootp.c (+338/-0)
slirp/bootp.h (+126/-0)
slirp/cksum.c (+139/-0)
slirp/debug.h (+34/-0)
slirp/dnssearch.c (+314/-0)
slirp/if.c (+237/-0)
slirp/if.h (+23/-0)
slirp/ip.h (+249/-0)
slirp/ip_icmp.c (+450/-0)
slirp/ip_icmp.h (+165/-0)
slirp/ip_input.c (+668/-0)
slirp/ip_output.c (+172/-0)
slirp/libslirp.h (+43/-0)
slirp/main.h (+50/-0)
slirp/mbuf.c (+241/-0)
slirp/mbuf.h (+118/-0)
slirp/misc.c (+319/-0)
slirp/misc.h (+53/-0)
slirp/sbuf.c (+187/-0)
slirp/sbuf.h (+30/-0)
slirp/slirp.c (+1207/-0)
slirp/slirp.h (+361/-0)
slirp/slirp_config.h (+185/-0)
slirp/socket.c (+720/-0)
slirp/socket.h (+97/-0)
slirp/tcp.h (+176/-0)
slirp/tcp_input.c (+1496/-0)
slirp/tcp_output.c (+493/-0)
slirp/tcp_subr.c (+926/-0)
slirp/tcp_timer.c (+292/-0)
slirp/tcp_timer.h (+127/-0)
slirp/tcp_var.h (+161/-0)
slirp/tcpip.h (+77/-0)
slirp/tftp.c (+442/-0)
slirp/tftp.h (+49/-0)
slirp/udp.c (+394/-0)
slirp/udp.h (+87/-0)
softmmu_template.h (+576/-0)
spice-qemu-char.c (+390/-0)
stubs/Makefile.objs (+40/-0)
stubs/arch-query-cpu-def.c (+9/-0)
stubs/bdrv-commit-all.c (+7/-0)
stubs/clock-warp.c (+7/-0)
stubs/cpu-get-clock.c (+7/-0)
stubs/cpu-get-icount.c (+9/-0)
stubs/cpus.c (+10/-0)
stubs/dump.c (+28/-0)
stubs/fd-register.c (+6/-0)
stubs/fdset-add-fd.c (+7/-0)
stubs/fdset-find-fd.c (+7/-0)
stubs/fdset-get-fd.c (+7/-0)
stubs/fdset-remove-fd.c (+6/-0)
stubs/gdbstub.c (+7/-0)
stubs/get-fd.c (+8/-0)
stubs/get-next-serial.c (+3/-0)
stubs/get-vm-name.c (+7/-0)
stubs/iothread-lock.c (+15/-0)
stubs/is-daemonized.c (+9/-0)
stubs/kvm.c (+7/-0)
stubs/machine-init-done.c (+6/-0)
stubs/migr-blocker.c (+10/-0)
stubs/mon-is-qmp.c (+9/-0)
stubs/mon-printf.c (+10/-0)
stubs/monitor-init.c (+6/-0)
stubs/notify-event.c (+6/-0)
stubs/qmp_pc_dimm_device_list.c (+12/-0)
stubs/qtest.c (+19/-0)
stubs/replay-user.c (+32/-0)
stubs/replay.c (+31/-0)
stubs/reset.c (+13/-0)
stubs/runstate-check.c (+6/-0)
stubs/set-fd-handler.c (+10/-0)
stubs/slirp.c (+11/-0)
stubs/sysbus.c (+6/-0)
stubs/target-get-monitor-def.c (+31/-0)
stubs/target-monitor-defs.c (+9/-0)
stubs/uuid.c (+12/-0)
stubs/vhost.c (+6/-0)
stubs/vm-stop.c (+12/-0)
stubs/vmstate.c (+19/-0)
target-alpha/Makefile.objs (+4/-0)
target-alpha/STATUS (+28/-0)
target-alpha/cpu-qom.h (+91/-0)
target-alpha/cpu.c (+340/-0)
target-alpha/cpu.h (+491/-0)
target-alpha/fpu_helper.c (+551/-0)
target-alpha/gdbstub.c (+93/-0)
target-alpha/helper.c (+487/-0)
target-alpha/helper.h (+113/-0)
target-alpha/int_helper.c (+278/-0)
target-alpha/machine.c (+89/-0)
target-alpha/mem_helper.c (+159/-0)
target-alpha/sys_helper.c (+89/-0)
target-alpha/translate.c (+3002/-0)
target-alpha/vax_helper.c (+353/-0)
target-arm/Makefile.objs (+12/-0)
target-arm/arm-semi.c (+656/-0)
target-arm/arm_ldst.h (+48/-0)
target-arm/cpu-qom.h (+250/-0)
target-arm/cpu.c (+1482/-0)
target-arm/cpu.h (+1994/-0)
target-arm/cpu64.c (+342/-0)
target-arm/crypto_helper.c (+465/-0)
target-arm/gdbstub.c (+102/-0)
target-arm/gdbstub64.c (+71/-0)
target-arm/helper-a64.c (+540/-0)
target-arm/helper-a64.h (+48/-0)
target-arm/helper.c (+8779/-0)
target-arm/helper.h (+537/-0)
target-arm/internals.h (+444/-0)
target-arm/iwmmxt_helper.c (+672/-0)
target-arm/kvm-consts.h (+186/-0)
target-arm/kvm-stub.c (+23/-0)
target-arm/kvm.c (+616/-0)
target-arm/kvm32.c (+477/-0)
target-arm/kvm64.c (+465/-0)
target-arm/kvm_arm.h (+218/-0)
target-arm/machine.c (+348/-0)
target-arm/neon_helper.c (+2243/-0)
target-arm/op_addsub.h (+103/-0)
target-arm/op_helper.c (+1006/-0)
target-arm/psci.c (+257/-0)
target-arm/translate-a64.c (+11227/-0)
target-arm/translate.c (+11673/-0)
target-arm/translate.h (+154/-0)
target-cris/Makefile.objs (+3/-0)
target-cris/cpu-qom.h (+93/-0)
target-cris/cpu.c (+341/-0)
target-cris/cpu.h (+267/-0)
target-cris/crisv10-decode.h (+107/-0)
target-cris/crisv32-decode.h (+132/-0)
target-cris/gdbstub.c (+130/-0)
target-cris/helper.c (+317/-0)
target-cris/helper.h (+25/-0)
target-cris/machine.c (+91/-0)
target-cris/mmu.c (+363/-0)
target-cris/mmu.h (+17/-0)
target-cris/op_helper.c (+642/-0)
target-cris/opcode-cris.h (+355/-0)
target-cris/translate.c (+3407/-0)
target-cris/translate_v10.c (+1290/-0)
target-i386/Makefile.objs (+7/-0)
target-i386/TODO (+31/-0)
target-i386/arch_dump.c (+452/-0)
target-i386/arch_memory_mapping.c (+280/-0)
target-i386/bpt_helper.c (+326/-0)
target-i386/cc_helper.c (+394/-0)
target-i386/cc_helper_template.h (+242/-0)
target-i386/cpu-qom.h (+167/-0)
target-i386/cpu.c (+3233/-0)
target-i386/cpu.h (+1346/-0)
target-i386/excp_helper.c (+135/-0)
target-i386/fpu_helper.c (+1337/-0)
target-i386/gdbstub.c (+233/-0)
target-i386/helper.c (+1434/-0)
target-i386/helper.h (+221/-0)
target-i386/int_helper.c (+471/-0)
target-i386/kvm-stub.c (+35/-0)
target-i386/kvm.c (+3087/-0)
target-i386/kvm_i386.h (+42/-0)
target-i386/machine.c (+900/-0)
target-i386/mem_helper.c (+148/-0)
target-i386/misc_helper.c (+601/-0)
target-i386/monitor.c (+511/-0)
target-i386/ops_sse.h (+2296/-0)
target-i386/ops_sse_header.h (+360/-0)
target-i386/seg_helper.c (+2633/-0)
target-i386/shift_helper_template.h (+108/-0)
target-i386/smm_helper.c (+336/-0)
target-i386/svm.h (+222/-0)
target-i386/svm_helper.c (+772/-0)
target-i386/translate.c (+8077/-0)
target-lm32/Makefile.objs (+4/-0)
target-lm32/README (+45/-0)
target-lm32/TODO (+1/-0)
target-lm32/cpu-qom.h (+92/-0)
target-lm32/cpu.c (+326/-0)
target-lm32/cpu.h (+239/-0)
target-lm32/gdbstub.c (+92/-0)
target-lm32/helper.c (+234/-0)
target-lm32/helper.h (+14/-0)
target-lm32/lm32-semi.c (+215/-0)
target-lm32/machine.c (+32/-0)
target-lm32/op_helper.c (+161/-0)
target-lm32/translate.c (+1239/-0)
target-m68k/Makefile.objs (+3/-0)
target-m68k/cpu-qom.h (+84/-0)
target-m68k/cpu.c (+263/-0)
target-m68k/cpu.h (+245/-0)
target-m68k/gdbstub.c (+75/-0)
target-m68k/helper.c (+886/-0)
target-m68k/helper.h (+50/-0)
target-m68k/m68k-semi.c (+469/-0)
target-m68k/op_helper.c (+232/-0)
target-m68k/qregs.def (+11/-0)
target-m68k/translate.c (+3095/-0)
target-microblaze/Makefile.objs (+3/-0)
target-microblaze/cpu-qom.h (+94/-0)
target-microblaze/cpu.c (+289/-0)
target-microblaze/cpu.h (+342/-0)
target-microblaze/gdbstub.c (+56/-0)
target-microblaze/helper.c (+304/-0)
target-microblaze/helper.h (+37/-0)
target-microblaze/microblaze-decode.h (+55/-0)
target-microblaze/mmu.c (+301/-0)
target-microblaze/mmu.h (+90/-0)
target-microblaze/op_helper.c (+519/-0)
target-microblaze/translate.c (+1908/-0)
target-mips/Makefile.objs (+4/-0)
target-mips/TODO (+51/-0)
target-mips/cpu-qom.h (+91/-0)
target-mips/cpu.c (+192/-0)
target-mips/cpu.h (+1097/-0)
target-mips/dsp_helper.c (+3761/-0)
target-mips/gdbstub.c (+150/-0)
target-mips/helper.c (+845/-0)
target-mips/helper.h (+947/-0)
target-mips/kvm.c (+689/-0)
target-mips/kvm_mips.h (+26/-0)
target-mips/lmi_helper.c (+744/-0)
target-mips/machine.c (+298/-0)
target-mips/mips-defs.h (+91/-0)
target-mips/mips-semi.c (+373/-0)
target-mips/msa_helper.c (+3445/-0)
target-mips/op_helper.c (+3733/-0)
target-mips/translate.c (+20076/-0)
target-mips/translate_init.c (+888/-0)
target-moxie/Makefile.objs (+2/-0)
target-moxie/cpu.c (+190/-0)
target-moxie/cpu.h (+146/-0)
target-moxie/helper.c (+164/-0)
target-moxie/helper.h (+5/-0)
target-moxie/machine.c (+18/-0)
target-moxie/machine.h (+1/-0)
target-moxie/mmu.c (+36/-0)
target-moxie/mmu.h (+19/-0)
target-moxie/translate.c (+901/-0)
target-openrisc/Makefile.objs (+5/-0)
target-openrisc/cpu.c (+276/-0)
target-openrisc/cpu.h (+416/-0)
target-openrisc/exception.c (+29/-0)
target-openrisc/exception.h (+28/-0)
target-openrisc/exception_helper.c (+29/-0)
target-openrisc/fpu_helper.c (+300/-0)
target-openrisc/gdbstub.c (+83/-0)
target-openrisc/helper.h (+66/-0)
target-openrisc/int_helper.c (+79/-0)
target-openrisc/interrupt.c (+85/-0)
target-openrisc/interrupt_helper.c (+58/-0)
target-openrisc/machine.c (+50/-0)
target-openrisc/mmu.c (+236/-0)
target-openrisc/mmu_helper.c (+42/-0)
target-openrisc/sys_helper.c (+286/-0)
target-openrisc/translate.c (+1771/-0)
target-ppc/Makefile.objs (+17/-0)
target-ppc/STATUS (+550/-0)
target-ppc/arch_dump.c (+286/-0)
target-ppc/cpu-models.c (+1421/-0)
target-ppc/cpu-models.h (+753/-0)
target-ppc/cpu-qom.h (+153/-0)
target-ppc/cpu.h (+2358/-0)
target-ppc/dfp_helper.c (+1295/-0)
target-ppc/excp_helper.c (+1058/-0)
target-ppc/fpu_helper.c (+2716/-0)
target-ppc/gdbstub.c (+320/-0)
target-ppc/helper.h (+669/-0)
target-ppc/helper_regs.h (+114/-0)
target-ppc/int_helper.c (+2569/-0)
target-ppc/kvm-stub.c (+18/-0)
target-ppc/kvm.c (+2512/-0)
target-ppc/kvm_ppc.h (+284/-0)
target-ppc/machine.c (+556/-0)
target-ppc/mem_helper.c (+294/-0)
target-ppc/mfrom_table.c (+79/-0)
target-ppc/mfrom_table_gen.c (+33/-0)
target-ppc/misc_helper.c (+166/-0)
target-ppc/mmu-hash32.c (+563/-0)
target-ppc/mmu-hash32.h (+110/-0)
target-ppc/mmu-hash64.c (+647/-0)
target-ppc/mmu-hash64.h (+122/-0)
target-ppc/mmu_helper.c (+2941/-0)
target-ppc/monitor.c (+146/-0)
target-ppc/timebase_helper.c (+159/-0)
target-ppc/translate.c (+11611/-0)
target-ppc/translate_init.c (+9755/-0)
target-ppc/user_only_helper.c (+46/-0)
target-s390x/Makefile.objs (+5/-0)
target-s390x/arch_dump.c (+254/-0)
target-s390x/cc_helper.c (+568/-0)
target-s390x/cpu-qom.h (+103/-0)
target-s390x/cpu.c (+389/-0)
target-s390x/cpu.h (+1333/-0)
target-s390x/fpu_helper.c (+743/-0)
target-s390x/gdbstub.c (+311/-0)
target-s390x/helper.c (+652/-0)
target-s390x/helper.h (+133/-0)
target-s390x/insn-data.def (+931/-0)
target-s390x/insn-format.def (+55/-0)
target-s390x/int_helper.c (+154/-0)
target-s390x/interrupt.c (+66/-0)
target-s390x/ioinst.c (+831/-0)
target-s390x/ioinst.h (+246/-0)
target-s390x/kvm.c (+2252/-0)
target-s390x/machine.c (+170/-0)
target-s390x/mem_helper.c (+1197/-0)
target-s390x/misc_helper.c (+640/-0)
target-s390x/mmu_helper.c (+498/-0)
target-s390x/translate.c (+5440/-0)
target-sh4/Makefile.objs (+3/-0)
target-sh4/README.sh4 (+150/-0)
target-sh4/cpu-qom.h (+94/-0)
target-sh4/cpu.c (+329/-0)
target-sh4/cpu.h (+365/-0)
target-sh4/gdbstub.c (+146/-0)
target-sh4/helper.c (+874/-0)
target-sh4/helper.h (+45/-0)
target-sh4/monitor.c (+52/-0)
target-sh4/op_helper.c (+496/-0)
target-sh4/translate.c (+1928/-0)
target-sparc/Makefile.objs (+7/-0)
target-sparc/TODO (+88/-0)
target-sparc/cc_helper.c (+485/-0)
target-sparc/cpu-qom.h (+88/-0)
target-sparc/cpu.c (+891/-0)
target-sparc/cpu.h (+741/-0)
target-sparc/fop_helper.c (+467/-0)
target-sparc/gdbstub.c (+208/-0)
target-sparc/helper.c (+255/-0)
target-sparc/helper.h (+175/-0)
target-sparc/int32_helper.c (+173/-0)
target-sparc/int64_helper.c (+204/-0)
target-sparc/ldst_helper.c (+2455/-0)
target-sparc/machine.c (+218/-0)
target-sparc/mmu_helper.c (+867/-0)
target-sparc/monitor.c (+158/-0)
target-sparc/translate.c (+5441/-0)
target-sparc/vis_helper.c (+489/-0)
target-sparc/win_helper.c (+393/-0)
target-tilegx/Makefile.objs (+1/-0)
target-tilegx/cpu.c (+185/-0)
target-tilegx/cpu.h (+182/-0)
target-tilegx/helper.c (+161/-0)
target-tilegx/helper.h (+26/-0)
target-tilegx/opcode_tilegx.h (+1406/-0)
target-tilegx/simd_helper.c (+165/-0)
target-tilegx/spr_def_64.h (+216/-0)
target-tilegx/translate.c (+2449/-0)
target-tricore/Makefile.objs (+1/-0)
target-tricore/cpu-qom.h (+70/-0)
target-tricore/cpu.c (+218/-0)
target-tricore/cpu.h (+397/-0)
target-tricore/csfr.def (+124/-0)
target-tricore/helper.c (+139/-0)
target-tricore/helper.h (+141/-0)
target-tricore/op_helper.c (+2695/-0)
target-tricore/translate.c (+8397/-0)
target-tricore/tricore-defs.h (+28/-0)
target-tricore/tricore-opcodes.h (+1445/-0)
target-unicore32/Makefile.objs (+4/-0)
target-unicore32/cpu-qom.h (+69/-0)
target-unicore32/cpu.c (+199/-0)
target-unicore32/cpu.h (+163/-0)
target-unicore32/helper.c (+261/-0)
target-unicore32/helper.h (+65/-0)
target-unicore32/op_helper.c (+259/-0)
target-unicore32/softmmu.c (+276/-0)
target-unicore32/translate.c (+2104/-0)
target-unicore32/ucf64_helper.c (+324/-0)
target-xtensa/Makefile.objs (+7/-0)
target-xtensa/core-dc232b.c (+49/-0)
target-xtensa/core-dc232b/core-isa.h (+423/-0)
target-xtensa/core-dc232b/gdb-config.c (+261/-0)
target-xtensa/core-dc233c.c (+50/-0)
target-xtensa/core-dc233c/core-isa.h (+474/-0)
target-xtensa/core-dc233c/gdb-config.c (+145/-0)
target-xtensa/core-fsf.c (+48/-0)
target-xtensa/core-fsf/core-isa.h (+361/-0)
target-xtensa/cpu-qom.h (+99/-0)
target-xtensa/cpu.c (+182/-0)
target-xtensa/cpu.h (+555/-0)
target-xtensa/gdbstub.c (+126/-0)
target-xtensa/helper.c (+729/-0)
target-xtensa/helper.h (+58/-0)
target-xtensa/import_core.sh (+51/-0)
target-xtensa/monitor.c (+34/-0)
target-xtensa/op_helper.c (+981/-0)
target-xtensa/overlay_tool.h (+602/-0)
target-xtensa/translate.c (+3216/-0)
target-xtensa/xtensa-semi.c (+321/-0)
tcg-runtime.c (+109/-0)
tcg/LICENSE (+3/-0)
tcg/README (+569/-0)
tcg/TODO (+14/-0)
tcg/aarch64/tcg-target.c (+1892/-0)
tcg/aarch64/tcg-target.h (+109/-0)
tcg/arm/tcg-target.c (+2128/-0)
tcg/arm/tcg-target.h (+109/-0)
tcg/i386/tcg-target.c (+2463/-0)
tcg/i386/tcg-target.h (+150/-0)
tcg/ia64/tcg-target.c (+2444/-0)
tcg/ia64/tcg-target.h (+186/-0)
tcg/mips/tcg-target.c (+1892/-0)
tcg/mips/tcg-target.h (+145/-0)
tcg/optimize.c (+1333/-0)
tcg/ppc/tcg-target.c (+2768/-0)
tcg/ppc/tcg-target.h (+113/-0)
tcg/s390/tcg-target.c (+2409/-0)
tcg/s390/tcg-target.h (+124/-0)
tcg/sparc/tcg-target.c (+1652/-0)
tcg/sparc/tcg-target.h (+161/-0)
tcg/tcg-be-ldst.h (+88/-0)
tcg/tcg-be-null.h (+43/-0)
tcg/tcg-common.c (+37/-0)
tcg/tcg-op.c (+1943/-0)
tcg/tcg-op.h (+1023/-0)
tcg/tcg-opc.h (+198/-0)
tcg/tcg-runtime.h (+16/-0)
tcg/tcg.c (+2792/-0)
tcg/tcg.h (+1045/-0)
tcg/tci/README (+130/-0)
tcg/tci/tcg-target.c (+879/-0)
tcg/tci/tcg-target.h (+186/-0)
tci.c (+1241/-0)
tests/.gitignore (+57/-0)
tests/Makefile (+672/-0)
tests/ac97-test.c (+33/-0)
tests/acpi-test-data/rebuild-expected-aml.sh (+36/-0)
tests/ahci-test.c (+1718/-0)
tests/bios-tables-test.c (+850/-0)
tests/boot-order-test.c (+209/-0)
tests/check-block.sh (+21/-0)
tests/check-qdict.c (+751/-0)
tests/check-qfloat.c (+53/-0)
tests/check-qint.c (+87/-0)
tests/check-qjson.c (+1549/-0)
tests/check-qlist.c (+127/-0)
tests/check-qom-interface.c (+105/-0)
tests/check-qom-proplist.c (+507/-0)
tests/check-qstring.c (+107/-0)
tests/crypto-tls-x509-helpers.c (+487/-0)
tests/crypto-tls-x509-helpers.h (+133/-0)
tests/device-introspect-test.c (+124/-0)
tests/display-vga-test.c (+70/-0)
tests/drive_del-test.c (+127/-0)
tests/ds1338-test.c (+78/-0)
tests/e1000-test.c (+52/-0)
tests/eepro100-test.c (+62/-0)
tests/endianness-test.c (+315/-0)
tests/es1370-test.c (+33/-0)
tests/fdc-test.c (+595/-0)
tests/fw_cfg-test.c (+141/-0)
tests/hd-geo-test.c (+426/-0)
tests/i440fx-test.c (+418/-0)
tests/i82801b11-test.c (+33/-0)
tests/ide-test.c (+859/-0)
tests/image-fuzzer/qcow2/__init__.py (+1/-0)
tests/image-fuzzer/qcow2/fuzz.py (+367/-0)
tests/image-fuzzer/qcow2/layout.py (+612/-0)
tests/image-fuzzer/runner.py (+437/-0)
tests/intel-hda-test.c (+45/-0)
tests/ioh3420-test.c (+34/-0)
tests/ipoctal232-test.c (+33/-0)
tests/ivshmem-test.c (+494/-0)
tests/libqos/ahci.c (+962/-0)
tests/libqos/ahci.h (+586/-0)
tests/libqos/fw_cfg.c (+107/-0)
tests/libqos/fw_cfg.h (+43/-0)
tests/libqos/i2c-imx.c (+209/-0)
tests/libqos/i2c-omap.c (+173/-0)
tests/libqos/i2c.c (+22/-0)
tests/libqos/i2c.h (+33/-0)
tests/libqos/libqos-pc.c (+29/-0)
tests/libqos/libqos-pc.h (+10/-0)
tests/libqos/libqos.c (+258/-0)
tests/libqos/libqos.h (+40/-0)
tests/libqos/malloc-generic.c (+39/-0)
tests/libqos/malloc-generic.h (+21/-0)
tests/libqos/malloc-pc.c (+52/-0)
tests/libqos/malloc-pc.h (+22/-0)
tests/libqos/malloc.c (+374/-0)
tests/libqos/malloc.h (+42/-0)
tests/libqos/pci-pc.c (+298/-0)
tests/libqos/pci-pc.h (+21/-0)
tests/libqos/pci.c (+264/-0)
tests/libqos/pci.h (+93/-0)
tests/libqos/usb.c (+71/-0)
tests/libqos/usb.h (+17/-0)
tests/libqos/virtio-mmio.c (+198/-0)
tests/libqos/virtio-mmio.h (+46/-0)
tests/libqos/virtio-pci.c (+353/-0)
tests/libqos/virtio-pci.h (+61/-0)
tests/libqos/virtio.c (+281/-0)
tests/libqos/virtio.h (+193/-0)
tests/libqtest.c (+915/-0)
tests/libqtest.h (+864/-0)
tests/m48t59-test.c (+264/-0)
tests/multiboot/Makefile (+21/-0)
tests/multiboot/libc.c (+151/-0)
tests/multiboot/libc.h (+62/-0)
tests/multiboot/link.ld (+19/-0)
tests/multiboot/mmap.c (+56/-0)
tests/multiboot/mmap.out (+92/-0)
tests/multiboot/module.txt (+1/-0)
tests/multiboot/modules.c (+55/-0)
tests/multiboot/modules.out (+38/-0)
tests/multiboot/multiboot.h (+66/-0)
tests/multiboot/run_test.sh (+88/-0)
tests/multiboot/start.S (+51/-0)
tests/ne2000-test.c (+33/-0)
tests/nvme-test.c (+34/-0)
tests/pc-cpu-test.c (+146/-0)
tests/pcnet-test.c (+33/-0)
tests/pkix_asn1_tab.c (+1104/-0)
tests/pvpanic-test.c (+47/-0)
tests/q35-test.c (+91/-0)
tests/qapi-schema/alternate-array.err (+1/-0)
tests/qapi-schema/alternate-array.exit (+1/-0)
tests/qapi-schema/alternate-array.json (+7/-0)
tests/qapi-schema/alternate-array.out (+0/-0)
tests/qapi-schema/alternate-base.err (+1/-0)
tests/qapi-schema/alternate-base.exit (+1/-0)
tests/qapi-schema/alternate-base.json (+6/-0)
tests/qapi-schema/alternate-base.out (+0/-0)
tests/qapi-schema/alternate-clash.err (+1/-0)
tests/qapi-schema/alternate-clash.exit (+1/-0)
tests/qapi-schema/alternate-clash.json (+8/-0)
tests/qapi-schema/alternate-clash.out (+0/-0)
tests/qapi-schema/alternate-conflict-dict.err (+1/-0)
tests/qapi-schema/alternate-conflict-dict.exit (+1/-0)
tests/qapi-schema/alternate-conflict-dict.json (+8/-0)
tests/qapi-schema/alternate-conflict-dict.out (+0/-0)
tests/qapi-schema/alternate-conflict-string.err (+1/-0)
tests/qapi-schema/alternate-conflict-string.exit (+1/-0)
tests/qapi-schema/alternate-conflict-string.json (+6/-0)
tests/qapi-schema/alternate-conflict-string.out (+0/-0)
tests/qapi-schema/alternate-empty.err (+0/-0)
tests/qapi-schema/alternate-empty.exit (+1/-0)
tests/qapi-schema/alternate-empty.json (+2/-0)
tests/qapi-schema/alternate-empty.out (+4/-0)
tests/qapi-schema/alternate-nested.err (+1/-0)
tests/qapi-schema/alternate-nested.exit (+1/-0)
tests/qapi-schema/alternate-nested.json (+5/-0)
tests/qapi-schema/alternate-nested.out (+0/-0)
tests/qapi-schema/alternate-unknown.err (+1/-0)
tests/qapi-schema/alternate-unknown.exit (+1/-0)
tests/qapi-schema/alternate-unknown.json (+3/-0)
tests/qapi-schema/alternate-unknown.out (+0/-0)
tests/qapi-schema/args-alternate.err (+1/-0)
tests/qapi-schema/args-alternate.exit (+1/-0)
tests/qapi-schema/args-alternate.json (+3/-0)
tests/qapi-schema/args-alternate.out (+0/-0)
tests/qapi-schema/args-any.err (+1/-0)
tests/qapi-schema/args-any.exit (+1/-0)
tests/qapi-schema/args-any.json (+2/-0)
tests/qapi-schema/args-any.out (+0/-0)
tests/qapi-schema/args-array-empty.err (+1/-0)
tests/qapi-schema/args-array-empty.exit (+1/-0)
tests/qapi-schema/args-array-empty.json (+2/-0)
tests/qapi-schema/args-array-empty.out (+0/-0)
tests/qapi-schema/args-array-unknown.err (+1/-0)
tests/qapi-schema/args-array-unknown.exit (+1/-0)
tests/qapi-schema/args-array-unknown.json (+2/-0)
tests/qapi-schema/args-array-unknown.out (+0/-0)
tests/qapi-schema/args-int.err (+1/-0)
tests/qapi-schema/args-int.exit (+1/-0)
tests/qapi-schema/args-int.json (+2/-0)
tests/qapi-schema/args-int.out (+0/-0)
tests/qapi-schema/args-invalid.err (+1/-0)
tests/qapi-schema/args-invalid.exit (+1/-0)
tests/qapi-schema/args-invalid.json (+2/-0)
tests/qapi-schema/args-invalid.out (+0/-0)
tests/qapi-schema/args-member-array-bad.err (+1/-0)
tests/qapi-schema/args-member-array-bad.exit (+1/-0)
tests/qapi-schema/args-member-array-bad.json (+2/-0)
tests/qapi-schema/args-member-array-bad.out (+0/-0)
tests/qapi-schema/args-member-unknown.err (+1/-0)
tests/qapi-schema/args-member-unknown.exit (+1/-0)
tests/qapi-schema/args-member-unknown.json (+2/-0)
tests/qapi-schema/args-member-unknown.out (+0/-0)
tests/qapi-schema/args-name-clash.err (+0/-0)
tests/qapi-schema/args-name-clash.exit (+1/-0)
tests/qapi-schema/args-name-clash.json (+5/-0)
tests/qapi-schema/args-name-clash.out (+6/-0)
tests/qapi-schema/args-union.err (+1/-0)
tests/qapi-schema/args-union.exit (+1/-0)
tests/qapi-schema/args-union.json (+4/-0)
tests/qapi-schema/args-union.out (+0/-0)
tests/qapi-schema/args-unknown.err (+1/-0)
tests/qapi-schema/args-unknown.exit (+1/-0)
tests/qapi-schema/args-unknown.json (+2/-0)
tests/qapi-schema/args-unknown.out (+0/-0)
tests/qapi-schema/bad-base.err (+1/-0)
tests/qapi-schema/bad-base.exit (+1/-0)
tests/qapi-schema/bad-base.json (+3/-0)
tests/qapi-schema/bad-base.out (+0/-0)
tests/qapi-schema/bad-data.err (+1/-0)
tests/qapi-schema/bad-data.exit (+1/-0)
tests/qapi-schema/bad-data.json (+2/-0)
tests/qapi-schema/bad-data.out (+0/-0)
tests/qapi-schema/bad-ident.err (+1/-0)
tests/qapi-schema/bad-ident.exit (+1/-0)
tests/qapi-schema/bad-ident.json (+2/-0)
tests/qapi-schema/bad-ident.out (+0/-0)
tests/qapi-schema/bad-type-bool.err (+1/-0)
tests/qapi-schema/bad-type-bool.exit (+1/-0)
tests/qapi-schema/bad-type-bool.json (+2/-0)
tests/qapi-schema/bad-type-bool.out (+0/-0)
tests/qapi-schema/bad-type-dict.err (+1/-0)
tests/qapi-schema/bad-type-dict.exit (+1/-0)
tests/qapi-schema/bad-type-dict.json (+2/-0)
tests/qapi-schema/bad-type-dict.out (+0/-0)
tests/qapi-schema/bad-type-int.err (+1/-0)
tests/qapi-schema/bad-type-int.exit (+1/-0)
tests/qapi-schema/bad-type-int.json (+3/-0)
tests/qapi-schema/bad-type-int.out (+0/-0)
tests/qapi-schema/command-int.err (+1/-0)
tests/qapi-schema/command-int.exit (+1/-0)
tests/qapi-schema/command-int.json (+2/-0)
tests/qapi-schema/command-int.out (+0/-0)
tests/qapi-schema/comments.err (+0/-0)
tests/qapi-schema/comments.exit (+1/-0)
tests/qapi-schema/comments.json (+4/-0)
tests/qapi-schema/comments.out (+2/-0)
tests/qapi-schema/double-data.err (+1/-0)
tests/qapi-schema/double-data.exit (+1/-0)
tests/qapi-schema/double-data.json (+2/-0)
tests/qapi-schema/double-data.out (+0/-0)
tests/qapi-schema/double-type.err (+1/-0)
tests/qapi-schema/double-type.exit (+1/-0)
tests/qapi-schema/double-type.json (+2/-0)
tests/qapi-schema/double-type.out (+0/-0)
tests/qapi-schema/duplicate-key.err (+1/-0)
tests/qapi-schema/duplicate-key.exit (+1/-0)
tests/qapi-schema/duplicate-key.json (+3/-0)
tests/qapi-schema/duplicate-key.out (+0/-0)
tests/qapi-schema/empty.err (+0/-0)
tests/qapi-schema/empty.exit (+1/-0)
tests/qapi-schema/empty.json (+0/-0)
tests/qapi-schema/empty.out (+1/-0)
tests/qapi-schema/enum-bad-name.err (+1/-0)
tests/qapi-schema/enum-bad-name.exit (+1/-0)
tests/qapi-schema/enum-bad-name.json (+2/-0)
tests/qapi-schema/enum-bad-name.out (+0/-0)
tests/qapi-schema/enum-bad-prefix.err (+1/-0)
tests/qapi-schema/enum-bad-prefix.exit (+1/-0)
tests/qapi-schema/enum-bad-prefix.json (+2/-0)
tests/qapi-schema/enum-bad-prefix.out (+0/-0)
tests/qapi-schema/enum-clash-member.err (+1/-0)
tests/qapi-schema/enum-clash-member.exit (+1/-0)
tests/qapi-schema/enum-clash-member.json (+2/-0)
tests/qapi-schema/enum-clash-member.out (+0/-0)
tests/qapi-schema/enum-dict-member.err (+1/-0)
tests/qapi-schema/enum-dict-member.exit (+1/-0)
tests/qapi-schema/enum-dict-member.json (+2/-0)
tests/qapi-schema/enum-dict-member.out (+0/-0)
tests/qapi-schema/enum-int-member.err (+1/-0)
tests/qapi-schema/enum-int-member.exit (+1/-0)
tests/qapi-schema/enum-int-member.json (+3/-0)
tests/qapi-schema/enum-int-member.out (+0/-0)
tests/qapi-schema/enum-max-member.err (+1/-0)
tests/qapi-schema/enum-max-member.exit (+1/-0)
tests/qapi-schema/enum-max-member.json (+3/-0)
tests/qapi-schema/enum-max-member.out (+0/-0)
tests/qapi-schema/enum-missing-data.err (+1/-0)
tests/qapi-schema/enum-missing-data.exit (+1/-0)
tests/qapi-schema/enum-missing-data.json (+2/-0)
tests/qapi-schema/enum-missing-data.out (+0/-0)
tests/qapi-schema/enum-wrong-data.err (+1/-0)
tests/qapi-schema/enum-wrong-data.exit (+1/-0)
tests/qapi-schema/enum-wrong-data.json (+2/-0)
tests/qapi-schema/enum-wrong-data.out (+0/-0)
tests/qapi-schema/escape-outside-string.err (+1/-0)
tests/qapi-schema/escape-outside-string.exit (+1/-0)
tests/qapi-schema/escape-outside-string.json (+3/-0)
tests/qapi-schema/escape-outside-string.out (+0/-0)
tests/qapi-schema/escape-too-big.err (+1/-0)
tests/qapi-schema/escape-too-big.exit (+1/-0)
tests/qapi-schema/escape-too-big.json (+3/-0)
tests/qapi-schema/escape-too-big.out (+0/-0)
tests/qapi-schema/escape-too-short.err (+1/-0)
tests/qapi-schema/escape-too-short.exit (+1/-0)
tests/qapi-schema/escape-too-short.json (+3/-0)
tests/qapi-schema/escape-too-short.out (+0/-0)
tests/qapi-schema/event-case.err (+0/-0)
tests/qapi-schema/event-case.exit (+1/-0)
tests/qapi-schema/event-case.json (+3/-0)
tests/qapi-schema/event-case.out (+2/-0)
tests/qapi-schema/event-max.err (+1/-0)
tests/qapi-schema/event-max.exit (+1/-0)
tests/qapi-schema/event-max.json (+2/-0)
tests/qapi-schema/event-max.out (+0/-0)
tests/qapi-schema/event-nest-struct.err (+1/-0)
tests/qapi-schema/event-nest-struct.exit (+1/-0)
tests/qapi-schema/event-nest-struct.json (+2/-0)
tests/qapi-schema/event-nest-struct.out (+0/-0)
tests/qapi-schema/flat-union-array-branch.err (+1/-0)
tests/qapi-schema/flat-union-array-branch.exit (+1/-0)
tests/qapi-schema/flat-union-array-branch.json (+12/-0)
tests/qapi-schema/flat-union-array-branch.out (+0/-0)
tests/qapi-schema/flat-union-bad-base.err (+1/-0)
tests/qapi-schema/flat-union-bad-base.exit (+1/-0)
tests/qapi-schema/flat-union-bad-base.json (+13/-0)
tests/qapi-schema/flat-union-bad-base.out (+0/-0)
tests/qapi-schema/flat-union-bad-discriminator.err (+1/-0)
tests/qapi-schema/flat-union-bad-discriminator.exit (+1/-0)
tests/qapi-schema/flat-union-bad-discriminator.json (+15/-0)
tests/qapi-schema/flat-union-bad-discriminator.out (+0/-0)
tests/qapi-schema/flat-union-base-any.err (+1/-0)
tests/qapi-schema/flat-union-base-any.exit (+1/-0)
tests/qapi-schema/flat-union-base-any.json (+12/-0)
tests/qapi-schema/flat-union-base-any.out (+0/-0)
tests/qapi-schema/flat-union-base-union.err (+1/-0)
tests/qapi-schema/flat-union-base-union.exit (+1/-0)
tests/qapi-schema/flat-union-base-union.json (+18/-0)
tests/qapi-schema/flat-union-base-union.out (+0/-0)
tests/qapi-schema/flat-union-clash-branch.err (+0/-0)
tests/qapi-schema/flat-union-clash-branch.exit (+1/-0)
tests/qapi-schema/flat-union-clash-branch.json (+18/-0)
tests/qapi-schema/flat-union-clash-branch.out (+14/-0)
tests/qapi-schema/flat-union-clash-member.err (+1/-0)
tests/qapi-schema/flat-union-clash-member.exit (+1/-0)
tests/qapi-schema/flat-union-clash-member.json (+15/-0)
tests/qapi-schema/flat-union-clash-member.out (+0/-0)
tests/qapi-schema/flat-union-clash-type.err (+1/-0)
tests/qapi-schema/flat-union-clash-type.exit (+1/-0)
tests/qapi-schema/flat-union-clash-type.json (+14/-0)
tests/qapi-schema/flat-union-clash-type.out (+0/-0)
tests/qapi-schema/flat-union-empty.err (+0/-0)
tests/qapi-schema/flat-union-empty.exit (+1/-0)
tests/qapi-schema/flat-union-empty.json (+4/-0)
tests/qapi-schema/flat-union-empty.out (+7/-0)
tests/qapi-schema/flat-union-inline.err (+1/-0)
tests/qapi-schema/flat-union-inline.exit (+1/-0)
tests/qapi-schema/flat-union-inline.json (+11/-0)
tests/qapi-schema/flat-union-inline.out (+0/-0)
tests/qapi-schema/flat-union-int-branch.err (+1/-0)
tests/qapi-schema/flat-union-int-branch.exit (+1/-0)
tests/qapi-schema/flat-union-int-branch.json (+12/-0)
tests/qapi-schema/flat-union-int-branch.out (+0/-0)
tests/qapi-schema/flat-union-invalid-branch-key.err (+1/-0)
tests/qapi-schema/flat-union-invalid-branch-key.exit (+1/-0)
tests/qapi-schema/flat-union-invalid-branch-key.json (+17/-0)
tests/qapi-schema/flat-union-invalid-branch-key.out (+0/-0)
tests/qapi-schema/flat-union-invalid-discriminator.err (+1/-0)
tests/qapi-schema/flat-union-invalid-discriminator.exit (+1/-0)
tests/qapi-schema/flat-union-invalid-discriminator.json (+17/-0)
tests/qapi-schema/flat-union-invalid-discriminator.out (+0/-0)
tests/qapi-schema/flat-union-no-base.err (+1/-0)
tests/qapi-schema/flat-union-no-base.exit (+1/-0)
tests/qapi-schema/flat-union-no-base.json (+12/-0)
tests/qapi-schema/flat-union-no-base.out (+0/-0)
tests/qapi-schema/flat-union-optional-discriminator.err (+1/-0)
tests/qapi-schema/flat-union-optional-discriminator.exit (+1/-0)
tests/qapi-schema/flat-union-optional-discriminator.json (+10/-0)
tests/qapi-schema/flat-union-optional-discriminator.out (+0/-0)
tests/qapi-schema/flat-union-string-discriminator.err (+1/-0)
tests/qapi-schema/flat-union-string-discriminator.exit (+1/-0)
tests/qapi-schema/flat-union-string-discriminator.json (+17/-0)
tests/qapi-schema/flat-union-string-discriminator.out (+0/-0)
tests/qapi-schema/funny-char.err (+1/-0)
tests/qapi-schema/funny-char.exit (+1/-0)
tests/qapi-schema/funny-char.json (+2/-0)
tests/qapi-schema/funny-char.out (+0/-0)
tests/qapi-schema/ident-with-escape.err (+0/-0)
tests/qapi-schema/ident-with-escape.exit (+1/-0)
tests/qapi-schema/ident-with-escape.json (+4/-0)
tests/qapi-schema/ident-with-escape.out (+5/-0)
tests/qapi-schema/include-before-err.err (+1/-0)
tests/qapi-schema/include-before-err.exit (+1/-0)
tests/qapi-schema/include-before-err.json (+2/-0)
tests/qapi-schema/include-before-err.out (+0/-0)
tests/qapi-schema/include-cycle-b.json (+1/-0)
tests/qapi-schema/include-cycle-c.json (+1/-0)
tests/qapi-schema/include-cycle.err (+3/-0)
tests/qapi-schema/include-cycle.exit (+1/-0)
tests/qapi-schema/include-cycle.json (+1/-0)
tests/qapi-schema/include-cycle.out (+0/-0)
tests/qapi-schema/include-format-err.err (+1/-0)
tests/qapi-schema/include-format-err.exit (+1/-0)
tests/qapi-schema/include-format-err.json (+2/-0)
tests/qapi-schema/include-format-err.out (+0/-0)
tests/qapi-schema/include-nested-err.err (+2/-0)
tests/qapi-schema/include-nested-err.exit (+1/-0)
tests/qapi-schema/include-nested-err.json (+1/-0)
tests/qapi-schema/include-nested-err.out (+0/-0)
tests/qapi-schema/include-no-file.err (+1/-0)
tests/qapi-schema/include-no-file.exit (+1/-0)
tests/qapi-schema/include-no-file.json (+1/-0)
tests/qapi-schema/include-no-file.out (+0/-0)
tests/qapi-schema/include-non-file.err (+1/-0)
tests/qapi-schema/include-non-file.exit (+1/-0)
tests/qapi-schema/include-non-file.json (+1/-0)
tests/qapi-schema/include-non-file.out (+0/-0)
tests/qapi-schema/include-relpath-sub.json (+2/-0)
tests/qapi-schema/include-relpath.err (+0/-0)
tests/qapi-schema/include-relpath.exit (+1/-0)
tests/qapi-schema/include-relpath.json (+1/-0)
tests/qapi-schema/include-relpath.out (+2/-0)
tests/qapi-schema/include-repetition-sub.json (+2/-0)
tests/qapi-schema/include-repetition.err (+0/-0)
tests/qapi-schema/include-repetition.exit (+1/-0)
tests/qapi-schema/include-repetition.json (+3/-0)
tests/qapi-schema/include-repetition.out (+2/-0)
tests/qapi-schema/include-self-cycle.err (+1/-0)
tests/qapi-schema/include-self-cycle.exit (+1/-0)
tests/qapi-schema/include-self-cycle.json (+1/-0)
tests/qapi-schema/include-self-cycle.out (+0/-0)
tests/qapi-schema/include-simple-sub.json (+2/-0)
tests/qapi-schema/include-simple.err (+0/-0)
tests/qapi-schema/include-simple.exit (+1/-0)
tests/qapi-schema/include-simple.json (+1/-0)
tests/qapi-schema/include-simple.out (+2/-0)
tests/qapi-schema/include/relpath.json (+1/-0)
tests/qapi-schema/indented-expr.err (+0/-0)
tests/qapi-schema/indented-expr.exit (+1/-0)
tests/qapi-schema/indented-expr.json (+2/-0)
tests/qapi-schema/indented-expr.out (+5/-0)
tests/qapi-schema/leading-comma-list.err (+1/-0)
tests/qapi-schema/leading-comma-list.exit (+1/-0)
tests/qapi-schema/leading-comma-list.json (+2/-0)
tests/qapi-schema/leading-comma-list.out (+0/-0)
tests/qapi-schema/leading-comma-object.err (+1/-0)
tests/qapi-schema/leading-comma-object.exit (+1/-0)
tests/qapi-schema/leading-comma-object.json (+2/-0)
tests/qapi-schema/leading-comma-object.out (+0/-0)
tests/qapi-schema/missing-colon.err (+1/-0)
tests/qapi-schema/missing-colon.exit (+1/-0)
tests/qapi-schema/missing-colon.json (+2/-0)
tests/qapi-schema/missing-colon.out (+0/-0)
tests/qapi-schema/missing-comma-list.err (+1/-0)
tests/qapi-schema/missing-comma-list.exit (+1/-0)
tests/qapi-schema/missing-comma-list.json (+2/-0)
tests/qapi-schema/missing-comma-list.out (+0/-0)
tests/qapi-schema/missing-comma-object.err (+1/-0)
tests/qapi-schema/missing-comma-object.exit (+1/-0)
tests/qapi-schema/missing-comma-object.json (+2/-0)
tests/qapi-schema/missing-comma-object.out (+0/-0)
tests/qapi-schema/missing-type.err (+1/-0)
tests/qapi-schema/missing-type.exit (+1/-0)
tests/qapi-schema/missing-type.json (+2/-0)
tests/qapi-schema/missing-type.out (+0/-0)
tests/qapi-schema/nested-struct-data.err (+1/-0)
tests/qapi-schema/nested-struct-data.exit (+1/-0)
tests/qapi-schema/nested-struct-data.json (+3/-0)
tests/qapi-schema/nested-struct-data.out (+0/-0)
tests/qapi-schema/non-objects.err (+1/-0)
tests/qapi-schema/non-objects.exit (+1/-0)
tests/qapi-schema/non-objects.json (+2/-0)
tests/qapi-schema/non-objects.out (+0/-0)
tests/qapi-schema/qapi-schema-test.err (+0/-0)
tests/qapi-schema/qapi-schema-test.exit (+1/-0)
tests/qapi-schema/qapi-schema-test.json (+173/-0)
tests/qapi-schema/qapi-schema-test.out (+207/-0)
tests/qapi-schema/quoted-structural-chars.err (+1/-0)
tests/qapi-schema/quoted-structural-chars.exit (+1/-0)
tests/qapi-schema/quoted-structural-chars.json (+1/-0)
tests/qapi-schema/quoted-structural-chars.out (+0/-0)
tests/qapi-schema/redefined-builtin.err (+1/-0)
tests/qapi-schema/redefined-builtin.exit (+1/-0)
tests/qapi-schema/redefined-builtin.json (+2/-0)
tests/qapi-schema/redefined-builtin.out (+0/-0)
tests/qapi-schema/redefined-command.err (+1/-0)
tests/qapi-schema/redefined-command.exit (+1/-0)
tests/qapi-schema/redefined-command.json (+3/-0)
tests/qapi-schema/redefined-command.out (+0/-0)
tests/qapi-schema/redefined-event.err (+1/-0)
tests/qapi-schema/redefined-event.exit (+1/-0)
tests/qapi-schema/redefined-event.json (+3/-0)
tests/qapi-schema/redefined-event.out (+0/-0)
tests/qapi-schema/redefined-type.err (+1/-0)
tests/qapi-schema/redefined-type.exit (+1/-0)
tests/qapi-schema/redefined-type.json (+3/-0)
tests/qapi-schema/redefined-type.out (+0/-0)
tests/qapi-schema/reserved-command-q.err (+1/-0)
tests/qapi-schema/reserved-command-q.exit (+1/-0)
tests/qapi-schema/reserved-command-q.json (+5/-0)
tests/qapi-schema/reserved-command-q.out (+0/-0)
tests/qapi-schema/reserved-member-has.err (+1/-0)
tests/qapi-schema/reserved-member-has.exit (+1/-0)
tests/qapi-schema/reserved-member-has.json (+5/-0)
tests/qapi-schema/reserved-member-has.out (+0/-0)
tests/qapi-schema/reserved-member-q.err (+1/-0)
tests/qapi-schema/reserved-member-q.exit (+1/-0)
tests/qapi-schema/reserved-member-q.json (+4/-0)
tests/qapi-schema/reserved-member-q.out (+0/-0)
tests/qapi-schema/reserved-member-u.err (+1/-0)
tests/qapi-schema/reserved-member-u.exit (+1/-0)
tests/qapi-schema/reserved-member-u.json (+7/-0)
tests/qapi-schema/reserved-member-u.out (+0/-0)
tests/qapi-schema/reserved-type-kind.err (+1/-0)
tests/qapi-schema/reserved-type-kind.exit (+1/-0)
tests/qapi-schema/reserved-type-kind.json (+2/-0)
tests/qapi-schema/reserved-type-kind.out (+0/-0)
tests/qapi-schema/reserved-type-list.err (+1/-0)
tests/qapi-schema/reserved-type-list.exit (+1/-0)
tests/qapi-schema/reserved-type-list.json (+5/-0)
tests/qapi-schema/reserved-type-list.out (+0/-0)
tests/qapi-schema/returns-alternate.err (+1/-0)
tests/qapi-schema/returns-alternate.exit (+1/-0)
tests/qapi-schema/returns-alternate.json (+3/-0)
tests/qapi-schema/returns-alternate.out (+0/-0)
tests/qapi-schema/returns-array-bad.err (+1/-0)
tests/qapi-schema/returns-array-bad.exit (+1/-0)
tests/qapi-schema/returns-array-bad.json (+2/-0)
tests/qapi-schema/returns-array-bad.out (+0/-0)
tests/qapi-schema/returns-dict.err (+1/-0)
tests/qapi-schema/returns-dict.exit (+1/-0)
tests/qapi-schema/returns-dict.json (+2/-0)
tests/qapi-schema/returns-dict.out (+0/-0)
tests/qapi-schema/returns-unknown.err (+1/-0)
tests/qapi-schema/returns-unknown.exit (+1/-0)
tests/qapi-schema/returns-unknown.json (+2/-0)
tests/qapi-schema/returns-unknown.out (+0/-0)
tests/qapi-schema/returns-whitelist.err (+1/-0)
tests/qapi-schema/returns-whitelist.exit (+1/-0)
tests/qapi-schema/returns-whitelist.json (+11/-0)
tests/qapi-schema/returns-whitelist.out (+0/-0)
tests/qapi-schema/struct-base-clash-deep.err (+1/-0)
tests/qapi-schema/struct-base-clash-deep.exit (+1/-0)
tests/qapi-schema/struct-base-clash-deep.json (+12/-0)
tests/qapi-schema/struct-base-clash-deep.out (+0/-0)
tests/qapi-schema/struct-base-clash.err (+1/-0)
tests/qapi-schema/struct-base-clash.exit (+1/-0)
tests/qapi-schema/struct-base-clash.json (+7/-0)
tests/qapi-schema/struct-base-clash.out (+0/-0)
tests/qapi-schema/struct-data-invalid.err (+1/-0)
tests/qapi-schema/struct-data-invalid.exit (+1/-0)
tests/qapi-schema/struct-data-invalid.json (+2/-0)
tests/qapi-schema/struct-data-invalid.out (+0/-0)
tests/qapi-schema/struct-member-invalid.err (+1/-0)
tests/qapi-schema/struct-member-invalid.exit (+1/-0)
tests/qapi-schema/struct-member-invalid.json (+2/-0)
tests/qapi-schema/struct-member-invalid.out (+0/-0)
tests/qapi-schema/test-qapi.py (+56/-0)
tests/qapi-schema/trailing-comma-list.err (+1/-0)
tests/qapi-schema/trailing-comma-list.exit (+1/-0)
tests/qapi-schema/trailing-comma-list.json (+2/-0)
tests/qapi-schema/trailing-comma-list.out (+0/-0)
tests/qapi-schema/trailing-comma-object.err (+1/-0)
tests/qapi-schema/trailing-comma-object.exit (+1/-0)
tests/qapi-schema/trailing-comma-object.json (+2/-0)
tests/qapi-schema/trailing-comma-object.out (+0/-0)
tests/qapi-schema/type-bypass-bad-gen.err (+1/-0)
tests/qapi-schema/type-bypass-bad-gen.exit (+1/-0)
tests/qapi-schema/type-bypass-bad-gen.json (+2/-0)
tests/qapi-schema/type-bypass-bad-gen.out (+0/-0)
tests/qapi-schema/unclosed-list.err (+1/-0)
tests/qapi-schema/unclosed-list.exit (+1/-0)
tests/qapi-schema/unclosed-list.json (+1/-0)
tests/qapi-schema/unclosed-list.out (+0/-0)
tests/qapi-schema/unclosed-object.err (+1/-0)
tests/qapi-schema/unclosed-object.exit (+1/-0)
tests/qapi-schema/unclosed-object.json (+1/-0)
tests/qapi-schema/unclosed-object.out (+0/-0)
tests/qapi-schema/unclosed-string.err (+1/-0)
tests/qapi-schema/unclosed-string.exit (+1/-0)
tests/qapi-schema/unclosed-string.json (+2/-0)
tests/qapi-schema/unclosed-string.out (+0/-0)
tests/qapi-schema/unicode-str.err (+1/-0)
tests/qapi-schema/unicode-str.exit (+1/-0)
tests/qapi-schema/unicode-str.json (+2/-0)
tests/qapi-schema/unicode-str.out (+0/-0)
tests/qapi-schema/union-bad-branch.err (+1/-0)
tests/qapi-schema/union-bad-branch.exit (+1/-0)
tests/qapi-schema/union-bad-branch.json (+8/-0)
tests/qapi-schema/union-bad-branch.out (+0/-0)
tests/qapi-schema/union-base-no-discriminator.err (+1/-0)
tests/qapi-schema/union-base-no-discriminator.exit (+1/-0)
tests/qapi-schema/union-base-no-discriminator.json (+14/-0)
tests/qapi-schema/union-base-no-discriminator.out (+0/-0)
tests/qapi-schema/union-clash-branches.err (+1/-0)
tests/qapi-schema/union-clash-branches.exit (+1/-0)
tests/qapi-schema/union-clash-branches.json (+5/-0)
tests/qapi-schema/union-clash-branches.out (+0/-0)
tests/qapi-schema/union-clash-data.err (+0/-0)
tests/qapi-schema/union-clash-data.exit (+1/-0)
tests/qapi-schema/union-clash-data.json (+7/-0)
tests/qapi-schema/union-clash-data.out (+6/-0)
tests/qapi-schema/union-clash-type.err (+1/-0)
tests/qapi-schema/union-clash-type.exit (+1/-0)
tests/qapi-schema/union-clash-type.json (+9/-0)
tests/qapi-schema/union-clash-type.out (+0/-0)
tests/qapi-schema/union-empty.err (+0/-0)
tests/qapi-schema/union-empty.exit (+1/-0)
tests/qapi-schema/union-empty.json (+2/-0)
tests/qapi-schema/union-empty.out (+3/-0)
tests/qapi-schema/union-invalid-base.err (+1/-0)
tests/qapi-schema/union-invalid-base.exit (+1/-0)
tests/qapi-schema/union-invalid-base.json (+12/-0)
tests/qapi-schema/union-invalid-base.out (+0/-0)
tests/qapi-schema/union-max.err (+1/-0)
tests/qapi-schema/union-max.exit (+1/-0)
tests/qapi-schema/union-max.json (+3/-0)
tests/qapi-schema/union-max.out (+0/-0)
tests/qapi-schema/union-optional-branch.err (+1/-0)
tests/qapi-schema/union-optional-branch.exit (+1/-0)
tests/qapi-schema/union-optional-branch.json (+2/-0)
tests/qapi-schema/union-optional-branch.out (+0/-0)
tests/qapi-schema/union-unknown.err (+1/-0)
tests/qapi-schema/union-unknown.exit (+1/-0)
tests/qapi-schema/union-unknown.json (+3/-0)
tests/qapi-schema/union-unknown.out (+0/-0)
tests/qapi-schema/unknown-escape.err (+1/-0)
tests/qapi-schema/unknown-escape.exit (+1/-0)
tests/qapi-schema/unknown-escape.json (+3/-0)
tests/qapi-schema/unknown-escape.out (+0/-0)
tests/qapi-schema/unknown-expr-key.err (+1/-0)
tests/qapi-schema/unknown-expr-key.exit (+1/-0)
tests/qapi-schema/unknown-expr-key.json (+2/-0)
tests/qapi-schema/unknown-expr-key.out (+0/-0)
tests/qemu-iotests-quick.sh (+8/-0)
tests/qemu-iotests/.gitignore (+9/-0)
tests/qemu-iotests/001 (+65/-0)
tests/qemu-iotests/001.out (+15/-0)
tests/qemu-iotests/002 (+85/-0)
tests/qemu-iotests/002.out (+49/-0)
tests/qemu-iotests/003 (+78/-0)
tests/qemu-iotests/003.out (+23/-0)
tests/qemu-iotests/004 (+104/-0)
tests/qemu-iotests/004.out (+41/-0)
tests/qemu-iotests/005 (+75/-0)
tests/qemu-iotests/005.out (+13/-0)
tests/qemu-iotests/007 (+69/-0)
tests/qemu-iotests/007.out (+18/-0)
tests/qemu-iotests/008 (+65/-0)
tests/qemu-iotests/008.out (+15/-0)
tests/qemu-iotests/009 (+69/-0)
tests/qemu-iotests/009.out (+18/-0)
tests/qemu-iotests/010 (+71/-0)
tests/qemu-iotests/010.out (+22/-0)
tests/qemu-iotests/011 (+75/-0)
tests/qemu-iotests/011.out (+50/-0)
tests/qemu-iotests/012 (+62/-0)
tests/qemu-iotests/012.out (+9/-0)
tests/qemu-iotests/013 (+98/-0)
tests/qemu-iotests/013.out (+43983/-0)
tests/qemu-iotests/014 (+77/-0)
tests/qemu-iotests/014.out (+64074/-0)
tests/qemu-iotests/015 (+87/-0)
tests/qemu-iotests/015.out (+20/-0)
tests/qemu-iotests/017 (+104/-0)
tests/qemu-iotests/017.out (+1077/-0)
tests/qemu-iotests/018 (+107/-0)
tests/qemu-iotests/018.out (+1077/-0)
tests/qemu-iotests/019 (+132/-0)
tests/qemu-iotests/019.out (+1628/-0)
tests/qemu-iotests/020 (+114/-0)
tests/qemu-iotests/020.out (+1078/-0)
tests/qemu-iotests/021 (+63/-0)
tests/qemu-iotests/021.out (+93/-0)
tests/qemu-iotests/022 (+67/-0)
tests/qemu-iotests/022.out (+8801/-0)
tests/qemu-iotests/023 (+120/-0)
tests/qemu-iotests/023.out (+25706/-0)
tests/qemu-iotests/024 (+125/-0)
tests/qemu-iotests/024.out (+144/-0)
tests/qemu-iotests/025 (+78/-0)
tests/qemu-iotests/025.out (+27/-0)
tests/qemu-iotests/026 (+207/-0)
tests/qemu-iotests/026.out (+706/-0)
tests/qemu-iotests/026.out.nocache (+610/-0)
tests/qemu-iotests/027 (+78/-0)
tests/qemu-iotests/027.out (+23/-0)
tests/qemu-iotests/028 (+135/-0)
tests/qemu-iotests/028.out (+737/-0)
tests/qemu-iotests/029 (+101/-0)
tests/qemu-iotests/029.out (+27/-0)
tests/qemu-iotests/030 (+470/-0)
tests/qemu-iotests/030.out (+5/-0)
tests/qemu-iotests/031 (+80/-0)
tests/qemu-iotests/031.out (+204/-0)
tests/qemu-iotests/032 (+69/-0)
tests/qemu-iotests/032.out (+78/-0)
tests/qemu-iotests/033 (+99/-0)
tests/qemu-iotests/033.out (+85/-0)
tests/qemu-iotests/034 (+116/-0)
tests/qemu-iotests/034.out (+81/-0)
tests/qemu-iotests/035 (+72/-0)
tests/qemu-iotests/035.out (+392/-0)
tests/qemu-iotests/036 (+119/-0)
tests/qemu-iotests/036.out (+87/-0)
tests/qemu-iotests/037 (+122/-0)
tests/qemu-iotests/037.out (+645/-0)
tests/qemu-iotests/038 (+134/-0)
tests/qemu-iotests/038.out (+909/-0)
tests/qemu-iotests/039 (+182/-0)
tests/qemu-iotests/039.out (+115/-0)
tests/qemu-iotests/040 (+285/-0)
tests/qemu-iotests/040.out (+5/-0)
tests/qemu-iotests/041 (+930/-0)
tests/qemu-iotests/041.out (+5/-0)
tests/qemu-iotests/042 (+78/-0)
tests/qemu-iotests/042.out (+15/-0)
tests/qemu-iotests/043 (+95/-0)
tests/qemu-iotests/043.out (+66/-0)
tests/qemu-iotests/044 (+117/-0)
tests/qemu-iotests/044.out (+8/-0)
tests/qemu-iotests/045 (+178/-0)
tests/qemu-iotests/045.out (+5/-0)
tests/qemu-iotests/046 (+272/-0)
tests/qemu-iotests/046.out (+239/-0)
tests/qemu-iotests/047 (+75/-0)
tests/qemu-iotests/047.out (+22/-0)
tests/qemu-iotests/048 (+85/-0)
tests/qemu-iotests/048.out (+40/-0)
tests/qemu-iotests/049 (+123/-0)
tests/qemu-iotests/049.out (+213/-0)
tests/qemu-iotests/050 (+75/-0)
tests/qemu-iotests/050.out (+17/-0)
tests/qemu-iotests/051 (+282/-0)
tests/qemu-iotests/051.out (+422/-0)
tests/qemu-iotests/052 (+63/-0)
tests/qemu-iotests/052.out (+13/-0)
tests/qemu-iotests/053 (+73/-0)
tests/qemu-iotests/053.out (+17/-0)
tests/qemu-iotests/054 (+58/-0)
tests/qemu-iotests/054.out (+10/-0)
tests/qemu-iotests/055 (+455/-0)
tests/qemu-iotests/055.out (+5/-0)
tests/qemu-iotests/056 (+112/-0)
tests/qemu-iotests/056.out (+5/-0)
tests/qemu-iotests/057 (+259/-0)
tests/qemu-iotests/057.out (+5/-0)
tests/qemu-iotests/058 (+148/-0)
tests/qemu-iotests/058.out (+44/-0)
tests/qemu-iotests/059 (+143/-0)
tests/qemu-iotests/059.out (+2342/-0)
tests/qemu-iotests/060 (+249/-0)
tests/qemu-iotests/060.out (+183/-0)
tests/qemu-iotests/061 (+242/-0)
tests/qemu-iotests/061.out (+423/-0)
tests/qemu-iotests/062 (+64/-0)
tests/qemu-iotests/062.out (+9/-0)
tests/qemu-iotests/063 (+100/-0)
tests/qemu-iotests/063.out (+10/-0)
tests/qemu-iotests/064 (+88/-0)
tests/qemu-iotests/064.out (+54/-0)
tests/qemu-iotests/065 (+132/-0)
tests/qemu-iotests/065.out (+5/-0)
tests/qemu-iotests/066 (+63/-0)
tests/qemu-iotests/066.out (+13/-0)
tests/qemu-iotests/067 (+137/-0)
tests/qemu-iotests/067.out (+521/-0)
tests/qemu-iotests/068 (+65/-0)
tests/qemu-iotests/068.out (+11/-0)
tests/qemu-iotests/069 (+60/-0)
tests/qemu-iotests/069.out (+8/-0)
tests/qemu-iotests/070 (+85/-0)
tests/qemu-iotests/070.out (+27/-0)
tests/qemu-iotests/071 (+275/-0)
tests/qemu-iotests/071.out (+98/-0)
tests/qemu-iotests/072 (+69/-0)
tests/qemu-iotests/072.out (+21/-0)
tests/qemu-iotests/073 (+166/-0)
tests/qemu-iotests/073.out (+118/-0)
tests/qemu-iotests/074 (+86/-0)
tests/qemu-iotests/074.out (+18/-0)
tests/qemu-iotests/075 (+106/-0)
tests/qemu-iotests/075.out (+38/-0)
tests/qemu-iotests/076 (+86/-0)
tests/qemu-iotests/076.out (+32/-0)
tests/qemu-iotests/077 (+278/-0)
tests/qemu-iotests/077.out (+202/-0)
tests/qemu-iotests/078 (+91/-0)
tests/qemu-iotests/078.out (+28/-0)
tests/qemu-iotests/079 (+57/-0)
tests/qemu-iotests/079.out (+14/-0)
tests/qemu-iotests/080 (+184/-0)
tests/qemu-iotests/080.out (+85/-0)
tests/qemu-iotests/081 (+179/-0)
tests/qemu-iotests/081.out (+58/-0)
tests/qemu-iotests/082 (+208/-0)
tests/qemu-iotests/082.out (+540/-0)
tests/qemu-iotests/083 (+130/-0)
tests/qemu-iotests/083.out (+138/-0)
tests/qemu-iotests/084 (+116/-0)
tests/qemu-iotests/084.out (+47/-0)
tests/qemu-iotests/085 (+243/-0)
tests/qemu-iotests/085.out (+89/-0)
tests/qemu-iotests/086 (+65/-0)
tests/qemu-iotests/086.out (+18/-0)
tests/qemu-iotests/087 (+242/-0)
tests/qemu-iotests/087.out (+85/-0)
tests/qemu-iotests/088 (+64/-0)
tests/qemu-iotests/088.out (+17/-0)
tests/qemu-iotests/089 (+133/-0)
tests/qemu-iotests/089.out (+56/-0)
tests/qemu-iotests/090 (+61/-0)
tests/qemu-iotests/090.out (+12/-0)
tests/qemu-iotests/091 (+107/-0)
tests/qemu-iotests/091.out (+28/-0)
tests/qemu-iotests/092 (+98/-0)
tests/qemu-iotests/092.out (+38/-0)
tests/qemu-iotests/093 (+151/-0)
tests/qemu-iotests/093.out (+5/-0)
tests/qemu-iotests/094 (+81/-0)
tests/qemu-iotests/094.out (+11/-0)
tests/qemu-iotests/095 (+86/-0)
tests/qemu-iotests/095.out (+23/-0)
tests/qemu-iotests/096 (+69/-0)
tests/qemu-iotests/096.out (+5/-0)
tests/qemu-iotests/097 (+122/-0)
tests/qemu-iotests/097.out (+119/-0)
tests/qemu-iotests/098 (+82/-0)
tests/qemu-iotests/098.out (+52/-0)
tests/qemu-iotests/099 (+130/-0)
tests/qemu-iotests/099.out (+28/-0)
tests/qemu-iotests/100 (+146/-0)
tests/qemu-iotests/100.out (+89/-0)
tests/qemu-iotests/101 (+58/-0)
tests/qemu-iotests/101.out (+10/-0)
tests/qemu-iotests/102 (+81/-0)
tests/qemu-iotests/102.out (+21/-0)
tests/qemu-iotests/103 (+109/-0)
tests/qemu-iotests/103.out (+34/-0)
tests/qemu-iotests/104 (+54/-0)
tests/qemu-iotests/104.out (+12/-0)
tests/qemu-iotests/105 (+70/-0)
tests/qemu-iotests/105.out (+21/-0)
tests/qemu-iotests/107 (+61/-0)
tests/qemu-iotests/107.out (+10/-0)
tests/qemu-iotests/108 (+143/-0)
tests/qemu-iotests/108.out (+110/-0)
tests/qemu-iotests/109 (+132/-0)
tests/qemu-iotests/109.out (+231/-0)
tests/qemu-iotests/110 (+94/-0)
tests/qemu-iotests/110.out (+19/-0)
tests/qemu-iotests/111 (+53/-0)
tests/qemu-iotests/111.out (+3/-0)
tests/qemu-iotests/112 (+187/-0)
tests/qemu-iotests/112.out (+84/-0)
tests/qemu-iotests/113 (+76/-0)
tests/qemu-iotests/113.out (+15/-0)
tests/qemu-iotests/114 (+61/-0)
tests/qemu-iotests/114.out (+13/-0)
tests/qemu-iotests/115 (+95/-0)
tests/qemu-iotests/115.out (+8/-0)
tests/qemu-iotests/116 (+96/-0)
tests/qemu-iotests/116.out (+37/-0)
tests/qemu-iotests/118 (+720/-0)
tests/qemu-iotests/118.out (+5/-0)
tests/qemu-iotests/119 (+60/-0)
tests/qemu-iotests/119.out (+11/-0)
tests/qemu-iotests/120 (+65/-0)
tests/qemu-iotests/120.out (+15/-0)
tests/qemu-iotests/121 (+102/-0)
tests/qemu-iotests/121.out (+23/-0)
tests/qemu-iotests/122 (+223/-0)
tests/qemu-iotests/122.out (+209/-0)
tests/qemu-iotests/123 (+62/-0)
tests/qemu-iotests/123.out (+9/-0)
tests/qemu-iotests/124 (+543/-0)
tests/qemu-iotests/124.out (+5/-0)
tests/qemu-iotests/128 (+91/-0)
tests/qemu-iotests/128.out (+5/-0)
tests/qemu-iotests/129 (+86/-0)
tests/qemu-iotests/129.out (+5/-0)
tests/qemu-iotests/130 (+95/-0)
tests/qemu-iotests/130.out (+43/-0)
tests/qemu-iotests/131 (+77/-0)
tests/qemu-iotests/131.out (+41/-0)
tests/qemu-iotests/132 (+59/-0)
tests/qemu-iotests/132.out (+5/-0)
tests/qemu-iotests/134 (+69/-0)
tests/qemu-iotests/134.out (+46/-0)
tests/qemu-iotests/135 (+54/-0)
tests/qemu-iotests/135.out (+5/-0)
tests/qemu-iotests/136 (+349/-0)
tests/qemu-iotests/136.out (+5/-0)
tests/qemu-iotests/137 (+145/-0)
tests/qemu-iotests/137.out (+46/-0)
tests/qemu-iotests/138 (+73/-0)
tests/qemu-iotests/138.out (+9/-0)
tests/qemu-iotests/139 (+416/-0)
tests/qemu-iotests/139.out (+5/-0)
tests/qemu-iotests/COPYING (+339/-0)
tests/qemu-iotests/Makefile (+9/-0)
tests/qemu-iotests/README (+20/-0)
tests/qemu-iotests/check (+382/-0)
tests/qemu-iotests/common (+438/-0)
tests/qemu-iotests/common.config (+214/-0)
tests/qemu-iotests/common.filter (+234/-0)
tests/qemu-iotests/common.pattern (+140/-0)
tests/qemu-iotests/common.qemu (+217/-0)
tests/qemu-iotests/common.rc (+495/-0)
tests/qemu-iotests/group (+142/-0)
tests/qemu-iotests/iotests.py (+424/-0)
tests/qemu-iotests/nbd-fault-injector.py (+264/-0)
tests/qemu-iotests/qcow2.py (+267/-0)
tests/qemu-iotests/qed.py (+235/-0)
tests/qemu-iotests/sample_images/README (+8/-0)
tests/qemu-iotests/socket_scm_helper.c (+135/-0)
tests/qom-test.c (+152/-0)
tests/rcutorture.c (+463/-0)
tests/rocker/README (+5/-0)
tests/rocker/all (+19/-0)
tests/rocker/bridge (+43/-0)
tests/rocker/bridge-stp (+52/-0)
tests/rocker/bridge-vlan (+52/-0)
tests/rocker/bridge-vlan-stp (+64/-0)
tests/rocker/port (+22/-0)
tests/rocker/tut.dot (+8/-0)
tests/rtc-test.c (+578/-0)
tests/rtl8139-test.c (+214/-0)
tests/spapr-phb-test.c (+35/-0)
tests/tcg/Makefile (+156/-0)
tests/tcg/alpha/Makefile (+35/-0)
tests/tcg/alpha/crt.s (+26/-0)
tests/tcg/alpha/hello-alpha.c (+5/-0)
tests/tcg/alpha/test-cond.c (+87/-0)
tests/tcg/alpha/test-ovf.c (+29/-0)
tests/tcg/cris/.gdbinit (+11/-0)
tests/tcg/cris/Makefile (+155/-0)
tests/tcg/cris/README (+1/-0)
tests/tcg/cris/check_abs.c (+40/-0)
tests/tcg/cris/check_addc.c (+58/-0)
tests/tcg/cris/check_addcm.c (+85/-0)
tests/tcg/cris/check_addi.s (+57/-0)
tests/tcg/cris/check_addiv32.s (+62/-0)
tests/tcg/cris/check_addm.s (+96/-0)
tests/tcg/cris/check_addo.c (+125/-0)
tests/tcg/cris/check_addoq.c (+44/-0)
tests/tcg/cris/check_addq.s (+47/-0)
tests/tcg/cris/check_addr.s (+96/-0)
tests/tcg/cris/check_addxc.s (+91/-0)
tests/tcg/cris/check_addxm.s (+106/-0)
tests/tcg/cris/check_addxr.s (+96/-0)
tests/tcg/cris/check_andc.s (+80/-0)
tests/tcg/cris/check_andm.s (+90/-0)
tests/tcg/cris/check_andq.s (+46/-0)
tests/tcg/cris/check_andr.s (+95/-0)
tests/tcg/cris/check_asr.s (+230/-0)
tests/tcg/cris/check_ba.s (+93/-0)
tests/tcg/cris/check_bas.s (+102/-0)
tests/tcg/cris/check_bcc.s (+197/-0)
tests/tcg/cris/check_bound.c (+142/-0)
tests/tcg/cris/check_boundc.s (+101/-0)
tests/tcg/cris/check_boundr.s (+125/-0)
tests/tcg/cris/check_btst.s (+96/-0)
tests/tcg/cris/check_clearfv32.s (+19/-0)
tests/tcg/cris/check_clrjmp1.s (+36/-0)
tests/tcg/cris/check_cmp-2.s (+15/-0)
tests/tcg/cris/check_cmpc.s (+86/-0)
tests/tcg/cris/check_cmpm.s (+96/-0)
tests/tcg/cris/check_cmpq.s (+75/-0)
tests/tcg/cris/check_cmpr.s (+102/-0)
tests/tcg/cris/check_cmpxc.s (+92/-0)
tests/tcg/cris/check_cmpxm.s (+106/-0)
tests/tcg/cris/check_dstep.s (+42/-0)
tests/tcg/cris/check_ftag.c (+37/-0)
tests/tcg/cris/check_gcctorture_pr28634-1.c (+15/-0)
tests/tcg/cris/check_gcctorture_pr28634.c (+15/-0)
tests/tcg/cris/check_glibc_kernelversion.c (+116/-0)
tests/tcg/cris/check_hello.c (+7/-0)
tests/tcg/cris/check_int64.c (+47/-0)
tests/tcg/cris/check_jsr.s (+85/-0)
tests/tcg/cris/check_lapc.s (+78/-0)
tests/tcg/cris/check_lsl.s (+217/-0)
tests/tcg/cris/check_lsr.s (+218/-0)
tests/tcg/cris/check_lz.c (+49/-0)
tests/tcg/cris/check_mapbrk.c (+39/-0)
tests/tcg/cris/check_mcp.s (+49/-0)
tests/tcg/cris/check_mmap1.c (+48/-0)
tests/tcg/cris/check_mmap2.c (+48/-0)
tests/tcg/cris/check_mmap3.c (+33/-0)
tests/tcg/cris/check_movdelsr1.s (+33/-0)
tests/tcg/cris/check_movecr.s (+37/-0)
tests/tcg/cris/check_movei.s (+50/-0)
tests/tcg/cris/check_movemr.s (+78/-0)
tests/tcg/cris/check_movemrv32.s (+96/-0)
tests/tcg/cris/check_moveq.c (+51/-0)
tests/tcg/cris/check_mover.s (+28/-0)
tests/tcg/cris/check_moverm.s (+45/-0)
tests/tcg/cris/check_movmp.s (+131/-0)
tests/tcg/cris/check_movpmv32.s (+35/-0)
tests/tcg/cris/check_movpr.s (+28/-0)
tests/tcg/cris/check_movprv32.s (+21/-0)
tests/tcg/cris/check_movscr.s (+29/-0)
tests/tcg/cris/check_movsm.s (+44/-0)
tests/tcg/cris/check_movsr.s (+46/-0)
tests/tcg/cris/check_movucr.s (+33/-0)
tests/tcg/cris/check_movum.s (+40/-0)
tests/tcg/cris/check_movur.s (+45/-0)
tests/tcg/cris/check_mulv32.s (+51/-0)
tests/tcg/cris/check_mulx.s (+246/-0)
tests/tcg/cris/check_neg.s (+104/-0)
tests/tcg/cris/check_not.s (+31/-0)
tests/tcg/cris/check_openpf1.c (+38/-0)
tests/tcg/cris/check_openpf2.c (+16/-0)
tests/tcg/cris/check_openpf3.c (+49/-0)
tests/tcg/cris/check_openpf4.c (+5/-0)
tests/tcg/cris/check_openpf5.c (+56/-0)
tests/tcg/cris/check_orc.s (+71/-0)
tests/tcg/cris/check_orm.s (+75/-0)
tests/tcg/cris/check_orq.s (+41/-0)
tests/tcg/cris/check_orr.s (+84/-0)
tests/tcg/cris/check_ret.s (+25/-0)
tests/tcg/cris/check_scc.s (+95/-0)
tests/tcg/cris/check_settls1.c (+45/-0)
tests/tcg/cris/check_sigalrm.c (+26/-0)
tests/tcg/cris/check_stat1.c (+16/-0)
tests/tcg/cris/check_stat2.c (+20/-0)
tests/tcg/cris/check_stat3.c (+25/-0)
tests/tcg/cris/check_stat4.c (+27/-0)
tests/tcg/cris/check_subc.s (+87/-0)
tests/tcg/cris/check_subm.s (+96/-0)
tests/tcg/cris/check_subq.s (+52/-0)
tests/tcg/cris/check_subr.s (+102/-0)
tests/tcg/cris/check_swap.c (+76/-0)
tests/tcg/cris/check_time1.c (+46/-0)
tests/tcg/cris/check_time2.c (+18/-0)
tests/tcg/cris/check_xarith.s (+72/-0)
tests/tcg/cris/crisutils.h (+76/-0)
tests/tcg/cris/crt.s (+13/-0)
tests/tcg/cris/sys.c (+51/-0)
tests/tcg/cris/sys.h (+16/-0)
tests/tcg/cris/testutils.inc (+117/-0)
tests/tcg/hello-arm.c (+113/-0)
tests/tcg/hello-i386.c (+27/-0)
tests/tcg/hello-mips.c (+64/-0)
tests/tcg/linux-test.c (+538/-0)
tests/tcg/lm32/Makefile (+106/-0)
tests/tcg/lm32/crt.S (+84/-0)
tests/tcg/lm32/helper.S (+65/-0)
tests/tcg/lm32/linker.ld (+55/-0)
tests/tcg/lm32/macros.inc (+90/-0)
tests/tcg/lm32/test_add.S (+75/-0)
tests/tcg/lm32/test_addi.S (+56/-0)
tests/tcg/lm32/test_and.S (+45/-0)
tests/tcg/lm32/test_andhi.S (+35/-0)
tests/tcg/lm32/test_andi.S (+35/-0)
tests/tcg/lm32/test_b.S (+13/-0)
tests/tcg/lm32/test_be.S (+48/-0)
tests/tcg/lm32/test_bg.S (+78/-0)
tests/tcg/lm32/test_bge.S (+78/-0)
tests/tcg/lm32/test_bgeu.S (+78/-0)
tests/tcg/lm32/test_bgu.S (+78/-0)
tests/tcg/lm32/test_bi.S (+23/-0)
tests/tcg/lm32/test_bne.S (+48/-0)
tests/tcg/lm32/test_break.S (+20/-0)
tests/tcg/lm32/test_bret.S (+38/-0)
tests/tcg/lm32/test_call.S (+16/-0)
tests/tcg/lm32/test_calli.S (+15/-0)
tests/tcg/lm32/test_cmpe.S (+40/-0)
tests/tcg/lm32/test_cmpei.S (+35/-0)
tests/tcg/lm32/test_cmpg.S (+64/-0)
tests/tcg/lm32/test_cmpge.S (+64/-0)
tests/tcg/lm32/test_cmpgei.S (+70/-0)
tests/tcg/lm32/test_cmpgeu.S (+64/-0)
tests/tcg/lm32/test_cmpgeui.S (+70/-0)
tests/tcg/lm32/test_cmpgi.S (+70/-0)
tests/tcg/lm32/test_cmpgu.S (+64/-0)
tests/tcg/lm32/test_cmpgui.S (+70/-0)
tests/tcg/lm32/test_cmpne.S (+40/-0)
tests/tcg/lm32/test_cmpnei.S (+35/-0)
tests/tcg/lm32/test_divu.S (+29/-0)
tests/tcg/lm32/test_eret.S (+38/-0)
tests/tcg/lm32/test_lb.S (+49/-0)
tests/tcg/lm32/test_lbu.S (+49/-0)
tests/tcg/lm32/test_lh.S (+49/-0)
tests/tcg/lm32/test_lhu.S (+49/-0)
tests/tcg/lm32/test_lw.S (+32/-0)
tests/tcg/lm32/test_modu.S (+35/-0)
tests/tcg/lm32/test_mul.S (+70/-0)
tests/tcg/lm32/test_muli.S (+45/-0)
tests/tcg/lm32/test_nor.S (+51/-0)
tests/tcg/lm32/test_nori.S (+35/-0)
tests/tcg/lm32/test_or.S (+51/-0)
tests/tcg/lm32/test_orhi.S (+35/-0)
tests/tcg/lm32/test_ori.S (+35/-0)
tests/tcg/lm32/test_ret.S (+14/-0)
tests/tcg/lm32/test_sb.S (+32/-0)
tests/tcg/lm32/test_scall.S (+24/-0)
tests/tcg/lm32/test_sextb.S (+20/-0)
tests/tcg/lm32/test_sexth.S (+20/-0)
tests/tcg/lm32/test_sh.S (+32/-0)
tests/tcg/lm32/test_sl.S (+45/-0)
tests/tcg/lm32/test_sli.S (+30/-0)
tests/tcg/lm32/test_sr.S (+57/-0)
tests/tcg/lm32/test_sri.S (+40/-0)
tests/tcg/lm32/test_sru.S (+57/-0)
tests/tcg/lm32/test_srui.S (+40/-0)
tests/tcg/lm32/test_sub.S (+75/-0)
tests/tcg/lm32/test_sw.S (+38/-0)
tests/tcg/lm32/test_xnor.S (+51/-0)
tests/tcg/lm32/test_xnori.S (+35/-0)
tests/tcg/lm32/test_xor.S (+51/-0)
tests/tcg/lm32/test_xori.S (+35/-0)
tests/tcg/mips/mips32-dsp/Makefile (+136/-0)
tests/tcg/mips/mips32-dsp/absq_s_ph.c (+31/-0)
tests/tcg/mips/mips32-dsp/absq_s_w.c (+37/-0)
tests/tcg/mips/mips32-dsp/addq_ph.c (+46/-0)
tests/tcg/mips/mips32-dsp/addq_s_ph.c (+69/-0)
tests/tcg/mips/mips32-dsp/addq_s_w.c (+44/-0)
tests/tcg/mips/mips32-dsp/addsc.c (+33/-0)
tests/tcg/mips/mips32-dsp/addu_qb.c (+35/-0)
tests/tcg/mips/mips32-dsp/addu_s_qb.c (+35/-0)
tests/tcg/mips/mips32-dsp/addwc.c (+49/-0)
tests/tcg/mips/mips32-dsp/bitrev.c (+20/-0)
tests/tcg/mips/mips32-dsp/bposge32.c (+44/-0)
tests/tcg/mips/mips32-dsp/cmp_eq_ph.c (+35/-0)
tests/tcg/mips/mips32-dsp/cmp_le_ph.c (+35/-0)
tests/tcg/mips/mips32-dsp/cmp_lt_ph.c (+35/-0)
tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c (+31/-0)
tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c (+31/-0)
tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c (+31/-0)
tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c (+35/-0)
tests/tcg/mips/mips32-dsp/cmpu_le_qb.c (+35/-0)
tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c (+35/-0)
tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c (+31/-0)
tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c (+125/-0)
tests/tcg/mips/mips32-dsp/dpau_h_qbl.c (+27/-0)
tests/tcg/mips/mips32-dsp/dpau_h_qbr.c (+27/-0)
tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c (+45/-0)
tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c (+55/-0)
tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c (+27/-0)
tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c (+27/-0)
tests/tcg/mips/mips32-dsp/extp.c (+62/-0)
tests/tcg/mips/mips32-dsp/extpdp.c (+64/-0)
tests/tcg/mips/mips32-dsp/extpdpv.c (+47/-0)
tests/tcg/mips/mips32-dsp/extpv.c (+45/-0)
tests/tcg/mips/mips32-dsp/extr_r_w.c (+94/-0)
tests/tcg/mips/mips32-dsp/extr_rs_w.c (+117/-0)
tests/tcg/mips/mips32-dsp/extr_s_h.c (+86/-0)
tests/tcg/mips/mips32-dsp/extr_w.c (+94/-0)
tests/tcg/mips/mips32-dsp/extrv_r_w.c (+79/-0)
tests/tcg/mips/mips32-dsp/extrv_rs_w.c (+77/-0)
tests/tcg/mips/mips32-dsp/extrv_s_h.c (+88/-0)
tests/tcg/mips/mips32-dsp/extrv_w.c (+80/-0)
tests/tcg/mips/mips32-dsp/insv.c (+36/-0)
tests/tcg/mips/mips32-dsp/lbux.c (+25/-0)
tests/tcg/mips/mips32-dsp/lhx.c (+25/-0)
tests/tcg/mips/mips32-dsp/lwx.c (+25/-0)
tests/tcg/mips/mips32-dsp/madd.c (+31/-0)
tests/tcg/mips/mips32-dsp/maddu.c (+31/-0)
tests/tcg/mips/mips32-dsp/main.c (+6/-0)
tests/tcg/mips/mips32-dsp/maq_s_w_phl.c (+55/-0)
tests/tcg/mips/mips32-dsp/maq_s_w_phr.c (+55/-0)
tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c (+55/-0)
tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c (+55/-0)
tests/tcg/mips/mips32-dsp/mfhi.c (+21/-0)
tests/tcg/mips/mips32-dsp/mflo.c (+21/-0)
tests/tcg/mips/mips32-dsp/modsub.c (+30/-0)
tests/tcg/mips/mips32-dsp/msub.c (+30/-0)
tests/tcg/mips/mips32-dsp/msubu.c (+30/-0)
tests/tcg/mips/mips32-dsp/mthi.c (+21/-0)
tests/tcg/mips/mips32-dsp/mthlip.c (+58/-0)
tests/tcg/mips/mips32-dsp/mtlo.c (+21/-0)
tests/tcg/mips/mips32-dsp/muleq_s_w_phl.c (+41/-0)
tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c (+40/-0)
tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c (+25/-0)
tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c (+25/-0)
tests/tcg/mips/mips32-dsp/mulq_rs_ph.c (+42/-0)
tests/tcg/mips/mips32-dsp/mult.c (+24/-0)
tests/tcg/mips/mips32-dsp/multu.c (+24/-0)
tests/tcg/mips/mips32-dsp/packrl_ph.c (+21/-0)
tests/tcg/mips/mips32-dsp/pick_ph.c (+49/-0)
tests/tcg/mips/mips32-dsp/pick_qb.c (+36/-0)
tests/tcg/mips/mips32-dsp/preceq_w_phl.c (+20/-0)
tests/tcg/mips/mips32-dsp/preceq_w_phr.c (+20/-0)
tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c (+20/-0)
tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c (+20/-0)
tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c (+20/-0)
tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c (+20/-0)
tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c (+20/-0)
tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c (+20/-0)
tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c (+20/-0)
tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c (+20/-0)
tests/tcg/mips/mips32-dsp/precrq_ph_w.c (+21/-0)
tests/tcg/mips/mips32-dsp/precrq_qb_ph.c (+21/-0)
tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c (+51/-0)
tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c (+24/-0)
tests/tcg/mips/mips32-dsp/raddu_w_qb.c (+20/-0)
tests/tcg/mips/mips32-dsp/rddsp.c (+46/-0)
tests/tcg/mips/mips32-dsp/repl_ph.c (+23/-0)
tests/tcg/mips/mips32-dsp/repl_qb.c (+16/-0)
tests/tcg/mips/mips32-dsp/replv_ph.c (+19/-0)
tests/tcg/mips/mips32-dsp/replv_qb.c (+19/-0)
tests/tcg/mips/mips32-dsp/shilo.c (+45/-0)
tests/tcg/mips/mips32-dsp/shilov.c (+49/-0)
tests/tcg/mips/mips32-dsp/shll_ph.c (+55/-0)
tests/tcg/mips/mips32-dsp/shll_qb.c (+55/-0)
tests/tcg/mips/mips32-dsp/shll_s_ph.c (+24/-0)
tests/tcg/mips/mips32-dsp/shll_s_w.c (+52/-0)
tests/tcg/mips/mips32-dsp/shllv_ph.c (+40/-0)
tests/tcg/mips/mips32-dsp/shllv_qb.c (+38/-0)
tests/tcg/mips/mips32-dsp/shllv_s_ph.c (+40/-0)
tests/tcg/mips/mips32-dsp/shllv_s_w.c (+40/-0)
tests/tcg/mips/mips32-dsp/shra_ph.c (+30/-0)
tests/tcg/mips/mips32-dsp/shra_r_ph.c (+30/-0)
tests/tcg/mips/mips32-dsp/shra_r_w.c (+30/-0)
tests/tcg/mips/mips32-dsp/shrav_ph.c (+32/-0)
tests/tcg/mips/mips32-dsp/shrav_r_ph.c (+32/-0)
tests/tcg/mips/mips32-dsp/shrav_r_w.c (+32/-0)
tests/tcg/mips/mips32-dsp/shrl_qb.c (+31/-0)
tests/tcg/mips/mips32-dsp/shrlv_qb.c (+32/-0)
tests/tcg/mips/mips32-dsp/subq_ph.c (+40/-0)
tests/tcg/mips/mips32-dsp/subq_s_ph.c (+58/-0)
tests/tcg/mips/mips32-dsp/subq_s_w.c (+74/-0)
tests/tcg/mips/mips32-dsp/subu_qb.c (+25/-0)
tests/tcg/mips/mips32-dsp/subu_s_qb.c (+25/-0)
tests/tcg/mips/mips32-dsp/wrdsp.c (+46/-0)
tests/tcg/mips/mips32-dspr2/Makefile (+71/-0)
tests/tcg/mips/mips32-dspr2/absq_s_qb.c (+35/-0)
tests/tcg/mips/mips32-dspr2/addqh_ph.c (+30/-0)
tests/tcg/mips/mips32-dspr2/addqh_r_ph.c (+30/-0)
tests/tcg/mips/mips32-dspr2/addqh_r_w.c (+34/-0)
tests/tcg/mips/mips32-dspr2/addqh_w.c (+34/-0)
tests/tcg/mips/mips32-dspr2/addu_ph.c (+33/-0)
tests/tcg/mips/mips32-dspr2/addu_s_ph.c (+33/-0)
tests/tcg/mips/mips32-dspr2/adduh_qb.c (+30/-0)
tests/tcg/mips/mips32-dspr2/adduh_r_qb.c (+30/-0)
tests/tcg/mips/mips32-dspr2/append.c (+30/-0)
tests/tcg/mips/mips32-dspr2/balign.c (+30/-0)
tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c (+37/-0)
tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c (+37/-0)
tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c (+37/-0)
tests/tcg/mips/mips32-dspr2/dpa_w_ph.c (+44/-0)
tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c (+79/-0)
tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c (+57/-0)
tests/tcg/mips/mips32-dspr2/dpax_w_ph.c (+44/-0)
tests/tcg/mips/mips32-dspr2/dps_w_ph.c (+44/-0)
tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c (+54/-0)
tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c (+53/-0)
tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c (+27/-0)
tests/tcg/mips/mips32-dspr2/mul_ph.c (+47/-0)
tests/tcg/mips/mips32-dspr2/mul_s_ph.c (+62/-0)
tests/tcg/mips/mips32-dspr2/mulq_rs_w.c (+36/-0)
tests/tcg/mips/mips32-dspr2/mulq_s_ph.c (+40/-0)
tests/tcg/mips/mips32-dspr2/mulq_s_w.c (+36/-0)
tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c (+29/-0)
tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c (+29/-0)
tests/tcg/mips/mips32-dspr2/precr_qb_ph.c (+21/-0)
tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c (+32/-0)
tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c (+32/-0)
tests/tcg/mips/mips32-dspr2/prepend.c (+30/-0)
tests/tcg/mips/mips32-dspr2/shra_qb.c (+30/-0)
tests/tcg/mips/mips32-dspr2/shra_r_qb.c (+30/-0)
tests/tcg/mips/mips32-dspr2/shrav_qb.c (+32/-0)
tests/tcg/mips/mips32-dspr2/shrav_r_qb.c (+32/-0)
tests/tcg/mips/mips32-dspr2/shrl_ph.c (+20/-0)
tests/tcg/mips/mips32-dspr2/shrlv_ph.c (+21/-0)
tests/tcg/mips/mips32-dspr2/subqh_ph.c (+21/-0)
tests/tcg/mips/mips32-dspr2/subqh_r_ph.c (+21/-0)
tests/tcg/mips/mips32-dspr2/subqh_r_w.c (+21/-0)
tests/tcg/mips/mips32-dspr2/subqh_w.c (+21/-0)
tests/tcg/mips/mips32-dspr2/subu_ph.c (+40/-0)
tests/tcg/mips/mips32-dspr2/subu_s_ph.c (+25/-0)
tests/tcg/mips/mips32-dspr2/subuh_qb.c (+21/-0)
tests/tcg/mips/mips32-dspr2/subuh_r_qb.c (+32/-0)
tests/tcg/mips/mips64-dsp/Makefile (+306/-0)
tests/tcg/mips/mips64-dsp/absq_s_ob.c (+63/-0)
tests/tcg/mips/mips64-dsp/absq_s_ph.c (+37/-0)
tests/tcg/mips/mips64-dsp/absq_s_pw.c (+66/-0)
tests/tcg/mips/mips64-dsp/absq_s_qh.c (+40/-0)
tests/tcg/mips/mips64-dsp/absq_s_w.c (+48/-0)
tests/tcg/mips/mips64-dsp/addq_ph.c (+57/-0)
tests/tcg/mips/mips64-dsp/addq_pw.c (+46/-0)
tests/tcg/mips/mips64-dsp/addq_qh.c (+28/-0)
tests/tcg/mips/mips64-dsp/addq_s_ph.c (+84/-0)
tests/tcg/mips/mips64-dsp/addq_s_pw.c (+45/-0)
tests/tcg/mips/mips64-dsp/addq_s_qh.c (+26/-0)
tests/tcg/mips/mips64-dsp/addq_s_w.c (+48/-0)
tests/tcg/mips/mips64-dsp/addsc.c (+39/-0)
tests/tcg/mips/mips64-dsp/addu_ob.c (+28/-0)
tests/tcg/mips/mips64-dsp/addu_qb.c (+40/-0)
tests/tcg/mips/mips64-dsp/addu_s_ob.c (+27/-0)
tests/tcg/mips/mips64-dsp/addu_s_qb.c (+40/-0)
tests/tcg/mips/mips64-dsp/addwc.c (+59/-0)
tests/tcg/mips/mips64-dsp/bitrev.c (+23/-0)
tests/tcg/mips/mips64-dsp/bposge32.c (+50/-0)
tests/tcg/mips/mips64-dsp/bposge64.c (+50/-0)
tests/tcg/mips/mips64-dsp/cmp_eq_ph.c (+42/-0)
tests/tcg/mips/mips64-dsp/cmp_eq_pw.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmp_eq_qh.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmp_le_ph.c (+40/-0)
tests/tcg/mips/mips64-dsp/cmp_le_pw.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmp_le_qh.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmp_lt_ph.c (+41/-0)
tests/tcg/mips/mips64-dsp/cmp_lt_pw.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmp_lt_qh.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmpgu_eq_ob.c (+40/-0)
tests/tcg/mips/mips64-dsp/cmpgu_eq_qb.c (+38/-0)
tests/tcg/mips/mips64-dsp/cmpgu_le_ob.c (+40/-0)
tests/tcg/mips/mips64-dsp/cmpgu_le_qb.c (+37/-0)
tests/tcg/mips/mips64-dsp/cmpgu_lt_ob.c (+40/-0)
tests/tcg/mips/mips64-dsp/cmpgu_lt_qb.c (+38/-0)
tests/tcg/mips/mips64-dsp/cmpu_eq_ob.c (+46/-0)
tests/tcg/mips/mips64-dsp/cmpu_eq_qb.c (+42/-0)
tests/tcg/mips/mips64-dsp/cmpu_le_ob.c (+44/-0)
tests/tcg/mips/mips64-dsp/cmpu_le_qb.c (+41/-0)
tests/tcg/mips/mips64-dsp/cmpu_lt_ob.c (+44/-0)
tests/tcg/mips/mips64-dsp/cmpu_lt_qb.c (+42/-0)
tests/tcg/mips/mips64-dsp/dappend.c (+37/-0)
tests/tcg/mips/mips64-dsp/dextp.c (+54/-0)
tests/tcg/mips/mips64-dsp/dextpdp.c (+59/-0)
tests/tcg/mips/mips64-dsp/dextpdpv.c (+63/-0)
tests/tcg/mips/mips64-dsp/dextpv.c (+58/-0)
tests/tcg/mips/mips64-dsp/dextr_l.c (+44/-0)
tests/tcg/mips/mips64-dsp/dextr_r_l.c (+54/-0)
tests/tcg/mips/mips64-dsp/dextr_r_w.c (+54/-0)
tests/tcg/mips/mips64-dsp/dextr_rs_l.c (+52/-0)
tests/tcg/mips/mips64-dsp/dextr_rs_w.c (+52/-0)
tests/tcg/mips/mips64-dsp/dextr_s_h.c (+73/-0)
tests/tcg/mips/mips64-dsp/dextr_w.c (+44/-0)
tests/tcg/mips/mips64-dsp/dextrv_l.c (+46/-0)
tests/tcg/mips/mips64-dsp/dextrv_r_l.c (+56/-0)
tests/tcg/mips/mips64-dsp/dextrv_r_w.c (+56/-0)
tests/tcg/mips/mips64-dsp/dextrv_rs_l.c (+54/-0)
tests/tcg/mips/mips64-dsp/dextrv_rs_w.c (+54/-0)
tests/tcg/mips/mips64-dsp/dextrv_s_h.c (+32/-0)
tests/tcg/mips/mips64-dsp/dextrv_w.c (+46/-0)
tests/tcg/mips/mips64-dsp/dinsv.c (+26/-0)
tests/tcg/mips/mips64-dsp/dmadd.c (+57/-0)
tests/tcg/mips/mips64-dsp/dmaddu.c (+56/-0)
tests/tcg/mips/mips64-dsp/dmsub.c (+59/-0)
tests/tcg/mips/mips64-dsp/dmsubu.c (+59/-0)
tests/tcg/mips/mips64-dsp/dmthlip.c (+41/-0)
tests/tcg/mips/mips64-dsp/dpaq_s_w_ph.c (+32/-0)
tests/tcg/mips/mips64-dsp/dpaq_s_w_qh.c (+57/-0)
tests/tcg/mips/mips64-dsp/dpaq_sa_l_pw.c (+88/-0)
tests/tcg/mips/mips64-dsp/dpaq_sa_l_w.c (+82/-0)
tests/tcg/mips/mips64-dsp/dpau_h_obl.c (+59/-0)
tests/tcg/mips/mips64-dsp/dpau_h_obr.c (+59/-0)
tests/tcg/mips/mips64-dsp/dpau_h_qbl.c (+29/-0)
tests/tcg/mips/mips64-dsp/dpau_h_qbr.c (+29/-0)
tests/tcg/mips/mips64-dsp/dpsq_s_w_ph.c (+51/-0)
tests/tcg/mips/mips64-dsp/dpsq_s_w_qh.c (+56/-0)
tests/tcg/mips/mips64-dsp/dpsq_sa_l_pw.c (+76/-0)
tests/tcg/mips/mips64-dsp/dpsq_sa_l_w.c (+59/-0)
tests/tcg/mips/mips64-dsp/dpsu_h_obl.c (+32/-0)
tests/tcg/mips/mips64-dsp/dpsu_h_obr.c (+32/-0)
tests/tcg/mips/mips64-dsp/dpsu_h_qbl.c (+29/-0)
tests/tcg/mips/mips64-dsp/dpsu_h_qbr.c (+29/-0)
tests/tcg/mips/mips64-dsp/dshilo.c (+52/-0)
tests/tcg/mips/mips64-dsp/dshilov.c (+54/-0)
tests/tcg/mips/mips64-dsp/extp.c (+50/-0)
tests/tcg/mips/mips64-dsp/extpdp.c (+51/-0)
tests/tcg/mips/mips64-dsp/extpdpv.c (+52/-0)
tests/tcg/mips/mips64-dsp/extpv.c (+51/-0)
tests/tcg/mips/mips64-dsp/extr_r_w.c (+53/-0)
tests/tcg/mips/mips64-dsp/extr_rs_w.c (+53/-0)
tests/tcg/mips/mips64-dsp/extr_s_h.c (+71/-0)
tests/tcg/mips/mips64-dsp/extr_w.c (+53/-0)
tests/tcg/mips/mips64-dsp/extrv_r_w.c (+59/-0)
tests/tcg/mips/mips64-dsp/extrv_rs_w.c (+59/-0)
tests/tcg/mips/mips64-dsp/extrv_s_h.c (+79/-0)
tests/tcg/mips/mips64-dsp/extrv_w.c (+59/-0)
tests/tcg/mips/mips64-dsp/head.S (+16/-0)
tests/tcg/mips/mips64-dsp/insv.c (+26/-0)
tests/tcg/mips/mips64-dsp/io.h (+22/-0)
tests/tcg/mips/mips64-dsp/lbux.c (+27/-0)
tests/tcg/mips/mips64-dsp/ldx.c (+27/-0)
tests/tcg/mips/mips64-dsp/lhx.c (+27/-0)
tests/tcg/mips/mips64-dsp/lwx.c (+27/-0)
tests/tcg/mips/mips64-dsp/madd.c (+33/-0)
tests/tcg/mips/mips64-dsp/maddu.c (+33/-0)
tests/tcg/mips/mips64-dsp/maq_s_l_pwl.c (+56/-0)
tests/tcg/mips/mips64-dsp/maq_s_l_pwr.c (+56/-0)
tests/tcg/mips/mips64-dsp/maq_s_w_phl.c (+60/-0)
tests/tcg/mips/mips64-dsp/maq_s_w_phr.c (+60/-0)
tests/tcg/mips/mips64-dsp/maq_s_w_qhll.c (+62/-0)
tests/tcg/mips/mips64-dsp/maq_s_w_qhlr.c (+62/-0)
tests/tcg/mips/mips64-dsp/maq_s_w_qhrl.c (+63/-0)
tests/tcg/mips/mips64-dsp/maq_s_w_qhrr.c (+63/-0)
tests/tcg/mips/mips64-dsp/maq_sa_w_phl.c (+60/-0)
tests/tcg/mips/mips64-dsp/maq_sa_w_phr.c (+60/-0)
tests/tcg/mips/mips64-dsp/maq_sa_w_qhll.c (+62/-0)
tests/tcg/mips/mips64-dsp/maq_sa_w_qhlr.c (+64/-0)
tests/tcg/mips/mips64-dsp/maq_sa_w_qhrl.c (+64/-0)
tests/tcg/mips/mips64-dsp/maq_sa_w_qhrr.c (+64/-0)
tests/tcg/mips/mips64-dsp/mfhi.c (+24/-0)
tests/tcg/mips/mips64-dsp/mflo.c (+24/-0)
tests/tcg/mips/mips64-dsp/mips_boot.lds (+31/-0)
tests/tcg/mips/mips64-dsp/modsub.c (+37/-0)
tests/tcg/mips/mips64-dsp/msub.c (+32/-0)
tests/tcg/mips/mips64-dsp/msubu.c (+32/-0)
tests/tcg/mips/mips64-dsp/mthi.c (+24/-0)
tests/tcg/mips/mips64-dsp/mthlip.c (+61/-0)
tests/tcg/mips/mips64-dsp/mtlo.c (+22/-0)
tests/tcg/mips/mips64-dsp/muleq_s_pw_qhl.c (+56/-0)
tests/tcg/mips/mips64-dsp/muleq_s_pw_qhr.c (+57/-0)
tests/tcg/mips/mips64-dsp/muleq_s_w_phl.c (+46/-0)
tests/tcg/mips/mips64-dsp/muleq_s_w_phr.c (+45/-0)
tests/tcg/mips/mips64-dsp/muleu_s_ph_qbl.c (+27/-0)
tests/tcg/mips/mips64-dsp/muleu_s_ph_qbr.c (+27/-0)
tests/tcg/mips/mips64-dsp/muleu_s_qh_obl.c (+30/-0)
tests/tcg/mips/mips64-dsp/muleu_s_qh_obr.c (+31/-0)
tests/tcg/mips/mips64-dsp/mulq_rs_ph.c (+27/-0)
tests/tcg/mips/mips64-dsp/mulq_rs_qh.c (+33/-0)
tests/tcg/mips/mips64-dsp/mulsaq_s_l_pw.c (+59/-0)
tests/tcg/mips/mips64-dsp/mulsaq_s_w_qh.c (+57/-0)
tests/tcg/mips/mips64-dsp/mult.c (+26/-0)
tests/tcg/mips/mips64-dsp/multu.c (+26/-0)
tests/tcg/mips/mips64-dsp/packrl_ph.c (+24/-0)
tests/tcg/mips/mips64-dsp/packrl_pw.c (+24/-0)
tests/tcg/mips/mips64-dsp/pick_ob.c (+66/-0)
tests/tcg/mips/mips64-dsp/pick_ph.c (+60/-0)
tests/tcg/mips/mips64-dsp/pick_pw.c (+48/-0)
tests/tcg/mips/mips64-dsp/pick_qb.c (+43/-0)
tests/tcg/mips/mips64-dsp/pick_qh.c (+48/-0)
tests/tcg/mips/mips64-dsp/preceq_l_pwl.c (+24/-0)
tests/tcg/mips/mips64-dsp/preceq_l_pwr.c (+24/-0)
tests/tcg/mips/mips64-dsp/preceq_pw_qhl.c (+21/-0)
tests/tcg/mips/mips64-dsp/preceq_pw_qhla.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceq_pw_qhr.c (+21/-0)
tests/tcg/mips/mips64-dsp/preceq_pw_qhra.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceq_w_phl.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceq_w_phr.c (+23/-0)
tests/tcg/mips/mips64-dsp/precequ_ph_qbl.c (+23/-0)
tests/tcg/mips/mips64-dsp/precequ_ph_qbla.c (+23/-0)
tests/tcg/mips/mips64-dsp/precequ_ph_qbr.c (+23/-0)
tests/tcg/mips/mips64-dsp/precequ_ph_qbra.c (+23/-0)
tests/tcg/mips/mips64-dsp/precequ_qh_obl.c (+22/-0)
tests/tcg/mips/mips64-dsp/precequ_qh_obla.c (+22/-0)
tests/tcg/mips/mips64-dsp/precequ_qh_obr.c (+24/-0)
tests/tcg/mips/mips64-dsp/precequ_qh_obra.c (+24/-0)
tests/tcg/mips/mips64-dsp/preceu_ph_qbl.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceu_ph_qbla.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceu_ph_qbr.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceu_ph_qbra.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceu_qh_obl.c (+22/-0)
tests/tcg/mips/mips64-dsp/preceu_qh_obla.c (+22/-0)
tests/tcg/mips/mips64-dsp/preceu_qh_obr.c (+23/-0)
tests/tcg/mips/mips64-dsp/preceu_qh_obra.c (+23/-0)
tests/tcg/mips/mips64-dsp/precr_ob_qh.c (+25/-0)
tests/tcg/mips/mips64-dsp/precr_sra_qh_pw.c (+40/-0)
tests/tcg/mips/mips64-dsp/precr_sra_r_qh_pw.c (+40/-0)
tests/tcg/mips/mips64-dsp/precrq_ob_qh.c (+25/-0)
tests/tcg/mips/mips64-dsp/precrq_ph_w.c (+24/-0)
tests/tcg/mips/mips64-dsp/precrq_pw_l.c (+25/-0)
tests/tcg/mips/mips64-dsp/precrq_qb_ph.c (+24/-0)
tests/tcg/mips/mips64-dsp/precrq_qh_pw.c (+25/-0)
tests/tcg/mips/mips64-dsp/precrq_rs_ph_w.c (+41/-0)
tests/tcg/mips/mips64-dsp/precrq_rs_qh_pw.c (+43/-0)
tests/tcg/mips/mips64-dsp/precrqu_s_ob_qh.c (+27/-0)
tests/tcg/mips/mips64-dsp/precrqu_s_qb_ph.c (+26/-0)
tests/tcg/mips/mips64-dsp/prependd.c (+37/-0)
tests/tcg/mips/mips64-dsp/prependw.c (+37/-0)
tests/tcg/mips/mips64-dsp/printf.c (+266/-0)
tests/tcg/mips/mips64-dsp/raddu_l_ob.c (+22/-0)
tests/tcg/mips/mips64-dsp/raddu_w_qb.c (+23/-0)
tests/tcg/mips/mips64-dsp/rddsp.c (+53/-0)
tests/tcg/mips/mips64-dsp/repl_ob.c (+21/-0)
tests/tcg/mips/mips64-dsp/repl_ph.c (+30/-0)
tests/tcg/mips/mips64-dsp/repl_pw.c (+34/-0)
tests/tcg/mips/mips64-dsp/repl_qb.c (+19/-0)
tests/tcg/mips/mips64-dsp/repl_qh.c (+34/-0)
tests/tcg/mips/mips64-dsp/replv_ob.c (+23/-0)
tests/tcg/mips/mips64-dsp/replv_ph.c (+22/-0)
tests/tcg/mips/mips64-dsp/replv_pw.c (+23/-0)
tests/tcg/mips/mips64-dsp/replv_qb.c (+22/-0)
tests/tcg/mips/mips64-dsp/shilo.c (+29/-0)
tests/tcg/mips/mips64-dsp/shilov.c (+31/-0)
tests/tcg/mips/mips64-dsp/shll_ob.c (+43/-0)
tests/tcg/mips/mips64-dsp/shll_ph.c (+43/-0)
tests/tcg/mips/mips64-dsp/shll_pw.c (+43/-0)
tests/tcg/mips/mips64-dsp/shll_qb.c (+26/-0)
tests/tcg/mips/mips64-dsp/shll_qh.c (+42/-0)
tests/tcg/mips/mips64-dsp/shll_s_ph.c (+43/-0)
tests/tcg/mips/mips64-dsp/shll_s_pw.c (+43/-0)
tests/tcg/mips/mips64-dsp/shll_s_qh.c (+43/-0)
tests/tcg/mips/mips64-dsp/shll_s_w.c (+26/-0)
tests/tcg/mips/mips64-dsp/shllv_ob.c (+45/-0)
tests/tcg/mips/mips64-dsp/shllv_ph.c (+27/-0)
tests/tcg/mips/mips64-dsp/shllv_pw.c (+45/-0)
tests/tcg/mips/mips64-dsp/shllv_qb.c (+27/-0)
tests/tcg/mips/mips64-dsp/shllv_qh.c (+45/-0)
tests/tcg/mips/mips64-dsp/shllv_s_ph.c (+27/-0)
tests/tcg/mips/mips64-dsp/shllv_s_pw.c (+45/-0)
tests/tcg/mips/mips64-dsp/shllv_s_qh.c (+45/-0)
tests/tcg/mips/mips64-dsp/shllv_s_w.c (+27/-0)
tests/tcg/mips/mips64-dsp/shra_ob.c (+23/-0)
tests/tcg/mips/mips64-dsp/shra_ph.c (+23/-0)
tests/tcg/mips/mips64-dsp/shra_pw.c (+36/-0)
tests/tcg/mips/mips64-dsp/shra_qh.c (+37/-0)
tests/tcg/mips/mips64-dsp/shra_r_ob.c (+22/-0)
tests/tcg/mips/mips64-dsp/shra_r_ph.c (+23/-0)
tests/tcg/mips/mips64-dsp/shra_r_pw.c (+36/-0)
tests/tcg/mips/mips64-dsp/shra_r_qh.c (+37/-0)
tests/tcg/mips/mips64-dsp/shra_r_w.c (+23/-0)
tests/tcg/mips/mips64-dsp/shrav_ph.c (+24/-0)
tests/tcg/mips/mips64-dsp/shrav_pw.c (+38/-0)
tests/tcg/mips/mips64-dsp/shrav_qh.c (+39/-0)
tests/tcg/mips/mips64-dsp/shrav_r_ph.c (+24/-0)
tests/tcg/mips/mips64-dsp/shrav_r_pw.c (+37/-0)
tests/tcg/mips/mips64-dsp/shrav_r_qh.c (+39/-0)
tests/tcg/mips/mips64-dsp/shrav_r_w.c (+24/-0)
tests/tcg/mips/mips64-dsp/shrl_ob.c (+38/-0)
tests/tcg/mips/mips64-dsp/shrl_qb.c (+23/-0)
tests/tcg/mips/mips64-dsp/shrl_qh.c (+22/-0)
tests/tcg/mips/mips64-dsp/shrlv_ob.c (+39/-0)
tests/tcg/mips/mips64-dsp/shrlv_qb.c (+24/-0)
tests/tcg/mips/mips64-dsp/shrlv_qh.c (+23/-0)
tests/tcg/mips/mips64-dsp/subq_ph.c (+27/-0)
tests/tcg/mips/mips64-dsp/subq_pw.c (+44/-0)
tests/tcg/mips/mips64-dsp/subq_qh.c (+26/-0)
tests/tcg/mips/mips64-dsp/subq_s_ph.c (+27/-0)
tests/tcg/mips/mips64-dsp/subq_s_pw.c (+63/-0)
tests/tcg/mips/mips64-dsp/subq_s_qh.c (+61/-0)
tests/tcg/mips/mips64-dsp/subq_s_w.c (+27/-0)
tests/tcg/mips/mips64-dsp/subu_ob.c (+26/-0)
tests/tcg/mips/mips64-dsp/subu_qb.c (+27/-0)
tests/tcg/mips/mips64-dsp/subu_s_ob.c (+26/-0)
tests/tcg/mips/mips64-dsp/subu_s_qb.c (+27/-0)
tests/tcg/mips/mips64-dsp/wrdsp.c (+48/-0)
tests/tcg/mips/mips64-dspr2/.directory (+2/-0)
tests/tcg/mips/mips64-dspr2/Makefile (+116/-0)
tests/tcg/mips/mips64-dspr2/absq_s_qb.c (+42/-0)
tests/tcg/mips/mips64-dspr2/addqh_ph.c (+35/-0)
tests/tcg/mips/mips64-dspr2/addqh_r_ph.c (+35/-0)
tests/tcg/mips/mips64-dspr2/addqh_r_w.c (+38/-0)
tests/tcg/mips/mips64-dspr2/addqh_w.c (+39/-0)
tests/tcg/mips/mips64-dspr2/addu_ph.c (+37/-0)
tests/tcg/mips/mips64-dspr2/addu_qh.c (+43/-0)
tests/tcg/mips/mips64-dspr2/addu_s_ph.c (+37/-0)
tests/tcg/mips/mips64-dspr2/addu_s_qh.c (+43/-0)
tests/tcg/mips/mips64-dspr2/adduh_ob.c (+35/-0)
tests/tcg/mips/mips64-dspr2/adduh_qb.c (+35/-0)
tests/tcg/mips/mips64-dspr2/adduh_r_ob.c (+35/-0)
tests/tcg/mips/mips64-dspr2/adduh_r_qb.c (+35/-0)
tests/tcg/mips/mips64-dspr2/append.c (+35/-0)
tests/tcg/mips/mips64-dspr2/balign.c (+35/-0)
tests/tcg/mips/mips64-dspr2/cmpgdu_eq_ob.c (+44/-0)
tests/tcg/mips/mips64-dspr2/cmpgdu_eq_qb.c (+41/-0)
tests/tcg/mips/mips64-dspr2/cmpgdu_le_ob.c (+44/-0)
tests/tcg/mips/mips64-dspr2/cmpgdu_le_qb.c (+48/-0)
tests/tcg/mips/mips64-dspr2/cmpgdu_lt_ob.c (+44/-0)
tests/tcg/mips/mips64-dspr2/cmpgdu_lt_qb.c (+48/-0)
tests/tcg/mips/mips64-dspr2/dbalign.c (+39/-0)
tests/tcg/mips/mips64-dspr2/dpa_w_ph.c (+47/-0)
tests/tcg/mips/mips64-dspr2/dpa_w_qh.c (+56/-0)
tests/tcg/mips/mips64-dspr2/dpaqx_s_w_ph.c (+97/-0)
tests/tcg/mips/mips64-dspr2/dpaqx_sa_w_ph.c (+54/-0)
tests/tcg/mips/mips64-dspr2/dpax_w_ph.c (+32/-0)
tests/tcg/mips/mips64-dspr2/dps_w_ph.c (+28/-0)
tests/tcg/mips/mips64-dspr2/dps_w_qh.c (+55/-0)
tests/tcg/mips/mips64-dspr2/dpsqx_s_w_ph.c (+55/-0)
tests/tcg/mips/mips64-dspr2/dpsqx_sa_w_ph.c (+53/-0)
tests/tcg/mips/mips64-dspr2/dpsx_w_ph.c (+28/-0)
tests/tcg/mips/mips64-dspr2/head.S (+16/-0)
tests/tcg/mips/mips64-dspr2/io.h (+22/-0)
tests/tcg/mips/mips64-dspr2/mips_boot.lds (+31/-0)
tests/tcg/mips/mips64-dspr2/mul_ph.c (+50/-0)
tests/tcg/mips/mips64-dspr2/mul_s_ph.c (+67/-0)
tests/tcg/mips/mips64-dspr2/mulq_rs_w.c (+40/-0)
tests/tcg/mips/mips64-dspr2/mulq_s_ph.c (+26/-0)
tests/tcg/mips/mips64-dspr2/mulq_s_w.c (+40/-0)
tests/tcg/mips/mips64-dspr2/mulsa_w_ph.c (+30/-0)
tests/tcg/mips/mips64-dspr2/mulsaq_s_w_ph.c (+30/-0)
tests/tcg/mips/mips64-dspr2/precr_qb_ph.c (+23/-0)
tests/tcg/mips/mips64-dspr2/precr_sra_ph_w.c (+37/-0)
tests/tcg/mips/mips64-dspr2/precr_sra_r_ph_w.c (+37/-0)
tests/tcg/mips/mips64-dspr2/prepend.c (+35/-0)
tests/tcg/mips/mips64-dspr2/printf.c (+266/-0)
tests/tcg/mips/mips64-dspr2/shra_qb.c (+35/-0)
tests/tcg/mips/mips64-dspr2/shra_r_qb.c (+35/-0)
tests/tcg/mips/mips64-dspr2/shrav_ob.c (+22/-0)
tests/tcg/mips/mips64-dspr2/shrav_qb.c (+37/-0)
tests/tcg/mips/mips64-dspr2/shrav_r_ob.c (+22/-0)
tests/tcg/mips/mips64-dspr2/shrav_r_qb.c (+37/-0)
tests/tcg/mips/mips64-dspr2/shrl_ph.c (+22/-0)
tests/tcg/mips/mips64-dspr2/shrlv_ph.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subqh_ph.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subqh_r_ph.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subqh_r_w.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subqh_w.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subu_ph.c (+26/-0)
tests/tcg/mips/mips64-dspr2/subu_qh.c (+24/-0)
tests/tcg/mips/mips64-dspr2/subu_s_ph.c (+25/-0)
tests/tcg/mips/mips64-dspr2/subu_s_qh.c (+42/-0)
tests/tcg/mips/mips64-dspr2/subuh_ob.c (+36/-0)
tests/tcg/mips/mips64-dspr2/subuh_qb.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subuh_r_ob.c (+23/-0)
tests/tcg/mips/mips64-dspr2/subuh_r_qb.c (+37/-0)
tests/tcg/openrisc/Makefile (+71/-0)
tests/tcg/openrisc/test_add.c (+43/-0)
tests/tcg/openrisc/test_addc.c (+40/-0)
tests/tcg/openrisc/test_addi.c (+33/-0)
tests/tcg/openrisc/test_addic.c (+35/-0)
tests/tcg/openrisc/test_and_or.c (+65/-0)
tests/tcg/openrisc/test_bf.c (+47/-0)
tests/tcg/openrisc/test_bnf.c (+51/-0)
tests/tcg/openrisc/test_div.c (+54/-0)
tests/tcg/openrisc/test_divu.c (+34/-0)
tests/tcg/openrisc/test_extx.c (+78/-0)
tests/tcg/openrisc/test_fx.c (+57/-0)
tests/tcg/openrisc/test_j.c (+26/-0)
tests/tcg/openrisc/test_jal.c (+26/-0)
tests/tcg/openrisc/test_lf_add.c (+39/-0)
tests/tcg/openrisc/test_lf_div.c (+37/-0)
tests/tcg/openrisc/test_lf_eqs.c (+88/-0)
tests/tcg/openrisc/test_lf_ges.c (+88/-0)
tests/tcg/openrisc/test_lf_gts.c (+86/-0)
tests/tcg/openrisc/test_lf_les.c (+88/-0)
tests/tcg/openrisc/test_lf_lts.c (+92/-0)
tests/tcg/openrisc/test_lf_mul.c (+22/-0)
tests/tcg/openrisc/test_lf_nes.c (+89/-0)
tests/tcg/openrisc/test_lf_rem.c (+32/-0)
tests/tcg/openrisc/test_lf_sub.c (+35/-0)
tests/tcg/openrisc/test_logic.c (+105/-0)
tests/tcg/openrisc/test_lx.c (+84/-0)
tests/tcg/openrisc/test_movhi.c (+31/-0)
tests/tcg/openrisc/test_mul.c (+61/-0)
tests/tcg/openrisc/test_muli.c (+48/-0)
tests/tcg/openrisc/test_mulu.c (+48/-0)
tests/tcg/openrisc/test_sfeq.c (+43/-0)
tests/tcg/openrisc/test_sfeqi.c (+39/-0)
tests/tcg/openrisc/test_sfges.c (+44/-0)
tests/tcg/openrisc/test_sfgesi.c (+40/-0)
tests/tcg/openrisc/test_sfgeu.c (+44/-0)
tests/tcg/openrisc/test_sfgeui.c (+41/-0)
tests/tcg/openrisc/test_sfgts.c (+45/-0)
tests/tcg/openrisc/test_sfgtsi.c (+41/-0)
tests/tcg/openrisc/test_sfgtu.c (+43/-0)
tests/tcg/openrisc/test_sfgtui.c (+42/-0)
tests/tcg/openrisc/test_sfles.c (+26/-0)
tests/tcg/openrisc/test_sflesi.c (+39/-0)
tests/tcg/openrisc/test_sfleu.c (+43/-0)
tests/tcg/openrisc/test_sfleui.c (+39/-0)
tests/tcg/openrisc/test_sflts.c (+43/-0)
tests/tcg/openrisc/test_sfltsi.c (+39/-0)
tests/tcg/openrisc/test_sfltu.c (+43/-0)
tests/tcg/openrisc/test_sfltui.c (+39/-0)
tests/tcg/openrisc/test_sfne.c (+43/-0)
tests/tcg/openrisc/test_sfnei.c (+39/-0)
tests/tcg/openrisc/test_sub.c (+35/-0)
tests/tcg/runcom.c (+192/-0)
tests/tcg/sha1.c (+240/-0)
tests/tcg/test-arm-iwmmxt.s (+49/-0)
tests/tcg/test-i386-code16.S (+79/-0)
tests/tcg/test-i386-fprem.c (+353/-0)
tests/tcg/test-i386-muldiv.h (+76/-0)
tests/tcg/test-i386-shift.h (+185/-0)
tests/tcg/test-i386-ssse3.c (+57/-0)
tests/tcg/test-i386-vm86.S (+103/-0)
tests/tcg/test-i386.c (+2765/-0)
tests/tcg/test-i386.h (+152/-0)
tests/tcg/test-mmap.c (+484/-0)
tests/tcg/test_path.c (+157/-0)
tests/tcg/testthread.c (+57/-0)
tests/tcg/xtensa/Makefile (+92/-0)
tests/tcg/xtensa/crt.S (+24/-0)
tests/tcg/xtensa/linker.ld.S (+130/-0)
tests/tcg/xtensa/macros.inc (+91/-0)
tests/tcg/xtensa/test_b.S (+221/-0)
tests/tcg/xtensa/test_bi.S (+103/-0)
tests/tcg/xtensa/test_boolean.S (+23/-0)
tests/tcg/xtensa/test_break.S (+257/-0)
tests/tcg/xtensa/test_bz.S (+57/-0)
tests/tcg/xtensa/test_cache.S (+97/-0)
tests/tcg/xtensa/test_clamps.S (+42/-0)
tests/tcg/xtensa/test_extui.S (+26/-0)
tests/tcg/xtensa/test_fail.S (+9/-0)
tests/tcg/xtensa/test_interrupt.S (+194/-0)
tests/tcg/xtensa/test_loop.S (+163/-0)
tests/tcg/xtensa/test_mac16.S (+243/-0)
tests/tcg/xtensa/test_max.S (+81/-0)
tests/tcg/xtensa/test_min.S (+81/-0)
tests/tcg/xtensa/test_mmu.S (+743/-0)
tests/tcg/xtensa/test_mul16.S (+83/-0)
tests/tcg/xtensa/test_mul32.S (+20/-0)
tests/tcg/xtensa/test_nsa.S (+59/-0)
tests/tcg/xtensa/test_pipeline.S (+157/-0)
tests/tcg/xtensa/test_quo.S (+147/-0)
tests/tcg/xtensa/test_rem.S (+147/-0)
tests/tcg/xtensa/test_rst0.S (+148/-0)
tests/tcg/xtensa/test_s32c1i.S (+39/-0)
tests/tcg/xtensa/test_sar.S (+111/-0)
tests/tcg/xtensa/test_sext.S (+69/-0)
tests/tcg/xtensa/test_shift.S (+206/-0)
tests/tcg/xtensa/test_sr.S (+90/-0)
tests/tcg/xtensa/test_timer.S (+178/-0)
tests/tcg/xtensa/test_windowed.S (+353/-0)
tests/tcg/xtensa/vectors.S (+39/-0)
tests/tco-test.c (+465/-0)
tests/test-aio.c (+876/-0)
tests/test-bitops.c (+76/-0)
tests/test-blockjob-txn.c (+250/-0)
tests/test-coroutine.c (+386/-0)
tests/test-crypto-cipher.c (+382/-0)
tests/test-crypto-hash.c (+209/-0)
tests/test-crypto-tlscredsx509.c (+731/-0)
tests/test-crypto-tlssession.c (+535/-0)
tests/test-cutils.c (+1597/-0)
tests/test-hbitmap.c (+692/-0)
tests/test-int128.c (+225/-0)
tests/test-iov.c (+410/-0)
tests/test-mul64.c (+70/-0)
tests/test-netfilter.c (+200/-0)
tests/test-opts-visitor.c (+276/-0)
tests/test-qdev-global-props.c (+323/-0)
tests/test-qemu-opts.c (+441/-0)
tests/test-qga.c (+877/-0)
tests/test-qmp-commands.c (+249/-0)
tests/test-qmp-event.c (+267/-0)
tests/test-qmp-input-strict.c (+343/-0)
tests/test-qmp-input-visitor.c (+847/-0)
tests/test-qmp-output-visitor.c (+859/-0)
tests/test-rcu-list.c (+316/-0)
tests/test-rfifolock.c (+91/-0)
tests/test-string-input-visitor.c (+282/-0)
tests/test-string-output-visitor.c (+289/-0)
tests/test-thread-pool.c (+251/-0)
tests/test-throttle.c (+620/-0)
tests/test-timed-average.c (+90/-0)
tests/test-visitor-serialization.c (+1188/-0)
tests/test-vmstate.c (+503/-0)
tests/test-write-threshold.c (+119/-0)
tests/test-x86-cpuid.c (+110/-0)
tests/test-xbzrle.c (+194/-0)
tests/tmp105-test.c (+169/-0)
tests/tpci200-test.c (+33/-0)
tests/usb-hcd-ehci-test.c (+173/-0)
tests/usb-hcd-ohci-test.c (+41/-0)
tests/usb-hcd-uhci-test.c (+96/-0)
tests/usb-hcd-xhci-test.c (+99/-0)
tests/vhost-user-bridge.c (+1398/-0)
tests/vhost-user-test.c (+677/-0)
tests/virtio-9p-test.c (+46/-0)
tests/virtio-balloon-test.c (+33/-0)
tests/virtio-blk-test.c (+789/-0)
tests/virtio-console-test.c (+41/-0)
tests/virtio-net-test.c (+266/-0)
tests/virtio-rng-test.c (+43/-0)
tests/virtio-scsi-test.c (+277/-0)
tests/virtio-serial-test.c (+60/-0)
tests/vmstate-static-checker-data/dump1.json (+1163/-0)
tests/vmstate-static-checker-data/dump2.json (+968/-0)
tests/vmxnet3-test.c (+33/-0)
tests/wdt_ib700-test.c (+133/-0)
thread-pool.c (+343/-0)
thunk.c (+324/-0)
tpm.c (+355/-0)
trace-events (+1794/-0)
trace/Makefile.objs (+147/-0)
trace/control-internal.h (+67/-0)
trace/control.c (+169/-0)
trace/control.h (+167/-0)
trace/event-internal.h (+33/-0)
trace/ftrace.c (+79/-0)
trace/ftrace.h (+15/-0)
trace/qmp.c (+75/-0)
trace/simple.c (+392/-0)
trace/simple.h (+58/-0)
translate-all.c (+2015/-0)
translate-all.h (+33/-0)
translate-common.c (+56/-0)
ui/Makefile.objs (+52/-0)
ui/cocoa.m (+1459/-0)
ui/console-gl.c (+173/-0)
ui/console.c (+2102/-0)
ui/curses.c (+439/-0)
ui/curses_keys.h (+518/-0)
ui/cursor.c (+211/-0)
ui/cursor_hidden.xpm (+37/-0)
ui/cursor_left_ptr.xpm (+39/-0)
ui/egl-context.c (+34/-0)
ui/egl-helpers.c (+148/-0)
ui/gtk-egl.c (+256/-0)
ui/gtk-gl-area.c (+223/-0)
ui/gtk.c (+2162/-0)
ui/input-keymap.c (+202/-0)
ui/input-legacy.c (+266/-0)
ui/input.c (+567/-0)
ui/keymaps.c (+240/-0)
ui/keymaps.h (+77/-0)
ui/qemu-pixman.c (+252/-0)
ui/qemu-x509.h (+9/-0)
ui/sdl.c (+1003/-0)
ui/sdl2-2d.c (+160/-0)
ui/sdl2-gl.c (+112/-0)
ui/sdl2-input.c (+100/-0)
ui/sdl2-keymap.h (+267/-0)
ui/sdl2.c (+806/-0)
ui/sdl_keysym.h (+278/-0)
ui/sdl_zoom.c (+96/-0)
ui/sdl_zoom.h (+25/-0)
ui/sdl_zoom_template.h (+219/-0)
ui/shader.c (+135/-0)
ui/shader/texture-blit.frag (+10/-0)
ui/shader/texture-blit.vert (+10/-0)
ui/spice-core.c (+933/-0)
ui/spice-display.c (+803/-0)
ui/spice-input.c (+249/-0)
ui/vgafont.h (+4611/-0)
ui/vnc-auth-sasl.c (+624/-0)
ui/vnc-auth-sasl.h (+75/-0)
ui/vnc-auth-vencrypt.c (+187/-0)
ui/vnc-auth-vencrypt.h (+33/-0)
ui/vnc-enc-hextile-template.h (+211/-0)
ui/vnc-enc-hextile.c (+83/-0)
ui/vnc-enc-tight.c (+1698/-0)
ui/vnc-enc-tight.h (+183/-0)
ui/vnc-enc-zlib.c (+152/-0)
ui/vnc-enc-zrle-template.c (+263/-0)
ui/vnc-enc-zrle.c (+366/-0)
ui/vnc-enc-zrle.h (+40/-0)
ui/vnc-enc-zywrle-template.c (+170/-0)
ui/vnc-enc-zywrle.h (+659/-0)
ui/vnc-jobs.c (+351/-0)
ui/vnc-jobs.h (+70/-0)
ui/vnc-palette.c (+160/-0)
ui/vnc-palette.h (+69/-0)
ui/vnc-ws.c (+391/-0)
ui/vnc-ws.h (+90/-0)
ui/vnc.c (+3940/-0)
ui/vnc.h (+581/-0)
ui/vnc_keysym.h (+720/-0)
ui/x_keymap.c (+168/-0)
ui/x_keymap.h (+32/-0)
user-exec.c (+678/-0)
util/Makefile.objs (+32/-0)
util/acl.c (+187/-0)
util/bitmap.c (+339/-0)
util/bitops.c (+158/-0)
util/buffer.c (+171/-0)
util/compatfd.c (+110/-0)
util/coroutine-gthread.c (+198/-0)
util/coroutine-sigaltstack.c (+293/-0)
util/coroutine-ucontext.c (+194/-0)
util/coroutine-win32.c (+101/-0)
util/crc32c.c (+115/-0)
util/cutils.c (+691/-0)
util/envlist.c (+241/-0)
util/error.c (+241/-0)
util/event_notifier-posix.c (+122/-0)
util/event_notifier-win32.c (+59/-0)
util/fifo8.c (+125/-0)
util/getauxval.c (+109/-0)
util/hbitmap.c (+495/-0)
util/hexdump.c (+37/-0)
util/host-utils.c (+162/-0)
util/id.c (+65/-0)
util/iov.c (+577/-0)
util/memfd.c (+162/-0)
util/mmap-alloc.c (+110/-0)
util/module.c (+219/-0)
util/notify.c (+71/-0)
util/osdep.c (+437/-0)
util/oslib-posix.c (+521/-0)
util/oslib-win32.c (+507/-0)
util/path.c (+181/-0)
util/qemu-config.c (+573/-0)
util/qemu-coroutine-io.c (+91/-0)
util/qemu-coroutine-lock.c (+186/-0)
util/qemu-coroutine-sleep.c (+41/-0)
util/qemu-coroutine.c (+146/-0)
util/qemu-error.c (+239/-0)
util/qemu-openpty.c (+137/-0)
util/qemu-option.c (+1205/-0)
util/qemu-progress.c (+159/-0)
util/qemu-sockets.c (+1167/-0)
util/qemu-thread-posix.c (+518/-0)
util/qemu-thread-win32.c (+479/-0)
util/qemu-timer-common.c (+61/-0)
util/rcu.c (+352/-0)
util/readline.c (+515/-0)
util/rfifolock.c (+78/-0)
util/throttle.c (+445/-0)
util/timed-average.c (+231/-0)
util/unicode.c (+100/-0)
util/uri.c (+2204/-0)
version.rc (+30/-0)
vl.c (+4695/-0)
xen-common-stub.c (+13/-0)
xen-common.c (+151/-0)
xen-hvm-stub.c (+57/-0)
xen-hvm.c (+1399/-0)
xen-mapcache.c (+457/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+348672@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

So far problem reproduced. I'm gonna need to setup nested kvm to try this on xenial.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I used nested KVM, so the xenial host for the test was a kvm already, and inside it I spun the x-freeze guest. The problem was reproduced, but after I updated qemu on the fake host (not the real one), it kept happening, even after a power cycle. Maybe the actual host needs to be updated, but I don't have a bare metal machine to install xenial on and try it. Is there another way to test?

review: Needs Information
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Update the innermost Guest as it is the guest tools that are changed.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Confirmed working.

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Tagged and Uploaded

Update scan failed

At least one of the branches involved have failed to scan. You can manually schedule a rescan if required.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 2aa1bf8..67ae9b8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1qemu (1:2.5+dfsg-5ubuntu10.31) xenial; urgency=medium
2
3 * d/p/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch:
4 Fix qemu-guest-agent failing to freeze filesystems that were mounted
5 multiple times like bind mounts. (LP: #1587065).
6
7 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 28 Jun 2018 11:35:05 +0200
8
1qemu (1:2.5+dfsg-5ubuntu10.30) xenial-security; urgency=medium9qemu (1:2.5+dfsg-5ubuntu10.30) xenial-security; urgency=medium
210
3 * SECURITY UPDATE: Speculative Store Bypass11 * SECURITY UPDATE: Speculative Store Bypass
diff --git a/debian/patches/series b/debian/patches/series
index 764d53c..c0a8392 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -237,3 +237,4 @@ CVE-2018-7550.patch
237CVE-2018-3639.patch237CVE-2018-3639.patch
238CVE-2018-3639-2.patch238CVE-2018-3639-2.patch
239CVE-2018-3639-3.patch239CVE-2018-3639-3.patch
240ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch
diff --git a/debian/patches/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch b/debian/patches/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch
240new file mode 100644241new file mode 100644
index 0000000..5363bd9
--- /dev/null
+++ b/debian/patches/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch
@@ -0,0 +1,44 @@
1From ce2eb6c4a044d809caf4dc4e08aed77678f9760e Mon Sep 17 00:00:00 2001
2From: Peter Lieven <pl@kamp.de>
3Date: Tue, 31 Jan 2017 16:36:34 +0100
4Subject: [PATCH] qga: ignore EBUSY when freezing a filesystem
5
6the current implementation fails if we try to freeze an
7already frozen filesystem. This can happen if a filesystem
8is mounted more than once (e.g. with a bind mount).
9
10Suggested-by: Christian Theune <ct@flyingcircus.io>
11Cc: qemu-stable@nongnu.org
12Signed-off-by: Peter Lieven <pl@kamp.de>
13Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
14Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
15
16Origin: backport, https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ce2eb6c4a044d809c
17Bug-Ubuntu: https://bugs.launchpad.net/bugs/1587065
18Last-Update: 2018-06-28
19
20---
21 qga/commands-posix.c | 5 ++++-
22 1 file changed, 4 insertions(+), 1 deletion(-)
23
24--- a/qga/commands-posix.c
25+++ b/qga/commands-posix.c
26@@ -1255,6 +1255,9 @@ int64_t qmp_guest_fsfreeze_freeze_list(b
27 * filesytems may not implement fsfreeze for less obvious reasons.
28 * these will report EOPNOTSUPP. we simply ignore these when tallying
29 * the number of frozen filesystems.
30+ * if a filesystem is mounted more than once (aka bind mount) a
31+ * consecutive attempt to freeze an already frozen filesystem will
32+ * return EBUSY.
33 *
34 * any other error means a failure to freeze a filesystem we
35 * expect to be freezable, so return an error in those cases
36@@ -1262,7 +1265,7 @@ int64_t qmp_guest_fsfreeze_freeze_list(b
37 */
38 ret = ioctl(fd, FIFREEZE);
39 if (ret == -1) {
40- if (errno != EOPNOTSUPP) {
41+ if (errno != EOPNOTSUPP && errno != EBUSY) {
42 error_setg_errno(errp, errno, "failed to freeze %s",
43 mount->dirname);
44 close(fd);
diff --git a/dump.c b/dump.c
0new file mode 10064445new file mode 100644
index 0000000..78b7d84
--- /dev/null
+++ b/dump.c
@@ -0,0 +1,1714 @@
1/*
2 * QEMU dump
3 *
4 * Copyright Fujitsu, Corp. 2011, 2012
5 *
6 * Authors:
7 * Wen Congyang <wency@cn.fujitsu.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
11 *
12 */
13
14#include "qemu-common.h"
15#include "elf.h"
16#include "cpu.h"
17#include "exec/cpu-all.h"
18#include "exec/hwaddr.h"
19#include "monitor/monitor.h"
20#include "sysemu/kvm.h"
21#include "sysemu/dump.h"
22#include "sysemu/sysemu.h"
23#include "sysemu/memory_mapping.h"
24#include "sysemu/cpus.h"
25#include "qapi/error.h"
26#include "qapi/qmp/qerror.h"
27#include "qmp-commands.h"
28
29#include <zlib.h>
30#ifdef CONFIG_LZO
31#include <lzo/lzo1x.h>
32#endif
33#ifdef CONFIG_SNAPPY
34#include <snappy-c.h>
35#endif
36#ifndef ELF_MACHINE_UNAME
37#define ELF_MACHINE_UNAME "Unknown"
38#endif
39
40uint16_t cpu_to_dump16(DumpState *s, uint16_t val)
41{
42 if (s->dump_info.d_endian == ELFDATA2LSB) {
43 val = cpu_to_le16(val);
44 } else {
45 val = cpu_to_be16(val);
46 }
47
48 return val;
49}
50
51uint32_t cpu_to_dump32(DumpState *s, uint32_t val)
52{
53 if (s->dump_info.d_endian == ELFDATA2LSB) {
54 val = cpu_to_le32(val);
55 } else {
56 val = cpu_to_be32(val);
57 }
58
59 return val;
60}
61
62uint64_t cpu_to_dump64(DumpState *s, uint64_t val)
63{
64 if (s->dump_info.d_endian == ELFDATA2LSB) {
65 val = cpu_to_le64(val);
66 } else {
67 val = cpu_to_be64(val);
68 }
69
70 return val;
71}
72
73static int dump_cleanup(DumpState *s)
74{
75 guest_phys_blocks_free(&s->guest_phys_blocks);
76 memory_mapping_list_free(&s->list);
77 close(s->fd);
78 if (s->resume) {
79 vm_start();
80 }
81
82 return 0;
83}
84
85static void dump_error(DumpState *s, const char *reason, Error **errp)
86{
87 dump_cleanup(s);
88 error_setg(errp, "%s", reason);
89}
90
91static int fd_write_vmcore(const void *buf, size_t size, void *opaque)
92{
93 DumpState *s = opaque;
94 size_t written_size;
95
96 written_size = qemu_write_full(s->fd, buf, size);
97 if (written_size != size) {
98 return -1;
99 }
100
101 return 0;
102}
103
104static void write_elf64_header(DumpState *s, Error **errp)
105{
106 Elf64_Ehdr elf_header;
107 int ret;
108
109 memset(&elf_header, 0, sizeof(Elf64_Ehdr));
110 memcpy(&elf_header, ELFMAG, SELFMAG);
111 elf_header.e_ident[EI_CLASS] = ELFCLASS64;
112 elf_header.e_ident[EI_DATA] = s->dump_info.d_endian;
113 elf_header.e_ident[EI_VERSION] = EV_CURRENT;
114 elf_header.e_type = cpu_to_dump16(s, ET_CORE);
115 elf_header.e_machine = cpu_to_dump16(s, s->dump_info.d_machine);
116 elf_header.e_version = cpu_to_dump32(s, EV_CURRENT);
117 elf_header.e_ehsize = cpu_to_dump16(s, sizeof(elf_header));
118 elf_header.e_phoff = cpu_to_dump64(s, sizeof(Elf64_Ehdr));
119 elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf64_Phdr));
120 elf_header.e_phnum = cpu_to_dump16(s, s->phdr_num);
121 if (s->have_section) {
122 uint64_t shoff = sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) * s->sh_info;
123
124 elf_header.e_shoff = cpu_to_dump64(s, shoff);
125 elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf64_Shdr));
126 elf_header.e_shnum = cpu_to_dump16(s, 1);
127 }
128
129 ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
130 if (ret < 0) {
131 dump_error(s, "dump: failed to write elf header", errp);
132 }
133}
134
135static void write_elf32_header(DumpState *s, Error **errp)
136{
137 Elf32_Ehdr elf_header;
138 int ret;
139
140 memset(&elf_header, 0, sizeof(Elf32_Ehdr));
141 memcpy(&elf_header, ELFMAG, SELFMAG);
142 elf_header.e_ident[EI_CLASS] = ELFCLASS32;
143 elf_header.e_ident[EI_DATA] = s->dump_info.d_endian;
144 elf_header.e_ident[EI_VERSION] = EV_CURRENT;
145 elf_header.e_type = cpu_to_dump16(s, ET_CORE);
146 elf_header.e_machine = cpu_to_dump16(s, s->dump_info.d_machine);
147 elf_header.e_version = cpu_to_dump32(s, EV_CURRENT);
148 elf_header.e_ehsize = cpu_to_dump16(s, sizeof(elf_header));
149 elf_header.e_phoff = cpu_to_dump32(s, sizeof(Elf32_Ehdr));
150 elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf32_Phdr));
151 elf_header.e_phnum = cpu_to_dump16(s, s->phdr_num);
152 if (s->have_section) {
153 uint32_t shoff = sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr) * s->sh_info;
154
155 elf_header.e_shoff = cpu_to_dump32(s, shoff);
156 elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf32_Shdr));
157 elf_header.e_shnum = cpu_to_dump16(s, 1);
158 }
159
160 ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
161 if (ret < 0) {
162 dump_error(s, "dump: failed to write elf header", errp);
163 }
164}
165
166static void write_elf64_load(DumpState *s, MemoryMapping *memory_mapping,
167 int phdr_index, hwaddr offset,
168 hwaddr filesz, Error **errp)
169{
170 Elf64_Phdr phdr;
171 int ret;
172
173 memset(&phdr, 0, sizeof(Elf64_Phdr));
174 phdr.p_type = cpu_to_dump32(s, PT_LOAD);
175 phdr.p_offset = cpu_to_dump64(s, offset);
176 phdr.p_paddr = cpu_to_dump64(s, memory_mapping->phys_addr);
177 phdr.p_filesz = cpu_to_dump64(s, filesz);
178 phdr.p_memsz = cpu_to_dump64(s, memory_mapping->length);
179 phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr);
180
181 assert(memory_mapping->length >= filesz);
182
183 ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
184 if (ret < 0) {
185 dump_error(s, "dump: failed to write program header table", errp);
186 }
187}
188
189static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
190 int phdr_index, hwaddr offset,
191 hwaddr filesz, Error **errp)
192{
193 Elf32_Phdr phdr;
194 int ret;
195
196 memset(&phdr, 0, sizeof(Elf32_Phdr));
197 phdr.p_type = cpu_to_dump32(s, PT_LOAD);
198 phdr.p_offset = cpu_to_dump32(s, offset);
199 phdr.p_paddr = cpu_to_dump32(s, memory_mapping->phys_addr);
200 phdr.p_filesz = cpu_to_dump32(s, filesz);
201 phdr.p_memsz = cpu_to_dump32(s, memory_mapping->length);
202 phdr.p_vaddr = cpu_to_dump32(s, memory_mapping->virt_addr);
203
204 assert(memory_mapping->length >= filesz);
205
206 ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
207 if (ret < 0) {
208 dump_error(s, "dump: failed to write program header table", errp);
209 }
210}
211
212static void write_elf64_note(DumpState *s, Error **errp)
213{
214 Elf64_Phdr phdr;
215 hwaddr begin = s->memory_offset - s->note_size;
216 int ret;
217
218 memset(&phdr, 0, sizeof(Elf64_Phdr));
219 phdr.p_type = cpu_to_dump32(s, PT_NOTE);
220 phdr.p_offset = cpu_to_dump64(s, begin);
221 phdr.p_paddr = 0;
222 phdr.p_filesz = cpu_to_dump64(s, s->note_size);
223 phdr.p_memsz = cpu_to_dump64(s, s->note_size);
224 phdr.p_vaddr = 0;
225
226 ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
227 if (ret < 0) {
228 dump_error(s, "dump: failed to write program header table", errp);
229 }
230}
231
232static inline int cpu_index(CPUState *cpu)
233{
234 return cpu->cpu_index + 1;
235}
236
237static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
238 Error **errp)
239{
240 CPUState *cpu;
241 int ret;
242 int id;
243
244 CPU_FOREACH(cpu) {
245 id = cpu_index(cpu);
246 ret = cpu_write_elf64_note(f, cpu, id, s);
247 if (ret < 0) {
248 dump_error(s, "dump: failed to write elf notes", errp);
249 return;
250 }
251 }
252
253 CPU_FOREACH(cpu) {
254 ret = cpu_write_elf64_qemunote(f, cpu, s);
255 if (ret < 0) {
256 dump_error(s, "dump: failed to write CPU status", errp);
257 return;
258 }
259 }
260}
261
262static void write_elf32_note(DumpState *s, Error **errp)
263{
264 hwaddr begin = s->memory_offset - s->note_size;
265 Elf32_Phdr phdr;
266 int ret;
267
268 memset(&phdr, 0, sizeof(Elf32_Phdr));
269 phdr.p_type = cpu_to_dump32(s, PT_NOTE);
270 phdr.p_offset = cpu_to_dump32(s, begin);
271 phdr.p_paddr = 0;
272 phdr.p_filesz = cpu_to_dump32(s, s->note_size);
273 phdr.p_memsz = cpu_to_dump32(s, s->note_size);
274 phdr.p_vaddr = 0;
275
276 ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
277 if (ret < 0) {
278 dump_error(s, "dump: failed to write program header table", errp);
279 }
280}
281
282static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
283 Error **errp)
284{
285 CPUState *cpu;
286 int ret;
287 int id;
288
289 CPU_FOREACH(cpu) {
290 id = cpu_index(cpu);
291 ret = cpu_write_elf32_note(f, cpu, id, s);
292 if (ret < 0) {
293 dump_error(s, "dump: failed to write elf notes", errp);
294 return;
295 }
296 }
297
298 CPU_FOREACH(cpu) {
299 ret = cpu_write_elf32_qemunote(f, cpu, s);
300 if (ret < 0) {
301 dump_error(s, "dump: failed to write CPU status", errp);
302 return;
303 }
304 }
305}
306
307static void write_elf_section(DumpState *s, int type, Error **errp)
308{
309 Elf32_Shdr shdr32;
310 Elf64_Shdr shdr64;
311 int shdr_size;
312 void *shdr;
313 int ret;
314
315 if (type == 0) {
316 shdr_size = sizeof(Elf32_Shdr);
317 memset(&shdr32, 0, shdr_size);
318 shdr32.sh_info = cpu_to_dump32(s, s->sh_info);
319 shdr = &shdr32;
320 } else {
321 shdr_size = sizeof(Elf64_Shdr);
322 memset(&shdr64, 0, shdr_size);
323 shdr64.sh_info = cpu_to_dump32(s, s->sh_info);
324 shdr = &shdr64;
325 }
326
327 ret = fd_write_vmcore(&shdr, shdr_size, s);
328 if (ret < 0) {
329 dump_error(s, "dump: failed to write section header table", errp);
330 }
331}
332
333static void write_data(DumpState *s, void *buf, int length, Error **errp)
334{
335 int ret;
336
337 ret = fd_write_vmcore(buf, length, s);
338 if (ret < 0) {
339 dump_error(s, "dump: failed to save memory", errp);
340 }
341}
342
343/* write the memory to vmcore. 1 page per I/O. */
344static void write_memory(DumpState *s, GuestPhysBlock *block, ram_addr_t start,
345 int64_t size, Error **errp)
346{
347 int64_t i;
348 Error *local_err = NULL;
349
350 for (i = 0; i < size / TARGET_PAGE_SIZE; i++) {
351 write_data(s, block->host_addr + start + i * TARGET_PAGE_SIZE,
352 TARGET_PAGE_SIZE, &local_err);
353 if (local_err) {
354 error_propagate(errp, local_err);
355 return;
356 }
357 }
358
359 if ((size % TARGET_PAGE_SIZE) != 0) {
360 write_data(s, block->host_addr + start + i * TARGET_PAGE_SIZE,
361 size % TARGET_PAGE_SIZE, &local_err);
362 if (local_err) {
363 error_propagate(errp, local_err);
364 return;
365 }
366 }
367}
368
369/* get the memory's offset and size in the vmcore */
370static void get_offset_range(hwaddr phys_addr,
371 ram_addr_t mapping_length,
372 DumpState *s,
373 hwaddr *p_offset,
374 hwaddr *p_filesz)
375{
376 GuestPhysBlock *block;
377 hwaddr offset = s->memory_offset;
378 int64_t size_in_block, start;
379
380 /* When the memory is not stored into vmcore, offset will be -1 */
381 *p_offset = -1;
382 *p_filesz = 0;
383
384 if (s->has_filter) {
385 if (phys_addr < s->begin || phys_addr >= s->begin + s->length) {
386 return;
387 }
388 }
389
390 QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) {
391 if (s->has_filter) {
392 if (block->target_start >= s->begin + s->length ||
393 block->target_end <= s->begin) {
394 /* This block is out of the range */
395 continue;
396 }
397
398 if (s->begin <= block->target_start) {
399 start = block->target_start;
400 } else {
401 start = s->begin;
402 }
403
404 size_in_block = block->target_end - start;
405 if (s->begin + s->length < block->target_end) {
406 size_in_block -= block->target_end - (s->begin + s->length);
407 }
408 } else {
409 start = block->target_start;
410 size_in_block = block->target_end - block->target_start;
411 }
412
413 if (phys_addr >= start && phys_addr < start + size_in_block) {
414 *p_offset = phys_addr - start + offset;
415
416 /* The offset range mapped from the vmcore file must not spill over
417 * the GuestPhysBlock, clamp it. The rest of the mapping will be
418 * zero-filled in memory at load time; see
419 * <http://refspecs.linuxbase.org/elf/gabi4+/ch5.pheader.html>.
420 */
421 *p_filesz = phys_addr + mapping_length <= start + size_in_block ?
422 mapping_length :
423 size_in_block - (phys_addr - start);
424 return;
425 }
426
427 offset += size_in_block;
428 }
429}
430
431static void write_elf_loads(DumpState *s, Error **errp)
432{
433 hwaddr offset, filesz;
434 MemoryMapping *memory_mapping;
435 uint32_t phdr_index = 1;
436 uint32_t max_index;
437 Error *local_err = NULL;
438
439 if (s->have_section) {
440 max_index = s->sh_info;
441 } else {
442 max_index = s->phdr_num;
443 }
444
445 QTAILQ_FOREACH(memory_mapping, &s->list.head, next) {
446 get_offset_range(memory_mapping->phys_addr,
447 memory_mapping->length,
448 s, &offset, &filesz);
449 if (s->dump_info.d_class == ELFCLASS64) {
450 write_elf64_load(s, memory_mapping, phdr_index++, offset,
451 filesz, &local_err);
452 } else {
453 write_elf32_load(s, memory_mapping, phdr_index++, offset,
454 filesz, &local_err);
455 }
456
457 if (local_err) {
458 error_propagate(errp, local_err);
459 return;
460 }
461
462 if (phdr_index >= max_index) {
463 break;
464 }
465 }
466}
467
468/* write elf header, PT_NOTE and elf note to vmcore. */
469static void dump_begin(DumpState *s, Error **errp)
470{
471 Error *local_err = NULL;
472
473 /*
474 * the vmcore's format is:
475 * --------------
476 * | elf header |
477 * --------------
478 * | PT_NOTE |
479 * --------------
480 * | PT_LOAD |
481 * --------------
482 * | ...... |
483 * --------------
484 * | PT_LOAD |
485 * --------------
486 * | sec_hdr |
487 * --------------
488 * | elf note |
489 * --------------
490 * | memory |
491 * --------------
492 *
493 * we only know where the memory is saved after we write elf note into
494 * vmcore.
495 */
496
497 /* write elf header to vmcore */
498 if (s->dump_info.d_class == ELFCLASS64) {
499 write_elf64_header(s, &local_err);
500 } else {
501 write_elf32_header(s, &local_err);
502 }
503 if (local_err) {
504 error_propagate(errp, local_err);
505 return;
506 }
507
508 if (s->dump_info.d_class == ELFCLASS64) {
509 /* write PT_NOTE to vmcore */
510 write_elf64_note(s, &local_err);
511 if (local_err) {
512 error_propagate(errp, local_err);
513 return;
514 }
515
516 /* write all PT_LOAD to vmcore */
517 write_elf_loads(s, &local_err);
518 if (local_err) {
519 error_propagate(errp, local_err);
520 return;
521 }
522
523 /* write section to vmcore */
524 if (s->have_section) {
525 write_elf_section(s, 1, &local_err);
526 if (local_err) {
527 error_propagate(errp, local_err);
528 return;
529 }
530 }
531
532 /* write notes to vmcore */
533 write_elf64_notes(fd_write_vmcore, s, &local_err);
534 if (local_err) {
535 error_propagate(errp, local_err);
536 return;
537 }
538 } else {
539 /* write PT_NOTE to vmcore */
540 write_elf32_note(s, &local_err);
541 if (local_err) {
542 error_propagate(errp, local_err);
543 return;
544 }
545
546 /* write all PT_LOAD to vmcore */
547 write_elf_loads(s, &local_err);
548 if (local_err) {
549 error_propagate(errp, local_err);
550 return;
551 }
552
553 /* write section to vmcore */
554 if (s->have_section) {
555 write_elf_section(s, 0, &local_err);
556 if (local_err) {
557 error_propagate(errp, local_err);
558 return;
559 }
560 }
561
562 /* write notes to vmcore */
563 write_elf32_notes(fd_write_vmcore, s, &local_err);
564 if (local_err) {
565 error_propagate(errp, local_err);
566 return;
567 }
568 }
569}
570
571static void dump_completed(DumpState *s)
572{
573 dump_cleanup(s);
574}
575
576static int get_next_block(DumpState *s, GuestPhysBlock *block)
577{
578 while (1) {
579 block = QTAILQ_NEXT(block, next);
580 if (!block) {
581 /* no more block */
582 return 1;
583 }
584
585 s->start = 0;
586 s->next_block = block;
587 if (s->has_filter) {
588 if (block->target_start >= s->begin + s->length ||
589 block->target_end <= s->begin) {
590 /* This block is out of the range */
591 continue;
592 }
593
594 if (s->begin > block->target_start) {
595 s->start = s->begin - block->target_start;
596 }
597 }
598
599 return 0;
600 }
601}
602
603/* write all memory to vmcore */
604static void dump_iterate(DumpState *s, Error **errp)
605{
606 GuestPhysBlock *block;
607 int64_t size;
608 Error *local_err = NULL;
609
610 do {
611 block = s->next_block;
612
613 size = block->target_end - block->target_start;
614 if (s->has_filter) {
615 size -= s->start;
616 if (s->begin + s->length < block->target_end) {
617 size -= block->target_end - (s->begin + s->length);
618 }
619 }
620 write_memory(s, block, s->start, size, &local_err);
621 if (local_err) {
622 error_propagate(errp, local_err);
623 return;
624 }
625
626 } while (!get_next_block(s, block));
627
628 dump_completed(s);
629}
630
631static void create_vmcore(DumpState *s, Error **errp)
632{
633 Error *local_err = NULL;
634
635 dump_begin(s, &local_err);
636 if (local_err) {
637 error_propagate(errp, local_err);
638 return;
639 }
640
641 dump_iterate(s, errp);
642}
643
644static int write_start_flat_header(int fd)
645{
646 MakedumpfileHeader *mh;
647 int ret = 0;
648
649 QEMU_BUILD_BUG_ON(sizeof *mh > MAX_SIZE_MDF_HEADER);
650 mh = g_malloc0(MAX_SIZE_MDF_HEADER);
651
652 memcpy(mh->signature, MAKEDUMPFILE_SIGNATURE,
653 MIN(sizeof mh->signature, sizeof MAKEDUMPFILE_SIGNATURE));
654
655 mh->type = cpu_to_be64(TYPE_FLAT_HEADER);
656 mh->version = cpu_to_be64(VERSION_FLAT_HEADER);
657
658 size_t written_size;
659 written_size = qemu_write_full(fd, mh, MAX_SIZE_MDF_HEADER);
660 if (written_size != MAX_SIZE_MDF_HEADER) {
661 ret = -1;
662 }
663
664 g_free(mh);
665 return ret;
666}
667
668static int write_end_flat_header(int fd)
669{
670 MakedumpfileDataHeader mdh;
671
672 mdh.offset = END_FLAG_FLAT_HEADER;
673 mdh.buf_size = END_FLAG_FLAT_HEADER;
674
675 size_t written_size;
676 written_size = qemu_write_full(fd, &mdh, sizeof(mdh));
677 if (written_size != sizeof(mdh)) {
678 return -1;
679 }
680
681 return 0;
682}
683
684static int write_buffer(int fd, off_t offset, const void *buf, size_t size)
685{
686 size_t written_size;
687 MakedumpfileDataHeader mdh;
688
689 mdh.offset = cpu_to_be64(offset);
690 mdh.buf_size = cpu_to_be64(size);
691
692 written_size = qemu_write_full(fd, &mdh, sizeof(mdh));
693 if (written_size != sizeof(mdh)) {
694 return -1;
695 }
696
697 written_size = qemu_write_full(fd, buf, size);
698 if (written_size != size) {
699 return -1;
700 }
701
702 return 0;
703}
704
705static int buf_write_note(const void *buf, size_t size, void *opaque)
706{
707 DumpState *s = opaque;
708
709 /* note_buf is not enough */
710 if (s->note_buf_offset + size > s->note_size) {
711 return -1;
712 }
713
714 memcpy(s->note_buf + s->note_buf_offset, buf, size);
715
716 s->note_buf_offset += size;
717
718 return 0;
719}
720
721/* write common header, sub header and elf note to vmcore */
722static void create_header32(DumpState *s, Error **errp)
723{
724 DiskDumpHeader32 *dh = NULL;
725 KdumpSubHeader32 *kh = NULL;
726 size_t size;
727 uint32_t block_size;
728 uint32_t sub_hdr_size;
729 uint32_t bitmap_blocks;
730 uint32_t status = 0;
731 uint64_t offset_note;
732 Error *local_err = NULL;
733
734 /* write common header, the version of kdump-compressed format is 6th */
735 size = sizeof(DiskDumpHeader32);
736 dh = g_malloc0(size);
737
738 strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
739 dh->header_version = cpu_to_dump32(s, 6);
740 block_size = TARGET_PAGE_SIZE;
741 dh->block_size = cpu_to_dump32(s, block_size);
742 sub_hdr_size = sizeof(struct KdumpSubHeader32) + s->note_size;
743 sub_hdr_size = DIV_ROUND_UP(sub_hdr_size, block_size);
744 dh->sub_hdr_size = cpu_to_dump32(s, sub_hdr_size);
745 /* dh->max_mapnr may be truncated, full 64bit is in kh.max_mapnr_64 */
746 dh->max_mapnr = cpu_to_dump32(s, MIN(s->max_mapnr, UINT_MAX));
747 dh->nr_cpus = cpu_to_dump32(s, s->nr_cpus);
748 bitmap_blocks = DIV_ROUND_UP(s->len_dump_bitmap, block_size) * 2;
749 dh->bitmap_blocks = cpu_to_dump32(s, bitmap_blocks);
750 strncpy(dh->utsname.machine, ELF_MACHINE_UNAME, sizeof(dh->utsname.machine));
751
752 if (s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) {
753 status |= DUMP_DH_COMPRESSED_ZLIB;
754 }
755#ifdef CONFIG_LZO
756 if (s->flag_compress & DUMP_DH_COMPRESSED_LZO) {
757 status |= DUMP_DH_COMPRESSED_LZO;
758 }
759#endif
760#ifdef CONFIG_SNAPPY
761 if (s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) {
762 status |= DUMP_DH_COMPRESSED_SNAPPY;
763 }
764#endif
765 dh->status = cpu_to_dump32(s, status);
766
767 if (write_buffer(s->fd, 0, dh, size) < 0) {
768 dump_error(s, "dump: failed to write disk dump header", errp);
769 goto out;
770 }
771
772 /* write sub header */
773 size = sizeof(KdumpSubHeader32);
774 kh = g_malloc0(size);
775
776 /* 64bit max_mapnr_64 */
777 kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
778 kh->phys_base = cpu_to_dump32(s, PHYS_BASE);
779 kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
780
781 offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
782 kh->offset_note = cpu_to_dump64(s, offset_note);
783 kh->note_size = cpu_to_dump32(s, s->note_size);
784
785 if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
786 block_size, kh, size) < 0) {
787 dump_error(s, "dump: failed to write kdump sub header", errp);
788 goto out;
789 }
790
791 /* write note */
792 s->note_buf = g_malloc0(s->note_size);
793 s->note_buf_offset = 0;
794
795 /* use s->note_buf to store notes temporarily */
796 write_elf32_notes(buf_write_note, s, &local_err);
797 if (local_err) {
798 error_propagate(errp, local_err);
799 goto out;
800 }
801 if (write_buffer(s->fd, offset_note, s->note_buf,
802 s->note_size) < 0) {
803 dump_error(s, "dump: failed to write notes", errp);
804 goto out;
805 }
806
807 /* get offset of dump_bitmap */
808 s->offset_dump_bitmap = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size) *
809 block_size;
810
811 /* get offset of page */
812 s->offset_page = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size + bitmap_blocks) *
813 block_size;
814
815out:
816 g_free(dh);
817 g_free(kh);
818 g_free(s->note_buf);
819}
820
821/* write common header, sub header and elf note to vmcore */
822static void create_header64(DumpState *s, Error **errp)
823{
824 DiskDumpHeader64 *dh = NULL;
825 KdumpSubHeader64 *kh = NULL;
826 size_t size;
827 uint32_t block_size;
828 uint32_t sub_hdr_size;
829 uint32_t bitmap_blocks;
830 uint32_t status = 0;
831 uint64_t offset_note;
832 Error *local_err = NULL;
833
834 /* write common header, the version of kdump-compressed format is 6th */
835 size = sizeof(DiskDumpHeader64);
836 dh = g_malloc0(size);
837
838 strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
839 dh->header_version = cpu_to_dump32(s, 6);
840 block_size = TARGET_PAGE_SIZE;
841 dh->block_size = cpu_to_dump32(s, block_size);
842 sub_hdr_size = sizeof(struct KdumpSubHeader64) + s->note_size;
843 sub_hdr_size = DIV_ROUND_UP(sub_hdr_size, block_size);
844 dh->sub_hdr_size = cpu_to_dump32(s, sub_hdr_size);
845 /* dh->max_mapnr may be truncated, full 64bit is in kh.max_mapnr_64 */
846 dh->max_mapnr = cpu_to_dump32(s, MIN(s->max_mapnr, UINT_MAX));
847 dh->nr_cpus = cpu_to_dump32(s, s->nr_cpus);
848 bitmap_blocks = DIV_ROUND_UP(s->len_dump_bitmap, block_size) * 2;
849 dh->bitmap_blocks = cpu_to_dump32(s, bitmap_blocks);
850 strncpy(dh->utsname.machine, ELF_MACHINE_UNAME, sizeof(dh->utsname.machine));
851
852 if (s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) {
853 status |= DUMP_DH_COMPRESSED_ZLIB;
854 }
855#ifdef CONFIG_LZO
856 if (s->flag_compress & DUMP_DH_COMPRESSED_LZO) {
857 status |= DUMP_DH_COMPRESSED_LZO;
858 }
859#endif
860#ifdef CONFIG_SNAPPY
861 if (s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) {
862 status |= DUMP_DH_COMPRESSED_SNAPPY;
863 }
864#endif
865 dh->status = cpu_to_dump32(s, status);
866
867 if (write_buffer(s->fd, 0, dh, size) < 0) {
868 dump_error(s, "dump: failed to write disk dump header", errp);
869 goto out;
870 }
871
872 /* write sub header */
873 size = sizeof(KdumpSubHeader64);
874 kh = g_malloc0(size);
875
876 /* 64bit max_mapnr_64 */
877 kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
878 kh->phys_base = cpu_to_dump64(s, PHYS_BASE);
879 kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
880
881 offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
882 kh->offset_note = cpu_to_dump64(s, offset_note);
883 kh->note_size = cpu_to_dump64(s, s->note_size);
884
885 if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
886 block_size, kh, size) < 0) {
887 dump_error(s, "dump: failed to write kdump sub header", errp);
888 goto out;
889 }
890
891 /* write note */
892 s->note_buf = g_malloc0(s->note_size);
893 s->note_buf_offset = 0;
894
895 /* use s->note_buf to store notes temporarily */
896 write_elf64_notes(buf_write_note, s, &local_err);
897 if (local_err) {
898 error_propagate(errp, local_err);
899 goto out;
900 }
901
902 if (write_buffer(s->fd, offset_note, s->note_buf,
903 s->note_size) < 0) {
904 dump_error(s, "dump: failed to write notes", errp);
905 goto out;
906 }
907
908 /* get offset of dump_bitmap */
909 s->offset_dump_bitmap = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size) *
910 block_size;
911
912 /* get offset of page */
913 s->offset_page = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size + bitmap_blocks) *
914 block_size;
915
916out:
917 g_free(dh);
918 g_free(kh);
919 g_free(s->note_buf);
920}
921
922static void write_dump_header(DumpState *s, Error **errp)
923{
924 Error *local_err = NULL;
925
926 if (s->dump_info.d_class == ELFCLASS32) {
927 create_header32(s, &local_err);
928 } else {
929 create_header64(s, &local_err);
930 }
931 if (local_err) {
932 error_propagate(errp, local_err);
933 }
934}
935
936/*
937 * set dump_bitmap sequencely. the bit before last_pfn is not allowed to be
938 * rewritten, so if need to set the first bit, set last_pfn and pfn to 0.
939 * set_dump_bitmap will always leave the recently set bit un-sync. And setting
940 * (last bit + sizeof(buf) * 8) to 0 will do flushing the content in buf into
941 * vmcore, ie. synchronizing un-sync bit into vmcore.
942 */
943static int set_dump_bitmap(uint64_t last_pfn, uint64_t pfn, bool value,
944 uint8_t *buf, DumpState *s)
945{
946 off_t old_offset, new_offset;
947 off_t offset_bitmap1, offset_bitmap2;
948 uint32_t byte, bit;
949
950 /* should not set the previous place */
951 assert(last_pfn <= pfn);
952
953 /*
954 * if the bit needed to be set is not cached in buf, flush the data in buf
955 * to vmcore firstly.
956 * making new_offset be bigger than old_offset can also sync remained data
957 * into vmcore.
958 */
959 old_offset = BUFSIZE_BITMAP * (last_pfn / PFN_BUFBITMAP);
960 new_offset = BUFSIZE_BITMAP * (pfn / PFN_BUFBITMAP);
961
962 while (old_offset < new_offset) {
963 /* calculate the offset and write dump_bitmap */
964 offset_bitmap1 = s->offset_dump_bitmap + old_offset;
965 if (write_buffer(s->fd, offset_bitmap1, buf,
966 BUFSIZE_BITMAP) < 0) {
967 return -1;
968 }
969
970 /* dump level 1 is chosen, so 1st and 2nd bitmap are same */
971 offset_bitmap2 = s->offset_dump_bitmap + s->len_dump_bitmap +
972 old_offset;
973 if (write_buffer(s->fd, offset_bitmap2, buf,
974 BUFSIZE_BITMAP) < 0) {
975 return -1;
976 }
977
978 memset(buf, 0, BUFSIZE_BITMAP);
979 old_offset += BUFSIZE_BITMAP;
980 }
981
982 /* get the exact place of the bit in the buf, and set it */
983 byte = (pfn % PFN_BUFBITMAP) / CHAR_BIT;
984 bit = (pfn % PFN_BUFBITMAP) % CHAR_BIT;
985 if (value) {
986 buf[byte] |= 1u << bit;
987 } else {
988 buf[byte] &= ~(1u << bit);
989 }
990
991 return 0;
992}
993
994/*
995 * exam every page and return the page frame number and the address of the page.
996 * bufptr can be NULL. note: the blocks here is supposed to reflect guest-phys
997 * blocks, so block->target_start and block->target_end should be interal
998 * multiples of the target page size.
999 */
1000static bool get_next_page(GuestPhysBlock **blockptr, uint64_t *pfnptr,
1001 uint8_t **bufptr, DumpState *s)
1002{
1003 GuestPhysBlock *block = *blockptr;
1004 hwaddr addr;
1005 uint8_t *buf;
1006
1007 /* block == NULL means the start of the iteration */
1008 if (!block) {
1009 block = QTAILQ_FIRST(&s->guest_phys_blocks.head);
1010 *blockptr = block;
1011 assert((block->target_start & ~TARGET_PAGE_MASK) == 0);
1012 assert((block->target_end & ~TARGET_PAGE_MASK) == 0);
1013 *pfnptr = paddr_to_pfn(block->target_start);
1014 if (bufptr) {
1015 *bufptr = block->host_addr;
1016 }
1017 return true;
1018 }
1019
1020 *pfnptr = *pfnptr + 1;
1021 addr = pfn_to_paddr(*pfnptr);
1022
1023 if ((addr >= block->target_start) &&
1024 (addr + TARGET_PAGE_SIZE <= block->target_end)) {
1025 buf = block->host_addr + (addr - block->target_start);
1026 } else {
1027 /* the next page is in the next block */
1028 block = QTAILQ_NEXT(block, next);
1029 *blockptr = block;
1030 if (!block) {
1031 return false;
1032 }
1033 assert((block->target_start & ~TARGET_PAGE_MASK) == 0);
1034 assert((block->target_end & ~TARGET_PAGE_MASK) == 0);
1035 *pfnptr = paddr_to_pfn(block->target_start);
1036 buf = block->host_addr;
1037 }
1038
1039 if (bufptr) {
1040 *bufptr = buf;
1041 }
1042
1043 return true;
1044}
1045
1046static void write_dump_bitmap(DumpState *s, Error **errp)
1047{
1048 int ret = 0;
1049 uint64_t last_pfn, pfn;
1050 void *dump_bitmap_buf;
1051 size_t num_dumpable;
1052 GuestPhysBlock *block_iter = NULL;
1053
1054 /* dump_bitmap_buf is used to store dump_bitmap temporarily */
1055 dump_bitmap_buf = g_malloc0(BUFSIZE_BITMAP);
1056
1057 num_dumpable = 0;
1058 last_pfn = 0;
1059
1060 /*
1061 * exam memory page by page, and set the bit in dump_bitmap corresponded
1062 * to the existing page.
1063 */
1064 while (get_next_page(&block_iter, &pfn, NULL, s)) {
1065 ret = set_dump_bitmap(last_pfn, pfn, true, dump_bitmap_buf, s);
1066 if (ret < 0) {
1067 dump_error(s, "dump: failed to set dump_bitmap", errp);
1068 goto out;
1069 }
1070
1071 last_pfn = pfn;
1072 num_dumpable++;
1073 }
1074
1075 /*
1076 * set_dump_bitmap will always leave the recently set bit un-sync. Here we
1077 * set last_pfn + PFN_BUFBITMAP to 0 and those set but un-sync bit will be
1078 * synchronized into vmcore.
1079 */
1080 if (num_dumpable > 0) {
1081 ret = set_dump_bitmap(last_pfn, last_pfn + PFN_BUFBITMAP, false,
1082 dump_bitmap_buf, s);
1083 if (ret < 0) {
1084 dump_error(s, "dump: failed to sync dump_bitmap", errp);
1085 goto out;
1086 }
1087 }
1088
1089 /* number of dumpable pages that will be dumped later */
1090 s->num_dumpable = num_dumpable;
1091
1092out:
1093 g_free(dump_bitmap_buf);
1094}
1095
1096static void prepare_data_cache(DataCache *data_cache, DumpState *s,
1097 off_t offset)
1098{
1099 data_cache->fd = s->fd;
1100 data_cache->data_size = 0;
1101 data_cache->buf_size = BUFSIZE_DATA_CACHE;
1102 data_cache->buf = g_malloc0(BUFSIZE_DATA_CACHE);
1103 data_cache->offset = offset;
1104}
1105
1106static int write_cache(DataCache *dc, const void *buf, size_t size,
1107 bool flag_sync)
1108{
1109 /*
1110 * dc->buf_size should not be less than size, otherwise dc will never be
1111 * enough
1112 */
1113 assert(size <= dc->buf_size);
1114
1115 /*
1116 * if flag_sync is set, synchronize data in dc->buf into vmcore.
1117 * otherwise check if the space is enough for caching data in buf, if not,
1118 * write the data in dc->buf to dc->fd and reset dc->buf
1119 */
1120 if ((!flag_sync && dc->data_size + size > dc->buf_size) ||
1121 (flag_sync && dc->data_size > 0)) {
1122 if (write_buffer(dc->fd, dc->offset, dc->buf, dc->data_size) < 0) {
1123 return -1;
1124 }
1125
1126 dc->offset += dc->data_size;
1127 dc->data_size = 0;
1128 }
1129
1130 if (!flag_sync) {
1131 memcpy(dc->buf + dc->data_size, buf, size);
1132 dc->data_size += size;
1133 }
1134
1135 return 0;
1136}
1137
1138static void free_data_cache(DataCache *data_cache)
1139{
1140 g_free(data_cache->buf);
1141}
1142
1143static size_t get_len_buf_out(size_t page_size, uint32_t flag_compress)
1144{
1145 switch (flag_compress) {
1146 case DUMP_DH_COMPRESSED_ZLIB:
1147 return compressBound(page_size);
1148
1149 case DUMP_DH_COMPRESSED_LZO:
1150 /*
1151 * LZO will expand incompressible data by a little amount. Please check
1152 * the following URL to see the expansion calculation:
1153 * http://www.oberhumer.com/opensource/lzo/lzofaq.php
1154 */
1155 return page_size + page_size / 16 + 64 + 3;
1156
1157#ifdef CONFIG_SNAPPY
1158 case DUMP_DH_COMPRESSED_SNAPPY:
1159 return snappy_max_compressed_length(page_size);
1160#endif
1161 }
1162 return 0;
1163}
1164
1165/*
1166 * check if the page is all 0
1167 */
1168static inline bool is_zero_page(const uint8_t *buf, size_t page_size)
1169{
1170 return buffer_is_zero(buf, page_size);
1171}
1172
1173static void write_dump_pages(DumpState *s, Error **errp)
1174{
1175 int ret = 0;
1176 DataCache page_desc, page_data;
1177 size_t len_buf_out, size_out;
1178#ifdef CONFIG_LZO
1179 lzo_bytep wrkmem = NULL;
1180#endif
1181 uint8_t *buf_out = NULL;
1182 off_t offset_desc, offset_data;
1183 PageDescriptor pd, pd_zero;
1184 uint8_t *buf;
1185 GuestPhysBlock *block_iter = NULL;
1186 uint64_t pfn_iter;
1187
1188 /* get offset of page_desc and page_data in dump file */
1189 offset_desc = s->offset_page;
1190 offset_data = offset_desc + sizeof(PageDescriptor) * s->num_dumpable;
1191
1192 prepare_data_cache(&page_desc, s, offset_desc);
1193 prepare_data_cache(&page_data, s, offset_data);
1194
1195 /* prepare buffer to store compressed data */
1196 len_buf_out = get_len_buf_out(TARGET_PAGE_SIZE, s->flag_compress);
1197 assert(len_buf_out != 0);
1198
1199#ifdef CONFIG_LZO
1200 wrkmem = g_malloc(LZO1X_1_MEM_COMPRESS);
1201#endif
1202
1203 buf_out = g_malloc(len_buf_out);
1204
1205 /*
1206 * init zero page's page_desc and page_data, because every zero page
1207 * uses the same page_data
1208 */
1209 pd_zero.size = cpu_to_dump32(s, TARGET_PAGE_SIZE);
1210 pd_zero.flags = cpu_to_dump32(s, 0);
1211 pd_zero.offset = cpu_to_dump64(s, offset_data);
1212 pd_zero.page_flags = cpu_to_dump64(s, 0);
1213 buf = g_malloc0(TARGET_PAGE_SIZE);
1214 ret = write_cache(&page_data, buf, TARGET_PAGE_SIZE, false);
1215 g_free(buf);
1216 if (ret < 0) {
1217 dump_error(s, "dump: failed to write page data (zero page)", errp);
1218 goto out;
1219 }
1220
1221 offset_data += TARGET_PAGE_SIZE;
1222
1223 /*
1224 * dump memory to vmcore page by page. zero page will all be resided in the
1225 * first page of page section
1226 */
1227 while (get_next_page(&block_iter, &pfn_iter, &buf, s)) {
1228 /* check zero page */
1229 if (is_zero_page(buf, TARGET_PAGE_SIZE)) {
1230 ret = write_cache(&page_desc, &pd_zero, sizeof(PageDescriptor),
1231 false);
1232 if (ret < 0) {
1233 dump_error(s, "dump: failed to write page desc", errp);
1234 goto out;
1235 }
1236 } else {
1237 /*
1238 * not zero page, then:
1239 * 1. compress the page
1240 * 2. write the compressed page into the cache of page_data
1241 * 3. get page desc of the compressed page and write it into the
1242 * cache of page_desc
1243 *
1244 * only one compression format will be used here, for
1245 * s->flag_compress is set. But when compression fails to work,
1246 * we fall back to save in plaintext.
1247 */
1248 size_out = len_buf_out;
1249 if ((s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) &&
1250 (compress2(buf_out, (uLongf *)&size_out, buf,
1251 TARGET_PAGE_SIZE, Z_BEST_SPEED) == Z_OK) &&
1252 (size_out < TARGET_PAGE_SIZE)) {
1253 pd.flags = cpu_to_dump32(s, DUMP_DH_COMPRESSED_ZLIB);
1254 pd.size = cpu_to_dump32(s, size_out);
1255
1256 ret = write_cache(&page_data, buf_out, size_out, false);
1257 if (ret < 0) {
1258 dump_error(s, "dump: failed to write page data", errp);
1259 goto out;
1260 }
1261#ifdef CONFIG_LZO
1262 } else if ((s->flag_compress & DUMP_DH_COMPRESSED_LZO) &&
1263 (lzo1x_1_compress(buf, TARGET_PAGE_SIZE, buf_out,
1264 (lzo_uint *)&size_out, wrkmem) == LZO_E_OK) &&
1265 (size_out < TARGET_PAGE_SIZE)) {
1266 pd.flags = cpu_to_dump32(s, DUMP_DH_COMPRESSED_LZO);
1267 pd.size = cpu_to_dump32(s, size_out);
1268
1269 ret = write_cache(&page_data, buf_out, size_out, false);
1270 if (ret < 0) {
1271 dump_error(s, "dump: failed to write page data", errp);
1272 goto out;
1273 }
1274#endif
1275#ifdef CONFIG_SNAPPY
1276 } else if ((s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) &&
1277 (snappy_compress((char *)buf, TARGET_PAGE_SIZE,
1278 (char *)buf_out, &size_out) == SNAPPY_OK) &&
1279 (size_out < TARGET_PAGE_SIZE)) {
1280 pd.flags = cpu_to_dump32(s, DUMP_DH_COMPRESSED_SNAPPY);
1281 pd.size = cpu_to_dump32(s, size_out);
1282
1283 ret = write_cache(&page_data, buf_out, size_out, false);
1284 if (ret < 0) {
1285 dump_error(s, "dump: failed to write page data", errp);
1286 goto out;
1287 }
1288#endif
1289 } else {
1290 /*
1291 * fall back to save in plaintext, size_out should be
1292 * assigned TARGET_PAGE_SIZE
1293 */
1294 pd.flags = cpu_to_dump32(s, 0);
1295 size_out = TARGET_PAGE_SIZE;
1296 pd.size = cpu_to_dump32(s, size_out);
1297
1298 ret = write_cache(&page_data, buf, TARGET_PAGE_SIZE, false);
1299 if (ret < 0) {
1300 dump_error(s, "dump: failed to write page data", errp);
1301 goto out;
1302 }
1303 }
1304
1305 /* get and write page desc here */
1306 pd.page_flags = cpu_to_dump64(s, 0);
1307 pd.offset = cpu_to_dump64(s, offset_data);
1308 offset_data += size_out;
1309
1310 ret = write_cache(&page_desc, &pd, sizeof(PageDescriptor), false);
1311 if (ret < 0) {
1312 dump_error(s, "dump: failed to write page desc", errp);
1313 goto out;
1314 }
1315 }
1316 }
1317
1318 ret = write_cache(&page_desc, NULL, 0, true);
1319 if (ret < 0) {
1320 dump_error(s, "dump: failed to sync cache for page_desc", errp);
1321 goto out;
1322 }
1323 ret = write_cache(&page_data, NULL, 0, true);
1324 if (ret < 0) {
1325 dump_error(s, "dump: failed to sync cache for page_data", errp);
1326 goto out;
1327 }
1328
1329out:
1330 free_data_cache(&page_desc);
1331 free_data_cache(&page_data);
1332
1333#ifdef CONFIG_LZO
1334 g_free(wrkmem);
1335#endif
1336
1337 g_free(buf_out);
1338}
1339
1340static void create_kdump_vmcore(DumpState *s, Error **errp)
1341{
1342 int ret;
1343 Error *local_err = NULL;
1344
1345 /*
1346 * the kdump-compressed format is:
1347 * File offset
1348 * +------------------------------------------+ 0x0
1349 * | main header (struct disk_dump_header) |
1350 * |------------------------------------------+ block 1
1351 * | sub header (struct kdump_sub_header) |
1352 * |------------------------------------------+ block 2
1353 * | 1st-dump_bitmap |
1354 * |------------------------------------------+ block 2 + X blocks
1355 * | 2nd-dump_bitmap | (aligned by block)
1356 * |------------------------------------------+ block 2 + 2 * X blocks
1357 * | page desc for pfn 0 (struct page_desc) | (aligned by block)
1358 * | page desc for pfn 1 (struct page_desc) |
1359 * | : |
1360 * |------------------------------------------| (not aligned by block)
1361 * | page data (pfn 0) |
1362 * | page data (pfn 1) |
1363 * | : |
1364 * +------------------------------------------+
1365 */
1366
1367 ret = write_start_flat_header(s->fd);
1368 if (ret < 0) {
1369 dump_error(s, "dump: failed to write start flat header", errp);
1370 return;
1371 }
1372
1373 write_dump_header(s, &local_err);
1374 if (local_err) {
1375 error_propagate(errp, local_err);
1376 return;
1377 }
1378
1379 write_dump_bitmap(s, &local_err);
1380 if (local_err) {
1381 error_propagate(errp, local_err);
1382 return;
1383 }
1384
1385 write_dump_pages(s, &local_err);
1386 if (local_err) {
1387 error_propagate(errp, local_err);
1388 return;
1389 }
1390
1391 ret = write_end_flat_header(s->fd);
1392 if (ret < 0) {
1393 dump_error(s, "dump: failed to write end flat header", errp);
1394 return;
1395 }
1396
1397 dump_completed(s);
1398}
1399
1400static ram_addr_t get_start_block(DumpState *s)
1401{
1402 GuestPhysBlock *block;
1403
1404 if (!s->has_filter) {
1405 s->next_block = QTAILQ_FIRST(&s->guest_phys_blocks.head);
1406 return 0;
1407 }
1408
1409 QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) {
1410 if (block->target_start >= s->begin + s->length ||
1411 block->target_end <= s->begin) {
1412 /* This block is out of the range */
1413 continue;
1414 }
1415
1416 s->next_block = block;
1417 if (s->begin > block->target_start) {
1418 s->start = s->begin - block->target_start;
1419 } else {
1420 s->start = 0;
1421 }
1422 return s->start;
1423 }
1424
1425 return -1;
1426}
1427
1428static void get_max_mapnr(DumpState *s)
1429{
1430 GuestPhysBlock *last_block;
1431
1432 last_block = QTAILQ_LAST(&s->guest_phys_blocks.head, GuestPhysBlockHead);
1433 s->max_mapnr = paddr_to_pfn(last_block->target_end);
1434}
1435
1436static void dump_init(DumpState *s, int fd, bool has_format,
1437 DumpGuestMemoryFormat format, bool paging, bool has_filter,
1438 int64_t begin, int64_t length, Error **errp)
1439{
1440 CPUState *cpu;
1441 int nr_cpus;
1442 Error *err = NULL;
1443 int ret;
1444
1445 /* kdump-compressed is conflict with paging and filter */
1446 if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
1447 assert(!paging && !has_filter);
1448 }
1449
1450 if (runstate_is_running()) {
1451 vm_stop(RUN_STATE_SAVE_VM);
1452 s->resume = true;
1453 } else {
1454 s->resume = false;
1455 }
1456
1457 /* If we use KVM, we should synchronize the registers before we get dump
1458 * info or physmap info.
1459 */
1460 cpu_synchronize_all_states();
1461 nr_cpus = 0;
1462 CPU_FOREACH(cpu) {
1463 nr_cpus++;
1464 }
1465
1466 s->fd = fd;
1467 s->has_filter = has_filter;
1468 s->begin = begin;
1469 s->length = length;
1470
1471 memory_mapping_list_init(&s->list);
1472
1473 guest_phys_blocks_init(&s->guest_phys_blocks);
1474 guest_phys_blocks_append(&s->guest_phys_blocks);
1475
1476 s->start = get_start_block(s);
1477 if (s->start == -1) {
1478 error_setg(errp, QERR_INVALID_PARAMETER, "begin");
1479 goto cleanup;
1480 }
1481
1482 /* get dump info: endian, class and architecture.
1483 * If the target architecture is not supported, cpu_get_dump_info() will
1484 * return -1.
1485 */
1486 ret = cpu_get_dump_info(&s->dump_info, &s->guest_phys_blocks);
1487 if (ret < 0) {
1488 error_setg(errp, QERR_UNSUPPORTED);
1489 goto cleanup;
1490 }
1491
1492 s->note_size = cpu_get_note_size(s->dump_info.d_class,
1493 s->dump_info.d_machine, nr_cpus);
1494 if (s->note_size < 0) {
1495 error_setg(errp, QERR_UNSUPPORTED);
1496 goto cleanup;
1497 }
1498
1499 /* get memory mapping */
1500 if (paging) {
1501 qemu_get_guest_memory_mapping(&s->list, &s->guest_phys_blocks, &err);
1502 if (err != NULL) {
1503 error_propagate(errp, err);
1504 goto cleanup;
1505 }
1506 } else {
1507 qemu_get_guest_simple_memory_mapping(&s->list, &s->guest_phys_blocks);
1508 }
1509
1510 s->nr_cpus = nr_cpus;
1511
1512 get_max_mapnr(s);
1513
1514 uint64_t tmp;
1515 tmp = DIV_ROUND_UP(DIV_ROUND_UP(s->max_mapnr, CHAR_BIT), TARGET_PAGE_SIZE);
1516 s->len_dump_bitmap = tmp * TARGET_PAGE_SIZE;
1517
1518 /* init for kdump-compressed format */
1519 if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
1520 switch (format) {
1521 case DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB:
1522 s->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
1523 break;
1524
1525 case DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO:
1526#ifdef CONFIG_LZO
1527 if (lzo_init() != LZO_E_OK) {
1528 error_setg(errp, "failed to initialize the LZO library");
1529 goto cleanup;
1530 }
1531#endif
1532 s->flag_compress = DUMP_DH_COMPRESSED_LZO;
1533 break;
1534
1535 case DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY:
1536 s->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
1537 break;
1538
1539 default:
1540 s->flag_compress = 0;
1541 }
1542
1543 return;
1544 }
1545
1546 if (s->has_filter) {
1547 memory_mapping_filter(&s->list, s->begin, s->length);
1548 }
1549
1550 /*
1551 * calculate phdr_num
1552 *
1553 * the type of ehdr->e_phnum is uint16_t, so we should avoid overflow
1554 */
1555 s->phdr_num = 1; /* PT_NOTE */
1556 if (s->list.num < UINT16_MAX - 2) {
1557 s->phdr_num += s->list.num;
1558 s->have_section = false;
1559 } else {
1560 s->have_section = true;
1561 s->phdr_num = PN_XNUM;
1562 s->sh_info = 1; /* PT_NOTE */
1563
1564 /* the type of shdr->sh_info is uint32_t, so we should avoid overflow */
1565 if (s->list.num <= UINT32_MAX - 1) {
1566 s->sh_info += s->list.num;
1567 } else {
1568 s->sh_info = UINT32_MAX;
1569 }
1570 }
1571
1572 if (s->dump_info.d_class == ELFCLASS64) {
1573 if (s->have_section) {
1574 s->memory_offset = sizeof(Elf64_Ehdr) +
1575 sizeof(Elf64_Phdr) * s->sh_info +
1576 sizeof(Elf64_Shdr) + s->note_size;
1577 } else {
1578 s->memory_offset = sizeof(Elf64_Ehdr) +
1579 sizeof(Elf64_Phdr) * s->phdr_num + s->note_size;
1580 }
1581 } else {
1582 if (s->have_section) {
1583 s->memory_offset = sizeof(Elf32_Ehdr) +
1584 sizeof(Elf32_Phdr) * s->sh_info +
1585 sizeof(Elf32_Shdr) + s->note_size;
1586 } else {
1587 s->memory_offset = sizeof(Elf32_Ehdr) +
1588 sizeof(Elf32_Phdr) * s->phdr_num + s->note_size;
1589 }
1590 }
1591
1592 return;
1593
1594cleanup:
1595 dump_cleanup(s);
1596}
1597
1598void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
1599 int64_t begin, bool has_length,
1600 int64_t length, bool has_format,
1601 DumpGuestMemoryFormat format, Error **errp)
1602{
1603 const char *p;
1604 int fd = -1;
1605 DumpState *s;
1606 Error *local_err = NULL;
1607
1608 /*
1609 * kdump-compressed format need the whole memory dumped, so paging or
1610 * filter is not supported here.
1611 */
1612 if ((has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) &&
1613 (paging || has_begin || has_length)) {
1614 error_setg(errp, "kdump-compressed format doesn't support paging or "
1615 "filter");
1616 return;
1617 }
1618 if (has_begin && !has_length) {
1619 error_setg(errp, QERR_MISSING_PARAMETER, "length");
1620 return;
1621 }
1622 if (!has_begin && has_length) {
1623 error_setg(errp, QERR_MISSING_PARAMETER, "begin");
1624 return;
1625 }
1626
1627 /* check whether lzo/snappy is supported */
1628#ifndef CONFIG_LZO
1629 if (has_format && format == DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO) {
1630 error_setg(errp, "kdump-lzo is not available now");
1631 return;
1632 }
1633#endif
1634
1635#ifndef CONFIG_SNAPPY
1636 if (has_format && format == DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY) {
1637 error_setg(errp, "kdump-snappy is not available now");
1638 return;
1639 }
1640#endif
1641
1642#if !defined(WIN32)
1643 if (strstart(file, "fd:", &p)) {
1644 fd = monitor_get_fd(cur_mon, p, errp);
1645 if (fd == -1) {
1646 return;
1647 }
1648 }
1649#endif
1650
1651 if (strstart(file, "file:", &p)) {
1652 fd = qemu_open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR);
1653 if (fd < 0) {
1654 error_setg_file_open(errp, errno, p);
1655 return;
1656 }
1657 }
1658
1659 if (fd == -1) {
1660 error_setg(errp, QERR_INVALID_PARAMETER, "protocol");
1661 return;
1662 }
1663
1664 s = g_malloc0(sizeof(DumpState));
1665
1666 dump_init(s, fd, has_format, format, paging, has_begin,
1667 begin, length, &local_err);
1668 if (local_err) {
1669 g_free(s);
1670 error_propagate(errp, local_err);
1671 return;
1672 }
1673
1674 if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
1675 create_kdump_vmcore(s, errp);
1676 } else {
1677 create_vmcore(s, errp);
1678 }
1679
1680 g_free(s);
1681}
1682
1683DumpGuestMemoryCapability *qmp_query_dump_guest_memory_capability(Error **errp)
1684{
1685 DumpGuestMemoryFormatList *item;
1686 DumpGuestMemoryCapability *cap =
1687 g_malloc0(sizeof(DumpGuestMemoryCapability));
1688
1689 /* elf is always available */
1690 item = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1691 cap->formats = item;
1692 item->value = DUMP_GUEST_MEMORY_FORMAT_ELF;
1693
1694 /* kdump-zlib is always available */
1695 item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1696 item = item->next;
1697 item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB;
1698
1699 /* add new item if kdump-lzo is available */
1700#ifdef CONFIG_LZO
1701 item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1702 item = item->next;
1703 item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO;
1704#endif
1705
1706 /* add new item if kdump-snappy is available */
1707#ifdef CONFIG_SNAPPY
1708 item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1709 item = item->next;
1710 item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY;
1711#endif
1712
1713 return cap;
1714}
diff --git a/exec.c b/exec.c
0new file mode 1006441715new file mode 100644
index 0000000..0bf0a6e
--- /dev/null
+++ b/exec.c
@@ -0,0 +1,3618 @@
1/*
2 * Virtual page mapping
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 */
19#include "config.h"
20#ifndef _WIN32
21#include <sys/types.h>
22#include <sys/mman.h>
23#endif
24
25#include "qemu-common.h"
26#include "cpu.h"
27#include "tcg.h"
28#include "hw/hw.h"
29#if !defined(CONFIG_USER_ONLY)
30#include "hw/boards.h"
31#endif
32#include "hw/qdev.h"
33#include "qemu/osdep.h"
34#include "sysemu/kvm.h"
35#include "sysemu/sysemu.h"
36#include "hw/xen/xen.h"
37#include "qemu/timer.h"
38#include "qemu/config-file.h"
39#include "qemu/error-report.h"
40#include "exec/memory.h"
41#include "sysemu/dma.h"
42#include "exec/address-spaces.h"
43#if defined(CONFIG_USER_ONLY)
44#include <qemu.h>
45#else /* !CONFIG_USER_ONLY */
46#include "sysemu/xen-mapcache.h"
47#include "trace.h"
48#endif
49#include "exec/cpu-all.h"
50#include "qemu/rcu_queue.h"
51#include "qemu/main-loop.h"
52#include "translate-all.h"
53#include "sysemu/replay.h"
54
55#include "exec/memory-internal.h"
56#include "exec/ram_addr.h"
57
58#include "qemu/range.h"
59#ifndef _WIN32
60#include "qemu/mmap-alloc.h"
61#endif
62
63//#define DEBUG_SUBPAGE
64
65#if !defined(CONFIG_USER_ONLY)
66/* ram_list is read under rcu_read_lock()/rcu_read_unlock(). Writes
67 * are protected by the ramlist lock.
68 */
69RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list.blocks) };
70
71static MemoryRegion *system_memory;
72static MemoryRegion *system_io;
73
74AddressSpace address_space_io;
75AddressSpace address_space_memory;
76
77MemoryRegion io_mem_rom, io_mem_notdirty;
78static MemoryRegion io_mem_unassigned;
79
80/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
81#define RAM_PREALLOC (1 << 0)
82
83/* RAM is mmap-ed with MAP_SHARED */
84#define RAM_SHARED (1 << 1)
85
86/* Only a portion of RAM (used_length) is actually used, and migrated.
87 * This used_length size can change across reboots.
88 */
89#define RAM_RESIZEABLE (1 << 2)
90
91/* RAM is backed by an mmapped file.
92 */
93#define RAM_FILE (1 << 3)
94#endif
95
96struct CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
97/* current CPU in the current thread. It is only valid inside
98 cpu_exec() */
99__thread CPUState *current_cpu;
100/* 0 = Do not count executed instructions.
101 1 = Precise instruction counting.
102 2 = Adaptive rate instruction counting. */
103int use_icount;
104
105#if !defined(CONFIG_USER_ONLY)
106
107typedef struct PhysPageEntry PhysPageEntry;
108
109struct PhysPageEntry {
110 /* How many bits skip to next level (in units of L2_SIZE). 0 for a leaf. */
111 uint32_t skip : 6;
112 /* index into phys_sections (!skip) or phys_map_nodes (skip) */
113 uint32_t ptr : 26;
114};
115
116#define PHYS_MAP_NODE_NIL (((uint32_t)~0) >> 6)
117
118/* Size of the L2 (and L3, etc) page tables. */
119#define ADDR_SPACE_BITS 64
120
121#define P_L2_BITS 9
122#define P_L2_SIZE (1 << P_L2_BITS)
123
124#define P_L2_LEVELS (((ADDR_SPACE_BITS - TARGET_PAGE_BITS - 1) / P_L2_BITS) + 1)
125
126typedef PhysPageEntry Node[P_L2_SIZE];
127
128typedef struct PhysPageMap {
129 struct rcu_head rcu;
130
131 unsigned sections_nb;
132 unsigned sections_nb_alloc;
133 unsigned nodes_nb;
134 unsigned nodes_nb_alloc;
135 Node *nodes;
136 MemoryRegionSection *sections;
137} PhysPageMap;
138
139struct AddressSpaceDispatch {
140 struct rcu_head rcu;
141
142 /* This is a multi-level map on the physical address space.
143 * The bottom level has pointers to MemoryRegionSections.
144 */
145 PhysPageEntry phys_map;
146 PhysPageMap map;
147 AddressSpace *as;
148};
149
150#define SUBPAGE_IDX(addr) ((addr) & ~TARGET_PAGE_MASK)
151typedef struct subpage_t {
152 MemoryRegion iomem;
153 AddressSpace *as;
154 hwaddr base;
155 uint16_t sub_section[TARGET_PAGE_SIZE];
156} subpage_t;
157
158#define PHYS_SECTION_UNASSIGNED 0
159#define PHYS_SECTION_NOTDIRTY 1
160#define PHYS_SECTION_ROM 2
161#define PHYS_SECTION_WATCH 3
162
163static void io_mem_init(void);
164static void memory_map_init(void);
165static void tcg_commit(MemoryListener *listener);
166
167static MemoryRegion io_mem_watch;
168
169/**
170 * CPUAddressSpace: all the information a CPU needs about an AddressSpace
171 * @cpu: the CPU whose AddressSpace this is
172 * @as: the AddressSpace itself
173 * @memory_dispatch: its dispatch pointer (cached, RCU protected)
174 * @tcg_as_listener: listener for tracking changes to the AddressSpace
175 */
176struct CPUAddressSpace {
177 CPUState *cpu;
178 AddressSpace *as;
179 struct AddressSpaceDispatch *memory_dispatch;
180 MemoryListener tcg_as_listener;
181};
182
183#endif
184
185#if !defined(CONFIG_USER_ONLY)
186
187static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
188{
189 if (map->nodes_nb + nodes > map->nodes_nb_alloc) {
190 map->nodes_nb_alloc = MAX(map->nodes_nb_alloc * 2, 16);
191 map->nodes_nb_alloc = MAX(map->nodes_nb_alloc, map->nodes_nb + nodes);
192 map->nodes = g_renew(Node, map->nodes, map->nodes_nb_alloc);
193 }
194}
195
196static uint32_t phys_map_node_alloc(PhysPageMap *map, bool leaf)
197{
198 unsigned i;
199 uint32_t ret;
200 PhysPageEntry e;
201 PhysPageEntry *p;
202
203 ret = map->nodes_nb++;
204 p = map->nodes[ret];
205 assert(ret != PHYS_MAP_NODE_NIL);
206 assert(ret != map->nodes_nb_alloc);
207
208 e.skip = leaf ? 0 : 1;
209 e.ptr = leaf ? PHYS_SECTION_UNASSIGNED : PHYS_MAP_NODE_NIL;
210 for (i = 0; i < P_L2_SIZE; ++i) {
211 memcpy(&p[i], &e, sizeof(e));
212 }
213 return ret;
214}
215
216static void phys_page_set_level(PhysPageMap *map, PhysPageEntry *lp,
217 hwaddr *index, hwaddr *nb, uint16_t leaf,
218 int level)
219{
220 PhysPageEntry *p;
221 hwaddr step = (hwaddr)1 << (level * P_L2_BITS);
222
223 if (lp->skip && lp->ptr == PHYS_MAP_NODE_NIL) {
224 lp->ptr = phys_map_node_alloc(map, level == 0);
225 }
226 p = map->nodes[lp->ptr];
227 lp = &p[(*index >> (level * P_L2_BITS)) & (P_L2_SIZE - 1)];
228
229 while (*nb && lp < &p[P_L2_SIZE]) {
230 if ((*index & (step - 1)) == 0 && *nb >= step) {
231 lp->skip = 0;
232 lp->ptr = leaf;
233 *index += step;
234 *nb -= step;
235 } else {
236 phys_page_set_level(map, lp, index, nb, leaf, level - 1);
237 }
238 ++lp;
239 }
240}
241
242static void phys_page_set(AddressSpaceDispatch *d,
243 hwaddr index, hwaddr nb,
244 uint16_t leaf)
245{
246 /* Wildly overreserve - it doesn't matter much. */
247 phys_map_node_reserve(&d->map, 3 * P_L2_LEVELS);
248
249 phys_page_set_level(&d->map, &d->phys_map, &index, &nb, leaf, P_L2_LEVELS - 1);
250}
251
252/* Compact a non leaf page entry. Simply detect that the entry has a single child,
253 * and update our entry so we can skip it and go directly to the destination.
254 */
255static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned long *compacted)
256{
257 unsigned valid_ptr = P_L2_SIZE;
258 int valid = 0;
259 PhysPageEntry *p;
260 int i;
261
262 if (lp->ptr == PHYS_MAP_NODE_NIL) {
263 return;
264 }
265
266 p = nodes[lp->ptr];
267 for (i = 0; i < P_L2_SIZE; i++) {
268 if (p[i].ptr == PHYS_MAP_NODE_NIL) {
269 continue;
270 }
271
272 valid_ptr = i;
273 valid++;
274 if (p[i].skip) {
275 phys_page_compact(&p[i], nodes, compacted);
276 }
277 }
278
279 /* We can only compress if there's only one child. */
280 if (valid != 1) {
281 return;
282 }
283
284 assert(valid_ptr < P_L2_SIZE);
285
286 /* Don't compress if it won't fit in the # of bits we have. */
287 if (lp->skip + p[valid_ptr].skip >= (1 << 3)) {
288 return;
289 }
290
291 lp->ptr = p[valid_ptr].ptr;
292 if (!p[valid_ptr].skip) {
293 /* If our only child is a leaf, make this a leaf. */
294 /* By design, we should have made this node a leaf to begin with so we
295 * should never reach here.
296 * But since it's so simple to handle this, let's do it just in case we
297 * change this rule.
298 */
299 lp->skip = 0;
300 } else {
301 lp->skip += p[valid_ptr].skip;
302 }
303}
304
305static void phys_page_compact_all(AddressSpaceDispatch *d, int nodes_nb)
306{
307 DECLARE_BITMAP(compacted, nodes_nb);
308
309 if (d->phys_map.skip) {
310 phys_page_compact(&d->phys_map, d->map.nodes, compacted);
311 }
312}
313
314static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr,
315 Node *nodes, MemoryRegionSection *sections)
316{
317 PhysPageEntry *p;
318 hwaddr index = addr >> TARGET_PAGE_BITS;
319 int i;
320
321 for (i = P_L2_LEVELS; lp.skip && (i -= lp.skip) >= 0;) {
322 if (lp.ptr == PHYS_MAP_NODE_NIL) {
323 return &sections[PHYS_SECTION_UNASSIGNED];
324 }
325 p = nodes[lp.ptr];
326 lp = p[(index >> (i * P_L2_BITS)) & (P_L2_SIZE - 1)];
327 }
328
329 if (sections[lp.ptr].size.hi ||
330 range_covers_byte(sections[lp.ptr].offset_within_address_space,
331 sections[lp.ptr].size.lo, addr)) {
332 return &sections[lp.ptr];
333 } else {
334 return &sections[PHYS_SECTION_UNASSIGNED];
335 }
336}
337
338bool memory_region_is_unassigned(MemoryRegion *mr)
339{
340 return mr != &io_mem_rom && mr != &io_mem_notdirty && !mr->rom_device
341 && mr != &io_mem_watch;
342}
343
344/* Called from RCU critical section */
345static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,
346 hwaddr addr,
347 bool resolve_subpage)
348{
349 MemoryRegionSection *section;
350 subpage_t *subpage;
351
352 section = phys_page_find(d->phys_map, addr, d->map.nodes, d->map.sections);
353 if (resolve_subpage && section->mr->subpage) {
354 subpage = container_of(section->mr, subpage_t, iomem);
355 section = &d->map.sections[subpage->sub_section[SUBPAGE_IDX(addr)]];
356 }
357 return section;
358}
359
360/* Called from RCU critical section */
361static MemoryRegionSection *
362address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *xlat,
363 hwaddr *plen, bool resolve_subpage)
364{
365 MemoryRegionSection *section;
366 MemoryRegion *mr;
367 Int128 diff;
368
369 section = address_space_lookup_region(d, addr, resolve_subpage);
370 /* Compute offset within MemoryRegionSection */
371 addr -= section->offset_within_address_space;
372
373 /* Compute offset within MemoryRegion */
374 *xlat = addr + section->offset_within_region;
375
376 mr = section->mr;
377
378 /* MMIO registers can be expected to perform full-width accesses based only
379 * on their address, without considering adjacent registers that could
380 * decode to completely different MemoryRegions. When such registers
381 * exist (e.g. I/O ports 0xcf8 and 0xcf9 on most PC chipsets), MMIO
382 * regions overlap wildly. For this reason we cannot clamp the accesses
383 * here.
384 *
385 * If the length is small (as is the case for address_space_ldl/stl),
386 * everything works fine. If the incoming length is large, however,
387 * the caller really has to do the clamping through memory_access_size.
388 */
389 if (memory_region_is_ram(mr)) {
390 diff = int128_sub(section->size, int128_make64(addr));
391 *plen = int128_get64(int128_min(diff, int128_make64(*plen)));
392 }
393 return section;
394}
395
396static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
397{
398 if (memory_region_is_ram(mr)) {
399 return !(is_write && mr->readonly);
400 }
401 if (memory_region_is_romd(mr)) {
402 return !is_write;
403 }
404
405 return false;
406}
407
408/* Called from RCU critical section */
409MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
410 hwaddr *xlat, hwaddr *plen,
411 bool is_write)
412{
413 IOMMUTLBEntry iotlb;
414 MemoryRegionSection *section;
415 MemoryRegion *mr;
416
417 for (;;) {
418 AddressSpaceDispatch *d = atomic_rcu_read(&as->dispatch);
419 section = address_space_translate_internal(d, addr, &addr, plen, true);
420 mr = section->mr;
421
422 if (!mr->iommu_ops) {
423 break;
424 }
425
426 iotlb = mr->iommu_ops->translate(mr, addr, is_write);
427 addr = ((iotlb.translated_addr & ~iotlb.addr_mask)
428 | (addr & iotlb.addr_mask));
429 *plen = MIN(*plen, (addr | iotlb.addr_mask) - addr + 1);
430 if (!(iotlb.perm & (1 << is_write))) {
431 mr = &io_mem_unassigned;
432 break;
433 }
434
435 as = iotlb.target_as;
436 }
437
438 if (xen_enabled() && memory_access_is_direct(mr, is_write)) {
439 hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
440 *plen = MIN(page, *plen);
441 }
442
443 *xlat = addr;
444 return mr;
445}
446
447/* Called from RCU critical section */
448MemoryRegionSection *
449address_space_translate_for_iotlb(CPUState *cpu, hwaddr addr,
450 hwaddr *xlat, hwaddr *plen)
451{
452 MemoryRegionSection *section;
453 section = address_space_translate_internal(cpu->cpu_ases[0].memory_dispatch,
454 addr, xlat, plen, false);
455
456 assert(!section->mr->iommu_ops);
457 return section;
458}
459#endif
460
461#if !defined(CONFIG_USER_ONLY)
462
463static int cpu_common_post_load(void *opaque, int version_id)
464{
465 CPUState *cpu = opaque;
466
467 /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the
468 version_id is increased. */
469 cpu->interrupt_request &= ~0x01;
470 tlb_flush(cpu, 1);
471
472 return 0;
473}
474
475static int cpu_common_pre_load(void *opaque)
476{
477 CPUState *cpu = opaque;
478
479 cpu->exception_index = -1;
480
481 return 0;
482}
483
484static bool cpu_common_exception_index_needed(void *opaque)
485{
486 CPUState *cpu = opaque;
487
488 return tcg_enabled() && cpu->exception_index != -1;
489}
490
491static const VMStateDescription vmstate_cpu_common_exception_index = {
492 .name = "cpu_common/exception_index",
493 .version_id = 1,
494 .minimum_version_id = 1,
495 .needed = cpu_common_exception_index_needed,
496 .fields = (VMStateField[]) {
497 VMSTATE_INT32(exception_index, CPUState),
498 VMSTATE_END_OF_LIST()
499 }
500};
501
502static bool cpu_common_crash_occurred_needed(void *opaque)
503{
504 CPUState *cpu = opaque;
505
506 return cpu->crash_occurred;
507}
508
509static const VMStateDescription vmstate_cpu_common_crash_occurred = {
510 .name = "cpu_common/crash_occurred",
511 .version_id = 1,
512 .minimum_version_id = 1,
513 .needed = cpu_common_crash_occurred_needed,
514 .fields = (VMStateField[]) {
515 VMSTATE_BOOL(crash_occurred, CPUState),
516 VMSTATE_END_OF_LIST()
517 }
518};
519
520const VMStateDescription vmstate_cpu_common = {
521 .name = "cpu_common",
522 .version_id = 1,
523 .minimum_version_id = 1,
524 .pre_load = cpu_common_pre_load,
525 .post_load = cpu_common_post_load,
526 .fields = (VMStateField[]) {
527 VMSTATE_UINT32(halted, CPUState),
528 VMSTATE_UINT32(interrupt_request, CPUState),
529 VMSTATE_END_OF_LIST()
530 },
531 .subsections = (const VMStateDescription*[]) {
532 &vmstate_cpu_common_exception_index,
533 &vmstate_cpu_common_crash_occurred,
534 NULL
535 }
536};
537
538#endif
539
540CPUState *qemu_get_cpu(int index)
541{
542 CPUState *cpu;
543
544 CPU_FOREACH(cpu) {
545 if (cpu->cpu_index == index) {
546 return cpu;
547 }
548 }
549
550 return NULL;
551}
552
553#if !defined(CONFIG_USER_ONLY)
554void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as)
555{
556 /* We only support one address space per cpu at the moment. */
557 assert(cpu->as == as);
558
559 if (cpu->cpu_ases) {
560 /* We've already registered the listener for our only AS */
561 return;
562 }
563
564 cpu->cpu_ases = g_new0(CPUAddressSpace, 1);
565 cpu->cpu_ases[0].cpu = cpu;
566 cpu->cpu_ases[0].as = as;
567 cpu->cpu_ases[0].tcg_as_listener.commit = tcg_commit;
568 memory_listener_register(&cpu->cpu_ases[0].tcg_as_listener, as);
569}
570#endif
571
572#ifndef CONFIG_USER_ONLY
573static DECLARE_BITMAP(cpu_index_map, MAX_CPUMASK_BITS);
574
575static int cpu_get_free_index(Error **errp)
576{
577 int cpu = find_first_zero_bit(cpu_index_map, MAX_CPUMASK_BITS);
578
579 if (cpu >= MAX_CPUMASK_BITS) {
580 error_setg(errp, "Trying to use more CPUs than max of %d",
581 MAX_CPUMASK_BITS);
582 return -1;
583 }
584
585 bitmap_set(cpu_index_map, cpu, 1);
586 return cpu;
587}
588
589void cpu_exec_exit(CPUState *cpu)
590{
591 if (cpu->cpu_index == -1) {
592 /* cpu_index was never allocated by this @cpu or was already freed. */
593 return;
594 }
595
596 bitmap_clear(cpu_index_map, cpu->cpu_index, 1);
597 cpu->cpu_index = -1;
598}
599#else
600
601static int cpu_get_free_index(Error **errp)
602{
603 CPUState *some_cpu;
604 int cpu_index = 0;
605
606 CPU_FOREACH(some_cpu) {
607 cpu_index++;
608 }
609 return cpu_index;
610}
611
612void cpu_exec_exit(CPUState *cpu)
613{
614}
615#endif
616
617void cpu_exec_init(CPUState *cpu, Error **errp)
618{
619 CPUClass *cc = CPU_GET_CLASS(cpu);
620 int cpu_index;
621 Error *local_err = NULL;
622
623#ifndef CONFIG_USER_ONLY
624 cpu->as = &address_space_memory;
625 cpu->thread_id = qemu_get_thread_id();
626#endif
627
628#if defined(CONFIG_USER_ONLY)
629 cpu_list_lock();
630#endif
631 cpu_index = cpu->cpu_index = cpu_get_free_index(&local_err);
632 if (local_err) {
633 error_propagate(errp, local_err);
634#if defined(CONFIG_USER_ONLY)
635 cpu_list_unlock();
636#endif
637 return;
638 }
639 QTAILQ_INSERT_TAIL(&cpus, cpu, node);
640#if defined(CONFIG_USER_ONLY)
641 cpu_list_unlock();
642#endif
643 if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
644 vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu);
645 }
646#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
647 register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,
648 cpu_save, cpu_load, cpu->env_ptr);
649 assert(cc->vmsd == NULL);
650 assert(qdev_get_vmsd(DEVICE(cpu)) == NULL);
651#endif
652 if (cc->vmsd != NULL) {
653 vmstate_register(NULL, cpu_index, cc->vmsd, cpu);
654 }
655}
656
657#if defined(CONFIG_USER_ONLY)
658static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
659{
660 tb_invalidate_phys_page_range(pc, pc + 1, 0);
661}
662#else
663static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
664{
665 hwaddr phys = cpu_get_phys_page_debug(cpu, pc);
666 if (phys != -1) {
667 tb_invalidate_phys_addr(cpu->as,
668 phys | (pc & ~TARGET_PAGE_MASK));
669 }
670}
671#endif
672
673#if defined(CONFIG_USER_ONLY)
674void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
675
676{
677}
678
679int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len,
680 int flags)
681{
682 return -ENOSYS;
683}
684
685void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint)
686{
687}
688
689int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
690 int flags, CPUWatchpoint **watchpoint)
691{
692 return -ENOSYS;
693}
694#else
695/* Add a watchpoint. */
696int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
697 int flags, CPUWatchpoint **watchpoint)
698{
699 CPUWatchpoint *wp;
700
701 /* forbid ranges which are empty or run off the end of the address space */
702 if (len == 0 || (addr + len - 1) < addr) {
703 error_report("tried to set invalid watchpoint at %"
704 VADDR_PRIx ", len=%" VADDR_PRIu, addr, len);
705 return -EINVAL;
706 }
707 wp = g_malloc(sizeof(*wp));
708
709 wp->vaddr = addr;
710 wp->len = len;
711 wp->flags = flags;
712
713 /* keep all GDB-injected watchpoints in front */
714 if (flags & BP_GDB) {
715 QTAILQ_INSERT_HEAD(&cpu->watchpoints, wp, entry);
716 } else {
717 QTAILQ_INSERT_TAIL(&cpu->watchpoints, wp, entry);
718 }
719
720 tlb_flush_page(cpu, addr);
721
722 if (watchpoint)
723 *watchpoint = wp;
724 return 0;
725}
726
727/* Remove a specific watchpoint. */
728int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len,
729 int flags)
730{
731 CPUWatchpoint *wp;
732
733 QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
734 if (addr == wp->vaddr && len == wp->len
735 && flags == (wp->flags & ~BP_WATCHPOINT_HIT)) {
736 cpu_watchpoint_remove_by_ref(cpu, wp);
737 return 0;
738 }
739 }
740 return -ENOENT;
741}
742
743/* Remove a specific watchpoint by reference. */
744void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint)
745{
746 QTAILQ_REMOVE(&cpu->watchpoints, watchpoint, entry);
747
748 tlb_flush_page(cpu, watchpoint->vaddr);
749
750 g_free(watchpoint);
751}
752
753/* Remove all matching watchpoints. */
754void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
755{
756 CPUWatchpoint *wp, *next;
757
758 QTAILQ_FOREACH_SAFE(wp, &cpu->watchpoints, entry, next) {
759 if (wp->flags & mask) {
760 cpu_watchpoint_remove_by_ref(cpu, wp);
761 }
762 }
763}
764
765/* Return true if this watchpoint address matches the specified
766 * access (ie the address range covered by the watchpoint overlaps
767 * partially or completely with the address range covered by the
768 * access).
769 */
770static inline bool cpu_watchpoint_address_matches(CPUWatchpoint *wp,
771 vaddr addr,
772 vaddr len)
773{
774 /* We know the lengths are non-zero, but a little caution is
775 * required to avoid errors in the case where the range ends
776 * exactly at the top of the address space and so addr + len
777 * wraps round to zero.
778 */
779 vaddr wpend = wp->vaddr + wp->len - 1;
780 vaddr addrend = addr + len - 1;
781
782 return !(addr > wpend || wp->vaddr > addrend);
783}
784
785#endif
786
787/* Add a breakpoint. */
788int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
789 CPUBreakpoint **breakpoint)
790{
791 CPUBreakpoint *bp;
792
793 bp = g_malloc(sizeof(*bp));
794
795 bp->pc = pc;
796 bp->flags = flags;
797
798 /* keep all GDB-injected breakpoints in front */
799 if (flags & BP_GDB) {
800 QTAILQ_INSERT_HEAD(&cpu->breakpoints, bp, entry);
801 } else {
802 QTAILQ_INSERT_TAIL(&cpu->breakpoints, bp, entry);
803 }
804
805 breakpoint_invalidate(cpu, pc);
806
807 if (breakpoint) {
808 *breakpoint = bp;
809 }
810 return 0;
811}
812
813/* Remove a specific breakpoint. */
814int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)
815{
816 CPUBreakpoint *bp;
817
818 QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
819 if (bp->pc == pc && bp->flags == flags) {
820 cpu_breakpoint_remove_by_ref(cpu, bp);
821 return 0;
822 }
823 }
824 return -ENOENT;
825}
826
827/* Remove a specific breakpoint by reference. */
828void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint)
829{
830 QTAILQ_REMOVE(&cpu->breakpoints, breakpoint, entry);
831
832 breakpoint_invalidate(cpu, breakpoint->pc);
833
834 g_free(breakpoint);
835}
836
837/* Remove all matching breakpoints. */
838void cpu_breakpoint_remove_all(CPUState *cpu, int mask)
839{
840 CPUBreakpoint *bp, *next;
841
842 QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) {
843 if (bp->flags & mask) {
844 cpu_breakpoint_remove_by_ref(cpu, bp);
845 }
846 }
847}
848
849/* enable or disable single step mode. EXCP_DEBUG is returned by the
850 CPU loop after each instruction */
851void cpu_single_step(CPUState *cpu, int enabled)
852{
853 if (cpu->singlestep_enabled != enabled) {
854 cpu->singlestep_enabled = enabled;
855 if (kvm_enabled()) {
856 kvm_update_guest_debug(cpu, 0);
857 } else {
858 /* must flush all the translated code to avoid inconsistencies */
859 /* XXX: only flush what is necessary */
860 tb_flush(cpu);
861 }
862 }
863}
864
865void cpu_abort(CPUState *cpu, const char *fmt, ...)
866{
867 va_list ap;
868 va_list ap2;
869
870 va_start(ap, fmt);
871 va_copy(ap2, ap);
872 fprintf(stderr, "qemu: fatal: ");
873 vfprintf(stderr, fmt, ap);
874 fprintf(stderr, "\n");
875 cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
876 if (qemu_log_enabled()) {
877 qemu_log("qemu: fatal: ");
878 qemu_log_vprintf(fmt, ap2);
879 qemu_log("\n");
880 log_cpu_state(cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP);
881 qemu_log_flush();
882 qemu_log_close();
883 }
884 va_end(ap2);
885 va_end(ap);
886 replay_finish();
887#if defined(CONFIG_USER_ONLY)
888 {
889 struct sigaction act;
890 sigfillset(&act.sa_mask);
891 act.sa_handler = SIG_DFL;
892 sigaction(SIGABRT, &act, NULL);
893 }
894#endif
895 abort();
896}
897
898#if !defined(CONFIG_USER_ONLY)
899/* Called from RCU critical section */
900static RAMBlock *qemu_get_ram_block(ram_addr_t addr)
901{
902 RAMBlock *block;
903
904 block = atomic_rcu_read(&ram_list.mru_block);
905 if (block && addr - block->offset < block->max_length) {
906 return block;
907 }
908 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
909 if (addr - block->offset < block->max_length) {
910 goto found;
911 }
912 }
913
914 fprintf(stderr, "Bad ram offset %" PRIx64 "\n", (uint64_t)addr);
915 abort();
916
917found:
918 /* It is safe to write mru_block outside the iothread lock. This
919 * is what happens:
920 *
921 * mru_block = xxx
922 * rcu_read_unlock()
923 * xxx removed from list
924 * rcu_read_lock()
925 * read mru_block
926 * mru_block = NULL;
927 * call_rcu(reclaim_ramblock, xxx);
928 * rcu_read_unlock()
929 *
930 * atomic_rcu_set is not needed here. The block was already published
931 * when it was placed into the list. Here we're just making an extra
932 * copy of the pointer.
933 */
934 ram_list.mru_block = block;
935 return block;
936}
937
938static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length)
939{
940 CPUState *cpu;
941 ram_addr_t start1;
942 RAMBlock *block;
943 ram_addr_t end;
944
945 end = TARGET_PAGE_ALIGN(start + length);
946 start &= TARGET_PAGE_MASK;
947
948 rcu_read_lock();
949 block = qemu_get_ram_block(start);
950 assert(block == qemu_get_ram_block(end - 1));
951 start1 = (uintptr_t)ramblock_ptr(block, start - block->offset);
952 CPU_FOREACH(cpu) {
953 tlb_reset_dirty(cpu, start1, length);
954 }
955 rcu_read_unlock();
956}
957
958/* Note: start and end must be within the same ram block. */
959bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start,
960 ram_addr_t length,
961 unsigned client)
962{
963 unsigned long end, page;
964 bool dirty;
965
966 if (length == 0) {
967 return false;
968 }
969
970 end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
971 page = start >> TARGET_PAGE_BITS;
972 dirty = bitmap_test_and_clear_atomic(ram_list.dirty_memory[client],
973 page, end - page);
974
975 if (dirty && tcg_enabled()) {
976 tlb_reset_dirty_range_all(start, length);
977 }
978
979 return dirty;
980}
981
982/* Called from RCU critical section */
983hwaddr memory_region_section_get_iotlb(CPUState *cpu,
984 MemoryRegionSection *section,
985 target_ulong vaddr,
986 hwaddr paddr, hwaddr xlat,
987 int prot,
988 target_ulong *address)
989{
990 hwaddr iotlb;
991 CPUWatchpoint *wp;
992
993 if (memory_region_is_ram(section->mr)) {
994 /* Normal RAM. */
995 iotlb = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)
996 + xlat;
997 if (!section->readonly) {
998 iotlb |= PHYS_SECTION_NOTDIRTY;
999 } else {
1000 iotlb |= PHYS_SECTION_ROM;
1001 }
1002 } else {
1003 AddressSpaceDispatch *d;
1004
1005 d = atomic_rcu_read(&section->address_space->dispatch);
1006 iotlb = section - d->map.sections;
1007 iotlb += xlat;
1008 }
1009
1010 /* Make accesses to pages with watchpoints go via the
1011 watchpoint trap routines. */
1012 QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
1013 if (cpu_watchpoint_address_matches(wp, vaddr, TARGET_PAGE_SIZE)) {
1014 /* Avoid trapping reads of pages with a write breakpoint. */
1015 if ((prot & PAGE_WRITE) || (wp->flags & BP_MEM_READ)) {
1016 iotlb = PHYS_SECTION_WATCH + paddr;
1017 *address |= TLB_MMIO;
1018 break;
1019 }
1020 }
1021 }
1022
1023 return iotlb;
1024}
1025#endif /* defined(CONFIG_USER_ONLY) */
1026
1027#if !defined(CONFIG_USER_ONLY)
1028
1029static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
1030 uint16_t section);
1031static subpage_t *subpage_init(AddressSpace *as, hwaddr base);
1032
1033static void *(*phys_mem_alloc)(size_t size, uint64_t *align) =
1034 qemu_anon_ram_alloc;
1035
1036/*
1037 * Set a custom physical guest memory alloator.
1038 * Accelerators with unusual needs may need this. Hopefully, we can
1039 * get rid of it eventually.
1040 */
1041void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align))
1042{
1043 phys_mem_alloc = alloc;
1044}
1045
1046static uint16_t phys_section_add(PhysPageMap *map,
1047 MemoryRegionSection *section)
1048{
1049 /* The physical section number is ORed with a page-aligned
1050 * pointer to produce the iotlb entries. Thus it should
1051 * never overflow into the page-aligned value.
1052 */
1053 assert(map->sections_nb < TARGET_PAGE_SIZE);
1054
1055 if (map->sections_nb == map->sections_nb_alloc) {
1056 map->sections_nb_alloc = MAX(map->sections_nb_alloc * 2, 16);
1057 map->sections = g_renew(MemoryRegionSection, map->sections,
1058 map->sections_nb_alloc);
1059 }
1060 map->sections[map->sections_nb] = *section;
1061 memory_region_ref(section->mr);
1062 return map->sections_nb++;
1063}
1064
1065static void phys_section_destroy(MemoryRegion *mr)
1066{
1067 bool have_sub_page = mr->subpage;
1068
1069 memory_region_unref(mr);
1070
1071 if (have_sub_page) {
1072 subpage_t *subpage = container_of(mr, subpage_t, iomem);
1073 object_unref(OBJECT(&subpage->iomem));
1074 g_free(subpage);
1075 }
1076}
1077
1078static void phys_sections_free(PhysPageMap *map)
1079{
1080 while (map->sections_nb > 0) {
1081 MemoryRegionSection *section = &map->sections[--map->sections_nb];
1082 phys_section_destroy(section->mr);
1083 }
1084 g_free(map->sections);
1085 g_free(map->nodes);
1086}
1087
1088static void register_subpage(AddressSpaceDispatch *d, MemoryRegionSection *section)
1089{
1090 subpage_t *subpage;
1091 hwaddr base = section->offset_within_address_space
1092 & TARGET_PAGE_MASK;
1093 MemoryRegionSection *existing = phys_page_find(d->phys_map, base,
1094 d->map.nodes, d->map.sections);
1095 MemoryRegionSection subsection = {
1096 .offset_within_address_space = base,
1097 .size = int128_make64(TARGET_PAGE_SIZE),
1098 };
1099 hwaddr start, end;
1100
1101 assert(existing->mr->subpage || existing->mr == &io_mem_unassigned);
1102
1103 if (!(existing->mr->subpage)) {
1104 subpage = subpage_init(d->as, base);
1105 subsection.address_space = d->as;
1106 subsection.mr = &subpage->iomem;
1107 phys_page_set(d, base >> TARGET_PAGE_BITS, 1,
1108 phys_section_add(&d->map, &subsection));
1109 } else {
1110 subpage = container_of(existing->mr, subpage_t, iomem);
1111 }
1112 start = section->offset_within_address_space & ~TARGET_PAGE_MASK;
1113 end = start + int128_get64(section->size) - 1;
1114 subpage_register(subpage, start, end,
1115 phys_section_add(&d->map, section));
1116}
1117
1118
1119static void register_multipage(AddressSpaceDispatch *d,
1120 MemoryRegionSection *section)
1121{
1122 hwaddr start_addr = section->offset_within_address_space;
1123 uint16_t section_index = phys_section_add(&d->map, section);
1124 uint64_t num_pages = int128_get64(int128_rshift(section->size,
1125 TARGET_PAGE_BITS));
1126
1127 assert(num_pages);
1128 phys_page_set(d, start_addr >> TARGET_PAGE_BITS, num_pages, section_index);
1129}
1130
1131static void mem_add(MemoryListener *listener, MemoryRegionSection *section)
1132{
1133 AddressSpace *as = container_of(listener, AddressSpace, dispatch_listener);
1134 AddressSpaceDispatch *d = as->next_dispatch;
1135 MemoryRegionSection now = *section, remain = *section;
1136 Int128 page_size = int128_make64(TARGET_PAGE_SIZE);
1137
1138 if (now.offset_within_address_space & ~TARGET_PAGE_MASK) {
1139 uint64_t left = TARGET_PAGE_ALIGN(now.offset_within_address_space)
1140 - now.offset_within_address_space;
1141
1142 now.size = int128_min(int128_make64(left), now.size);
1143 register_subpage(d, &now);
1144 } else {
1145 now.size = int128_zero();
1146 }
1147 while (int128_ne(remain.size, now.size)) {
1148 remain.size = int128_sub(remain.size, now.size);
1149 remain.offset_within_address_space += int128_get64(now.size);
1150 remain.offset_within_region += int128_get64(now.size);
1151 now = remain;
1152 if (int128_lt(remain.size, page_size)) {
1153 register_subpage(d, &now);
1154 } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) {
1155 now.size = page_size;
1156 register_subpage(d, &now);
1157 } else {
1158 now.size = int128_and(now.size, int128_neg(page_size));
1159 register_multipage(d, &now);
1160 }
1161 }
1162}
1163
1164void qemu_flush_coalesced_mmio_buffer(void)
1165{
1166 if (kvm_enabled())
1167 kvm_flush_coalesced_mmio_buffer();
1168}
1169
1170void qemu_mutex_lock_ramlist(void)
1171{
1172 qemu_mutex_lock(&ram_list.mutex);
1173}
1174
1175void qemu_mutex_unlock_ramlist(void)
1176{
1177 qemu_mutex_unlock(&ram_list.mutex);
1178}
1179
1180#ifdef __linux__
1181
1182#include <sys/vfs.h>
1183
1184#define HUGETLBFS_MAGIC 0x958458f6
1185
1186static long gethugepagesize(const char *path, Error **errp)
1187{
1188 struct statfs fs;
1189 int ret;
1190
1191 do {
1192 ret = statfs(path, &fs);
1193 } while (ret != 0 && errno == EINTR);
1194
1195 if (ret != 0) {
1196 error_setg_errno(errp, errno, "failed to get page size of file %s",
1197 path);
1198 return 0;
1199 }
1200
1201 return fs.f_bsize;
1202}
1203
1204static void *file_ram_alloc(RAMBlock *block,
1205 ram_addr_t memory,
1206 const char *path,
1207 Error **errp)
1208{
1209 struct stat st;
1210 char *filename;
1211 char *sanitized_name;
1212 char *c;
1213 void *area;
1214 int fd;
1215 uint64_t hpagesize;
1216 Error *local_err = NULL;
1217
1218 hpagesize = gethugepagesize(path, &local_err);
1219 if (local_err) {
1220 error_propagate(errp, local_err);
1221 goto error;
1222 }
1223 block->mr->align = hpagesize;
1224
1225 if (memory < hpagesize) {
1226 error_setg(errp, "memory size 0x" RAM_ADDR_FMT " must be equal to "
1227 "or larger than huge page size 0x%" PRIx64,
1228 memory, hpagesize);
1229 goto error;
1230 }
1231
1232 if (kvm_enabled() && !kvm_has_sync_mmu()) {
1233 error_setg(errp,
1234 "host lacks kvm mmu notifiers, -mem-path unsupported");
1235 goto error;
1236 }
1237
1238 if (!stat(path, &st) && S_ISDIR(st.st_mode)) {
1239 /* Make name safe to use with mkstemp by replacing '/' with '_'. */
1240 sanitized_name = g_strdup(memory_region_name(block->mr));
1241 for (c = sanitized_name; *c != '\0'; c++) {
1242 if (*c == '/') {
1243 *c = '_';
1244 }
1245 }
1246
1247 filename = g_strdup_printf("%s/qemu_back_mem.%s.XXXXXX", path,
1248 sanitized_name);
1249 g_free(sanitized_name);
1250
1251 fd = mkstemp(filename);
1252 if (fd >= 0) {
1253 unlink(filename);
1254 }
1255 g_free(filename);
1256 } else {
1257 fd = open(path, O_RDWR | O_CREAT, 0644);
1258 }
1259
1260 if (fd < 0) {
1261 error_setg_errno(errp, errno,
1262 "unable to create backing store for hugepages");
1263 goto error;
1264 }
1265
1266 memory = ROUND_UP(memory, hpagesize);
1267
1268 /*
1269 * ftruncate is not supported by hugetlbfs in older
1270 * hosts, so don't bother bailing out on errors.
1271 * If anything goes wrong with it under other filesystems,
1272 * mmap will fail.
1273 */
1274 if (ftruncate(fd, memory)) {
1275 perror("ftruncate");
1276 }
1277
1278 area = qemu_ram_mmap(fd, memory, hpagesize, block->flags & RAM_SHARED);
1279 if (area == MAP_FAILED) {
1280 error_setg_errno(errp, errno,
1281 "unable to map backing store for hugepages");
1282 close(fd);
1283 goto error;
1284 }
1285
1286 if (mem_prealloc) {
1287 os_mem_prealloc(fd, area, memory);
1288 }
1289
1290 block->fd = fd;
1291 return area;
1292
1293error:
1294 return NULL;
1295}
1296#endif
1297
1298/* Called with the ramlist lock held. */
1299static ram_addr_t find_ram_offset(ram_addr_t size)
1300{
1301 RAMBlock *block, *next_block;
1302 ram_addr_t offset = RAM_ADDR_MAX, mingap = RAM_ADDR_MAX;
1303
1304 assert(size != 0); /* it would hand out same offset multiple times */
1305
1306 if (QLIST_EMPTY_RCU(&ram_list.blocks)) {
1307 return 0;
1308 }
1309
1310 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1311 ram_addr_t end, next = RAM_ADDR_MAX;
1312
1313 end = block->offset + block->max_length;
1314
1315 QLIST_FOREACH_RCU(next_block, &ram_list.blocks, next) {
1316 if (next_block->offset >= end) {
1317 next = MIN(next, next_block->offset);
1318 }
1319 }
1320 if (next - end >= size && next - end < mingap) {
1321 offset = end;
1322 mingap = next - end;
1323 }
1324 }
1325
1326 if (offset == RAM_ADDR_MAX) {
1327 fprintf(stderr, "Failed to find gap of requested size: %" PRIu64 "\n",
1328 (uint64_t)size);
1329 abort();
1330 }
1331
1332 return offset;
1333}
1334
1335ram_addr_t last_ram_offset(void)
1336{
1337 RAMBlock *block;
1338 ram_addr_t last = 0;
1339
1340 rcu_read_lock();
1341 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1342 last = MAX(last, block->offset + block->max_length);
1343 }
1344 rcu_read_unlock();
1345 return last;
1346}
1347
1348static void qemu_ram_setup_dump(void *addr, ram_addr_t size)
1349{
1350 int ret;
1351
1352 /* Use MADV_DONTDUMP, if user doesn't want the guest memory in the core */
1353 if (!machine_dump_guest_core(current_machine)) {
1354 ret = qemu_madvise(addr, size, QEMU_MADV_DONTDUMP);
1355 if (ret) {
1356 perror("qemu_madvise");
1357 fprintf(stderr, "madvise doesn't support MADV_DONTDUMP, "
1358 "but dump_guest_core=off specified\n");
1359 }
1360 }
1361}
1362
1363/* Called within an RCU critical section, or while the ramlist lock
1364 * is held.
1365 */
1366static RAMBlock *find_ram_block(ram_addr_t addr)
1367{
1368 RAMBlock *block;
1369
1370 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1371 if (block->offset == addr) {
1372 return block;
1373 }
1374 }
1375
1376 return NULL;
1377}
1378
1379const char *qemu_ram_get_idstr(RAMBlock *rb)
1380{
1381 return rb->idstr;
1382}
1383
1384/* Called with iothread lock held. */
1385void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev)
1386{
1387 RAMBlock *new_block, *block;
1388
1389 rcu_read_lock();
1390 new_block = find_ram_block(addr);
1391 assert(new_block);
1392 assert(!new_block->idstr[0]);
1393
1394 if (dev) {
1395 char *id = qdev_get_dev_path(dev);
1396 if (id) {
1397 snprintf(new_block->idstr, sizeof(new_block->idstr), "%s/", id);
1398 g_free(id);
1399 }
1400 }
1401 pstrcat(new_block->idstr, sizeof(new_block->idstr), name);
1402
1403 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1404 if (block != new_block && !strcmp(block->idstr, new_block->idstr)) {
1405 fprintf(stderr, "RAMBlock \"%s\" already registered, abort!\n",
1406 new_block->idstr);
1407 abort();
1408 }
1409 }
1410 rcu_read_unlock();
1411}
1412
1413/* Called with iothread lock held. */
1414void qemu_ram_unset_idstr(ram_addr_t addr)
1415{
1416 RAMBlock *block;
1417
1418 /* FIXME: arch_init.c assumes that this is not called throughout
1419 * migration. Ignore the problem since hot-unplug during migration
1420 * does not work anyway.
1421 */
1422
1423 rcu_read_lock();
1424 block = find_ram_block(addr);
1425 if (block) {
1426 memset(block->idstr, 0, sizeof(block->idstr));
1427 }
1428 rcu_read_unlock();
1429}
1430
1431static int memory_try_enable_merging(void *addr, size_t len)
1432{
1433 if (!machine_mem_merge(current_machine)) {
1434 /* disabled by the user */
1435 return 0;
1436 }
1437
1438 return qemu_madvise(addr, len, QEMU_MADV_MERGEABLE);
1439}
1440
1441/* Only legal before guest might have detected the memory size: e.g. on
1442 * incoming migration, or right after reset.
1443 *
1444 * As memory core doesn't know how is memory accessed, it is up to
1445 * resize callback to update device state and/or add assertions to detect
1446 * misuse, if necessary.
1447 */
1448int qemu_ram_resize(ram_addr_t base, ram_addr_t newsize, Error **errp)
1449{
1450 RAMBlock *block = find_ram_block(base);
1451
1452 assert(block);
1453
1454 newsize = HOST_PAGE_ALIGN(newsize);
1455
1456 if (block->used_length == newsize) {
1457 return 0;
1458 }
1459
1460 if (!(block->flags & RAM_RESIZEABLE)) {
1461 error_setg_errno(errp, EINVAL,
1462 "Length mismatch: %s: 0x" RAM_ADDR_FMT
1463 " in != 0x" RAM_ADDR_FMT, block->idstr,
1464 newsize, block->used_length);
1465 return -EINVAL;
1466 }
1467
1468 if (block->max_length < newsize) {
1469 error_setg_errno(errp, EINVAL,
1470 "Length too large: %s: 0x" RAM_ADDR_FMT
1471 " > 0x" RAM_ADDR_FMT, block->idstr,
1472 newsize, block->max_length);
1473 return -EINVAL;
1474 }
1475
1476 cpu_physical_memory_clear_dirty_range(block->offset, block->used_length);
1477 block->used_length = newsize;
1478 cpu_physical_memory_set_dirty_range(block->offset, block->used_length,
1479 DIRTY_CLIENTS_ALL);
1480 memory_region_set_size(block->mr, newsize);
1481 if (block->resized) {
1482 block->resized(block->idstr, newsize, block->host);
1483 }
1484 return 0;
1485}
1486
1487static ram_addr_t ram_block_add(RAMBlock *new_block, Error **errp)
1488{
1489 RAMBlock *block;
1490 RAMBlock *last_block = NULL;
1491 ram_addr_t old_ram_size, new_ram_size;
1492
1493 old_ram_size = last_ram_offset() >> TARGET_PAGE_BITS;
1494
1495 qemu_mutex_lock_ramlist();
1496 new_block->offset = find_ram_offset(new_block->max_length);
1497
1498 if (!new_block->host) {
1499 if (xen_enabled()) {
1500 xen_ram_alloc(new_block->offset, new_block->max_length,
1501 new_block->mr);
1502 } else {
1503 new_block->host = phys_mem_alloc(new_block->max_length,
1504 &new_block->mr->align);
1505 if (!new_block->host) {
1506 error_setg_errno(errp, errno,
1507 "cannot set up guest memory '%s'",
1508 memory_region_name(new_block->mr));
1509 qemu_mutex_unlock_ramlist();
1510 return -1;
1511 }
1512 memory_try_enable_merging(new_block->host, new_block->max_length);
1513 }
1514 }
1515
1516 new_ram_size = MAX(old_ram_size,
1517 (new_block->offset + new_block->max_length) >> TARGET_PAGE_BITS);
1518 if (new_ram_size > old_ram_size) {
1519 migration_bitmap_extend(old_ram_size, new_ram_size);
1520 }
1521 /* Keep the list sorted from biggest to smallest block. Unlike QTAILQ,
1522 * QLIST (which has an RCU-friendly variant) does not have insertion at
1523 * tail, so save the last element in last_block.
1524 */
1525 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1526 last_block = block;
1527 if (block->max_length < new_block->max_length) {
1528 break;
1529 }
1530 }
1531 if (block) {
1532 QLIST_INSERT_BEFORE_RCU(block, new_block, next);
1533 } else if (last_block) {
1534 QLIST_INSERT_AFTER_RCU(last_block, new_block, next);
1535 } else { /* list is empty */
1536 QLIST_INSERT_HEAD_RCU(&ram_list.blocks, new_block, next);
1537 }
1538 ram_list.mru_block = NULL;
1539
1540 /* Write list before version */
1541 smp_wmb();
1542 ram_list.version++;
1543 qemu_mutex_unlock_ramlist();
1544
1545 new_ram_size = last_ram_offset() >> TARGET_PAGE_BITS;
1546
1547 if (new_ram_size > old_ram_size) {
1548 int i;
1549
1550 /* ram_list.dirty_memory[] is protected by the iothread lock. */
1551 for (i = 0; i < DIRTY_MEMORY_NUM; i++) {
1552 ram_list.dirty_memory[i] =
1553 bitmap_zero_extend(ram_list.dirty_memory[i],
1554 old_ram_size, new_ram_size);
1555 }
1556 }
1557 cpu_physical_memory_set_dirty_range(new_block->offset,
1558 new_block->used_length,
1559 DIRTY_CLIENTS_ALL);
1560
1561 if (new_block->host) {
1562 qemu_ram_setup_dump(new_block->host, new_block->max_length);
1563 qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_HUGEPAGE);
1564 qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_DONTFORK);
1565 if (kvm_enabled()) {
1566 kvm_setup_guest_memory(new_block->host, new_block->max_length);
1567 }
1568 }
1569
1570 return new_block->offset;
1571}
1572
1573#ifdef __linux__
1574ram_addr_t qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
1575 bool share, const char *mem_path,
1576 Error **errp)
1577{
1578 RAMBlock *new_block;
1579 ram_addr_t addr;
1580 Error *local_err = NULL;
1581
1582 if (xen_enabled()) {
1583 error_setg(errp, "-mem-path not supported with Xen");
1584 return -1;
1585 }
1586
1587 if (phys_mem_alloc != qemu_anon_ram_alloc) {
1588 /*
1589 * file_ram_alloc() needs to allocate just like
1590 * phys_mem_alloc, but we haven't bothered to provide
1591 * a hook there.
1592 */
1593 error_setg(errp,
1594 "-mem-path not supported with this accelerator");
1595 return -1;
1596 }
1597
1598 size = HOST_PAGE_ALIGN(size);
1599 new_block = g_malloc0(sizeof(*new_block));
1600 new_block->mr = mr;
1601 new_block->used_length = size;
1602 new_block->max_length = size;
1603 new_block->flags = share ? RAM_SHARED : 0;
1604 new_block->flags |= RAM_FILE;
1605 new_block->host = file_ram_alloc(new_block, size,
1606 mem_path, errp);
1607 if (!new_block->host) {
1608 g_free(new_block);
1609 return -1;
1610 }
1611
1612 addr = ram_block_add(new_block, &local_err);
1613 if (local_err) {
1614 g_free(new_block);
1615 error_propagate(errp, local_err);
1616 return -1;
1617 }
1618 return addr;
1619}
1620#endif
1621
1622static
1623ram_addr_t qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size,
1624 void (*resized)(const char*,
1625 uint64_t length,
1626 void *host),
1627 void *host, bool resizeable,
1628 MemoryRegion *mr, Error **errp)
1629{
1630 RAMBlock *new_block;
1631 ram_addr_t addr;
1632 Error *local_err = NULL;
1633
1634 size = HOST_PAGE_ALIGN(size);
1635 max_size = HOST_PAGE_ALIGN(max_size);
1636 new_block = g_malloc0(sizeof(*new_block));
1637 new_block->mr = mr;
1638 new_block->resized = resized;
1639 new_block->used_length = size;
1640 new_block->max_length = max_size;
1641 assert(max_size >= size);
1642 new_block->fd = -1;
1643 new_block->host = host;
1644 if (host) {
1645 new_block->flags |= RAM_PREALLOC;
1646 }
1647 if (resizeable) {
1648 new_block->flags |= RAM_RESIZEABLE;
1649 }
1650 addr = ram_block_add(new_block, &local_err);
1651 if (local_err) {
1652 g_free(new_block);
1653 error_propagate(errp, local_err);
1654 return -1;
1655 }
1656 return addr;
1657}
1658
1659ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
1660 MemoryRegion *mr, Error **errp)
1661{
1662 return qemu_ram_alloc_internal(size, size, NULL, host, false, mr, errp);
1663}
1664
1665ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr, Error **errp)
1666{
1667 return qemu_ram_alloc_internal(size, size, NULL, NULL, false, mr, errp);
1668}
1669
1670ram_addr_t qemu_ram_alloc_resizeable(ram_addr_t size, ram_addr_t maxsz,
1671 void (*resized)(const char*,
1672 uint64_t length,
1673 void *host),
1674 MemoryRegion *mr, Error **errp)
1675{
1676 return qemu_ram_alloc_internal(size, maxsz, resized, NULL, true, mr, errp);
1677}
1678
1679void qemu_ram_free_from_ptr(ram_addr_t addr)
1680{
1681 RAMBlock *block;
1682
1683 qemu_mutex_lock_ramlist();
1684 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1685 if (addr == block->offset) {
1686 QLIST_REMOVE_RCU(block, next);
1687 ram_list.mru_block = NULL;
1688 /* Write list before version */
1689 smp_wmb();
1690 ram_list.version++;
1691 g_free_rcu(block, rcu);
1692 break;
1693 }
1694 }
1695 qemu_mutex_unlock_ramlist();
1696}
1697
1698static void reclaim_ramblock(RAMBlock *block)
1699{
1700 if (block->flags & RAM_PREALLOC) {
1701 ;
1702 } else if (xen_enabled()) {
1703 xen_invalidate_map_cache_entry(block->host);
1704#ifndef _WIN32
1705 } else if (block->fd >= 0) {
1706 if (block->flags & RAM_FILE) {
1707 qemu_ram_munmap(block->host, block->max_length);
1708 } else {
1709 munmap(block->host, block->max_length);
1710 }
1711 close(block->fd);
1712#endif
1713 } else {
1714 qemu_anon_ram_free(block->host, block->max_length);
1715 }
1716 g_free(block);
1717}
1718
1719void qemu_ram_free(ram_addr_t addr)
1720{
1721 RAMBlock *block;
1722
1723 qemu_mutex_lock_ramlist();
1724 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1725 if (addr == block->offset) {
1726 QLIST_REMOVE_RCU(block, next);
1727 ram_list.mru_block = NULL;
1728 /* Write list before version */
1729 smp_wmb();
1730 ram_list.version++;
1731 call_rcu(block, reclaim_ramblock, rcu);
1732 break;
1733 }
1734 }
1735 qemu_mutex_unlock_ramlist();
1736}
1737
1738#ifndef _WIN32
1739void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
1740{
1741 RAMBlock *block;
1742 ram_addr_t offset;
1743 int flags;
1744 void *area, *vaddr;
1745
1746 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1747 offset = addr - block->offset;
1748 if (offset < block->max_length) {
1749 vaddr = ramblock_ptr(block, offset);
1750 if (block->flags & RAM_PREALLOC) {
1751 ;
1752 } else if (xen_enabled()) {
1753 abort();
1754 } else {
1755 flags = MAP_FIXED;
1756 if (block->fd >= 0) {
1757 flags |= (block->flags & RAM_SHARED ?
1758 MAP_SHARED : MAP_PRIVATE);
1759 area = mmap(vaddr, length, PROT_READ | PROT_WRITE,
1760 flags, block->fd, offset);
1761 } else {
1762 /*
1763 * Remap needs to match alloc. Accelerators that
1764 * set phys_mem_alloc never remap. If they did,
1765 * we'd need a remap hook here.
1766 */
1767 assert(phys_mem_alloc == qemu_anon_ram_alloc);
1768
1769 flags |= MAP_PRIVATE | MAP_ANONYMOUS;
1770 area = mmap(vaddr, length, PROT_READ | PROT_WRITE,
1771 flags, -1, 0);
1772 }
1773 if (area != vaddr) {
1774 fprintf(stderr, "Could not remap addr: "
1775 RAM_ADDR_FMT "@" RAM_ADDR_FMT "\n",
1776 length, addr);
1777 exit(1);
1778 }
1779 memory_try_enable_merging(vaddr, length);
1780 qemu_ram_setup_dump(vaddr, length);
1781 }
1782 }
1783 }
1784}
1785#endif /* !_WIN32 */
1786
1787int qemu_get_ram_fd(ram_addr_t addr)
1788{
1789 RAMBlock *block;
1790 int fd;
1791
1792 rcu_read_lock();
1793 block = qemu_get_ram_block(addr);
1794 fd = block->fd;
1795 rcu_read_unlock();
1796 return fd;
1797}
1798
1799void *qemu_get_ram_block_host_ptr(ram_addr_t addr)
1800{
1801 RAMBlock *block;
1802 void *ptr;
1803
1804 rcu_read_lock();
1805 block = qemu_get_ram_block(addr);
1806 ptr = ramblock_ptr(block, 0);
1807 rcu_read_unlock();
1808 return ptr;
1809}
1810
1811/* Return a host pointer to ram allocated with qemu_ram_alloc.
1812 * This should not be used for general purpose DMA. Use address_space_map
1813 * or address_space_rw instead. For local memory (e.g. video ram) that the
1814 * device owns, use memory_region_get_ram_ptr.
1815 *
1816 * By the time this function returns, the returned pointer is not protected
1817 * by RCU anymore. If the caller is not within an RCU critical section and
1818 * does not hold the iothread lock, it must have other means of protecting the
1819 * pointer, such as a reference to the region that includes the incoming
1820 * ram_addr_t.
1821 */
1822void *qemu_get_ram_ptr(ram_addr_t addr)
1823{
1824 RAMBlock *block;
1825 void *ptr;
1826
1827 rcu_read_lock();
1828 block = qemu_get_ram_block(addr);
1829
1830 if (xen_enabled() && block->host == NULL) {
1831 /* We need to check if the requested address is in the RAM
1832 * because we don't want to map the entire memory in QEMU.
1833 * In that case just map until the end of the page.
1834 */
1835 if (block->offset == 0) {
1836 ptr = xen_map_cache(addr, 0, 0);
1837 goto unlock;
1838 }
1839
1840 block->host = xen_map_cache(block->offset, block->max_length, 1);
1841 }
1842 ptr = ramblock_ptr(block, addr - block->offset);
1843
1844unlock:
1845 rcu_read_unlock();
1846 return ptr;
1847}
1848
1849/* Return a host pointer to guest's ram. Similar to qemu_get_ram_ptr
1850 * but takes a size argument.
1851 *
1852 * By the time this function returns, the returned pointer is not protected
1853 * by RCU anymore. If the caller is not within an RCU critical section and
1854 * does not hold the iothread lock, it must have other means of protecting the
1855 * pointer, such as a reference to the region that includes the incoming
1856 * ram_addr_t.
1857 */
1858static void *qemu_ram_ptr_length(ram_addr_t addr, hwaddr *size)
1859{
1860 void *ptr;
1861 if (*size == 0) {
1862 return NULL;
1863 }
1864 if (xen_enabled()) {
1865 return xen_map_cache(addr, *size, 1);
1866 } else {
1867 RAMBlock *block;
1868 rcu_read_lock();
1869 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1870 if (addr - block->offset < block->max_length) {
1871 if (addr - block->offset + *size > block->max_length)
1872 *size = block->max_length - addr + block->offset;
1873 ptr = ramblock_ptr(block, addr - block->offset);
1874 rcu_read_unlock();
1875 return ptr;
1876 }
1877 }
1878
1879 fprintf(stderr, "Bad ram offset %" PRIx64 "\n", (uint64_t)addr);
1880 abort();
1881 }
1882}
1883
1884/*
1885 * Translates a host ptr back to a RAMBlock, a ram_addr and an offset
1886 * in that RAMBlock.
1887 *
1888 * ptr: Host pointer to look up
1889 * round_offset: If true round the result offset down to a page boundary
1890 * *ram_addr: set to result ram_addr
1891 * *offset: set to result offset within the RAMBlock
1892 *
1893 * Returns: RAMBlock (or NULL if not found)
1894 *
1895 * By the time this function returns, the returned pointer is not protected
1896 * by RCU anymore. If the caller is not within an RCU critical section and
1897 * does not hold the iothread lock, it must have other means of protecting the
1898 * pointer, such as a reference to the region that includes the incoming
1899 * ram_addr_t.
1900 */
1901RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset,
1902 ram_addr_t *ram_addr,
1903 ram_addr_t *offset)
1904{
1905 RAMBlock *block;
1906 uint8_t *host = ptr;
1907
1908 if (xen_enabled()) {
1909 rcu_read_lock();
1910 *ram_addr = xen_ram_addr_from_mapcache(ptr);
1911 block = qemu_get_ram_block(*ram_addr);
1912 if (block) {
1913 *offset = (host - block->host);
1914 }
1915 rcu_read_unlock();
1916 return block;
1917 }
1918
1919 rcu_read_lock();
1920 block = atomic_rcu_read(&ram_list.mru_block);
1921 if (block && block->host && host - block->host < block->max_length) {
1922 goto found;
1923 }
1924
1925 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1926 /* This case append when the block is not mapped. */
1927 if (block->host == NULL) {
1928 continue;
1929 }
1930 if (host - block->host < block->max_length) {
1931 goto found;
1932 }
1933 }
1934
1935 rcu_read_unlock();
1936 return NULL;
1937
1938found:
1939 *offset = (host - block->host);
1940 if (round_offset) {
1941 *offset &= TARGET_PAGE_MASK;
1942 }
1943 *ram_addr = block->offset + *offset;
1944 rcu_read_unlock();
1945 return block;
1946}
1947
1948/*
1949 * Finds the named RAMBlock
1950 *
1951 * name: The name of RAMBlock to find
1952 *
1953 * Returns: RAMBlock (or NULL if not found)
1954 */
1955RAMBlock *qemu_ram_block_by_name(const char *name)
1956{
1957 RAMBlock *block;
1958
1959 QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
1960 if (!strcmp(name, block->idstr)) {
1961 return block;
1962 }
1963 }
1964
1965 return NULL;
1966}
1967
1968/* Some of the softmmu routines need to translate from a host pointer
1969 (typically a TLB entry) back to a ram offset. */
1970MemoryRegion *qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr)
1971{
1972 RAMBlock *block;
1973 ram_addr_t offset; /* Not used */
1974
1975 block = qemu_ram_block_from_host(ptr, false, ram_addr, &offset);
1976
1977 if (!block) {
1978 return NULL;
1979 }
1980
1981 return block->mr;
1982}
1983
1984static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
1985 uint64_t val, unsigned size)
1986{
1987 if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) {
1988 tb_invalidate_phys_page_fast(ram_addr, size);
1989 }
1990 switch (size) {
1991 case 1:
1992 stb_p(qemu_get_ram_ptr(ram_addr), val);
1993 break;
1994 case 2:
1995 stw_p(qemu_get_ram_ptr(ram_addr), val);
1996 break;
1997 case 4:
1998 stl_p(qemu_get_ram_ptr(ram_addr), val);
1999 break;
2000 default:
2001 abort();
2002 }
2003 /* Set both VGA and migration bits for simplicity and to remove
2004 * the notdirty callback faster.
2005 */
2006 cpu_physical_memory_set_dirty_range(ram_addr, size,
2007 DIRTY_CLIENTS_NOCODE);
2008 /* we remove the notdirty callback only if the code has been
2009 flushed */
2010 if (!cpu_physical_memory_is_clean(ram_addr)) {
2011 tlb_set_dirty(current_cpu, current_cpu->mem_io_vaddr);
2012 }
2013}
2014
2015static bool notdirty_mem_accepts(void *opaque, hwaddr addr,
2016 unsigned size, bool is_write)
2017{
2018 return is_write;
2019}
2020
2021static const MemoryRegionOps notdirty_mem_ops = {
2022 .write = notdirty_mem_write,
2023 .valid.accepts = notdirty_mem_accepts,
2024 .endianness = DEVICE_NATIVE_ENDIAN,
2025};
2026
2027/* Generate a debug exception if a watchpoint has been hit. */
2028static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags)
2029{
2030 CPUState *cpu = current_cpu;
2031 CPUArchState *env = cpu->env_ptr;
2032 target_ulong pc, cs_base;
2033 target_ulong vaddr;
2034 CPUWatchpoint *wp;
2035 int cpu_flags;
2036
2037 if (cpu->watchpoint_hit) {
2038 /* We re-entered the check after replacing the TB. Now raise
2039 * the debug interrupt so that is will trigger after the
2040 * current instruction. */
2041 cpu_interrupt(cpu, CPU_INTERRUPT_DEBUG);
2042 return;
2043 }
2044 vaddr = (cpu->mem_io_vaddr & TARGET_PAGE_MASK) + offset;
2045 QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
2046 if (cpu_watchpoint_address_matches(wp, vaddr, len)
2047 && (wp->flags & flags)) {
2048 if (flags == BP_MEM_READ) {
2049 wp->flags |= BP_WATCHPOINT_HIT_READ;
2050 } else {
2051 wp->flags |= BP_WATCHPOINT_HIT_WRITE;
2052 }
2053 wp->hitaddr = vaddr;
2054 wp->hitattrs = attrs;
2055 if (!cpu->watchpoint_hit) {
2056 cpu->watchpoint_hit = wp;
2057 tb_check_watchpoint(cpu);
2058 if (wp->flags & BP_STOP_BEFORE_ACCESS) {
2059 cpu->exception_index = EXCP_DEBUG;
2060 cpu_loop_exit(cpu);
2061 } else {
2062 cpu_get_tb_cpu_state(env, &pc, &cs_base, &cpu_flags);
2063 tb_gen_code(cpu, pc, cs_base, cpu_flags, 1);
2064 cpu_resume_from_signal(cpu, NULL);
2065 }
2066 }
2067 } else {
2068 wp->flags &= ~BP_WATCHPOINT_HIT;
2069 }
2070 }
2071}
2072
2073/* Watchpoint access routines. Watchpoints are inserted using TLB tricks,
2074 so these check for a hit then pass through to the normal out-of-line
2075 phys routines. */
2076static MemTxResult watch_mem_read(void *opaque, hwaddr addr, uint64_t *pdata,
2077 unsigned size, MemTxAttrs attrs)
2078{
2079 MemTxResult res;
2080 uint64_t data;
2081
2082 check_watchpoint(addr & ~TARGET_PAGE_MASK, size, attrs, BP_MEM_READ);
2083 switch (size) {
2084 case 1:
2085 data = address_space_ldub(&address_space_memory, addr, attrs, &res);
2086 break;
2087 case 2:
2088 data = address_space_lduw(&address_space_memory, addr, attrs, &res);
2089 break;
2090 case 4:
2091 data = address_space_ldl(&address_space_memory, addr, attrs, &res);
2092 break;
2093 default: abort();
2094 }
2095 *pdata = data;
2096 return res;
2097}
2098
2099static MemTxResult watch_mem_write(void *opaque, hwaddr addr,
2100 uint64_t val, unsigned size,
2101 MemTxAttrs attrs)
2102{
2103 MemTxResult res;
2104
2105 check_watchpoint(addr & ~TARGET_PAGE_MASK, size, attrs, BP_MEM_WRITE);
2106 switch (size) {
2107 case 1:
2108 address_space_stb(&address_space_memory, addr, val, attrs, &res);
2109 break;
2110 case 2:
2111 address_space_stw(&address_space_memory, addr, val, attrs, &res);
2112 break;
2113 case 4:
2114 address_space_stl(&address_space_memory, addr, val, attrs, &res);
2115 break;
2116 default: abort();
2117 }
2118 return res;
2119}
2120
2121static const MemoryRegionOps watch_mem_ops = {
2122 .read_with_attrs = watch_mem_read,
2123 .write_with_attrs = watch_mem_write,
2124 .endianness = DEVICE_NATIVE_ENDIAN,
2125};
2126
2127static MemTxResult subpage_read(void *opaque, hwaddr addr, uint64_t *data,
2128 unsigned len, MemTxAttrs attrs)
2129{
2130 subpage_t *subpage = opaque;
2131 uint8_t buf[8];
2132 MemTxResult res;
2133
2134#if defined(DEBUG_SUBPAGE)
2135 printf("%s: subpage %p len %u addr " TARGET_FMT_plx "\n", __func__,
2136 subpage, len, addr);
2137#endif
2138 res = address_space_read(subpage->as, addr + subpage->base,
2139 attrs, buf, len);
2140 if (res) {
2141 return res;
2142 }
2143 switch (len) {
2144 case 1:
2145 *data = ldub_p(buf);
2146 return MEMTX_OK;
2147 case 2:
2148 *data = lduw_p(buf);
2149 return MEMTX_OK;
2150 case 4:
2151 *data = ldl_p(buf);
2152 return MEMTX_OK;
2153 case 8:
2154 *data = ldq_p(buf);
2155 return MEMTX_OK;
2156 default:
2157 abort();
2158 }
2159}
2160
2161static MemTxResult subpage_write(void *opaque, hwaddr addr,
2162 uint64_t value, unsigned len, MemTxAttrs attrs)
2163{
2164 subpage_t *subpage = opaque;
2165 uint8_t buf[8];
2166
2167#if defined(DEBUG_SUBPAGE)
2168 printf("%s: subpage %p len %u addr " TARGET_FMT_plx
2169 " value %"PRIx64"\n",
2170 __func__, subpage, len, addr, value);
2171#endif
2172 switch (len) {
2173 case 1:
2174 stb_p(buf, value);
2175 break;
2176 case 2:
2177 stw_p(buf, value);
2178 break;
2179 case 4:
2180 stl_p(buf, value);
2181 break;
2182 case 8:
2183 stq_p(buf, value);
2184 break;
2185 default:
2186 abort();
2187 }
2188 return address_space_write(subpage->as, addr + subpage->base,
2189 attrs, buf, len);
2190}
2191
2192static bool subpage_accepts(void *opaque, hwaddr addr,
2193 unsigned len, bool is_write)
2194{
2195 subpage_t *subpage = opaque;
2196#if defined(DEBUG_SUBPAGE)
2197 printf("%s: subpage %p %c len %u addr " TARGET_FMT_plx "\n",
2198 __func__, subpage, is_write ? 'w' : 'r', len, addr);
2199#endif
2200
2201 return address_space_access_valid(subpage->as, addr + subpage->base,
2202 len, is_write);
2203}
2204
2205static const MemoryRegionOps subpage_ops = {
2206 .read_with_attrs = subpage_read,
2207 .write_with_attrs = subpage_write,
2208 .impl.min_access_size = 1,
2209 .impl.max_access_size = 8,
2210 .valid.min_access_size = 1,
2211 .valid.max_access_size = 8,
2212 .valid.accepts = subpage_accepts,
2213 .endianness = DEVICE_NATIVE_ENDIAN,
2214};
2215
2216static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
2217 uint16_t section)
2218{
2219 int idx, eidx;
2220
2221 if (start >= TARGET_PAGE_SIZE || end >= TARGET_PAGE_SIZE)
2222 return -1;
2223 idx = SUBPAGE_IDX(start);
2224 eidx = SUBPAGE_IDX(end);
2225#if defined(DEBUG_SUBPAGE)
2226 printf("%s: %p start %08x end %08x idx %08x eidx %08x section %d\n",
2227 __func__, mmio, start, end, idx, eidx, section);
2228#endif
2229 for (; idx <= eidx; idx++) {
2230 mmio->sub_section[idx] = section;
2231 }
2232
2233 return 0;
2234}
2235
2236static subpage_t *subpage_init(AddressSpace *as, hwaddr base)
2237{
2238 subpage_t *mmio;
2239
2240 mmio = g_malloc0(sizeof(subpage_t));
2241
2242 mmio->as = as;
2243 mmio->base = base;
2244 memory_region_init_io(&mmio->iomem, NULL, &subpage_ops, mmio,
2245 NULL, TARGET_PAGE_SIZE);
2246 mmio->iomem.subpage = true;
2247#if defined(DEBUG_SUBPAGE)
2248 printf("%s: %p base " TARGET_FMT_plx " len %08x\n", __func__,
2249 mmio, base, TARGET_PAGE_SIZE);
2250#endif
2251 subpage_register(mmio, 0, TARGET_PAGE_SIZE-1, PHYS_SECTION_UNASSIGNED);
2252
2253 return mmio;
2254}
2255
2256static uint16_t dummy_section(PhysPageMap *map, AddressSpace *as,
2257 MemoryRegion *mr)
2258{
2259 assert(as);
2260 MemoryRegionSection section = {
2261 .address_space = as,
2262 .mr = mr,
2263 .offset_within_address_space = 0,
2264 .offset_within_region = 0,
2265 .size = int128_2_64(),
2266 };
2267
2268 return phys_section_add(map, &section);
2269}
2270
2271MemoryRegion *iotlb_to_region(CPUState *cpu, hwaddr index)
2272{
2273 CPUAddressSpace *cpuas = &cpu->cpu_ases[0];
2274 AddressSpaceDispatch *d = atomic_rcu_read(&cpuas->memory_dispatch);
2275 MemoryRegionSection *sections = d->map.sections;
2276
2277 return sections[index & ~TARGET_PAGE_MASK].mr;
2278}
2279
2280static void io_mem_init(void)
2281{
2282 memory_region_init_io(&io_mem_rom, NULL, &unassigned_mem_ops, NULL, NULL, UINT64_MAX);
2283 memory_region_init_io(&io_mem_unassigned, NULL, &unassigned_mem_ops, NULL,
2284 NULL, UINT64_MAX);
2285 memory_region_init_io(&io_mem_notdirty, NULL, &notdirty_mem_ops, NULL,
2286 NULL, UINT64_MAX);
2287 memory_region_init_io(&io_mem_watch, NULL, &watch_mem_ops, NULL,
2288 NULL, UINT64_MAX);
2289}
2290
2291static void mem_begin(MemoryListener *listener)
2292{
2293 AddressSpace *as = container_of(listener, AddressSpace, dispatch_listener);
2294 AddressSpaceDispatch *d = g_new0(AddressSpaceDispatch, 1);
2295 uint16_t n;
2296
2297 n = dummy_section(&d->map, as, &io_mem_unassigned);
2298 assert(n == PHYS_SECTION_UNASSIGNED);
2299 n = dummy_section(&d->map, as, &io_mem_notdirty);
2300 assert(n == PHYS_SECTION_NOTDIRTY);
2301 n = dummy_section(&d->map, as, &io_mem_rom);
2302 assert(n == PHYS_SECTION_ROM);
2303 n = dummy_section(&d->map, as, &io_mem_watch);
2304 assert(n == PHYS_SECTION_WATCH);
2305
2306 d->phys_map = (PhysPageEntry) { .ptr = PHYS_MAP_NODE_NIL, .skip = 1 };
2307 d->as = as;
2308 as->next_dispatch = d;
2309}
2310
2311static void address_space_dispatch_free(AddressSpaceDispatch *d)
2312{
2313 phys_sections_free(&d->map);
2314 g_free(d);
2315}
2316
2317static void mem_commit(MemoryListener *listener)
2318{
2319 AddressSpace *as = container_of(listener, AddressSpace, dispatch_listener);
2320 AddressSpaceDispatch *cur = as->dispatch;
2321 AddressSpaceDispatch *next = as->next_dispatch;
2322
2323 phys_page_compact_all(next, next->map.nodes_nb);
2324
2325 atomic_rcu_set(&as->dispatch, next);
2326 if (cur) {
2327 call_rcu(cur, address_space_dispatch_free, rcu);
2328 }
2329}
2330
2331static void tcg_commit(MemoryListener *listener)
2332{
2333 CPUAddressSpace *cpuas;
2334 AddressSpaceDispatch *d;
2335
2336 /* since each CPU stores ram addresses in its TLB cache, we must
2337 reset the modified entries */
2338 cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener);
2339 cpu_reloading_memory_map();
2340 /* The CPU and TLB are protected by the iothread lock.
2341 * We reload the dispatch pointer now because cpu_reloading_memory_map()
2342 * may have split the RCU critical section.
2343 */
2344 d = atomic_rcu_read(&cpuas->as->dispatch);
2345 cpuas->memory_dispatch = d;
2346 tlb_flush(cpuas->cpu, 1);
2347}
2348
2349void address_space_init_dispatch(AddressSpace *as)
2350{
2351 as->dispatch = NULL;
2352 as->dispatch_listener = (MemoryListener) {
2353 .begin = mem_begin,
2354 .commit = mem_commit,
2355 .region_add = mem_add,
2356 .region_nop = mem_add,
2357 .priority = 0,
2358 };
2359 memory_listener_register(&as->dispatch_listener, as);
2360}
2361
2362void address_space_unregister(AddressSpace *as)
2363{
2364 memory_listener_unregister(&as->dispatch_listener);
2365}
2366
2367void address_space_destroy_dispatch(AddressSpace *as)
2368{
2369 AddressSpaceDispatch *d = as->dispatch;
2370
2371 atomic_rcu_set(&as->dispatch, NULL);
2372 if (d) {
2373 call_rcu(d, address_space_dispatch_free, rcu);
2374 }
2375}
2376
2377static void memory_map_init(void)
2378{
2379 system_memory = g_malloc(sizeof(*system_memory));
2380
2381 memory_region_init(system_memory, NULL, "system", UINT64_MAX);
2382 address_space_init(&address_space_memory, system_memory, "memory");
2383
2384 system_io = g_malloc(sizeof(*system_io));
2385 memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io",
2386 65536);
2387 address_space_init(&address_space_io, system_io, "I/O");
2388}
2389
2390MemoryRegion *get_system_memory(void)
2391{
2392 return system_memory;
2393}
2394
2395MemoryRegion *get_system_io(void)
2396{
2397 return system_io;
2398}
2399
2400#endif /* !defined(CONFIG_USER_ONLY) */
2401
2402/* physical memory access (slow version, mainly for debug) */
2403#if defined(CONFIG_USER_ONLY)
2404int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
2405 uint8_t *buf, int len, int is_write)
2406{
2407 int l, flags;
2408 target_ulong page;
2409 void * p;
2410
2411 while (len > 0) {
2412 page = addr & TARGET_PAGE_MASK;
2413 l = (page + TARGET_PAGE_SIZE) - addr;
2414 if (l > len)
2415 l = len;
2416 flags = page_get_flags(page);
2417 if (!(flags & PAGE_VALID))
2418 return -1;
2419 if (is_write) {
2420 if (!(flags & PAGE_WRITE))
2421 return -1;
2422 /* XXX: this code should not depend on lock_user */
2423 if (!(p = lock_user(VERIFY_WRITE, addr, l, 0)))
2424 return -1;
2425 memcpy(p, buf, l);
2426 unlock_user(p, addr, l);
2427 } else {
2428 if (!(flags & PAGE_READ))
2429 return -1;
2430 /* XXX: this code should not depend on lock_user */
2431 if (!(p = lock_user(VERIFY_READ, addr, l, 1)))
2432 return -1;
2433 memcpy(buf, p, l);
2434 unlock_user(p, addr, 0);
2435 }
2436 len -= l;
2437 buf += l;
2438 addr += l;
2439 }
2440 return 0;
2441}
2442
2443#else
2444
2445static void invalidate_and_set_dirty(MemoryRegion *mr, hwaddr addr,
2446 hwaddr length)
2447{
2448 uint8_t dirty_log_mask = memory_region_get_dirty_log_mask(mr);
2449 /* No early return if dirty_log_mask is or becomes 0, because
2450 * cpu_physical_memory_set_dirty_range will still call
2451 * xen_modified_memory.
2452 */
2453 if (dirty_log_mask) {
2454 dirty_log_mask =
2455 cpu_physical_memory_range_includes_clean(addr, length, dirty_log_mask);
2456 }
2457 if (dirty_log_mask & (1 << DIRTY_MEMORY_CODE)) {
2458 tb_invalidate_phys_range(addr, addr + length);
2459 dirty_log_mask &= ~(1 << DIRTY_MEMORY_CODE);
2460 }
2461 cpu_physical_memory_set_dirty_range(addr, length, dirty_log_mask);
2462}
2463
2464static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)
2465{
2466 unsigned access_size_max = mr->ops->valid.max_access_size;
2467
2468 /* Regions are assumed to support 1-4 byte accesses unless
2469 otherwise specified. */
2470 if (access_size_max == 0) {
2471 access_size_max = 4;
2472 }
2473
2474 /* Bound the maximum access by the alignment of the address. */
2475 if (!mr->ops->impl.unaligned) {
2476 unsigned align_size_max = addr & -addr;
2477 if (align_size_max != 0 && align_size_max < access_size_max) {
2478 access_size_max = align_size_max;
2479 }
2480 }
2481
2482 /* Don't attempt accesses larger than the maximum. */
2483 if (l > access_size_max) {
2484 l = access_size_max;
2485 }
2486 l = pow2floor(l);
2487
2488 return l;
2489}
2490
2491static bool prepare_mmio_access(MemoryRegion *mr)
2492{
2493 bool unlocked = !qemu_mutex_iothread_locked();
2494 bool release_lock = false;
2495
2496 if (unlocked && mr->global_locking) {
2497 qemu_mutex_lock_iothread();
2498 unlocked = false;
2499 release_lock = true;
2500 }
2501 if (mr->flush_coalesced_mmio) {
2502 if (unlocked) {
2503 qemu_mutex_lock_iothread();
2504 }
2505 qemu_flush_coalesced_mmio_buffer();
2506 if (unlocked) {
2507 qemu_mutex_unlock_iothread();
2508 }
2509 }
2510
2511 return release_lock;
2512}
2513
2514MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
2515 uint8_t *buf, int len, bool is_write)
2516{
2517 hwaddr l;
2518 uint8_t *ptr;
2519 uint64_t val;
2520 hwaddr addr1;
2521 MemoryRegion *mr;
2522 MemTxResult result = MEMTX_OK;
2523 bool release_lock = false;
2524
2525 rcu_read_lock();
2526 while (len > 0) {
2527 l = len;
2528 mr = address_space_translate(as, addr, &addr1, &l, is_write);
2529
2530 if (is_write) {
2531 if (!memory_access_is_direct(mr, is_write)) {
2532 release_lock |= prepare_mmio_access(mr);
2533 l = memory_access_size(mr, l, addr1);
2534 /* XXX: could force current_cpu to NULL to avoid
2535 potential bugs */
2536 switch (l) {
2537 case 8:
2538 /* 64 bit write access */
2539 val = ldq_p(buf);
2540 result |= memory_region_dispatch_write(mr, addr1, val, 8,
2541 attrs);
2542 break;
2543 case 4:
2544 /* 32 bit write access */
2545 val = ldl_p(buf);
2546 result |= memory_region_dispatch_write(mr, addr1, val, 4,
2547 attrs);
2548 break;
2549 case 2:
2550 /* 16 bit write access */
2551 val = lduw_p(buf);
2552 result |= memory_region_dispatch_write(mr, addr1, val, 2,
2553 attrs);
2554 break;
2555 case 1:
2556 /* 8 bit write access */
2557 val = ldub_p(buf);
2558 result |= memory_region_dispatch_write(mr, addr1, val, 1,
2559 attrs);
2560 break;
2561 default:
2562 abort();
2563 }
2564 } else {
2565 addr1 += memory_region_get_ram_addr(mr);
2566 /* RAM case */
2567 ptr = qemu_get_ram_ptr(addr1);
2568 memcpy(ptr, buf, l);
2569 invalidate_and_set_dirty(mr, addr1, l);
2570 }
2571 } else {
2572 if (!memory_access_is_direct(mr, is_write)) {
2573 /* I/O case */
2574 release_lock |= prepare_mmio_access(mr);
2575 l = memory_access_size(mr, l, addr1);
2576 switch (l) {
2577 case 8:
2578 /* 64 bit read access */
2579 result |= memory_region_dispatch_read(mr, addr1, &val, 8,
2580 attrs);
2581 stq_p(buf, val);
2582 break;
2583 case 4:
2584 /* 32 bit read access */
2585 result |= memory_region_dispatch_read(mr, addr1, &val, 4,
2586 attrs);
2587 stl_p(buf, val);
2588 break;
2589 case 2:
2590 /* 16 bit read access */
2591 result |= memory_region_dispatch_read(mr, addr1, &val, 2,
2592 attrs);
2593 stw_p(buf, val);
2594 break;
2595 case 1:
2596 /* 8 bit read access */
2597 result |= memory_region_dispatch_read(mr, addr1, &val, 1,
2598 attrs);
2599 stb_p(buf, val);
2600 break;
2601 default:
2602 abort();
2603 }
2604 } else {
2605 /* RAM case */
2606 ptr = qemu_get_ram_ptr(mr->ram_addr + addr1);
2607 memcpy(buf, ptr, l);
2608 }
2609 }
2610
2611 if (release_lock) {
2612 qemu_mutex_unlock_iothread();
2613 release_lock = false;
2614 }
2615
2616 len -= l;
2617 buf += l;
2618 addr += l;
2619 }
2620 rcu_read_unlock();
2621
2622 return result;
2623}
2624
2625MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
2626 const uint8_t *buf, int len)
2627{
2628 return address_space_rw(as, addr, attrs, (uint8_t *)buf, len, true);
2629}
2630
2631MemTxResult address_space_read(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
2632 uint8_t *buf, int len)
2633{
2634 return address_space_rw(as, addr, attrs, buf, len, false);
2635}
2636
2637
2638void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
2639 int len, int is_write)
2640{
2641 address_space_rw(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
2642 buf, len, is_write);
2643}
2644
2645enum write_rom_type {
2646 WRITE_DATA,
2647 FLUSH_CACHE,
2648};
2649
2650static inline void cpu_physical_memory_write_rom_internal(AddressSpace *as,
2651 hwaddr addr, const uint8_t *buf, int len, enum write_rom_type type)
2652{
2653 hwaddr l;
2654 uint8_t *ptr;
2655 hwaddr addr1;
2656 MemoryRegion *mr;
2657
2658 rcu_read_lock();
2659 while (len > 0) {
2660 l = len;
2661 mr = address_space_translate(as, addr, &addr1, &l, true);
2662
2663 if (!(memory_region_is_ram(mr) ||
2664 memory_region_is_romd(mr))) {
2665 l = memory_access_size(mr, l, addr1);
2666 } else {
2667 addr1 += memory_region_get_ram_addr(mr);
2668 /* ROM/RAM case */
2669 ptr = qemu_get_ram_ptr(addr1);
2670 switch (type) {
2671 case WRITE_DATA:
2672 memcpy(ptr, buf, l);
2673 invalidate_and_set_dirty(mr, addr1, l);
2674 break;
2675 case FLUSH_CACHE:
2676 flush_icache_range((uintptr_t)ptr, (uintptr_t)ptr + l);
2677 break;
2678 }
2679 }
2680 len -= l;
2681 buf += l;
2682 addr += l;
2683 }
2684 rcu_read_unlock();
2685}
2686
2687/* used for ROM loading : can write in RAM and ROM */
2688void cpu_physical_memory_write_rom(AddressSpace *as, hwaddr addr,
2689 const uint8_t *buf, int len)
2690{
2691 cpu_physical_memory_write_rom_internal(as, addr, buf, len, WRITE_DATA);
2692}
2693
2694void cpu_flush_icache_range(hwaddr start, int len)
2695{
2696 /*
2697 * This function should do the same thing as an icache flush that was
2698 * triggered from within the guest. For TCG we are always cache coherent,
2699 * so there is no need to flush anything. For KVM / Xen we need to flush
2700 * the host's instruction cache at least.
2701 */
2702 if (tcg_enabled()) {
2703 return;
2704 }
2705
2706 cpu_physical_memory_write_rom_internal(&address_space_memory,
2707 start, NULL, len, FLUSH_CACHE);
2708}
2709
2710typedef struct {
2711 MemoryRegion *mr;
2712 void *buffer;
2713 hwaddr addr;
2714 hwaddr len;
2715 bool in_use;
2716} BounceBuffer;
2717
2718static BounceBuffer bounce;
2719
2720typedef struct MapClient {
2721 QEMUBH *bh;
2722 QLIST_ENTRY(MapClient) link;
2723} MapClient;
2724
2725QemuMutex map_client_list_lock;
2726static QLIST_HEAD(map_client_list, MapClient) map_client_list
2727 = QLIST_HEAD_INITIALIZER(map_client_list);
2728
2729static void cpu_unregister_map_client_do(MapClient *client)
2730{
2731 QLIST_REMOVE(client, link);
2732 g_free(client);
2733}
2734
2735static void cpu_notify_map_clients_locked(void)
2736{
2737 MapClient *client;
2738
2739 while (!QLIST_EMPTY(&map_client_list)) {
2740 client = QLIST_FIRST(&map_client_list);
2741 qemu_bh_schedule(client->bh);
2742 cpu_unregister_map_client_do(client);
2743 }
2744}
2745
2746void cpu_register_map_client(QEMUBH *bh)
2747{
2748 MapClient *client = g_malloc(sizeof(*client));
2749
2750 qemu_mutex_lock(&map_client_list_lock);
2751 client->bh = bh;
2752 QLIST_INSERT_HEAD(&map_client_list, client, link);
2753 if (!atomic_read(&bounce.in_use)) {
2754 cpu_notify_map_clients_locked();
2755 }
2756 qemu_mutex_unlock(&map_client_list_lock);
2757}
2758
2759void cpu_exec_init_all(void)
2760{
2761 qemu_mutex_init(&ram_list.mutex);
2762 io_mem_init();
2763 memory_map_init();
2764 qemu_mutex_init(&map_client_list_lock);
2765}
2766
2767void cpu_unregister_map_client(QEMUBH *bh)
2768{
2769 MapClient *client;
2770
2771 qemu_mutex_lock(&map_client_list_lock);
2772 QLIST_FOREACH(client, &map_client_list, link) {
2773 if (client->bh == bh) {
2774 cpu_unregister_map_client_do(client);
2775 break;
2776 }
2777 }
2778 qemu_mutex_unlock(&map_client_list_lock);
2779}
2780
2781static void cpu_notify_map_clients(void)
2782{
2783 qemu_mutex_lock(&map_client_list_lock);
2784 cpu_notify_map_clients_locked();
2785 qemu_mutex_unlock(&map_client_list_lock);
2786}
2787
2788bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write)
2789{
2790 MemoryRegion *mr;
2791 hwaddr l, xlat;
2792
2793 rcu_read_lock();
2794 while (len > 0) {
2795 l = len;
2796 mr = address_space_translate(as, addr, &xlat, &l, is_write);
2797 if (!memory_access_is_direct(mr, is_write)) {
2798 l = memory_access_size(mr, l, addr);
2799 if (!memory_region_access_valid(mr, xlat, l, is_write)) {
2800 return false;
2801 }
2802 }
2803
2804 len -= l;
2805 addr += l;
2806 }
2807 rcu_read_unlock();
2808 return true;
2809}
2810
2811/* Map a physical memory region into a host virtual address.
2812 * May map a subset of the requested range, given by and returned in *plen.
2813 * May return NULL if resources needed to perform the mapping are exhausted.
2814 * Use only for reads OR writes - not for read-modify-write operations.
2815 * Use cpu_register_map_client() to know when retrying the map operation is
2816 * likely to succeed.
2817 */
2818void *address_space_map(AddressSpace *as,
2819 hwaddr addr,
2820 hwaddr *plen,
2821 bool is_write)
2822{
2823 hwaddr len = *plen;
2824 hwaddr done = 0;
2825 hwaddr l, xlat, base;
2826 MemoryRegion *mr, *this_mr;
2827 ram_addr_t raddr;
2828
2829 if (len == 0) {
2830 return NULL;
2831 }
2832
2833 l = len;
2834 rcu_read_lock();
2835 mr = address_space_translate(as, addr, &xlat, &l, is_write);
2836
2837 if (!memory_access_is_direct(mr, is_write)) {
2838 if (atomic_xchg(&bounce.in_use, true)) {
2839 rcu_read_unlock();
2840 return NULL;
2841 }
2842 /* Avoid unbounded allocations */
2843 l = MIN(l, TARGET_PAGE_SIZE);
2844 bounce.buffer = qemu_memalign(TARGET_PAGE_SIZE, l);
2845 bounce.addr = addr;
2846 bounce.len = l;
2847
2848 memory_region_ref(mr);
2849 bounce.mr = mr;
2850 if (!is_write) {
2851 address_space_read(as, addr, MEMTXATTRS_UNSPECIFIED,
2852 bounce.buffer, l);
2853 }
2854
2855 rcu_read_unlock();
2856 *plen = l;
2857 return bounce.buffer;
2858 }
2859
2860 base = xlat;
2861 raddr = memory_region_get_ram_addr(mr);
2862
2863 for (;;) {
2864 len -= l;
2865 addr += l;
2866 done += l;
2867 if (len == 0) {
2868 break;
2869 }
2870
2871 l = len;
2872 this_mr = address_space_translate(as, addr, &xlat, &l, is_write);
2873 if (this_mr != mr || xlat != base + done) {
2874 break;
2875 }
2876 }
2877
2878 memory_region_ref(mr);
2879 rcu_read_unlock();
2880 *plen = done;
2881 return qemu_ram_ptr_length(raddr + base, plen);
2882}
2883
2884/* Unmaps a memory region previously mapped by address_space_map().
2885 * Will also mark the memory as dirty if is_write == 1. access_len gives
2886 * the amount of memory that was actually read or written by the caller.
2887 */
2888void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
2889 int is_write, hwaddr access_len)
2890{
2891 if (buffer != bounce.buffer) {
2892 MemoryRegion *mr;
2893 ram_addr_t addr1;
2894
2895 mr = qemu_ram_addr_from_host(buffer, &addr1);
2896 assert(mr != NULL);
2897 if (is_write) {
2898 invalidate_and_set_dirty(mr, addr1, access_len);
2899 }
2900 if (xen_enabled()) {
2901 xen_invalidate_map_cache_entry(buffer);
2902 }
2903 memory_region_unref(mr);
2904 return;
2905 }
2906 if (is_write) {
2907 address_space_write(as, bounce.addr, MEMTXATTRS_UNSPECIFIED,
2908 bounce.buffer, access_len);
2909 }
2910 qemu_vfree(bounce.buffer);
2911 bounce.buffer = NULL;
2912 memory_region_unref(bounce.mr);
2913 atomic_mb_set(&bounce.in_use, false);
2914 cpu_notify_map_clients();
2915}
2916
2917void *cpu_physical_memory_map(hwaddr addr,
2918 hwaddr *plen,
2919 int is_write)
2920{
2921 return address_space_map(&address_space_memory, addr, plen, is_write);
2922}
2923
2924void cpu_physical_memory_unmap(void *buffer, hwaddr len,
2925 int is_write, hwaddr access_len)
2926{
2927 return address_space_unmap(&address_space_memory, buffer, len, is_write, access_len);
2928}
2929
2930/* warning: addr must be aligned */
2931static inline uint32_t address_space_ldl_internal(AddressSpace *as, hwaddr addr,
2932 MemTxAttrs attrs,
2933 MemTxResult *result,
2934 enum device_endian endian)
2935{
2936 uint8_t *ptr;
2937 uint64_t val;
2938 MemoryRegion *mr;
2939 hwaddr l = 4;
2940 hwaddr addr1;
2941 MemTxResult r;
2942 bool release_lock = false;
2943
2944 rcu_read_lock();
2945 mr = address_space_translate(as, addr, &addr1, &l, false);
2946 if (l < 4 || !memory_access_is_direct(mr, false)) {
2947 release_lock |= prepare_mmio_access(mr);
2948
2949 /* I/O case */
2950 r = memory_region_dispatch_read(mr, addr1, &val, 4, attrs);
2951#if defined(TARGET_WORDS_BIGENDIAN)
2952 if (endian == DEVICE_LITTLE_ENDIAN) {
2953 val = bswap32(val);
2954 }
2955#else
2956 if (endian == DEVICE_BIG_ENDIAN) {
2957 val = bswap32(val);
2958 }
2959#endif
2960 } else {
2961 /* RAM case */
2962 ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(mr)
2963 & TARGET_PAGE_MASK)
2964 + addr1);
2965 switch (endian) {
2966 case DEVICE_LITTLE_ENDIAN:
2967 val = ldl_le_p(ptr);
2968 break;
2969 case DEVICE_BIG_ENDIAN:
2970 val = ldl_be_p(ptr);
2971 break;
2972 default:
2973 val = ldl_p(ptr);
2974 break;
2975 }
2976 r = MEMTX_OK;
2977 }
2978 if (result) {
2979 *result = r;
2980 }
2981 if (release_lock) {
2982 qemu_mutex_unlock_iothread();
2983 }
2984 rcu_read_unlock();
2985 return val;
2986}
2987
2988uint32_t address_space_ldl(AddressSpace *as, hwaddr addr,
2989 MemTxAttrs attrs, MemTxResult *result)
2990{
2991 return address_space_ldl_internal(as, addr, attrs, result,
2992 DEVICE_NATIVE_ENDIAN);
2993}
2994
2995uint32_t address_space_ldl_le(AddressSpace *as, hwaddr addr,
2996 MemTxAttrs attrs, MemTxResult *result)
2997{
2998 return address_space_ldl_internal(as, addr, attrs, result,
2999 DEVICE_LITTLE_ENDIAN);
3000}
3001
3002uint32_t address_space_ldl_be(AddressSpace *as, hwaddr addr,
3003 MemTxAttrs attrs, MemTxResult *result)
3004{
3005 return address_space_ldl_internal(as, addr, attrs, result,
3006 DEVICE_BIG_ENDIAN);
3007}
3008
3009uint32_t ldl_phys(AddressSpace *as, hwaddr addr)
3010{
3011 return address_space_ldl(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3012}
3013
3014uint32_t ldl_le_phys(AddressSpace *as, hwaddr addr)
3015{
3016 return address_space_ldl_le(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3017}
3018
3019uint32_t ldl_be_phys(AddressSpace *as, hwaddr addr)
3020{
3021 return address_space_ldl_be(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3022}
3023
3024/* warning: addr must be aligned */
3025static inline uint64_t address_space_ldq_internal(AddressSpace *as, hwaddr addr,
3026 MemTxAttrs attrs,
3027 MemTxResult *result,
3028 enum device_endian endian)
3029{
3030 uint8_t *ptr;
3031 uint64_t val;
3032 MemoryRegion *mr;
3033 hwaddr l = 8;
3034 hwaddr addr1;
3035 MemTxResult r;
3036 bool release_lock = false;
3037
3038 rcu_read_lock();
3039 mr = address_space_translate(as, addr, &addr1, &l,
3040 false);
3041 if (l < 8 || !memory_access_is_direct(mr, false)) {
3042 release_lock |= prepare_mmio_access(mr);
3043
3044 /* I/O case */
3045 r = memory_region_dispatch_read(mr, addr1, &val, 8, attrs);
3046#if defined(TARGET_WORDS_BIGENDIAN)
3047 if (endian == DEVICE_LITTLE_ENDIAN) {
3048 val = bswap64(val);
3049 }
3050#else
3051 if (endian == DEVICE_BIG_ENDIAN) {
3052 val = bswap64(val);
3053 }
3054#endif
3055 } else {
3056 /* RAM case */
3057 ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(mr)
3058 & TARGET_PAGE_MASK)
3059 + addr1);
3060 switch (endian) {
3061 case DEVICE_LITTLE_ENDIAN:
3062 val = ldq_le_p(ptr);
3063 break;
3064 case DEVICE_BIG_ENDIAN:
3065 val = ldq_be_p(ptr);
3066 break;
3067 default:
3068 val = ldq_p(ptr);
3069 break;
3070 }
3071 r = MEMTX_OK;
3072 }
3073 if (result) {
3074 *result = r;
3075 }
3076 if (release_lock) {
3077 qemu_mutex_unlock_iothread();
3078 }
3079 rcu_read_unlock();
3080 return val;
3081}
3082
3083uint64_t address_space_ldq(AddressSpace *as, hwaddr addr,
3084 MemTxAttrs attrs, MemTxResult *result)
3085{
3086 return address_space_ldq_internal(as, addr, attrs, result,
3087 DEVICE_NATIVE_ENDIAN);
3088}
3089
3090uint64_t address_space_ldq_le(AddressSpace *as, hwaddr addr,
3091 MemTxAttrs attrs, MemTxResult *result)
3092{
3093 return address_space_ldq_internal(as, addr, attrs, result,
3094 DEVICE_LITTLE_ENDIAN);
3095}
3096
3097uint64_t address_space_ldq_be(AddressSpace *as, hwaddr addr,
3098 MemTxAttrs attrs, MemTxResult *result)
3099{
3100 return address_space_ldq_internal(as, addr, attrs, result,
3101 DEVICE_BIG_ENDIAN);
3102}
3103
3104uint64_t ldq_phys(AddressSpace *as, hwaddr addr)
3105{
3106 return address_space_ldq(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3107}
3108
3109uint64_t ldq_le_phys(AddressSpace *as, hwaddr addr)
3110{
3111 return address_space_ldq_le(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3112}
3113
3114uint64_t ldq_be_phys(AddressSpace *as, hwaddr addr)
3115{
3116 return address_space_ldq_be(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3117}
3118
3119/* XXX: optimize */
3120uint32_t address_space_ldub(AddressSpace *as, hwaddr addr,
3121 MemTxAttrs attrs, MemTxResult *result)
3122{
3123 uint8_t val;
3124 MemTxResult r;
3125
3126 r = address_space_rw(as, addr, attrs, &val, 1, 0);
3127 if (result) {
3128 *result = r;
3129 }
3130 return val;
3131}
3132
3133uint32_t ldub_phys(AddressSpace *as, hwaddr addr)
3134{
3135 return address_space_ldub(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
3136}
3137
3138/* warning: addr must be aligned */
3139static inline uint32_t address_space_lduw_internal(AddressSpace *as,
3140 hwaddr addr,
3141 MemTxAttrs attrs,
3142 MemTxResult *result,
3143 enum device_endian endian)
3144{
3145 uint8_t *ptr;
3146 uint64_t val;
3147 MemoryRegion *mr;
3148 hwaddr l = 2;
3149 hwaddr addr1;
3150 MemTxResult r;
3151 bool release_lock = false;
3152
3153 rcu_read_lock();
3154 mr = address_space_translate(as, addr, &addr1, &l,
3155 false);
3156 if (l < 2 || !memory_access_is_direct(mr, false)) {
3157 release_lock |= prepare_mmio_access(mr);
3158
3159 /* I/O case */
3160 r = memory_region_dispatch_read(mr, addr1, &val, 2, attrs);
3161#if defined(TARGET_WORDS_BIGENDIAN)
3162 if (endian == DEVICE_LITTLE_ENDIAN) {
3163 val = bswap16(val);
3164 }
3165#else
3166 if (endian == DEVICE_BIG_ENDIAN) {
3167 val = bswap16(val);
3168 }
3169#endif
3170 } else {
3171 /* RAM case */
3172 ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(mr)
3173 & TARGET_PAGE_MASK)
3174 + addr1);
3175 switch (endian) {
3176 case DEVICE_LITTLE_ENDIAN:
3177 val = lduw_le_p(ptr);
3178 break;
3179 case DEVICE_BIG_ENDIAN:
3180 val = lduw_be_p(ptr);
3181 break;
3182 default:
3183 val = lduw_p(ptr);
3184 break;
3185 }
3186 r = MEMTX_OK;
3187 }
3188 if (result) {
3189 *result = r;
3190 }
3191 if (release_lock) {
3192 qemu_mutex_unlock_iothread();
3193 }
3194 rcu_read_unlock();
3195 return val;
3196}
3197
3198uint32_t address_space_lduw(AddressSpace *as, hwaddr addr,
3199 MemTxAttrs attrs, MemTxResult *result)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches