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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 2aa1bf8..67ae9b8 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+qemu (1:2.5+dfsg-5ubuntu10.31) xenial; urgency=medium
7+
8+ * d/p/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch:
9+ Fix qemu-guest-agent failing to freeze filesystems that were mounted
10+ multiple times like bind mounts. (LP: #1587065).
11+
12+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 28 Jun 2018 11:35:05 +0200
13+
14 qemu (1:2.5+dfsg-5ubuntu10.30) xenial-security; urgency=medium
15
16 * SECURITY UPDATE: Speculative Store Bypass
17diff --git a/debian/patches/series b/debian/patches/series
18index 764d53c..c0a8392 100644
19--- a/debian/patches/series
20+++ b/debian/patches/series
21@@ -237,3 +237,4 @@ CVE-2018-7550.patch
22 CVE-2018-3639.patch
23 CVE-2018-3639-2.patch
24 CVE-2018-3639-3.patch
25+ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch
26diff --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
27new file mode 100644
28index 0000000..5363bd9
29--- /dev/null
30+++ b/debian/patches/ubuntu/lp-1587065-qga-ignore-EBUSY-when-freezing-a-filesystem.patch
31@@ -0,0 +1,44 @@
32+From ce2eb6c4a044d809caf4dc4e08aed77678f9760e Mon Sep 17 00:00:00 2001
33+From: Peter Lieven <pl@kamp.de>
34+Date: Tue, 31 Jan 2017 16:36:34 +0100
35+Subject: [PATCH] qga: ignore EBUSY when freezing a filesystem
36+
37+the current implementation fails if we try to freeze an
38+already frozen filesystem. This can happen if a filesystem
39+is mounted more than once (e.g. with a bind mount).
40+
41+Suggested-by: Christian Theune <ct@flyingcircus.io>
42+Cc: qemu-stable@nongnu.org
43+Signed-off-by: Peter Lieven <pl@kamp.de>
44+Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
45+Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
46+
47+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ce2eb6c4a044d809c
48+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1587065
49+Last-Update: 2018-06-28
50+
51+---
52+ qga/commands-posix.c | 5 ++++-
53+ 1 file changed, 4 insertions(+), 1 deletion(-)
54+
55+--- a/qga/commands-posix.c
56++++ b/qga/commands-posix.c
57+@@ -1255,6 +1255,9 @@ int64_t qmp_guest_fsfreeze_freeze_list(b
58+ * filesytems may not implement fsfreeze for less obvious reasons.
59+ * these will report EOPNOTSUPP. we simply ignore these when tallying
60+ * the number of frozen filesystems.
61++ * if a filesystem is mounted more than once (aka bind mount) a
62++ * consecutive attempt to freeze an already frozen filesystem will
63++ * return EBUSY.
64+ *
65+ * any other error means a failure to freeze a filesystem we
66+ * expect to be freezable, so return an error in those cases
67+@@ -1262,7 +1265,7 @@ int64_t qmp_guest_fsfreeze_freeze_list(b
68+ */
69+ ret = ioctl(fd, FIFREEZE);
70+ if (ret == -1) {
71+- if (errno != EOPNOTSUPP) {
72++ if (errno != EOPNOTSUPP && errno != EBUSY) {
73+ error_setg_errno(errp, errno, "failed to freeze %s",
74+ mount->dirname);
75+ close(fd);
76diff --git a/dump.c b/dump.c
77new file mode 100644
78index 0000000..78b7d84
79--- /dev/null
80+++ b/dump.c
81@@ -0,0 +1,1714 @@
82+/*
83+ * QEMU dump
84+ *
85+ * Copyright Fujitsu, Corp. 2011, 2012
86+ *
87+ * Authors:
88+ * Wen Congyang <wency@cn.fujitsu.com>
89+ *
90+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
91+ * See the COPYING file in the top-level directory.
92+ *
93+ */
94+
95+#include "qemu-common.h"
96+#include "elf.h"
97+#include "cpu.h"
98+#include "exec/cpu-all.h"
99+#include "exec/hwaddr.h"
100+#include "monitor/monitor.h"
101+#include "sysemu/kvm.h"
102+#include "sysemu/dump.h"
103+#include "sysemu/sysemu.h"
104+#include "sysemu/memory_mapping.h"
105+#include "sysemu/cpus.h"
106+#include "qapi/error.h"
107+#include "qapi/qmp/qerror.h"
108+#include "qmp-commands.h"
109+
110+#include <zlib.h>
111+#ifdef CONFIG_LZO
112+#include <lzo/lzo1x.h>
113+#endif
114+#ifdef CONFIG_SNAPPY
115+#include <snappy-c.h>
116+#endif
117+#ifndef ELF_MACHINE_UNAME
118+#define ELF_MACHINE_UNAME "Unknown"
119+#endif
120+
121+uint16_t cpu_to_dump16(DumpState *s, uint16_t val)
122+{
123+ if (s->dump_info.d_endian == ELFDATA2LSB) {
124+ val = cpu_to_le16(val);
125+ } else {
126+ val = cpu_to_be16(val);
127+ }
128+
129+ return val;
130+}
131+
132+uint32_t cpu_to_dump32(DumpState *s, uint32_t val)
133+{
134+ if (s->dump_info.d_endian == ELFDATA2LSB) {
135+ val = cpu_to_le32(val);
136+ } else {
137+ val = cpu_to_be32(val);
138+ }
139+
140+ return val;
141+}
142+
143+uint64_t cpu_to_dump64(DumpState *s, uint64_t val)
144+{
145+ if (s->dump_info.d_endian == ELFDATA2LSB) {
146+ val = cpu_to_le64(val);
147+ } else {
148+ val = cpu_to_be64(val);
149+ }
150+
151+ return val;
152+}
153+
154+static int dump_cleanup(DumpState *s)
155+{
156+ guest_phys_blocks_free(&s->guest_phys_blocks);
157+ memory_mapping_list_free(&s->list);
158+ close(s->fd);
159+ if (s->resume) {
160+ vm_start();
161+ }
162+
163+ return 0;
164+}
165+
166+static void dump_error(DumpState *s, const char *reason, Error **errp)
167+{
168+ dump_cleanup(s);
169+ error_setg(errp, "%s", reason);
170+}
171+
172+static int fd_write_vmcore(const void *buf, size_t size, void *opaque)
173+{
174+ DumpState *s = opaque;
175+ size_t written_size;
176+
177+ written_size = qemu_write_full(s->fd, buf, size);
178+ if (written_size != size) {
179+ return -1;
180+ }
181+
182+ return 0;
183+}
184+
185+static void write_elf64_header(DumpState *s, Error **errp)
186+{
187+ Elf64_Ehdr elf_header;
188+ int ret;
189+
190+ memset(&elf_header, 0, sizeof(Elf64_Ehdr));
191+ memcpy(&elf_header, ELFMAG, SELFMAG);
192+ elf_header.e_ident[EI_CLASS] = ELFCLASS64;
193+ elf_header.e_ident[EI_DATA] = s->dump_info.d_endian;
194+ elf_header.e_ident[EI_VERSION] = EV_CURRENT;
195+ elf_header.e_type = cpu_to_dump16(s, ET_CORE);
196+ elf_header.e_machine = cpu_to_dump16(s, s->dump_info.d_machine);
197+ elf_header.e_version = cpu_to_dump32(s, EV_CURRENT);
198+ elf_header.e_ehsize = cpu_to_dump16(s, sizeof(elf_header));
199+ elf_header.e_phoff = cpu_to_dump64(s, sizeof(Elf64_Ehdr));
200+ elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf64_Phdr));
201+ elf_header.e_phnum = cpu_to_dump16(s, s->phdr_num);
202+ if (s->have_section) {
203+ uint64_t shoff = sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) * s->sh_info;
204+
205+ elf_header.e_shoff = cpu_to_dump64(s, shoff);
206+ elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf64_Shdr));
207+ elf_header.e_shnum = cpu_to_dump16(s, 1);
208+ }
209+
210+ ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
211+ if (ret < 0) {
212+ dump_error(s, "dump: failed to write elf header", errp);
213+ }
214+}
215+
216+static void write_elf32_header(DumpState *s, Error **errp)
217+{
218+ Elf32_Ehdr elf_header;
219+ int ret;
220+
221+ memset(&elf_header, 0, sizeof(Elf32_Ehdr));
222+ memcpy(&elf_header, ELFMAG, SELFMAG);
223+ elf_header.e_ident[EI_CLASS] = ELFCLASS32;
224+ elf_header.e_ident[EI_DATA] = s->dump_info.d_endian;
225+ elf_header.e_ident[EI_VERSION] = EV_CURRENT;
226+ elf_header.e_type = cpu_to_dump16(s, ET_CORE);
227+ elf_header.e_machine = cpu_to_dump16(s, s->dump_info.d_machine);
228+ elf_header.e_version = cpu_to_dump32(s, EV_CURRENT);
229+ elf_header.e_ehsize = cpu_to_dump16(s, sizeof(elf_header));
230+ elf_header.e_phoff = cpu_to_dump32(s, sizeof(Elf32_Ehdr));
231+ elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf32_Phdr));
232+ elf_header.e_phnum = cpu_to_dump16(s, s->phdr_num);
233+ if (s->have_section) {
234+ uint32_t shoff = sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr) * s->sh_info;
235+
236+ elf_header.e_shoff = cpu_to_dump32(s, shoff);
237+ elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf32_Shdr));
238+ elf_header.e_shnum = cpu_to_dump16(s, 1);
239+ }
240+
241+ ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
242+ if (ret < 0) {
243+ dump_error(s, "dump: failed to write elf header", errp);
244+ }
245+}
246+
247+static void write_elf64_load(DumpState *s, MemoryMapping *memory_mapping,
248+ int phdr_index, hwaddr offset,
249+ hwaddr filesz, Error **errp)
250+{
251+ Elf64_Phdr phdr;
252+ int ret;
253+
254+ memset(&phdr, 0, sizeof(Elf64_Phdr));
255+ phdr.p_type = cpu_to_dump32(s, PT_LOAD);
256+ phdr.p_offset = cpu_to_dump64(s, offset);
257+ phdr.p_paddr = cpu_to_dump64(s, memory_mapping->phys_addr);
258+ phdr.p_filesz = cpu_to_dump64(s, filesz);
259+ phdr.p_memsz = cpu_to_dump64(s, memory_mapping->length);
260+ phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr);
261+
262+ assert(memory_mapping->length >= filesz);
263+
264+ ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
265+ if (ret < 0) {
266+ dump_error(s, "dump: failed to write program header table", errp);
267+ }
268+}
269+
270+static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
271+ int phdr_index, hwaddr offset,
272+ hwaddr filesz, Error **errp)
273+{
274+ Elf32_Phdr phdr;
275+ int ret;
276+
277+ memset(&phdr, 0, sizeof(Elf32_Phdr));
278+ phdr.p_type = cpu_to_dump32(s, PT_LOAD);
279+ phdr.p_offset = cpu_to_dump32(s, offset);
280+ phdr.p_paddr = cpu_to_dump32(s, memory_mapping->phys_addr);
281+ phdr.p_filesz = cpu_to_dump32(s, filesz);
282+ phdr.p_memsz = cpu_to_dump32(s, memory_mapping->length);
283+ phdr.p_vaddr = cpu_to_dump32(s, memory_mapping->virt_addr);
284+
285+ assert(memory_mapping->length >= filesz);
286+
287+ ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
288+ if (ret < 0) {
289+ dump_error(s, "dump: failed to write program header table", errp);
290+ }
291+}
292+
293+static void write_elf64_note(DumpState *s, Error **errp)
294+{
295+ Elf64_Phdr phdr;
296+ hwaddr begin = s->memory_offset - s->note_size;
297+ int ret;
298+
299+ memset(&phdr, 0, sizeof(Elf64_Phdr));
300+ phdr.p_type = cpu_to_dump32(s, PT_NOTE);
301+ phdr.p_offset = cpu_to_dump64(s, begin);
302+ phdr.p_paddr = 0;
303+ phdr.p_filesz = cpu_to_dump64(s, s->note_size);
304+ phdr.p_memsz = cpu_to_dump64(s, s->note_size);
305+ phdr.p_vaddr = 0;
306+
307+ ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
308+ if (ret < 0) {
309+ dump_error(s, "dump: failed to write program header table", errp);
310+ }
311+}
312+
313+static inline int cpu_index(CPUState *cpu)
314+{
315+ return cpu->cpu_index + 1;
316+}
317+
318+static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
319+ Error **errp)
320+{
321+ CPUState *cpu;
322+ int ret;
323+ int id;
324+
325+ CPU_FOREACH(cpu) {
326+ id = cpu_index(cpu);
327+ ret = cpu_write_elf64_note(f, cpu, id, s);
328+ if (ret < 0) {
329+ dump_error(s, "dump: failed to write elf notes", errp);
330+ return;
331+ }
332+ }
333+
334+ CPU_FOREACH(cpu) {
335+ ret = cpu_write_elf64_qemunote(f, cpu, s);
336+ if (ret < 0) {
337+ dump_error(s, "dump: failed to write CPU status", errp);
338+ return;
339+ }
340+ }
341+}
342+
343+static void write_elf32_note(DumpState *s, Error **errp)
344+{
345+ hwaddr begin = s->memory_offset - s->note_size;
346+ Elf32_Phdr phdr;
347+ int ret;
348+
349+ memset(&phdr, 0, sizeof(Elf32_Phdr));
350+ phdr.p_type = cpu_to_dump32(s, PT_NOTE);
351+ phdr.p_offset = cpu_to_dump32(s, begin);
352+ phdr.p_paddr = 0;
353+ phdr.p_filesz = cpu_to_dump32(s, s->note_size);
354+ phdr.p_memsz = cpu_to_dump32(s, s->note_size);
355+ phdr.p_vaddr = 0;
356+
357+ ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
358+ if (ret < 0) {
359+ dump_error(s, "dump: failed to write program header table", errp);
360+ }
361+}
362+
363+static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
364+ Error **errp)
365+{
366+ CPUState *cpu;
367+ int ret;
368+ int id;
369+
370+ CPU_FOREACH(cpu) {
371+ id = cpu_index(cpu);
372+ ret = cpu_write_elf32_note(f, cpu, id, s);
373+ if (ret < 0) {
374+ dump_error(s, "dump: failed to write elf notes", errp);
375+ return;
376+ }
377+ }
378+
379+ CPU_FOREACH(cpu) {
380+ ret = cpu_write_elf32_qemunote(f, cpu, s);
381+ if (ret < 0) {
382+ dump_error(s, "dump: failed to write CPU status", errp);
383+ return;
384+ }
385+ }
386+}
387+
388+static void write_elf_section(DumpState *s, int type, Error **errp)
389+{
390+ Elf32_Shdr shdr32;
391+ Elf64_Shdr shdr64;
392+ int shdr_size;
393+ void *shdr;
394+ int ret;
395+
396+ if (type == 0) {
397+ shdr_size = sizeof(Elf32_Shdr);
398+ memset(&shdr32, 0, shdr_size);
399+ shdr32.sh_info = cpu_to_dump32(s, s->sh_info);
400+ shdr = &shdr32;
401+ } else {
402+ shdr_size = sizeof(Elf64_Shdr);
403+ memset(&shdr64, 0, shdr_size);
404+ shdr64.sh_info = cpu_to_dump32(s, s->sh_info);
405+ shdr = &shdr64;
406+ }
407+
408+ ret = fd_write_vmcore(&shdr, shdr_size, s);
409+ if (ret < 0) {
410+ dump_error(s, "dump: failed to write section header table", errp);
411+ }
412+}
413+
414+static void write_data(DumpState *s, void *buf, int length, Error **errp)
415+{
416+ int ret;
417+
418+ ret = fd_write_vmcore(buf, length, s);
419+ if (ret < 0) {
420+ dump_error(s, "dump: failed to save memory", errp);
421+ }
422+}
423+
424+/* write the memory to vmcore. 1 page per I/O. */
425+static void write_memory(DumpState *s, GuestPhysBlock *block, ram_addr_t start,
426+ int64_t size, Error **errp)
427+{
428+ int64_t i;
429+ Error *local_err = NULL;
430+
431+ for (i = 0; i < size / TARGET_PAGE_SIZE; i++) {
432+ write_data(s, block->host_addr + start + i * TARGET_PAGE_SIZE,
433+ TARGET_PAGE_SIZE, &local_err);
434+ if (local_err) {
435+ error_propagate(errp, local_err);
436+ return;
437+ }
438+ }
439+
440+ if ((size % TARGET_PAGE_SIZE) != 0) {
441+ write_data(s, block->host_addr + start + i * TARGET_PAGE_SIZE,
442+ size % TARGET_PAGE_SIZE, &local_err);
443+ if (local_err) {
444+ error_propagate(errp, local_err);
445+ return;
446+ }
447+ }
448+}
449+
450+/* get the memory's offset and size in the vmcore */
451+static void get_offset_range(hwaddr phys_addr,
452+ ram_addr_t mapping_length,
453+ DumpState *s,
454+ hwaddr *p_offset,
455+ hwaddr *p_filesz)
456+{
457+ GuestPhysBlock *block;
458+ hwaddr offset = s->memory_offset;
459+ int64_t size_in_block, start;
460+
461+ /* When the memory is not stored into vmcore, offset will be -1 */
462+ *p_offset = -1;
463+ *p_filesz = 0;
464+
465+ if (s->has_filter) {
466+ if (phys_addr < s->begin || phys_addr >= s->begin + s->length) {
467+ return;
468+ }
469+ }
470+
471+ QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) {
472+ if (s->has_filter) {
473+ if (block->target_start >= s->begin + s->length ||
474+ block->target_end <= s->begin) {
475+ /* This block is out of the range */
476+ continue;
477+ }
478+
479+ if (s->begin <= block->target_start) {
480+ start = block->target_start;
481+ } else {
482+ start = s->begin;
483+ }
484+
485+ size_in_block = block->target_end - start;
486+ if (s->begin + s->length < block->target_end) {
487+ size_in_block -= block->target_end - (s->begin + s->length);
488+ }
489+ } else {
490+ start = block->target_start;
491+ size_in_block = block->target_end - block->target_start;
492+ }
493+
494+ if (phys_addr >= start && phys_addr < start + size_in_block) {
495+ *p_offset = phys_addr - start + offset;
496+
497+ /* The offset range mapped from the vmcore file must not spill over
498+ * the GuestPhysBlock, clamp it. The rest of the mapping will be
499+ * zero-filled in memory at load time; see
500+ * <http://refspecs.linuxbase.org/elf/gabi4+/ch5.pheader.html>.
501+ */
502+ *p_filesz = phys_addr + mapping_length <= start + size_in_block ?
503+ mapping_length :
504+ size_in_block - (phys_addr - start);
505+ return;
506+ }
507+
508+ offset += size_in_block;
509+ }
510+}
511+
512+static void write_elf_loads(DumpState *s, Error **errp)
513+{
514+ hwaddr offset, filesz;
515+ MemoryMapping *memory_mapping;
516+ uint32_t phdr_index = 1;
517+ uint32_t max_index;
518+ Error *local_err = NULL;
519+
520+ if (s->have_section) {
521+ max_index = s->sh_info;
522+ } else {
523+ max_index = s->phdr_num;
524+ }
525+
526+ QTAILQ_FOREACH(memory_mapping, &s->list.head, next) {
527+ get_offset_range(memory_mapping->phys_addr,
528+ memory_mapping->length,
529+ s, &offset, &filesz);
530+ if (s->dump_info.d_class == ELFCLASS64) {
531+ write_elf64_load(s, memory_mapping, phdr_index++, offset,
532+ filesz, &local_err);
533+ } else {
534+ write_elf32_load(s, memory_mapping, phdr_index++, offset,
535+ filesz, &local_err);
536+ }
537+
538+ if (local_err) {
539+ error_propagate(errp, local_err);
540+ return;
541+ }
542+
543+ if (phdr_index >= max_index) {
544+ break;
545+ }
546+ }
547+}
548+
549+/* write elf header, PT_NOTE and elf note to vmcore. */
550+static void dump_begin(DumpState *s, Error **errp)
551+{
552+ Error *local_err = NULL;
553+
554+ /*
555+ * the vmcore's format is:
556+ * --------------
557+ * | elf header |
558+ * --------------
559+ * | PT_NOTE |
560+ * --------------
561+ * | PT_LOAD |
562+ * --------------
563+ * | ...... |
564+ * --------------
565+ * | PT_LOAD |
566+ * --------------
567+ * | sec_hdr |
568+ * --------------
569+ * | elf note |
570+ * --------------
571+ * | memory |
572+ * --------------
573+ *
574+ * we only know where the memory is saved after we write elf note into
575+ * vmcore.
576+ */
577+
578+ /* write elf header to vmcore */
579+ if (s->dump_info.d_class == ELFCLASS64) {
580+ write_elf64_header(s, &local_err);
581+ } else {
582+ write_elf32_header(s, &local_err);
583+ }
584+ if (local_err) {
585+ error_propagate(errp, local_err);
586+ return;
587+ }
588+
589+ if (s->dump_info.d_class == ELFCLASS64) {
590+ /* write PT_NOTE to vmcore */
591+ write_elf64_note(s, &local_err);
592+ if (local_err) {
593+ error_propagate(errp, local_err);
594+ return;
595+ }
596+
597+ /* write all PT_LOAD to vmcore */
598+ write_elf_loads(s, &local_err);
599+ if (local_err) {
600+ error_propagate(errp, local_err);
601+ return;
602+ }
603+
604+ /* write section to vmcore */
605+ if (s->have_section) {
606+ write_elf_section(s, 1, &local_err);
607+ if (local_err) {
608+ error_propagate(errp, local_err);
609+ return;
610+ }
611+ }
612+
613+ /* write notes to vmcore */
614+ write_elf64_notes(fd_write_vmcore, s, &local_err);
615+ if (local_err) {
616+ error_propagate(errp, local_err);
617+ return;
618+ }
619+ } else {
620+ /* write PT_NOTE to vmcore */
621+ write_elf32_note(s, &local_err);
622+ if (local_err) {
623+ error_propagate(errp, local_err);
624+ return;
625+ }
626+
627+ /* write all PT_LOAD to vmcore */
628+ write_elf_loads(s, &local_err);
629+ if (local_err) {
630+ error_propagate(errp, local_err);
631+ return;
632+ }
633+
634+ /* write section to vmcore */
635+ if (s->have_section) {
636+ write_elf_section(s, 0, &local_err);
637+ if (local_err) {
638+ error_propagate(errp, local_err);
639+ return;
640+ }
641+ }
642+
643+ /* write notes to vmcore */
644+ write_elf32_notes(fd_write_vmcore, s, &local_err);
645+ if (local_err) {
646+ error_propagate(errp, local_err);
647+ return;
648+ }
649+ }
650+}
651+
652+static void dump_completed(DumpState *s)
653+{
654+ dump_cleanup(s);
655+}
656+
657+static int get_next_block(DumpState *s, GuestPhysBlock *block)
658+{
659+ while (1) {
660+ block = QTAILQ_NEXT(block, next);
661+ if (!block) {
662+ /* no more block */
663+ return 1;
664+ }
665+
666+ s->start = 0;
667+ s->next_block = block;
668+ if (s->has_filter) {
669+ if (block->target_start >= s->begin + s->length ||
670+ block->target_end <= s->begin) {
671+ /* This block is out of the range */
672+ continue;
673+ }
674+
675+ if (s->begin > block->target_start) {
676+ s->start = s->begin - block->target_start;
677+ }
678+ }
679+
680+ return 0;
681+ }
682+}
683+
684+/* write all memory to vmcore */
685+static void dump_iterate(DumpState *s, Error **errp)
686+{
687+ GuestPhysBlock *block;
688+ int64_t size;
689+ Error *local_err = NULL;
690+
691+ do {
692+ block = s->next_block;
693+
694+ size = block->target_end - block->target_start;
695+ if (s->has_filter) {
696+ size -= s->start;
697+ if (s->begin + s->length < block->target_end) {
698+ size -= block->target_end - (s->begin + s->length);
699+ }
700+ }
701+ write_memory(s, block, s->start, size, &local_err);
702+ if (local_err) {
703+ error_propagate(errp, local_err);
704+ return;
705+ }
706+
707+ } while (!get_next_block(s, block));
708+
709+ dump_completed(s);
710+}
711+
712+static void create_vmcore(DumpState *s, Error **errp)
713+{
714+ Error *local_err = NULL;
715+
716+ dump_begin(s, &local_err);
717+ if (local_err) {
718+ error_propagate(errp, local_err);
719+ return;
720+ }
721+
722+ dump_iterate(s, errp);
723+}
724+
725+static int write_start_flat_header(int fd)
726+{
727+ MakedumpfileHeader *mh;
728+ int ret = 0;
729+
730+ QEMU_BUILD_BUG_ON(sizeof *mh > MAX_SIZE_MDF_HEADER);
731+ mh = g_malloc0(MAX_SIZE_MDF_HEADER);
732+
733+ memcpy(mh->signature, MAKEDUMPFILE_SIGNATURE,
734+ MIN(sizeof mh->signature, sizeof MAKEDUMPFILE_SIGNATURE));
735+
736+ mh->type = cpu_to_be64(TYPE_FLAT_HEADER);
737+ mh->version = cpu_to_be64(VERSION_FLAT_HEADER);
738+
739+ size_t written_size;
740+ written_size = qemu_write_full(fd, mh, MAX_SIZE_MDF_HEADER);
741+ if (written_size != MAX_SIZE_MDF_HEADER) {
742+ ret = -1;
743+ }
744+
745+ g_free(mh);
746+ return ret;
747+}
748+
749+static int write_end_flat_header(int fd)
750+{
751+ MakedumpfileDataHeader mdh;
752+
753+ mdh.offset = END_FLAG_FLAT_HEADER;
754+ mdh.buf_size = END_FLAG_FLAT_HEADER;
755+
756+ size_t written_size;
757+ written_size = qemu_write_full(fd, &mdh, sizeof(mdh));
758+ if (written_size != sizeof(mdh)) {
759+ return -1;
760+ }
761+
762+ return 0;
763+}
764+
765+static int write_buffer(int fd, off_t offset, const void *buf, size_t size)
766+{
767+ size_t written_size;
768+ MakedumpfileDataHeader mdh;
769+
770+ mdh.offset = cpu_to_be64(offset);
771+ mdh.buf_size = cpu_to_be64(size);
772+
773+ written_size = qemu_write_full(fd, &mdh, sizeof(mdh));
774+ if (written_size != sizeof(mdh)) {
775+ return -1;
776+ }
777+
778+ written_size = qemu_write_full(fd, buf, size);
779+ if (written_size != size) {
780+ return -1;
781+ }
782+
783+ return 0;
784+}
785+
786+static int buf_write_note(const void *buf, size_t size, void *opaque)
787+{
788+ DumpState *s = opaque;
789+
790+ /* note_buf is not enough */
791+ if (s->note_buf_offset + size > s->note_size) {
792+ return -1;
793+ }
794+
795+ memcpy(s->note_buf + s->note_buf_offset, buf, size);
796+
797+ s->note_buf_offset += size;
798+
799+ return 0;
800+}
801+
802+/* write common header, sub header and elf note to vmcore */
803+static void create_header32(DumpState *s, Error **errp)
804+{
805+ DiskDumpHeader32 *dh = NULL;
806+ KdumpSubHeader32 *kh = NULL;
807+ size_t size;
808+ uint32_t block_size;
809+ uint32_t sub_hdr_size;
810+ uint32_t bitmap_blocks;
811+ uint32_t status = 0;
812+ uint64_t offset_note;
813+ Error *local_err = NULL;
814+
815+ /* write common header, the version of kdump-compressed format is 6th */
816+ size = sizeof(DiskDumpHeader32);
817+ dh = g_malloc0(size);
818+
819+ strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
820+ dh->header_version = cpu_to_dump32(s, 6);
821+ block_size = TARGET_PAGE_SIZE;
822+ dh->block_size = cpu_to_dump32(s, block_size);
823+ sub_hdr_size = sizeof(struct KdumpSubHeader32) + s->note_size;
824+ sub_hdr_size = DIV_ROUND_UP(sub_hdr_size, block_size);
825+ dh->sub_hdr_size = cpu_to_dump32(s, sub_hdr_size);
826+ /* dh->max_mapnr may be truncated, full 64bit is in kh.max_mapnr_64 */
827+ dh->max_mapnr = cpu_to_dump32(s, MIN(s->max_mapnr, UINT_MAX));
828+ dh->nr_cpus = cpu_to_dump32(s, s->nr_cpus);
829+ bitmap_blocks = DIV_ROUND_UP(s->len_dump_bitmap, block_size) * 2;
830+ dh->bitmap_blocks = cpu_to_dump32(s, bitmap_blocks);
831+ strncpy(dh->utsname.machine, ELF_MACHINE_UNAME, sizeof(dh->utsname.machine));
832+
833+ if (s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) {
834+ status |= DUMP_DH_COMPRESSED_ZLIB;
835+ }
836+#ifdef CONFIG_LZO
837+ if (s->flag_compress & DUMP_DH_COMPRESSED_LZO) {
838+ status |= DUMP_DH_COMPRESSED_LZO;
839+ }
840+#endif
841+#ifdef CONFIG_SNAPPY
842+ if (s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) {
843+ status |= DUMP_DH_COMPRESSED_SNAPPY;
844+ }
845+#endif
846+ dh->status = cpu_to_dump32(s, status);
847+
848+ if (write_buffer(s->fd, 0, dh, size) < 0) {
849+ dump_error(s, "dump: failed to write disk dump header", errp);
850+ goto out;
851+ }
852+
853+ /* write sub header */
854+ size = sizeof(KdumpSubHeader32);
855+ kh = g_malloc0(size);
856+
857+ /* 64bit max_mapnr_64 */
858+ kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
859+ kh->phys_base = cpu_to_dump32(s, PHYS_BASE);
860+ kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
861+
862+ offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
863+ kh->offset_note = cpu_to_dump64(s, offset_note);
864+ kh->note_size = cpu_to_dump32(s, s->note_size);
865+
866+ if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
867+ block_size, kh, size) < 0) {
868+ dump_error(s, "dump: failed to write kdump sub header", errp);
869+ goto out;
870+ }
871+
872+ /* write note */
873+ s->note_buf = g_malloc0(s->note_size);
874+ s->note_buf_offset = 0;
875+
876+ /* use s->note_buf to store notes temporarily */
877+ write_elf32_notes(buf_write_note, s, &local_err);
878+ if (local_err) {
879+ error_propagate(errp, local_err);
880+ goto out;
881+ }
882+ if (write_buffer(s->fd, offset_note, s->note_buf,
883+ s->note_size) < 0) {
884+ dump_error(s, "dump: failed to write notes", errp);
885+ goto out;
886+ }
887+
888+ /* get offset of dump_bitmap */
889+ s->offset_dump_bitmap = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size) *
890+ block_size;
891+
892+ /* get offset of page */
893+ s->offset_page = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size + bitmap_blocks) *
894+ block_size;
895+
896+out:
897+ g_free(dh);
898+ g_free(kh);
899+ g_free(s->note_buf);
900+}
901+
902+/* write common header, sub header and elf note to vmcore */
903+static void create_header64(DumpState *s, Error **errp)
904+{
905+ DiskDumpHeader64 *dh = NULL;
906+ KdumpSubHeader64 *kh = NULL;
907+ size_t size;
908+ uint32_t block_size;
909+ uint32_t sub_hdr_size;
910+ uint32_t bitmap_blocks;
911+ uint32_t status = 0;
912+ uint64_t offset_note;
913+ Error *local_err = NULL;
914+
915+ /* write common header, the version of kdump-compressed format is 6th */
916+ size = sizeof(DiskDumpHeader64);
917+ dh = g_malloc0(size);
918+
919+ strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
920+ dh->header_version = cpu_to_dump32(s, 6);
921+ block_size = TARGET_PAGE_SIZE;
922+ dh->block_size = cpu_to_dump32(s, block_size);
923+ sub_hdr_size = sizeof(struct KdumpSubHeader64) + s->note_size;
924+ sub_hdr_size = DIV_ROUND_UP(sub_hdr_size, block_size);
925+ dh->sub_hdr_size = cpu_to_dump32(s, sub_hdr_size);
926+ /* dh->max_mapnr may be truncated, full 64bit is in kh.max_mapnr_64 */
927+ dh->max_mapnr = cpu_to_dump32(s, MIN(s->max_mapnr, UINT_MAX));
928+ dh->nr_cpus = cpu_to_dump32(s, s->nr_cpus);
929+ bitmap_blocks = DIV_ROUND_UP(s->len_dump_bitmap, block_size) * 2;
930+ dh->bitmap_blocks = cpu_to_dump32(s, bitmap_blocks);
931+ strncpy(dh->utsname.machine, ELF_MACHINE_UNAME, sizeof(dh->utsname.machine));
932+
933+ if (s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) {
934+ status |= DUMP_DH_COMPRESSED_ZLIB;
935+ }
936+#ifdef CONFIG_LZO
937+ if (s->flag_compress & DUMP_DH_COMPRESSED_LZO) {
938+ status |= DUMP_DH_COMPRESSED_LZO;
939+ }
940+#endif
941+#ifdef CONFIG_SNAPPY
942+ if (s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) {
943+ status |= DUMP_DH_COMPRESSED_SNAPPY;
944+ }
945+#endif
946+ dh->status = cpu_to_dump32(s, status);
947+
948+ if (write_buffer(s->fd, 0, dh, size) < 0) {
949+ dump_error(s, "dump: failed to write disk dump header", errp);
950+ goto out;
951+ }
952+
953+ /* write sub header */
954+ size = sizeof(KdumpSubHeader64);
955+ kh = g_malloc0(size);
956+
957+ /* 64bit max_mapnr_64 */
958+ kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
959+ kh->phys_base = cpu_to_dump64(s, PHYS_BASE);
960+ kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
961+
962+ offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
963+ kh->offset_note = cpu_to_dump64(s, offset_note);
964+ kh->note_size = cpu_to_dump64(s, s->note_size);
965+
966+ if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
967+ block_size, kh, size) < 0) {
968+ dump_error(s, "dump: failed to write kdump sub header", errp);
969+ goto out;
970+ }
971+
972+ /* write note */
973+ s->note_buf = g_malloc0(s->note_size);
974+ s->note_buf_offset = 0;
975+
976+ /* use s->note_buf to store notes temporarily */
977+ write_elf64_notes(buf_write_note, s, &local_err);
978+ if (local_err) {
979+ error_propagate(errp, local_err);
980+ goto out;
981+ }
982+
983+ if (write_buffer(s->fd, offset_note, s->note_buf,
984+ s->note_size) < 0) {
985+ dump_error(s, "dump: failed to write notes", errp);
986+ goto out;
987+ }
988+
989+ /* get offset of dump_bitmap */
990+ s->offset_dump_bitmap = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size) *
991+ block_size;
992+
993+ /* get offset of page */
994+ s->offset_page = (DISKDUMP_HEADER_BLOCKS + sub_hdr_size + bitmap_blocks) *
995+ block_size;
996+
997+out:
998+ g_free(dh);
999+ g_free(kh);
1000+ g_free(s->note_buf);
1001+}
1002+
1003+static void write_dump_header(DumpState *s, Error **errp)
1004+{
1005+ Error *local_err = NULL;
1006+
1007+ if (s->dump_info.d_class == ELFCLASS32) {
1008+ create_header32(s, &local_err);
1009+ } else {
1010+ create_header64(s, &local_err);
1011+ }
1012+ if (local_err) {
1013+ error_propagate(errp, local_err);
1014+ }
1015+}
1016+
1017+/*
1018+ * set dump_bitmap sequencely. the bit before last_pfn is not allowed to be
1019+ * rewritten, so if need to set the first bit, set last_pfn and pfn to 0.
1020+ * set_dump_bitmap will always leave the recently set bit un-sync. And setting
1021+ * (last bit + sizeof(buf) * 8) to 0 will do flushing the content in buf into
1022+ * vmcore, ie. synchronizing un-sync bit into vmcore.
1023+ */
1024+static int set_dump_bitmap(uint64_t last_pfn, uint64_t pfn, bool value,
1025+ uint8_t *buf, DumpState *s)
1026+{
1027+ off_t old_offset, new_offset;
1028+ off_t offset_bitmap1, offset_bitmap2;
1029+ uint32_t byte, bit;
1030+
1031+ /* should not set the previous place */
1032+ assert(last_pfn <= pfn);
1033+
1034+ /*
1035+ * if the bit needed to be set is not cached in buf, flush the data in buf
1036+ * to vmcore firstly.
1037+ * making new_offset be bigger than old_offset can also sync remained data
1038+ * into vmcore.
1039+ */
1040+ old_offset = BUFSIZE_BITMAP * (last_pfn / PFN_BUFBITMAP);
1041+ new_offset = BUFSIZE_BITMAP * (pfn / PFN_BUFBITMAP);
1042+
1043+ while (old_offset < new_offset) {
1044+ /* calculate the offset and write dump_bitmap */
1045+ offset_bitmap1 = s->offset_dump_bitmap + old_offset;
1046+ if (write_buffer(s->fd, offset_bitmap1, buf,
1047+ BUFSIZE_BITMAP) < 0) {
1048+ return -1;
1049+ }
1050+
1051+ /* dump level 1 is chosen, so 1st and 2nd bitmap are same */
1052+ offset_bitmap2 = s->offset_dump_bitmap + s->len_dump_bitmap +
1053+ old_offset;
1054+ if (write_buffer(s->fd, offset_bitmap2, buf,
1055+ BUFSIZE_BITMAP) < 0) {
1056+ return -1;
1057+ }
1058+
1059+ memset(buf, 0, BUFSIZE_BITMAP);
1060+ old_offset += BUFSIZE_BITMAP;
1061+ }
1062+
1063+ /* get the exact place of the bit in the buf, and set it */
1064+ byte = (pfn % PFN_BUFBITMAP) / CHAR_BIT;
1065+ bit = (pfn % PFN_BUFBITMAP) % CHAR_BIT;
1066+ if (value) {
1067+ buf[byte] |= 1u << bit;
1068+ } else {
1069+ buf[byte] &= ~(1u << bit);
1070+ }
1071+
1072+ return 0;
1073+}
1074+
1075+/*
1076+ * exam every page and return the page frame number and the address of the page.
1077+ * bufptr can be NULL. note: the blocks here is supposed to reflect guest-phys
1078+ * blocks, so block->target_start and block->target_end should be interal
1079+ * multiples of the target page size.
1080+ */
1081+static bool get_next_page(GuestPhysBlock **blockptr, uint64_t *pfnptr,
1082+ uint8_t **bufptr, DumpState *s)
1083+{
1084+ GuestPhysBlock *block = *blockptr;
1085+ hwaddr addr;
1086+ uint8_t *buf;
1087+
1088+ /* block == NULL means the start of the iteration */
1089+ if (!block) {
1090+ block = QTAILQ_FIRST(&s->guest_phys_blocks.head);
1091+ *blockptr = block;
1092+ assert((block->target_start & ~TARGET_PAGE_MASK) == 0);
1093+ assert((block->target_end & ~TARGET_PAGE_MASK) == 0);
1094+ *pfnptr = paddr_to_pfn(block->target_start);
1095+ if (bufptr) {
1096+ *bufptr = block->host_addr;
1097+ }
1098+ return true;
1099+ }
1100+
1101+ *pfnptr = *pfnptr + 1;
1102+ addr = pfn_to_paddr(*pfnptr);
1103+
1104+ if ((addr >= block->target_start) &&
1105+ (addr + TARGET_PAGE_SIZE <= block->target_end)) {
1106+ buf = block->host_addr + (addr - block->target_start);
1107+ } else {
1108+ /* the next page is in the next block */
1109+ block = QTAILQ_NEXT(block, next);
1110+ *blockptr = block;
1111+ if (!block) {
1112+ return false;
1113+ }
1114+ assert((block->target_start & ~TARGET_PAGE_MASK) == 0);
1115+ assert((block->target_end & ~TARGET_PAGE_MASK) == 0);
1116+ *pfnptr = paddr_to_pfn(block->target_start);
1117+ buf = block->host_addr;
1118+ }
1119+
1120+ if (bufptr) {
1121+ *bufptr = buf;
1122+ }
1123+
1124+ return true;
1125+}
1126+
1127+static void write_dump_bitmap(DumpState *s, Error **errp)
1128+{
1129+ int ret = 0;
1130+ uint64_t last_pfn, pfn;
1131+ void *dump_bitmap_buf;
1132+ size_t num_dumpable;
1133+ GuestPhysBlock *block_iter = NULL;
1134+
1135+ /* dump_bitmap_buf is used to store dump_bitmap temporarily */
1136+ dump_bitmap_buf = g_malloc0(BUFSIZE_BITMAP);
1137+
1138+ num_dumpable = 0;
1139+ last_pfn = 0;
1140+
1141+ /*
1142+ * exam memory page by page, and set the bit in dump_bitmap corresponded
1143+ * to the existing page.
1144+ */
1145+ while (get_next_page(&block_iter, &pfn, NULL, s)) {
1146+ ret = set_dump_bitmap(last_pfn, pfn, true, dump_bitmap_buf, s);
1147+ if (ret < 0) {
1148+ dump_error(s, "dump: failed to set dump_bitmap", errp);
1149+ goto out;
1150+ }
1151+
1152+ last_pfn = pfn;
1153+ num_dumpable++;
1154+ }
1155+
1156+ /*
1157+ * set_dump_bitmap will always leave the recently set bit un-sync. Here we
1158+ * set last_pfn + PFN_BUFBITMAP to 0 and those set but un-sync bit will be
1159+ * synchronized into vmcore.
1160+ */
1161+ if (num_dumpable > 0) {
1162+ ret = set_dump_bitmap(last_pfn, last_pfn + PFN_BUFBITMAP, false,
1163+ dump_bitmap_buf, s);
1164+ if (ret < 0) {
1165+ dump_error(s, "dump: failed to sync dump_bitmap", errp);
1166+ goto out;
1167+ }
1168+ }
1169+
1170+ /* number of dumpable pages that will be dumped later */
1171+ s->num_dumpable = num_dumpable;
1172+
1173+out:
1174+ g_free(dump_bitmap_buf);
1175+}
1176+
1177+static void prepare_data_cache(DataCache *data_cache, DumpState *s,
1178+ off_t offset)
1179+{
1180+ data_cache->fd = s->fd;
1181+ data_cache->data_size = 0;
1182+ data_cache->buf_size = BUFSIZE_DATA_CACHE;
1183+ data_cache->buf = g_malloc0(BUFSIZE_DATA_CACHE);
1184+ data_cache->offset = offset;
1185+}
1186+
1187+static int write_cache(DataCache *dc, const void *buf, size_t size,
1188+ bool flag_sync)
1189+{
1190+ /*
1191+ * dc->buf_size should not be less than size, otherwise dc will never be
1192+ * enough
1193+ */
1194+ assert(size <= dc->buf_size);
1195+
1196+ /*
1197+ * if flag_sync is set, synchronize data in dc->buf into vmcore.
1198+ * otherwise check if the space is enough for caching data in buf, if not,
1199+ * write the data in dc->buf to dc->fd and reset dc->buf
1200+ */
1201+ if ((!flag_sync && dc->data_size + size > dc->buf_size) ||
1202+ (flag_sync && dc->data_size > 0)) {
1203+ if (write_buffer(dc->fd, dc->offset, dc->buf, dc->data_size) < 0) {
1204+ return -1;
1205+ }
1206+
1207+ dc->offset += dc->data_size;
1208+ dc->data_size = 0;
1209+ }
1210+
1211+ if (!flag_sync) {
1212+ memcpy(dc->buf + dc->data_size, buf, size);
1213+ dc->data_size += size;
1214+ }
1215+
1216+ return 0;
1217+}
1218+
1219+static void free_data_cache(DataCache *data_cache)
1220+{
1221+ g_free(data_cache->buf);
1222+}
1223+
1224+static size_t get_len_buf_out(size_t page_size, uint32_t flag_compress)
1225+{
1226+ switch (flag_compress) {
1227+ case DUMP_DH_COMPRESSED_ZLIB:
1228+ return compressBound(page_size);
1229+
1230+ case DUMP_DH_COMPRESSED_LZO:
1231+ /*
1232+ * LZO will expand incompressible data by a little amount. Please check
1233+ * the following URL to see the expansion calculation:
1234+ * http://www.oberhumer.com/opensource/lzo/lzofaq.php
1235+ */
1236+ return page_size + page_size / 16 + 64 + 3;
1237+
1238+#ifdef CONFIG_SNAPPY
1239+ case DUMP_DH_COMPRESSED_SNAPPY:
1240+ return snappy_max_compressed_length(page_size);
1241+#endif
1242+ }
1243+ return 0;
1244+}
1245+
1246+/*
1247+ * check if the page is all 0
1248+ */
1249+static inline bool is_zero_page(const uint8_t *buf, size_t page_size)
1250+{
1251+ return buffer_is_zero(buf, page_size);
1252+}
1253+
1254+static void write_dump_pages(DumpState *s, Error **errp)
1255+{
1256+ int ret = 0;
1257+ DataCache page_desc, page_data;
1258+ size_t len_buf_out, size_out;
1259+#ifdef CONFIG_LZO
1260+ lzo_bytep wrkmem = NULL;
1261+#endif
1262+ uint8_t *buf_out = NULL;
1263+ off_t offset_desc, offset_data;
1264+ PageDescriptor pd, pd_zero;
1265+ uint8_t *buf;
1266+ GuestPhysBlock *block_iter = NULL;
1267+ uint64_t pfn_iter;
1268+
1269+ /* get offset of page_desc and page_data in dump file */
1270+ offset_desc = s->offset_page;
1271+ offset_data = offset_desc + sizeof(PageDescriptor) * s->num_dumpable;
1272+
1273+ prepare_data_cache(&page_desc, s, offset_desc);
1274+ prepare_data_cache(&page_data, s, offset_data);
1275+
1276+ /* prepare buffer to store compressed data */
1277+ len_buf_out = get_len_buf_out(TARGET_PAGE_SIZE, s->flag_compress);
1278+ assert(len_buf_out != 0);
1279+
1280+#ifdef CONFIG_LZO
1281+ wrkmem = g_malloc(LZO1X_1_MEM_COMPRESS);
1282+#endif
1283+
1284+ buf_out = g_malloc(len_buf_out);
1285+
1286+ /*
1287+ * init zero page's page_desc and page_data, because every zero page
1288+ * uses the same page_data
1289+ */
1290+ pd_zero.size = cpu_to_dump32(s, TARGET_PAGE_SIZE);
1291+ pd_zero.flags = cpu_to_dump32(s, 0);
1292+ pd_zero.offset = cpu_to_dump64(s, offset_data);
1293+ pd_zero.page_flags = cpu_to_dump64(s, 0);
1294+ buf = g_malloc0(TARGET_PAGE_SIZE);
1295+ ret = write_cache(&page_data, buf, TARGET_PAGE_SIZE, false);
1296+ g_free(buf);
1297+ if (ret < 0) {
1298+ dump_error(s, "dump: failed to write page data (zero page)", errp);
1299+ goto out;
1300+ }
1301+
1302+ offset_data += TARGET_PAGE_SIZE;
1303+
1304+ /*
1305+ * dump memory to vmcore page by page. zero page will all be resided in the
1306+ * first page of page section
1307+ */
1308+ while (get_next_page(&block_iter, &pfn_iter, &buf, s)) {
1309+ /* check zero page */
1310+ if (is_zero_page(buf, TARGET_PAGE_SIZE)) {
1311+ ret = write_cache(&page_desc, &pd_zero, sizeof(PageDescriptor),
1312+ false);
1313+ if (ret < 0) {
1314+ dump_error(s, "dump: failed to write page desc", errp);
1315+ goto out;
1316+ }
1317+ } else {
1318+ /*
1319+ * not zero page, then:
1320+ * 1. compress the page
1321+ * 2. write the compressed page into the cache of page_data
1322+ * 3. get page desc of the compressed page and write it into the
1323+ * cache of page_desc
1324+ *
1325+ * only one compression format will be used here, for
1326+ * s->flag_compress is set. But when compression fails to work,
1327+ * we fall back to save in plaintext.
1328+ */
1329+ size_out = len_buf_out;
1330+ if ((s->flag_compress & DUMP_DH_COMPRESSED_ZLIB) &&
1331+ (compress2(buf_out, (uLongf *)&size_out, buf,
1332+ TARGET_PAGE_SIZE, Z_BEST_SPEED) == Z_OK) &&
1333+ (size_out < TARGET_PAGE_SIZE)) {
1334+ pd.flags = cpu_to_dump32(s, DUMP_DH_COMPRESSED_ZLIB);
1335+ pd.size = cpu_to_dump32(s, size_out);
1336+
1337+ ret = write_cache(&page_data, buf_out, size_out, false);
1338+ if (ret < 0) {
1339+ dump_error(s, "dump: failed to write page data", errp);
1340+ goto out;
1341+ }
1342+#ifdef CONFIG_LZO
1343+ } else if ((s->flag_compress & DUMP_DH_COMPRESSED_LZO) &&
1344+ (lzo1x_1_compress(buf, TARGET_PAGE_SIZE, buf_out,
1345+ (lzo_uint *)&size_out, wrkmem) == LZO_E_OK) &&
1346+ (size_out < TARGET_PAGE_SIZE)) {
1347+ pd.flags = cpu_to_dump32(s, DUMP_DH_COMPRESSED_LZO);
1348+ pd.size = cpu_to_dump32(s, size_out);
1349+
1350+ ret = write_cache(&page_data, buf_out, size_out, false);
1351+ if (ret < 0) {
1352+ dump_error(s, "dump: failed to write page data", errp);
1353+ goto out;
1354+ }
1355+#endif
1356+#ifdef CONFIG_SNAPPY
1357+ } else if ((s->flag_compress & DUMP_DH_COMPRESSED_SNAPPY) &&
1358+ (snappy_compress((char *)buf, TARGET_PAGE_SIZE,
1359+ (char *)buf_out, &size_out) == SNAPPY_OK) &&
1360+ (size_out < TARGET_PAGE_SIZE)) {
1361+ pd.flags = cpu_to_dump32(s, DUMP_DH_COMPRESSED_SNAPPY);
1362+ pd.size = cpu_to_dump32(s, size_out);
1363+
1364+ ret = write_cache(&page_data, buf_out, size_out, false);
1365+ if (ret < 0) {
1366+ dump_error(s, "dump: failed to write page data", errp);
1367+ goto out;
1368+ }
1369+#endif
1370+ } else {
1371+ /*
1372+ * fall back to save in plaintext, size_out should be
1373+ * assigned TARGET_PAGE_SIZE
1374+ */
1375+ pd.flags = cpu_to_dump32(s, 0);
1376+ size_out = TARGET_PAGE_SIZE;
1377+ pd.size = cpu_to_dump32(s, size_out);
1378+
1379+ ret = write_cache(&page_data, buf, TARGET_PAGE_SIZE, false);
1380+ if (ret < 0) {
1381+ dump_error(s, "dump: failed to write page data", errp);
1382+ goto out;
1383+ }
1384+ }
1385+
1386+ /* get and write page desc here */
1387+ pd.page_flags = cpu_to_dump64(s, 0);
1388+ pd.offset = cpu_to_dump64(s, offset_data);
1389+ offset_data += size_out;
1390+
1391+ ret = write_cache(&page_desc, &pd, sizeof(PageDescriptor), false);
1392+ if (ret < 0) {
1393+ dump_error(s, "dump: failed to write page desc", errp);
1394+ goto out;
1395+ }
1396+ }
1397+ }
1398+
1399+ ret = write_cache(&page_desc, NULL, 0, true);
1400+ if (ret < 0) {
1401+ dump_error(s, "dump: failed to sync cache for page_desc", errp);
1402+ goto out;
1403+ }
1404+ ret = write_cache(&page_data, NULL, 0, true);
1405+ if (ret < 0) {
1406+ dump_error(s, "dump: failed to sync cache for page_data", errp);
1407+ goto out;
1408+ }
1409+
1410+out:
1411+ free_data_cache(&page_desc);
1412+ free_data_cache(&page_data);
1413+
1414+#ifdef CONFIG_LZO
1415+ g_free(wrkmem);
1416+#endif
1417+
1418+ g_free(buf_out);
1419+}
1420+
1421+static void create_kdump_vmcore(DumpState *s, Error **errp)
1422+{
1423+ int ret;
1424+ Error *local_err = NULL;
1425+
1426+ /*
1427+ * the kdump-compressed format is:
1428+ * File offset
1429+ * +------------------------------------------+ 0x0
1430+ * | main header (struct disk_dump_header) |
1431+ * |------------------------------------------+ block 1
1432+ * | sub header (struct kdump_sub_header) |
1433+ * |------------------------------------------+ block 2
1434+ * | 1st-dump_bitmap |
1435+ * |------------------------------------------+ block 2 + X blocks
1436+ * | 2nd-dump_bitmap | (aligned by block)
1437+ * |------------------------------------------+ block 2 + 2 * X blocks
1438+ * | page desc for pfn 0 (struct page_desc) | (aligned by block)
1439+ * | page desc for pfn 1 (struct page_desc) |
1440+ * | : |
1441+ * |------------------------------------------| (not aligned by block)
1442+ * | page data (pfn 0) |
1443+ * | page data (pfn 1) |
1444+ * | : |
1445+ * +------------------------------------------+
1446+ */
1447+
1448+ ret = write_start_flat_header(s->fd);
1449+ if (ret < 0) {
1450+ dump_error(s, "dump: failed to write start flat header", errp);
1451+ return;
1452+ }
1453+
1454+ write_dump_header(s, &local_err);
1455+ if (local_err) {
1456+ error_propagate(errp, local_err);
1457+ return;
1458+ }
1459+
1460+ write_dump_bitmap(s, &local_err);
1461+ if (local_err) {
1462+ error_propagate(errp, local_err);
1463+ return;
1464+ }
1465+
1466+ write_dump_pages(s, &local_err);
1467+ if (local_err) {
1468+ error_propagate(errp, local_err);
1469+ return;
1470+ }
1471+
1472+ ret = write_end_flat_header(s->fd);
1473+ if (ret < 0) {
1474+ dump_error(s, "dump: failed to write end flat header", errp);
1475+ return;
1476+ }
1477+
1478+ dump_completed(s);
1479+}
1480+
1481+static ram_addr_t get_start_block(DumpState *s)
1482+{
1483+ GuestPhysBlock *block;
1484+
1485+ if (!s->has_filter) {
1486+ s->next_block = QTAILQ_FIRST(&s->guest_phys_blocks.head);
1487+ return 0;
1488+ }
1489+
1490+ QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) {
1491+ if (block->target_start >= s->begin + s->length ||
1492+ block->target_end <= s->begin) {
1493+ /* This block is out of the range */
1494+ continue;
1495+ }
1496+
1497+ s->next_block = block;
1498+ if (s->begin > block->target_start) {
1499+ s->start = s->begin - block->target_start;
1500+ } else {
1501+ s->start = 0;
1502+ }
1503+ return s->start;
1504+ }
1505+
1506+ return -1;
1507+}
1508+
1509+static void get_max_mapnr(DumpState *s)
1510+{
1511+ GuestPhysBlock *last_block;
1512+
1513+ last_block = QTAILQ_LAST(&s->guest_phys_blocks.head, GuestPhysBlockHead);
1514+ s->max_mapnr = paddr_to_pfn(last_block->target_end);
1515+}
1516+
1517+static void dump_init(DumpState *s, int fd, bool has_format,
1518+ DumpGuestMemoryFormat format, bool paging, bool has_filter,
1519+ int64_t begin, int64_t length, Error **errp)
1520+{
1521+ CPUState *cpu;
1522+ int nr_cpus;
1523+ Error *err = NULL;
1524+ int ret;
1525+
1526+ /* kdump-compressed is conflict with paging and filter */
1527+ if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
1528+ assert(!paging && !has_filter);
1529+ }
1530+
1531+ if (runstate_is_running()) {
1532+ vm_stop(RUN_STATE_SAVE_VM);
1533+ s->resume = true;
1534+ } else {
1535+ s->resume = false;
1536+ }
1537+
1538+ /* If we use KVM, we should synchronize the registers before we get dump
1539+ * info or physmap info.
1540+ */
1541+ cpu_synchronize_all_states();
1542+ nr_cpus = 0;
1543+ CPU_FOREACH(cpu) {
1544+ nr_cpus++;
1545+ }
1546+
1547+ s->fd = fd;
1548+ s->has_filter = has_filter;
1549+ s->begin = begin;
1550+ s->length = length;
1551+
1552+ memory_mapping_list_init(&s->list);
1553+
1554+ guest_phys_blocks_init(&s->guest_phys_blocks);
1555+ guest_phys_blocks_append(&s->guest_phys_blocks);
1556+
1557+ s->start = get_start_block(s);
1558+ if (s->start == -1) {
1559+ error_setg(errp, QERR_INVALID_PARAMETER, "begin");
1560+ goto cleanup;
1561+ }
1562+
1563+ /* get dump info: endian, class and architecture.
1564+ * If the target architecture is not supported, cpu_get_dump_info() will
1565+ * return -1.
1566+ */
1567+ ret = cpu_get_dump_info(&s->dump_info, &s->guest_phys_blocks);
1568+ if (ret < 0) {
1569+ error_setg(errp, QERR_UNSUPPORTED);
1570+ goto cleanup;
1571+ }
1572+
1573+ s->note_size = cpu_get_note_size(s->dump_info.d_class,
1574+ s->dump_info.d_machine, nr_cpus);
1575+ if (s->note_size < 0) {
1576+ error_setg(errp, QERR_UNSUPPORTED);
1577+ goto cleanup;
1578+ }
1579+
1580+ /* get memory mapping */
1581+ if (paging) {
1582+ qemu_get_guest_memory_mapping(&s->list, &s->guest_phys_blocks, &err);
1583+ if (err != NULL) {
1584+ error_propagate(errp, err);
1585+ goto cleanup;
1586+ }
1587+ } else {
1588+ qemu_get_guest_simple_memory_mapping(&s->list, &s->guest_phys_blocks);
1589+ }
1590+
1591+ s->nr_cpus = nr_cpus;
1592+
1593+ get_max_mapnr(s);
1594+
1595+ uint64_t tmp;
1596+ tmp = DIV_ROUND_UP(DIV_ROUND_UP(s->max_mapnr, CHAR_BIT), TARGET_PAGE_SIZE);
1597+ s->len_dump_bitmap = tmp * TARGET_PAGE_SIZE;
1598+
1599+ /* init for kdump-compressed format */
1600+ if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
1601+ switch (format) {
1602+ case DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB:
1603+ s->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
1604+ break;
1605+
1606+ case DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO:
1607+#ifdef CONFIG_LZO
1608+ if (lzo_init() != LZO_E_OK) {
1609+ error_setg(errp, "failed to initialize the LZO library");
1610+ goto cleanup;
1611+ }
1612+#endif
1613+ s->flag_compress = DUMP_DH_COMPRESSED_LZO;
1614+ break;
1615+
1616+ case DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY:
1617+ s->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
1618+ break;
1619+
1620+ default:
1621+ s->flag_compress = 0;
1622+ }
1623+
1624+ return;
1625+ }
1626+
1627+ if (s->has_filter) {
1628+ memory_mapping_filter(&s->list, s->begin, s->length);
1629+ }
1630+
1631+ /*
1632+ * calculate phdr_num
1633+ *
1634+ * the type of ehdr->e_phnum is uint16_t, so we should avoid overflow
1635+ */
1636+ s->phdr_num = 1; /* PT_NOTE */
1637+ if (s->list.num < UINT16_MAX - 2) {
1638+ s->phdr_num += s->list.num;
1639+ s->have_section = false;
1640+ } else {
1641+ s->have_section = true;
1642+ s->phdr_num = PN_XNUM;
1643+ s->sh_info = 1; /* PT_NOTE */
1644+
1645+ /* the type of shdr->sh_info is uint32_t, so we should avoid overflow */
1646+ if (s->list.num <= UINT32_MAX - 1) {
1647+ s->sh_info += s->list.num;
1648+ } else {
1649+ s->sh_info = UINT32_MAX;
1650+ }
1651+ }
1652+
1653+ if (s->dump_info.d_class == ELFCLASS64) {
1654+ if (s->have_section) {
1655+ s->memory_offset = sizeof(Elf64_Ehdr) +
1656+ sizeof(Elf64_Phdr) * s->sh_info +
1657+ sizeof(Elf64_Shdr) + s->note_size;
1658+ } else {
1659+ s->memory_offset = sizeof(Elf64_Ehdr) +
1660+ sizeof(Elf64_Phdr) * s->phdr_num + s->note_size;
1661+ }
1662+ } else {
1663+ if (s->have_section) {
1664+ s->memory_offset = sizeof(Elf32_Ehdr) +
1665+ sizeof(Elf32_Phdr) * s->sh_info +
1666+ sizeof(Elf32_Shdr) + s->note_size;
1667+ } else {
1668+ s->memory_offset = sizeof(Elf32_Ehdr) +
1669+ sizeof(Elf32_Phdr) * s->phdr_num + s->note_size;
1670+ }
1671+ }
1672+
1673+ return;
1674+
1675+cleanup:
1676+ dump_cleanup(s);
1677+}
1678+
1679+void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
1680+ int64_t begin, bool has_length,
1681+ int64_t length, bool has_format,
1682+ DumpGuestMemoryFormat format, Error **errp)
1683+{
1684+ const char *p;
1685+ int fd = -1;
1686+ DumpState *s;
1687+ Error *local_err = NULL;
1688+
1689+ /*
1690+ * kdump-compressed format need the whole memory dumped, so paging or
1691+ * filter is not supported here.
1692+ */
1693+ if ((has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) &&
1694+ (paging || has_begin || has_length)) {
1695+ error_setg(errp, "kdump-compressed format doesn't support paging or "
1696+ "filter");
1697+ return;
1698+ }
1699+ if (has_begin && !has_length) {
1700+ error_setg(errp, QERR_MISSING_PARAMETER, "length");
1701+ return;
1702+ }
1703+ if (!has_begin && has_length) {
1704+ error_setg(errp, QERR_MISSING_PARAMETER, "begin");
1705+ return;
1706+ }
1707+
1708+ /* check whether lzo/snappy is supported */
1709+#ifndef CONFIG_LZO
1710+ if (has_format && format == DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO) {
1711+ error_setg(errp, "kdump-lzo is not available now");
1712+ return;
1713+ }
1714+#endif
1715+
1716+#ifndef CONFIG_SNAPPY
1717+ if (has_format && format == DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY) {
1718+ error_setg(errp, "kdump-snappy is not available now");
1719+ return;
1720+ }
1721+#endif
1722+
1723+#if !defined(WIN32)
1724+ if (strstart(file, "fd:", &p)) {
1725+ fd = monitor_get_fd(cur_mon, p, errp);
1726+ if (fd == -1) {
1727+ return;
1728+ }
1729+ }
1730+#endif
1731+
1732+ if (strstart(file, "file:", &p)) {
1733+ fd = qemu_open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR);
1734+ if (fd < 0) {
1735+ error_setg_file_open(errp, errno, p);
1736+ return;
1737+ }
1738+ }
1739+
1740+ if (fd == -1) {
1741+ error_setg(errp, QERR_INVALID_PARAMETER, "protocol");
1742+ return;
1743+ }
1744+
1745+ s = g_malloc0(sizeof(DumpState));
1746+
1747+ dump_init(s, fd, has_format, format, paging, has_begin,
1748+ begin, length, &local_err);
1749+ if (local_err) {
1750+ g_free(s);
1751+ error_propagate(errp, local_err);
1752+ return;
1753+ }
1754+
1755+ if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
1756+ create_kdump_vmcore(s, errp);
1757+ } else {
1758+ create_vmcore(s, errp);
1759+ }
1760+
1761+ g_free(s);
1762+}
1763+
1764+DumpGuestMemoryCapability *qmp_query_dump_guest_memory_capability(Error **errp)
1765+{
1766+ DumpGuestMemoryFormatList *item;
1767+ DumpGuestMemoryCapability *cap =
1768+ g_malloc0(sizeof(DumpGuestMemoryCapability));
1769+
1770+ /* elf is always available */
1771+ item = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1772+ cap->formats = item;
1773+ item->value = DUMP_GUEST_MEMORY_FORMAT_ELF;
1774+
1775+ /* kdump-zlib is always available */
1776+ item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1777+ item = item->next;
1778+ item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB;
1779+
1780+ /* add new item if kdump-lzo is available */
1781+#ifdef CONFIG_LZO
1782+ item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1783+ item = item->next;
1784+ item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO;
1785+#endif
1786+
1787+ /* add new item if kdump-snappy is available */
1788+#ifdef CONFIG_SNAPPY
1789+ item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
1790+ item = item->next;
1791+ item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY;
1792+#endif
1793+
1794+ return cap;
1795+}
1796diff --git a/exec.c b/exec.c
1797new file mode 100644
1798index 0000000..0bf0a6e
1799--- /dev/null
1800+++ b/exec.c
1801@@ -0,0 +1,3618 @@
1802+/*
1803+ * Virtual page mapping
1804+ *
1805+ * Copyright (c) 2003 Fabrice Bellard
1806+ *
1807+ * This library is free software; you can redistribute it and/or
1808+ * modify it under the terms of the GNU Lesser General Public
1809+ * License as published by the Free Software Foundation; either
1810+ * version 2 of the License, or (at your option) any later version.
1811+ *
1812+ * This library is distributed in the hope that it will be useful,
1813+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1814+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1815+ * Lesser General Public License for more details.
1816+ *
1817+ * You should have received a copy of the GNU Lesser General Public
1818+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
1819+ */
1820+#include "config.h"
1821+#ifndef _WIN32
1822+#include <sys/types.h>
1823+#include <sys/mman.h>
1824+#endif
1825+
1826+#include "qemu-common.h"
1827+#include "cpu.h"
1828+#include "tcg.h"
1829+#include "hw/hw.h"
1830+#if !defined(CONFIG_USER_ONLY)
1831+#include "hw/boards.h"
1832+#endif
1833+#include "hw/qdev.h"
1834+#include "qemu/osdep.h"
1835+#include "sysemu/kvm.h"
1836+#include "sysemu/sysemu.h"
1837+#include "hw/xen/xen.h"
1838+#include "qemu/timer.h"
1839+#include "qemu/config-file.h"
1840+#include "qemu/error-report.h"
1841+#include "exec/memory.h"
1842+#include "sysemu/dma.h"
1843+#include "exec/address-spaces.h"
1844+#if defined(CONFIG_USER_ONLY)
1845+#include <qemu.h>
1846+#else /* !CONFIG_USER_ONLY */
1847+#include "sysemu/xen-mapcache.h"
1848+#include "trace.h"
1849+#endif
1850+#include "exec/cpu-all.h"
1851+#include "qemu/rcu_queue.h"
1852+#include "qemu/main-loop.h"
1853+#include "translate-all.h"
1854+#include "sysemu/replay.h"
1855+
1856+#include "exec/memory-internal.h"
1857+#include "exec/ram_addr.h"
1858+
1859+#include "qemu/range.h"
1860+#ifndef _WIN32
1861+#include "qemu/mmap-alloc.h"
1862+#endif
1863+
1864+//#define DEBUG_SUBPAGE
1865+
1866+#if !defined(CONFIG_USER_ONLY)
1867+/* ram_list is read under rcu_read_lock()/rcu_read_unlock(). Writes
1868+ * are protected by the ramlist lock.
1869+ */
1870+RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list.blocks) };
1871+
1872+static MemoryRegion *system_memory;
1873+static MemoryRegion *system_io;
1874+
1875+AddressSpace address_space_io;
1876+AddressSpace address_space_memory;
1877+
1878+MemoryRegion io_mem_rom, io_mem_notdirty;
1879+static MemoryRegion io_mem_unassigned;
1880+
1881+/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
1882+#define RAM_PREALLOC (1 << 0)
1883+
1884+/* RAM is mmap-ed with MAP_SHARED */
1885+#define RAM_SHARED (1 << 1)
1886+
1887+/* Only a portion of RAM (used_length) is actually used, and migrated.
1888+ * This used_length size can change across reboots.
1889+ */
1890+#define RAM_RESIZEABLE (1 << 2)
1891+
1892+/* RAM is backed by an mmapped file.
1893+ */
1894+#define RAM_FILE (1 << 3)
1895+#endif
1896+
1897+struct CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
1898+/* current CPU in the current thread. It is only valid inside
1899+ cpu_exec() */
1900+__thread CPUState *current_cpu;
1901+/* 0 = Do not count executed instructions.
1902+ 1 = Precise instruction counting.
1903+ 2 = Adaptive rate instruction counting. */
1904+int use_icount;
1905+
1906+#if !defined(CONFIG_USER_ONLY)
1907+
1908+typedef struct PhysPageEntry PhysPageEntry;
1909+
1910+struct PhysPageEntry {
1911+ /* How many bits skip to next level (in units of L2_SIZE). 0 for a leaf. */
1912+ uint32_t skip : 6;
1913+ /* index into phys_sections (!skip) or phys_map_nodes (skip) */
1914+ uint32_t ptr : 26;
1915+};
1916+
1917+#define PHYS_MAP_NODE_NIL (((uint32_t)~0) >> 6)
1918+
1919+/* Size of the L2 (and L3, etc) page tables. */
1920+#define ADDR_SPACE_BITS 64
1921+
1922+#define P_L2_BITS 9
1923+#define P_L2_SIZE (1 << P_L2_BITS)
1924+
1925+#define P_L2_LEVELS (((ADDR_SPACE_BITS - TARGET_PAGE_BITS - 1) / P_L2_BITS) + 1)
1926+
1927+typedef PhysPageEntry Node[P_L2_SIZE];
1928+
1929+typedef struct PhysPageMap {
1930+ struct rcu_head rcu;
1931+
1932+ unsigned sections_nb;
1933+ unsigned sections_nb_alloc;
1934+ unsigned nodes_nb;
1935+ unsigned nodes_nb_alloc;
1936+ Node *nodes;
1937+ MemoryRegionSection *sections;
1938+} PhysPageMap;
1939+
1940+struct AddressSpaceDispatch {
1941+ struct rcu_head rcu;
1942+
1943+ /* This is a multi-level map on the physical address space.
1944+ * The bottom level has pointers to MemoryRegionSections.
1945+ */
1946+ PhysPageEntry phys_map;
1947+ PhysPageMap map;
1948+ AddressSpace *as;
1949+};
1950+
1951+#define SUBPAGE_IDX(addr) ((addr) & ~TARGET_PAGE_MASK)
1952+typedef struct subpage_t {
1953+ MemoryRegion iomem;
1954+ AddressSpace *as;
1955+ hwaddr base;
1956+ uint16_t sub_section[TARGET_PAGE_SIZE];
1957+} subpage_t;
1958+
1959+#define PHYS_SECTION_UNASSIGNED 0
1960+#define PHYS_SECTION_NOTDIRTY 1
1961+#define PHYS_SECTION_ROM 2
1962+#define PHYS_SECTION_WATCH 3
1963+
1964+static void io_mem_init(void);
1965+static void memory_map_init(void);
1966+static void tcg_commit(MemoryListener *listener);
1967+
1968+static MemoryRegion io_mem_watch;
1969+
1970+/**
1971+ * CPUAddressSpace: all the information a CPU needs about an AddressSpace
1972+ * @cpu: the CPU whose AddressSpace this is
1973+ * @as: the AddressSpace itself
1974+ * @memory_dispatch: its dispatch pointer (cached, RCU protected)
1975+ * @tcg_as_listener: listener for tracking changes to the AddressSpace
1976+ */
1977+struct CPUAddressSpace {
1978+ CPUState *cpu;
1979+ AddressSpace *as;
1980+ struct AddressSpaceDispatch *memory_dispatch;
1981+ MemoryListener tcg_as_listener;
1982+};
1983+
1984+#endif
1985+
1986+#if !defined(CONFIG_USER_ONLY)
1987+
1988+static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
1989+{
1990+ if (map->nodes_nb + nodes > map->nodes_nb_alloc) {
1991+ map->nodes_nb_alloc = MAX(map->nodes_nb_alloc * 2, 16);
1992+ map->nodes_nb_alloc = MAX(map->nodes_nb_alloc, map->nodes_nb + nodes);
1993+ map->nodes = g_renew(Node, map->nodes, map->nodes_nb_alloc);
1994+ }
1995+}
1996+
1997+static uint32_t phys_map_node_alloc(PhysPageMap *map, bool leaf)
1998+{
1999+ unsigned i;
2000+ uint32_t ret;
2001+ PhysPageEntry e;
2002+ PhysPageEntry *p;
2003+
2004+ ret = map->nodes_nb++;
2005+ p = map->nodes[ret];
2006+ assert(ret != PHYS_MAP_NODE_NIL);
2007+ assert(ret != map->nodes_nb_alloc);
2008+
2009+ e.skip = leaf ? 0 : 1;
2010+ e.ptr = leaf ? PHYS_SECTION_UNASSIGNED : PHYS_MAP_NODE_NIL;
2011+ for (i = 0; i < P_L2_SIZE; ++i) {
2012+ memcpy(&p[i], &e, sizeof(e));
2013+ }
2014+ return ret;
2015+}
2016+
2017+static void phys_page_set_level(PhysPageMap *map, PhysPageEntry *lp,
2018+ hwaddr *index, hwaddr *nb, uint16_t leaf,
2019+ int level)
2020+{
2021+ PhysPageEntry *p;
2022+ hwaddr step = (hwaddr)1 << (level * P_L2_BITS);
2023+
2024+ if (lp->skip && lp->ptr == PHYS_MAP_NODE_NIL) {
2025+ lp->ptr = phys_map_node_alloc(map, level == 0);
2026+ }
2027+ p = map->nodes[lp->ptr];
2028+ lp = &p[(*index >> (level * P_L2_BITS)) & (P_L2_SIZE - 1)];
2029+
2030+ while (*nb && lp < &p[P_L2_SIZE]) {
2031+ if ((*index & (step - 1)) == 0 && *nb >= step) {
2032+ lp->skip = 0;
2033+ lp->ptr = leaf;
2034+ *index += step;
2035+ *nb -= step;
2036+ } else {
2037+ phys_page_set_level(map, lp, index, nb, leaf, level - 1);
2038+ }
2039+ ++lp;
2040+ }
2041+}
2042+
2043+static void phys_page_set(AddressSpaceDispatch *d,
2044+ hwaddr index, hwaddr nb,
2045+ uint16_t leaf)
2046+{
2047+ /* Wildly overreserve - it doesn't matter much. */
2048+ phys_map_node_reserve(&d->map, 3 * P_L2_LEVELS);
2049+
2050+ phys_page_set_level(&d->map, &d->phys_map, &index, &nb, leaf, P_L2_LEVELS - 1);
2051+}
2052+
2053+/* Compact a non leaf page entry. Simply detect that the entry has a single child,
2054+ * and update our entry so we can skip it and go directly to the destination.
2055+ */
2056+static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned long *compacted)
2057+{
2058+ unsigned valid_ptr = P_L2_SIZE;
2059+ int valid = 0;
2060+ PhysPageEntry *p;
2061+ int i;
2062+
2063+ if (lp->ptr == PHYS_MAP_NODE_NIL) {
2064+ return;
2065+ }
2066+
2067+ p = nodes[lp->ptr];
2068+ for (i = 0; i < P_L2_SIZE; i++) {
2069+ if (p[i].ptr == PHYS_MAP_NODE_NIL) {
2070+ continue;
2071+ }
2072+
2073+ valid_ptr = i;
2074+ valid++;
2075+ if (p[i].skip) {
2076+ phys_page_compact(&p[i], nodes, compacted);
2077+ }
2078+ }
2079+
2080+ /* We can only compress if there's only one child. */
2081+ if (valid != 1) {
2082+ return;
2083+ }
2084+
2085+ assert(valid_ptr < P_L2_SIZE);
2086+
2087+ /* Don't compress if it won't fit in the # of bits we have. */
2088+ if (lp->skip + p[valid_ptr].skip >= (1 << 3)) {
2089+ return;
2090+ }
2091+
2092+ lp->ptr = p[valid_ptr].ptr;
2093+ if (!p[valid_ptr].skip) {
2094+ /* If our only child is a leaf, make this a leaf. */
2095+ /* By design, we should have made this node a leaf to begin with so we
2096+ * should never reach here.
2097+ * But since it's so simple to handle this, let's do it just in case we
2098+ * change this rule.
2099+ */
2100+ lp->skip = 0;
2101+ } else {
2102+ lp->skip += p[valid_ptr].skip;
2103+ }
2104+}
2105+
2106+static void phys_page_compact_all(AddressSpaceDispatch *d, int nodes_nb)
2107+{
2108+ DECLARE_BITMAP(compacted, nodes_nb);
2109+
2110+ if (d->phys_map.skip) {
2111+ phys_page_compact(&d->phys_map, d->map.nodes, compacted);
2112+ }
2113+}
2114+
2115+static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr,
2116+ Node *nodes, MemoryRegionSection *sections)
2117+{
2118+ PhysPageEntry *p;
2119+ hwaddr index = addr >> TARGET_PAGE_BITS;
2120+ int i;
2121+
2122+ for (i = P_L2_LEVELS; lp.skip && (i -= lp.skip) >= 0;) {
2123+ if (lp.ptr == PHYS_MAP_NODE_NIL) {
2124+ return &sections[PHYS_SECTION_UNASSIGNED];
2125+ }
2126+ p = nodes[lp.ptr];
2127+ lp = p[(index >> (i * P_L2_BITS)) & (P_L2_SIZE - 1)];
2128+ }
2129+
2130+ if (sections[lp.ptr].size.hi ||
2131+ range_covers_byte(sections[lp.ptr].offset_within_address_space,
2132+ sections[lp.ptr].size.lo, addr)) {
2133+ return &sections[lp.ptr];
2134+ } else {
2135+ return &sections[PHYS_SECTION_UNASSIGNED];
2136+ }
2137+}
2138+
2139+bool memory_region_is_unassigned(MemoryRegion *mr)
2140+{
2141+ return mr != &io_mem_rom && mr != &io_mem_notdirty && !mr->rom_device
2142+ && mr != &io_mem_watch;
2143+}
2144+
2145+/* Called from RCU critical section */
2146+static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,
2147+ hwaddr addr,
2148+ bool resolve_subpage)
2149+{
2150+ MemoryRegionSection *section;
2151+ subpage_t *subpage;
2152+
2153+ section = phys_page_find(d->phys_map, addr, d->map.nodes, d->map.sections);
2154+ if (resolve_subpage && section->mr->subpage) {
2155+ subpage = container_of(section->mr, subpage_t, iomem);
2156+ section = &d->map.sections[subpage->sub_section[SUBPAGE_IDX(addr)]];
2157+ }
2158+ return section;
2159+}
2160+
2161+/* Called from RCU critical section */
2162+static MemoryRegionSection *
2163+address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *xlat,
2164+ hwaddr *plen, bool resolve_subpage)
2165+{
2166+ MemoryRegionSection *section;
2167+ MemoryRegion *mr;
2168+ Int128 diff;
2169+
2170+ section = address_space_lookup_region(d, addr, resolve_subpage);
2171+ /* Compute offset within MemoryRegionSection */
2172+ addr -= section->offset_within_address_space;
2173+
2174+ /* Compute offset within MemoryRegion */
2175+ *xlat = addr + section->offset_within_region;
2176+
2177+ mr = section->mr;
2178+
2179+ /* MMIO registers can be expected to perform full-width accesses based only
2180+ * on their address, without considering adjacent registers that could
2181+ * decode to completely different MemoryRegions. When such registers
2182+ * exist (e.g. I/O ports 0xcf8 and 0xcf9 on most PC chipsets), MMIO
2183+ * regions overlap wildly. For this reason we cannot clamp the accesses
2184+ * here.
2185+ *
2186+ * If the length is small (as is the case for address_space_ldl/stl),
2187+ * everything works fine. If the incoming length is large, however,
2188+ * the caller really has to do the clamping through memory_access_size.
2189+ */
2190+ if (memory_region_is_ram(mr)) {
2191+ diff = int128_sub(section->size, int128_make64(addr));
2192+ *plen = int128_get64(int128_min(diff, int128_make64(*plen)));
2193+ }
2194+ return section;
2195+}
2196+
2197+static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
2198+{
2199+ if (memory_region_is_ram(mr)) {
2200+ return !(is_write && mr->readonly);
2201+ }
2202+ if (memory_region_is_romd(mr)) {
2203+ return !is_write;
2204+ }
2205+
2206+ return false;
2207+}
2208+
2209+/* Called from RCU critical section */
2210+MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
2211+ hwaddr *xlat, hwaddr *plen,
2212+ bool is_write)
2213+{
2214+ IOMMUTLBEntry iotlb;
2215+ MemoryRegionSection *section;
2216+ MemoryRegion *mr;
2217+
2218+ for (;;) {
2219+ AddressSpaceDispatch *d = atomic_rcu_read(&as->dispatch);
2220+ section = address_space_translate_internal(d, addr, &addr, plen, true);
2221+ mr = section->mr;
2222+
2223+ if (!mr->iommu_ops) {
2224+ break;
2225+ }
2226+
2227+ iotlb = mr->iommu_ops->translate(mr, addr, is_write);
2228+ addr = ((iotlb.translated_addr & ~iotlb.addr_mask)
2229+ | (addr & iotlb.addr_mask));
2230+ *plen = MIN(*plen, (addr | iotlb.addr_mask) - addr + 1);
2231+ if (!(iotlb.perm & (1 << is_write))) {
2232+ mr = &io_mem_unassigned;
2233+ break;
2234+ }
2235+
2236+ as = iotlb.target_as;
2237+ }
2238+
2239+ if (xen_enabled() && memory_access_is_direct(mr, is_write)) {
2240+ hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
2241+ *plen = MIN(page, *plen);
2242+ }
2243+
2244+ *xlat = addr;
2245+ return mr;
2246+}
2247+
2248+/* Called from RCU critical section */
2249+MemoryRegionSection *
2250+address_space_translate_for_iotlb(CPUState *cpu, hwaddr addr,
2251+ hwaddr *xlat, hwaddr *plen)
2252+{
2253+ MemoryRegionSection *section;
2254+ section = address_space_translate_internal(cpu->cpu_ases[0].memory_dispatch,
2255+ addr, xlat, plen, false);
2256+
2257+ assert(!section->mr->iommu_ops);
2258+ return section;
2259+}
2260+#endif
2261+
2262+#if !defined(CONFIG_USER_ONLY)
2263+
2264+static int cpu_common_post_load(void *opaque, int version_id)
2265+{
2266+ CPUState *cpu = opaque;
2267+
2268+ /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the
2269+ version_id is increased. */
2270+ cpu->interrupt_request &= ~0x01;
2271+ tlb_flush(cpu, 1);
2272+
2273+ return 0;
2274+}
2275+
2276+static int cpu_common_pre_load(void *opaque)
2277+{
2278+ CPUState *cpu = opaque;
2279+
2280+ cpu->exception_index = -1;
2281+
2282+ return 0;
2283+}
2284+
2285+static bool cpu_common_exception_index_needed(void *opaque)
2286+{
2287+ CPUState *cpu = opaque;
2288+
2289+ return tcg_enabled() && cpu->exception_index != -1;
2290+}
2291+
2292+static const VMStateDescription vmstate_cpu_common_exception_index = {
2293+ .name = "cpu_common/exception_index",
2294+ .version_id = 1,
2295+ .minimum_version_id = 1,
2296+ .needed = cpu_common_exception_index_needed,
2297+ .fields = (VMStateField[]) {
2298+ VMSTATE_INT32(exception_index, CPUState),
2299+ VMSTATE_END_OF_LIST()
2300+ }
2301+};
2302+
2303+static bool cpu_common_crash_occurred_needed(void *opaque)
2304+{
2305+ CPUState *cpu = opaque;
2306+
2307+ return cpu->crash_occurred;
2308+}
2309+
2310+static const VMStateDescription vmstate_cpu_common_crash_occurred = {
2311+ .name = "cpu_common/crash_occurred",
2312+ .version_id = 1,
2313+ .minimum_version_id = 1,
2314+ .needed = cpu_common_crash_occurred_needed,
2315+ .fields = (VMStateField[]) {
2316+ VMSTATE_BOOL(crash_occurred, CPUState),
2317+ VMSTATE_END_OF_LIST()
2318+ }
2319+};
2320+
2321+const VMStateDescription vmstate_cpu_common = {
2322+ .name = "cpu_common",
2323+ .version_id = 1,
2324+ .minimum_version_id = 1,
2325+ .pre_load = cpu_common_pre_load,
2326+ .post_load = cpu_common_post_load,
2327+ .fields = (VMStateField[]) {
2328+ VMSTATE_UINT32(halted, CPUState),
2329+ VMSTATE_UINT32(interrupt_request, CPUState),
2330+ VMSTATE_END_OF_LIST()
2331+ },
2332+ .subsections = (const VMStateDescription*[]) {
2333+ &vmstate_cpu_common_exception_index,
2334+ &vmstate_cpu_common_crash_occurred,
2335+ NULL
2336+ }
2337+};
2338+
2339+#endif
2340+
2341+CPUState *qemu_get_cpu(int index)
2342+{
2343+ CPUState *cpu;
2344+
2345+ CPU_FOREACH(cpu) {
2346+ if (cpu->cpu_index == index) {
2347+ return cpu;
2348+ }
2349+ }
2350+
2351+ return NULL;
2352+}
2353+
2354+#if !defined(CONFIG_USER_ONLY)
2355+void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as)
2356+{
2357+ /* We only support one address space per cpu at the moment. */
2358+ assert(cpu->as == as);
2359+
2360+ if (cpu->cpu_ases) {
2361+ /* We've already registered the listener for our only AS */
2362+ return;
2363+ }
2364+
2365+ cpu->cpu_ases = g_new0(CPUAddressSpace, 1);
2366+ cpu->cpu_ases[0].cpu = cpu;
2367+ cpu->cpu_ases[0].as = as;
2368+ cpu->cpu_ases[0].tcg_as_listener.commit = tcg_commit;
2369+ memory_listener_register(&cpu->cpu_ases[0].tcg_as_listener, as);
2370+}
2371+#endif
2372+
2373+#ifndef CONFIG_USER_ONLY
2374+static DECLARE_BITMAP(cpu_index_map, MAX_CPUMASK_BITS);
2375+
2376+static int cpu_get_free_index(Error **errp)
2377+{
2378+ int cpu = find_first_zero_bit(cpu_index_map, MAX_CPUMASK_BITS);
2379+
2380+ if (cpu >= MAX_CPUMASK_BITS) {
2381+ error_setg(errp, "Trying to use more CPUs than max of %d",
2382+ MAX_CPUMASK_BITS);
2383+ return -1;
2384+ }
2385+
2386+ bitmap_set(cpu_index_map, cpu, 1);
2387+ return cpu;
2388+}
2389+
2390+void cpu_exec_exit(CPUState *cpu)
2391+{
2392+ if (cpu->cpu_index == -1) {
2393+ /* cpu_index was never allocated by this @cpu or was already freed. */
2394+ return;
2395+ }
2396+
2397+ bitmap_clear(cpu_index_map, cpu->cpu_index, 1);
2398+ cpu->cpu_index = -1;
2399+}
2400+#else
2401+
2402+static int cpu_get_free_index(Error **errp)
2403+{
2404+ CPUState *some_cpu;
2405+ int cpu_index = 0;
2406+
2407+ CPU_FOREACH(some_cpu) {
2408+ cpu_index++;
2409+ }
2410+ return cpu_index;
2411+}
2412+
2413+void cpu_exec_exit(CPUState *cpu)
2414+{
2415+}
2416+#endif
2417+
2418+void cpu_exec_init(CPUState *cpu, Error **errp)
2419+{
2420+ CPUClass *cc = CPU_GET_CLASS(cpu);
2421+ int cpu_index;
2422+ Error *local_err = NULL;
2423+
2424+#ifndef CONFIG_USER_ONLY
2425+ cpu->as = &address_space_memory;
2426+ cpu->thread_id = qemu_get_thread_id();
2427+#endif
2428+
2429+#if defined(CONFIG_USER_ONLY)
2430+ cpu_list_lock();
2431+#endif
2432+ cpu_index = cpu->cpu_index = cpu_get_free_index(&local_err);
2433+ if (local_err) {
2434+ error_propagate(errp, local_err);
2435+#if defined(CONFIG_USER_ONLY)
2436+ cpu_list_unlock();
2437+#endif
2438+ return;
2439+ }
2440+ QTAILQ_INSERT_TAIL(&cpus, cpu, node);
2441+#if defined(CONFIG_USER_ONLY)
2442+ cpu_list_unlock();
2443+#endif
2444+ if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
2445+ vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu);
2446+ }
2447+#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
2448+ register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,
2449+ cpu_save, cpu_load, cpu->env_ptr);
2450+ assert(cc->vmsd == NULL);
2451+ assert(qdev_get_vmsd(DEVICE(cpu)) == NULL);
2452+#endif
2453+ if (cc->vmsd != NULL) {
2454+ vmstate_register(NULL, cpu_index, cc->vmsd, cpu);
2455+ }
2456+}
2457+
2458+#if defined(CONFIG_USER_ONLY)
2459+static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
2460+{
2461+ tb_invalidate_phys_page_range(pc, pc + 1, 0);
2462+}
2463+#else
2464+static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
2465+{
2466+ hwaddr phys = cpu_get_phys_page_debug(cpu, pc);
2467+ if (phys != -1) {
2468+ tb_invalidate_phys_addr(cpu->as,
2469+ phys | (pc & ~TARGET_PAGE_MASK));
2470+ }
2471+}
2472+#endif
2473+
2474+#if defined(CONFIG_USER_ONLY)
2475+void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
2476+
2477+{
2478+}
2479+
2480+int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len,
2481+ int flags)
2482+{
2483+ return -ENOSYS;
2484+}
2485+
2486+void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint)
2487+{
2488+}
2489+
2490+int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
2491+ int flags, CPUWatchpoint **watchpoint)
2492+{
2493+ return -ENOSYS;
2494+}
2495+#else
2496+/* Add a watchpoint. */
2497+int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
2498+ int flags, CPUWatchpoint **watchpoint)
2499+{
2500+ CPUWatchpoint *wp;
2501+
2502+ /* forbid ranges which are empty or run off the end of the address space */
2503+ if (len == 0 || (addr + len - 1) < addr) {
2504+ error_report("tried to set invalid watchpoint at %"
2505+ VADDR_PRIx ", len=%" VADDR_PRIu, addr, len);
2506+ return -EINVAL;
2507+ }
2508+ wp = g_malloc(sizeof(*wp));
2509+
2510+ wp->vaddr = addr;
2511+ wp->len = len;
2512+ wp->flags = flags;
2513+
2514+ /* keep all GDB-injected watchpoints in front */
2515+ if (flags & BP_GDB) {
2516+ QTAILQ_INSERT_HEAD(&cpu->watchpoints, wp, entry);
2517+ } else {
2518+ QTAILQ_INSERT_TAIL(&cpu->watchpoints, wp, entry);
2519+ }
2520+
2521+ tlb_flush_page(cpu, addr);
2522+
2523+ if (watchpoint)
2524+ *watchpoint = wp;
2525+ return 0;
2526+}
2527+
2528+/* Remove a specific watchpoint. */
2529+int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len,
2530+ int flags)
2531+{
2532+ CPUWatchpoint *wp;
2533+
2534+ QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
2535+ if (addr == wp->vaddr && len == wp->len
2536+ && flags == (wp->flags & ~BP_WATCHPOINT_HIT)) {
2537+ cpu_watchpoint_remove_by_ref(cpu, wp);
2538+ return 0;
2539+ }
2540+ }
2541+ return -ENOENT;
2542+}
2543+
2544+/* Remove a specific watchpoint by reference. */
2545+void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint)
2546+{
2547+ QTAILQ_REMOVE(&cpu->watchpoints, watchpoint, entry);
2548+
2549+ tlb_flush_page(cpu, watchpoint->vaddr);
2550+
2551+ g_free(watchpoint);
2552+}
2553+
2554+/* Remove all matching watchpoints. */
2555+void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
2556+{
2557+ CPUWatchpoint *wp, *next;
2558+
2559+ QTAILQ_FOREACH_SAFE(wp, &cpu->watchpoints, entry, next) {
2560+ if (wp->flags & mask) {
2561+ cpu_watchpoint_remove_by_ref(cpu, wp);
2562+ }
2563+ }
2564+}
2565+
2566+/* Return true if this watchpoint address matches the specified
2567+ * access (ie the address range covered by the watchpoint overlaps
2568+ * partially or completely with the address range covered by the
2569+ * access).
2570+ */
2571+static inline bool cpu_watchpoint_address_matches(CPUWatchpoint *wp,
2572+ vaddr addr,
2573+ vaddr len)
2574+{
2575+ /* We know the lengths are non-zero, but a little caution is
2576+ * required to avoid errors in the case where the range ends
2577+ * exactly at the top of the address space and so addr + len
2578+ * wraps round to zero.
2579+ */
2580+ vaddr wpend = wp->vaddr + wp->len - 1;
2581+ vaddr addrend = addr + len - 1;
2582+
2583+ return !(addr > wpend || wp->vaddr > addrend);
2584+}
2585+
2586+#endif
2587+
2588+/* Add a breakpoint. */
2589+int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
2590+ CPUBreakpoint **breakpoint)
2591+{
2592+ CPUBreakpoint *bp;
2593+
2594+ bp = g_malloc(sizeof(*bp));
2595+
2596+ bp->pc = pc;
2597+ bp->flags = flags;
2598+
2599+ /* keep all GDB-injected breakpoints in front */
2600+ if (flags & BP_GDB) {
2601+ QTAILQ_INSERT_HEAD(&cpu->breakpoints, bp, entry);
2602+ } else {
2603+ QTAILQ_INSERT_TAIL(&cpu->breakpoints, bp, entry);
2604+ }
2605+
2606+ breakpoint_invalidate(cpu, pc);
2607+
2608+ if (breakpoint) {
2609+ *breakpoint = bp;
2610+ }
2611+ return 0;
2612+}
2613+
2614+/* Remove a specific breakpoint. */
2615+int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)
2616+{
2617+ CPUBreakpoint *bp;
2618+
2619+ QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
2620+ if (bp->pc == pc && bp->flags == flags) {
2621+ cpu_breakpoint_remove_by_ref(cpu, bp);
2622+ return 0;
2623+ }
2624+ }
2625+ return -ENOENT;
2626+}
2627+
2628+/* Remove a specific breakpoint by reference. */
2629+void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint)
2630+{
2631+ QTAILQ_REMOVE(&cpu->breakpoints, breakpoint, entry);
2632+
2633+ breakpoint_invalidate(cpu, breakpoint->pc);
2634+
2635+ g_free(breakpoint);
2636+}
2637+
2638+/* Remove all matching breakpoints. */
2639+void cpu_breakpoint_remove_all(CPUState *cpu, int mask)
2640+{
2641+ CPUBreakpoint *bp, *next;
2642+
2643+ QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) {
2644+ if (bp->flags & mask) {
2645+ cpu_breakpoint_remove_by_ref(cpu, bp);
2646+ }
2647+ }
2648+}
2649+
2650+/* enable or disable single step mode. EXCP_DEBUG is returned by the
2651+ CPU loop after each instruction */
2652+void cpu_single_step(CPUState *cpu, int enabled)
2653+{
2654+ if (cpu->singlestep_enabled != enabled) {
2655+ cpu->singlestep_enabled = enabled;
2656+ if (kvm_enabled()) {
2657+ kvm_update_guest_debug(cpu, 0);
2658+ } else {
2659+ /* must flush all the translated code to avoid inconsistencies */
2660+ /* XXX: only flush what is necessary */
2661+ tb_flush(cpu);
2662+ }
2663+ }
2664+}
2665+
2666+void cpu_abort(CPUState *cpu, const char *fmt, ...)
2667+{
2668+ va_list ap;
2669+ va_list ap2;
2670+
2671+ va_start(ap, fmt);
2672+ va_copy(ap2, ap);
2673+ fprintf(stderr, "qemu: fatal: ");
2674+ vfprintf(stderr, fmt, ap);
2675+ fprintf(stderr, "\n");
2676+ cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
2677+ if (qemu_log_enabled()) {
2678+ qemu_log("qemu: fatal: ");
2679+ qemu_log_vprintf(fmt, ap2);
2680+ qemu_log("\n");
2681+ log_cpu_state(cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP);
2682+ qemu_log_flush();
2683+ qemu_log_close();
2684+ }
2685+ va_end(ap2);
2686+ va_end(ap);
2687+ replay_finish();
2688+#if defined(CONFIG_USER_ONLY)
2689+ {
2690+ struct sigaction act;
2691+ sigfillset(&act.sa_mask);
2692+ act.sa_handler = SIG_DFL;
2693+ sigaction(SIGABRT, &act, NULL);
2694+ }
2695+#endif
2696+ abort();
2697+}
2698+
2699+#if !defined(CONFIG_USER_ONLY)
2700+/* Called from RCU critical section */
2701+static RAMBlock *qemu_get_ram_block(ram_addr_t addr)
2702+{
2703+ RAMBlock *block;
2704+
2705+ block = atomic_rcu_read(&ram_list.mru_block);
2706+ if (block && addr - block->offset < block->max_length) {
2707+ return block;
2708+ }
2709+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
2710+ if (addr - block->offset < block->max_length) {
2711+ goto found;
2712+ }
2713+ }
2714+
2715+ fprintf(stderr, "Bad ram offset %" PRIx64 "\n", (uint64_t)addr);
2716+ abort();
2717+
2718+found:
2719+ /* It is safe to write mru_block outside the iothread lock. This
2720+ * is what happens:
2721+ *
2722+ * mru_block = xxx
2723+ * rcu_read_unlock()
2724+ * xxx removed from list
2725+ * rcu_read_lock()
2726+ * read mru_block
2727+ * mru_block = NULL;
2728+ * call_rcu(reclaim_ramblock, xxx);
2729+ * rcu_read_unlock()
2730+ *
2731+ * atomic_rcu_set is not needed here. The block was already published
2732+ * when it was placed into the list. Here we're just making an extra
2733+ * copy of the pointer.
2734+ */
2735+ ram_list.mru_block = block;
2736+ return block;
2737+}
2738+
2739+static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length)
2740+{
2741+ CPUState *cpu;
2742+ ram_addr_t start1;
2743+ RAMBlock *block;
2744+ ram_addr_t end;
2745+
2746+ end = TARGET_PAGE_ALIGN(start + length);
2747+ start &= TARGET_PAGE_MASK;
2748+
2749+ rcu_read_lock();
2750+ block = qemu_get_ram_block(start);
2751+ assert(block == qemu_get_ram_block(end - 1));
2752+ start1 = (uintptr_t)ramblock_ptr(block, start - block->offset);
2753+ CPU_FOREACH(cpu) {
2754+ tlb_reset_dirty(cpu, start1, length);
2755+ }
2756+ rcu_read_unlock();
2757+}
2758+
2759+/* Note: start and end must be within the same ram block. */
2760+bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start,
2761+ ram_addr_t length,
2762+ unsigned client)
2763+{
2764+ unsigned long end, page;
2765+ bool dirty;
2766+
2767+ if (length == 0) {
2768+ return false;
2769+ }
2770+
2771+ end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
2772+ page = start >> TARGET_PAGE_BITS;
2773+ dirty = bitmap_test_and_clear_atomic(ram_list.dirty_memory[client],
2774+ page, end - page);
2775+
2776+ if (dirty && tcg_enabled()) {
2777+ tlb_reset_dirty_range_all(start, length);
2778+ }
2779+
2780+ return dirty;
2781+}
2782+
2783+/* Called from RCU critical section */
2784+hwaddr memory_region_section_get_iotlb(CPUState *cpu,
2785+ MemoryRegionSection *section,
2786+ target_ulong vaddr,
2787+ hwaddr paddr, hwaddr xlat,
2788+ int prot,
2789+ target_ulong *address)
2790+{
2791+ hwaddr iotlb;
2792+ CPUWatchpoint *wp;
2793+
2794+ if (memory_region_is_ram(section->mr)) {
2795+ /* Normal RAM. */
2796+ iotlb = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK)
2797+ + xlat;
2798+ if (!section->readonly) {
2799+ iotlb |= PHYS_SECTION_NOTDIRTY;
2800+ } else {
2801+ iotlb |= PHYS_SECTION_ROM;
2802+ }
2803+ } else {
2804+ AddressSpaceDispatch *d;
2805+
2806+ d = atomic_rcu_read(&section->address_space->dispatch);
2807+ iotlb = section - d->map.sections;
2808+ iotlb += xlat;
2809+ }
2810+
2811+ /* Make accesses to pages with watchpoints go via the
2812+ watchpoint trap routines. */
2813+ QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
2814+ if (cpu_watchpoint_address_matches(wp, vaddr, TARGET_PAGE_SIZE)) {
2815+ /* Avoid trapping reads of pages with a write breakpoint. */
2816+ if ((prot & PAGE_WRITE) || (wp->flags & BP_MEM_READ)) {
2817+ iotlb = PHYS_SECTION_WATCH + paddr;
2818+ *address |= TLB_MMIO;
2819+ break;
2820+ }
2821+ }
2822+ }
2823+
2824+ return iotlb;
2825+}
2826+#endif /* defined(CONFIG_USER_ONLY) */
2827+
2828+#if !defined(CONFIG_USER_ONLY)
2829+
2830+static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
2831+ uint16_t section);
2832+static subpage_t *subpage_init(AddressSpace *as, hwaddr base);
2833+
2834+static void *(*phys_mem_alloc)(size_t size, uint64_t *align) =
2835+ qemu_anon_ram_alloc;
2836+
2837+/*
2838+ * Set a custom physical guest memory alloator.
2839+ * Accelerators with unusual needs may need this. Hopefully, we can
2840+ * get rid of it eventually.
2841+ */
2842+void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align))
2843+{
2844+ phys_mem_alloc = alloc;
2845+}
2846+
2847+static uint16_t phys_section_add(PhysPageMap *map,
2848+ MemoryRegionSection *section)
2849+{
2850+ /* The physical section number is ORed with a page-aligned
2851+ * pointer to produce the iotlb entries. Thus it should
2852+ * never overflow into the page-aligned value.
2853+ */
2854+ assert(map->sections_nb < TARGET_PAGE_SIZE);
2855+
2856+ if (map->sections_nb == map->sections_nb_alloc) {
2857+ map->sections_nb_alloc = MAX(map->sections_nb_alloc * 2, 16);
2858+ map->sections = g_renew(MemoryRegionSection, map->sections,
2859+ map->sections_nb_alloc);
2860+ }
2861+ map->sections[map->sections_nb] = *section;
2862+ memory_region_ref(section->mr);
2863+ return map->sections_nb++;
2864+}
2865+
2866+static void phys_section_destroy(MemoryRegion *mr)
2867+{
2868+ bool have_sub_page = mr->subpage;
2869+
2870+ memory_region_unref(mr);
2871+
2872+ if (have_sub_page) {
2873+ subpage_t *subpage = container_of(mr, subpage_t, iomem);
2874+ object_unref(OBJECT(&subpage->iomem));
2875+ g_free(subpage);
2876+ }
2877+}
2878+
2879+static void phys_sections_free(PhysPageMap *map)
2880+{
2881+ while (map->sections_nb > 0) {
2882+ MemoryRegionSection *section = &map->sections[--map->sections_nb];
2883+ phys_section_destroy(section->mr);
2884+ }
2885+ g_free(map->sections);
2886+ g_free(map->nodes);
2887+}
2888+
2889+static void register_subpage(AddressSpaceDispatch *d, MemoryRegionSection *section)
2890+{
2891+ subpage_t *subpage;
2892+ hwaddr base = section->offset_within_address_space
2893+ & TARGET_PAGE_MASK;
2894+ MemoryRegionSection *existing = phys_page_find(d->phys_map, base,
2895+ d->map.nodes, d->map.sections);
2896+ MemoryRegionSection subsection = {
2897+ .offset_within_address_space = base,
2898+ .size = int128_make64(TARGET_PAGE_SIZE),
2899+ };
2900+ hwaddr start, end;
2901+
2902+ assert(existing->mr->subpage || existing->mr == &io_mem_unassigned);
2903+
2904+ if (!(existing->mr->subpage)) {
2905+ subpage = subpage_init(d->as, base);
2906+ subsection.address_space = d->as;
2907+ subsection.mr = &subpage->iomem;
2908+ phys_page_set(d, base >> TARGET_PAGE_BITS, 1,
2909+ phys_section_add(&d->map, &subsection));
2910+ } else {
2911+ subpage = container_of(existing->mr, subpage_t, iomem);
2912+ }
2913+ start = section->offset_within_address_space & ~TARGET_PAGE_MASK;
2914+ end = start + int128_get64(section->size) - 1;
2915+ subpage_register(subpage, start, end,
2916+ phys_section_add(&d->map, section));
2917+}
2918+
2919+
2920+static void register_multipage(AddressSpaceDispatch *d,
2921+ MemoryRegionSection *section)
2922+{
2923+ hwaddr start_addr = section->offset_within_address_space;
2924+ uint16_t section_index = phys_section_add(&d->map, section);
2925+ uint64_t num_pages = int128_get64(int128_rshift(section->size,
2926+ TARGET_PAGE_BITS));
2927+
2928+ assert(num_pages);
2929+ phys_page_set(d, start_addr >> TARGET_PAGE_BITS, num_pages, section_index);
2930+}
2931+
2932+static void mem_add(MemoryListener *listener, MemoryRegionSection *section)
2933+{
2934+ AddressSpace *as = container_of(listener, AddressSpace, dispatch_listener);
2935+ AddressSpaceDispatch *d = as->next_dispatch;
2936+ MemoryRegionSection now = *section, remain = *section;
2937+ Int128 page_size = int128_make64(TARGET_PAGE_SIZE);
2938+
2939+ if (now.offset_within_address_space & ~TARGET_PAGE_MASK) {
2940+ uint64_t left = TARGET_PAGE_ALIGN(now.offset_within_address_space)
2941+ - now.offset_within_address_space;
2942+
2943+ now.size = int128_min(int128_make64(left), now.size);
2944+ register_subpage(d, &now);
2945+ } else {
2946+ now.size = int128_zero();
2947+ }
2948+ while (int128_ne(remain.size, now.size)) {
2949+ remain.size = int128_sub(remain.size, now.size);
2950+ remain.offset_within_address_space += int128_get64(now.size);
2951+ remain.offset_within_region += int128_get64(now.size);
2952+ now = remain;
2953+ if (int128_lt(remain.size, page_size)) {
2954+ register_subpage(d, &now);
2955+ } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) {
2956+ now.size = page_size;
2957+ register_subpage(d, &now);
2958+ } else {
2959+ now.size = int128_and(now.size, int128_neg(page_size));
2960+ register_multipage(d, &now);
2961+ }
2962+ }
2963+}
2964+
2965+void qemu_flush_coalesced_mmio_buffer(void)
2966+{
2967+ if (kvm_enabled())
2968+ kvm_flush_coalesced_mmio_buffer();
2969+}
2970+
2971+void qemu_mutex_lock_ramlist(void)
2972+{
2973+ qemu_mutex_lock(&ram_list.mutex);
2974+}
2975+
2976+void qemu_mutex_unlock_ramlist(void)
2977+{
2978+ qemu_mutex_unlock(&ram_list.mutex);
2979+}
2980+
2981+#ifdef __linux__
2982+
2983+#include <sys/vfs.h>
2984+
2985+#define HUGETLBFS_MAGIC 0x958458f6
2986+
2987+static long gethugepagesize(const char *path, Error **errp)
2988+{
2989+ struct statfs fs;
2990+ int ret;
2991+
2992+ do {
2993+ ret = statfs(path, &fs);
2994+ } while (ret != 0 && errno == EINTR);
2995+
2996+ if (ret != 0) {
2997+ error_setg_errno(errp, errno, "failed to get page size of file %s",
2998+ path);
2999+ return 0;
3000+ }
3001+
3002+ return fs.f_bsize;
3003+}
3004+
3005+static void *file_ram_alloc(RAMBlock *block,
3006+ ram_addr_t memory,
3007+ const char *path,
3008+ Error **errp)
3009+{
3010+ struct stat st;
3011+ char *filename;
3012+ char *sanitized_name;
3013+ char *c;
3014+ void *area;
3015+ int fd;
3016+ uint64_t hpagesize;
3017+ Error *local_err = NULL;
3018+
3019+ hpagesize = gethugepagesize(path, &local_err);
3020+ if (local_err) {
3021+ error_propagate(errp, local_err);
3022+ goto error;
3023+ }
3024+ block->mr->align = hpagesize;
3025+
3026+ if (memory < hpagesize) {
3027+ error_setg(errp, "memory size 0x" RAM_ADDR_FMT " must be equal to "
3028+ "or larger than huge page size 0x%" PRIx64,
3029+ memory, hpagesize);
3030+ goto error;
3031+ }
3032+
3033+ if (kvm_enabled() && !kvm_has_sync_mmu()) {
3034+ error_setg(errp,
3035+ "host lacks kvm mmu notifiers, -mem-path unsupported");
3036+ goto error;
3037+ }
3038+
3039+ if (!stat(path, &st) && S_ISDIR(st.st_mode)) {
3040+ /* Make name safe to use with mkstemp by replacing '/' with '_'. */
3041+ sanitized_name = g_strdup(memory_region_name(block->mr));
3042+ for (c = sanitized_name; *c != '\0'; c++) {
3043+ if (*c == '/') {
3044+ *c = '_';
3045+ }
3046+ }
3047+
3048+ filename = g_strdup_printf("%s/qemu_back_mem.%s.XXXXXX", path,
3049+ sanitized_name);
3050+ g_free(sanitized_name);
3051+
3052+ fd = mkstemp(filename);
3053+ if (fd >= 0) {
3054+ unlink(filename);
3055+ }
3056+ g_free(filename);
3057+ } else {
3058+ fd = open(path, O_RDWR | O_CREAT, 0644);
3059+ }
3060+
3061+ if (fd < 0) {
3062+ error_setg_errno(errp, errno,
3063+ "unable to create backing store for hugepages");
3064+ goto error;
3065+ }
3066+
3067+ memory = ROUND_UP(memory, hpagesize);
3068+
3069+ /*
3070+ * ftruncate is not supported by hugetlbfs in older
3071+ * hosts, so don't bother bailing out on errors.
3072+ * If anything goes wrong with it under other filesystems,
3073+ * mmap will fail.
3074+ */
3075+ if (ftruncate(fd, memory)) {
3076+ perror("ftruncate");
3077+ }
3078+
3079+ area = qemu_ram_mmap(fd, memory, hpagesize, block->flags & RAM_SHARED);
3080+ if (area == MAP_FAILED) {
3081+ error_setg_errno(errp, errno,
3082+ "unable to map backing store for hugepages");
3083+ close(fd);
3084+ goto error;
3085+ }
3086+
3087+ if (mem_prealloc) {
3088+ os_mem_prealloc(fd, area, memory);
3089+ }
3090+
3091+ block->fd = fd;
3092+ return area;
3093+
3094+error:
3095+ return NULL;
3096+}
3097+#endif
3098+
3099+/* Called with the ramlist lock held. */
3100+static ram_addr_t find_ram_offset(ram_addr_t size)
3101+{
3102+ RAMBlock *block, *next_block;
3103+ ram_addr_t offset = RAM_ADDR_MAX, mingap = RAM_ADDR_MAX;
3104+
3105+ assert(size != 0); /* it would hand out same offset multiple times */
3106+
3107+ if (QLIST_EMPTY_RCU(&ram_list.blocks)) {
3108+ return 0;
3109+ }
3110+
3111+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3112+ ram_addr_t end, next = RAM_ADDR_MAX;
3113+
3114+ end = block->offset + block->max_length;
3115+
3116+ QLIST_FOREACH_RCU(next_block, &ram_list.blocks, next) {
3117+ if (next_block->offset >= end) {
3118+ next = MIN(next, next_block->offset);
3119+ }
3120+ }
3121+ if (next - end >= size && next - end < mingap) {
3122+ offset = end;
3123+ mingap = next - end;
3124+ }
3125+ }
3126+
3127+ if (offset == RAM_ADDR_MAX) {
3128+ fprintf(stderr, "Failed to find gap of requested size: %" PRIu64 "\n",
3129+ (uint64_t)size);
3130+ abort();
3131+ }
3132+
3133+ return offset;
3134+}
3135+
3136+ram_addr_t last_ram_offset(void)
3137+{
3138+ RAMBlock *block;
3139+ ram_addr_t last = 0;
3140+
3141+ rcu_read_lock();
3142+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3143+ last = MAX(last, block->offset + block->max_length);
3144+ }
3145+ rcu_read_unlock();
3146+ return last;
3147+}
3148+
3149+static void qemu_ram_setup_dump(void *addr, ram_addr_t size)
3150+{
3151+ int ret;
3152+
3153+ /* Use MADV_DONTDUMP, if user doesn't want the guest memory in the core */
3154+ if (!machine_dump_guest_core(current_machine)) {
3155+ ret = qemu_madvise(addr, size, QEMU_MADV_DONTDUMP);
3156+ if (ret) {
3157+ perror("qemu_madvise");
3158+ fprintf(stderr, "madvise doesn't support MADV_DONTDUMP, "
3159+ "but dump_guest_core=off specified\n");
3160+ }
3161+ }
3162+}
3163+
3164+/* Called within an RCU critical section, or while the ramlist lock
3165+ * is held.
3166+ */
3167+static RAMBlock *find_ram_block(ram_addr_t addr)
3168+{
3169+ RAMBlock *block;
3170+
3171+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3172+ if (block->offset == addr) {
3173+ return block;
3174+ }
3175+ }
3176+
3177+ return NULL;
3178+}
3179+
3180+const char *qemu_ram_get_idstr(RAMBlock *rb)
3181+{
3182+ return rb->idstr;
3183+}
3184+
3185+/* Called with iothread lock held. */
3186+void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev)
3187+{
3188+ RAMBlock *new_block, *block;
3189+
3190+ rcu_read_lock();
3191+ new_block = find_ram_block(addr);
3192+ assert(new_block);
3193+ assert(!new_block->idstr[0]);
3194+
3195+ if (dev) {
3196+ char *id = qdev_get_dev_path(dev);
3197+ if (id) {
3198+ snprintf(new_block->idstr, sizeof(new_block->idstr), "%s/", id);
3199+ g_free(id);
3200+ }
3201+ }
3202+ pstrcat(new_block->idstr, sizeof(new_block->idstr), name);
3203+
3204+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3205+ if (block != new_block && !strcmp(block->idstr, new_block->idstr)) {
3206+ fprintf(stderr, "RAMBlock \"%s\" already registered, abort!\n",
3207+ new_block->idstr);
3208+ abort();
3209+ }
3210+ }
3211+ rcu_read_unlock();
3212+}
3213+
3214+/* Called with iothread lock held. */
3215+void qemu_ram_unset_idstr(ram_addr_t addr)
3216+{
3217+ RAMBlock *block;
3218+
3219+ /* FIXME: arch_init.c assumes that this is not called throughout
3220+ * migration. Ignore the problem since hot-unplug during migration
3221+ * does not work anyway.
3222+ */
3223+
3224+ rcu_read_lock();
3225+ block = find_ram_block(addr);
3226+ if (block) {
3227+ memset(block->idstr, 0, sizeof(block->idstr));
3228+ }
3229+ rcu_read_unlock();
3230+}
3231+
3232+static int memory_try_enable_merging(void *addr, size_t len)
3233+{
3234+ if (!machine_mem_merge(current_machine)) {
3235+ /* disabled by the user */
3236+ return 0;
3237+ }
3238+
3239+ return qemu_madvise(addr, len, QEMU_MADV_MERGEABLE);
3240+}
3241+
3242+/* Only legal before guest might have detected the memory size: e.g. on
3243+ * incoming migration, or right after reset.
3244+ *
3245+ * As memory core doesn't know how is memory accessed, it is up to
3246+ * resize callback to update device state and/or add assertions to detect
3247+ * misuse, if necessary.
3248+ */
3249+int qemu_ram_resize(ram_addr_t base, ram_addr_t newsize, Error **errp)
3250+{
3251+ RAMBlock *block = find_ram_block(base);
3252+
3253+ assert(block);
3254+
3255+ newsize = HOST_PAGE_ALIGN(newsize);
3256+
3257+ if (block->used_length == newsize) {
3258+ return 0;
3259+ }
3260+
3261+ if (!(block->flags & RAM_RESIZEABLE)) {
3262+ error_setg_errno(errp, EINVAL,
3263+ "Length mismatch: %s: 0x" RAM_ADDR_FMT
3264+ " in != 0x" RAM_ADDR_FMT, block->idstr,
3265+ newsize, block->used_length);
3266+ return -EINVAL;
3267+ }
3268+
3269+ if (block->max_length < newsize) {
3270+ error_setg_errno(errp, EINVAL,
3271+ "Length too large: %s: 0x" RAM_ADDR_FMT
3272+ " > 0x" RAM_ADDR_FMT, block->idstr,
3273+ newsize, block->max_length);
3274+ return -EINVAL;
3275+ }
3276+
3277+ cpu_physical_memory_clear_dirty_range(block->offset, block->used_length);
3278+ block->used_length = newsize;
3279+ cpu_physical_memory_set_dirty_range(block->offset, block->used_length,
3280+ DIRTY_CLIENTS_ALL);
3281+ memory_region_set_size(block->mr, newsize);
3282+ if (block->resized) {
3283+ block->resized(block->idstr, newsize, block->host);
3284+ }
3285+ return 0;
3286+}
3287+
3288+static ram_addr_t ram_block_add(RAMBlock *new_block, Error **errp)
3289+{
3290+ RAMBlock *block;
3291+ RAMBlock *last_block = NULL;
3292+ ram_addr_t old_ram_size, new_ram_size;
3293+
3294+ old_ram_size = last_ram_offset() >> TARGET_PAGE_BITS;
3295+
3296+ qemu_mutex_lock_ramlist();
3297+ new_block->offset = find_ram_offset(new_block->max_length);
3298+
3299+ if (!new_block->host) {
3300+ if (xen_enabled()) {
3301+ xen_ram_alloc(new_block->offset, new_block->max_length,
3302+ new_block->mr);
3303+ } else {
3304+ new_block->host = phys_mem_alloc(new_block->max_length,
3305+ &new_block->mr->align);
3306+ if (!new_block->host) {
3307+ error_setg_errno(errp, errno,
3308+ "cannot set up guest memory '%s'",
3309+ memory_region_name(new_block->mr));
3310+ qemu_mutex_unlock_ramlist();
3311+ return -1;
3312+ }
3313+ memory_try_enable_merging(new_block->host, new_block->max_length);
3314+ }
3315+ }
3316+
3317+ new_ram_size = MAX(old_ram_size,
3318+ (new_block->offset + new_block->max_length) >> TARGET_PAGE_BITS);
3319+ if (new_ram_size > old_ram_size) {
3320+ migration_bitmap_extend(old_ram_size, new_ram_size);
3321+ }
3322+ /* Keep the list sorted from biggest to smallest block. Unlike QTAILQ,
3323+ * QLIST (which has an RCU-friendly variant) does not have insertion at
3324+ * tail, so save the last element in last_block.
3325+ */
3326+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3327+ last_block = block;
3328+ if (block->max_length < new_block->max_length) {
3329+ break;
3330+ }
3331+ }
3332+ if (block) {
3333+ QLIST_INSERT_BEFORE_RCU(block, new_block, next);
3334+ } else if (last_block) {
3335+ QLIST_INSERT_AFTER_RCU(last_block, new_block, next);
3336+ } else { /* list is empty */
3337+ QLIST_INSERT_HEAD_RCU(&ram_list.blocks, new_block, next);
3338+ }
3339+ ram_list.mru_block = NULL;
3340+
3341+ /* Write list before version */
3342+ smp_wmb();
3343+ ram_list.version++;
3344+ qemu_mutex_unlock_ramlist();
3345+
3346+ new_ram_size = last_ram_offset() >> TARGET_PAGE_BITS;
3347+
3348+ if (new_ram_size > old_ram_size) {
3349+ int i;
3350+
3351+ /* ram_list.dirty_memory[] is protected by the iothread lock. */
3352+ for (i = 0; i < DIRTY_MEMORY_NUM; i++) {
3353+ ram_list.dirty_memory[i] =
3354+ bitmap_zero_extend(ram_list.dirty_memory[i],
3355+ old_ram_size, new_ram_size);
3356+ }
3357+ }
3358+ cpu_physical_memory_set_dirty_range(new_block->offset,
3359+ new_block->used_length,
3360+ DIRTY_CLIENTS_ALL);
3361+
3362+ if (new_block->host) {
3363+ qemu_ram_setup_dump(new_block->host, new_block->max_length);
3364+ qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_HUGEPAGE);
3365+ qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_DONTFORK);
3366+ if (kvm_enabled()) {
3367+ kvm_setup_guest_memory(new_block->host, new_block->max_length);
3368+ }
3369+ }
3370+
3371+ return new_block->offset;
3372+}
3373+
3374+#ifdef __linux__
3375+ram_addr_t qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
3376+ bool share, const char *mem_path,
3377+ Error **errp)
3378+{
3379+ RAMBlock *new_block;
3380+ ram_addr_t addr;
3381+ Error *local_err = NULL;
3382+
3383+ if (xen_enabled()) {
3384+ error_setg(errp, "-mem-path not supported with Xen");
3385+ return -1;
3386+ }
3387+
3388+ if (phys_mem_alloc != qemu_anon_ram_alloc) {
3389+ /*
3390+ * file_ram_alloc() needs to allocate just like
3391+ * phys_mem_alloc, but we haven't bothered to provide
3392+ * a hook there.
3393+ */
3394+ error_setg(errp,
3395+ "-mem-path not supported with this accelerator");
3396+ return -1;
3397+ }
3398+
3399+ size = HOST_PAGE_ALIGN(size);
3400+ new_block = g_malloc0(sizeof(*new_block));
3401+ new_block->mr = mr;
3402+ new_block->used_length = size;
3403+ new_block->max_length = size;
3404+ new_block->flags = share ? RAM_SHARED : 0;
3405+ new_block->flags |= RAM_FILE;
3406+ new_block->host = file_ram_alloc(new_block, size,
3407+ mem_path, errp);
3408+ if (!new_block->host) {
3409+ g_free(new_block);
3410+ return -1;
3411+ }
3412+
3413+ addr = ram_block_add(new_block, &local_err);
3414+ if (local_err) {
3415+ g_free(new_block);
3416+ error_propagate(errp, local_err);
3417+ return -1;
3418+ }
3419+ return addr;
3420+}
3421+#endif
3422+
3423+static
3424+ram_addr_t qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size,
3425+ void (*resized)(const char*,
3426+ uint64_t length,
3427+ void *host),
3428+ void *host, bool resizeable,
3429+ MemoryRegion *mr, Error **errp)
3430+{
3431+ RAMBlock *new_block;
3432+ ram_addr_t addr;
3433+ Error *local_err = NULL;
3434+
3435+ size = HOST_PAGE_ALIGN(size);
3436+ max_size = HOST_PAGE_ALIGN(max_size);
3437+ new_block = g_malloc0(sizeof(*new_block));
3438+ new_block->mr = mr;
3439+ new_block->resized = resized;
3440+ new_block->used_length = size;
3441+ new_block->max_length = max_size;
3442+ assert(max_size >= size);
3443+ new_block->fd = -1;
3444+ new_block->host = host;
3445+ if (host) {
3446+ new_block->flags |= RAM_PREALLOC;
3447+ }
3448+ if (resizeable) {
3449+ new_block->flags |= RAM_RESIZEABLE;
3450+ }
3451+ addr = ram_block_add(new_block, &local_err);
3452+ if (local_err) {
3453+ g_free(new_block);
3454+ error_propagate(errp, local_err);
3455+ return -1;
3456+ }
3457+ return addr;
3458+}
3459+
3460+ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
3461+ MemoryRegion *mr, Error **errp)
3462+{
3463+ return qemu_ram_alloc_internal(size, size, NULL, host, false, mr, errp);
3464+}
3465+
3466+ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr, Error **errp)
3467+{
3468+ return qemu_ram_alloc_internal(size, size, NULL, NULL, false, mr, errp);
3469+}
3470+
3471+ram_addr_t qemu_ram_alloc_resizeable(ram_addr_t size, ram_addr_t maxsz,
3472+ void (*resized)(const char*,
3473+ uint64_t length,
3474+ void *host),
3475+ MemoryRegion *mr, Error **errp)
3476+{
3477+ return qemu_ram_alloc_internal(size, maxsz, resized, NULL, true, mr, errp);
3478+}
3479+
3480+void qemu_ram_free_from_ptr(ram_addr_t addr)
3481+{
3482+ RAMBlock *block;
3483+
3484+ qemu_mutex_lock_ramlist();
3485+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3486+ if (addr == block->offset) {
3487+ QLIST_REMOVE_RCU(block, next);
3488+ ram_list.mru_block = NULL;
3489+ /* Write list before version */
3490+ smp_wmb();
3491+ ram_list.version++;
3492+ g_free_rcu(block, rcu);
3493+ break;
3494+ }
3495+ }
3496+ qemu_mutex_unlock_ramlist();
3497+}
3498+
3499+static void reclaim_ramblock(RAMBlock *block)
3500+{
3501+ if (block->flags & RAM_PREALLOC) {
3502+ ;
3503+ } else if (xen_enabled()) {
3504+ xen_invalidate_map_cache_entry(block->host);
3505+#ifndef _WIN32
3506+ } else if (block->fd >= 0) {
3507+ if (block->flags & RAM_FILE) {
3508+ qemu_ram_munmap(block->host, block->max_length);
3509+ } else {
3510+ munmap(block->host, block->max_length);
3511+ }
3512+ close(block->fd);
3513+#endif
3514+ } else {
3515+ qemu_anon_ram_free(block->host, block->max_length);
3516+ }
3517+ g_free(block);
3518+}
3519+
3520+void qemu_ram_free(ram_addr_t addr)
3521+{
3522+ RAMBlock *block;
3523+
3524+ qemu_mutex_lock_ramlist();
3525+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3526+ if (addr == block->offset) {
3527+ QLIST_REMOVE_RCU(block, next);
3528+ ram_list.mru_block = NULL;
3529+ /* Write list before version */
3530+ smp_wmb();
3531+ ram_list.version++;
3532+ call_rcu(block, reclaim_ramblock, rcu);
3533+ break;
3534+ }
3535+ }
3536+ qemu_mutex_unlock_ramlist();
3537+}
3538+
3539+#ifndef _WIN32
3540+void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
3541+{
3542+ RAMBlock *block;
3543+ ram_addr_t offset;
3544+ int flags;
3545+ void *area, *vaddr;
3546+
3547+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3548+ offset = addr - block->offset;
3549+ if (offset < block->max_length) {
3550+ vaddr = ramblock_ptr(block, offset);
3551+ if (block->flags & RAM_PREALLOC) {
3552+ ;
3553+ } else if (xen_enabled()) {
3554+ abort();
3555+ } else {
3556+ flags = MAP_FIXED;
3557+ if (block->fd >= 0) {
3558+ flags |= (block->flags & RAM_SHARED ?
3559+ MAP_SHARED : MAP_PRIVATE);
3560+ area = mmap(vaddr, length, PROT_READ | PROT_WRITE,
3561+ flags, block->fd, offset);
3562+ } else {
3563+ /*
3564+ * Remap needs to match alloc. Accelerators that
3565+ * set phys_mem_alloc never remap. If they did,
3566+ * we'd need a remap hook here.
3567+ */
3568+ assert(phys_mem_alloc == qemu_anon_ram_alloc);
3569+
3570+ flags |= MAP_PRIVATE | MAP_ANONYMOUS;
3571+ area = mmap(vaddr, length, PROT_READ | PROT_WRITE,
3572+ flags, -1, 0);
3573+ }
3574+ if (area != vaddr) {
3575+ fprintf(stderr, "Could not remap addr: "
3576+ RAM_ADDR_FMT "@" RAM_ADDR_FMT "\n",
3577+ length, addr);
3578+ exit(1);
3579+ }
3580+ memory_try_enable_merging(vaddr, length);
3581+ qemu_ram_setup_dump(vaddr, length);
3582+ }
3583+ }
3584+ }
3585+}
3586+#endif /* !_WIN32 */
3587+
3588+int qemu_get_ram_fd(ram_addr_t addr)
3589+{
3590+ RAMBlock *block;
3591+ int fd;
3592+
3593+ rcu_read_lock();
3594+ block = qemu_get_ram_block(addr);
3595+ fd = block->fd;
3596+ rcu_read_unlock();
3597+ return fd;
3598+}
3599+
3600+void *qemu_get_ram_block_host_ptr(ram_addr_t addr)
3601+{
3602+ RAMBlock *block;
3603+ void *ptr;
3604+
3605+ rcu_read_lock();
3606+ block = qemu_get_ram_block(addr);
3607+ ptr = ramblock_ptr(block, 0);
3608+ rcu_read_unlock();
3609+ return ptr;
3610+}
3611+
3612+/* Return a host pointer to ram allocated with qemu_ram_alloc.
3613+ * This should not be used for general purpose DMA. Use address_space_map
3614+ * or address_space_rw instead. For local memory (e.g. video ram) that the
3615+ * device owns, use memory_region_get_ram_ptr.
3616+ *
3617+ * By the time this function returns, the returned pointer is not protected
3618+ * by RCU anymore. If the caller is not within an RCU critical section and
3619+ * does not hold the iothread lock, it must have other means of protecting the
3620+ * pointer, such as a reference to the region that includes the incoming
3621+ * ram_addr_t.
3622+ */
3623+void *qemu_get_ram_ptr(ram_addr_t addr)
3624+{
3625+ RAMBlock *block;
3626+ void *ptr;
3627+
3628+ rcu_read_lock();
3629+ block = qemu_get_ram_block(addr);
3630+
3631+ if (xen_enabled() && block->host == NULL) {
3632+ /* We need to check if the requested address is in the RAM
3633+ * because we don't want to map the entire memory in QEMU.
3634+ * In that case just map until the end of the page.
3635+ */
3636+ if (block->offset == 0) {
3637+ ptr = xen_map_cache(addr, 0, 0);
3638+ goto unlock;
3639+ }
3640+
3641+ block->host = xen_map_cache(block->offset, block->max_length, 1);
3642+ }
3643+ ptr = ramblock_ptr(block, addr - block->offset);
3644+
3645+unlock:
3646+ rcu_read_unlock();
3647+ return ptr;
3648+}
3649+
3650+/* Return a host pointer to guest's ram. Similar to qemu_get_ram_ptr
3651+ * but takes a size argument.
3652+ *
3653+ * By the time this function returns, the returned pointer is not protected
3654+ * by RCU anymore. If the caller is not within an RCU critical section and
3655+ * does not hold the iothread lock, it must have other means of protecting the
3656+ * pointer, such as a reference to the region that includes the incoming
3657+ * ram_addr_t.
3658+ */
3659+static void *qemu_ram_ptr_length(ram_addr_t addr, hwaddr *size)
3660+{
3661+ void *ptr;
3662+ if (*size == 0) {
3663+ return NULL;
3664+ }
3665+ if (xen_enabled()) {
3666+ return xen_map_cache(addr, *size, 1);
3667+ } else {
3668+ RAMBlock *block;
3669+ rcu_read_lock();
3670+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3671+ if (addr - block->offset < block->max_length) {
3672+ if (addr - block->offset + *size > block->max_length)
3673+ *size = block->max_length - addr + block->offset;
3674+ ptr = ramblock_ptr(block, addr - block->offset);
3675+ rcu_read_unlock();
3676+ return ptr;
3677+ }
3678+ }
3679+
3680+ fprintf(stderr, "Bad ram offset %" PRIx64 "\n", (uint64_t)addr);
3681+ abort();
3682+ }
3683+}
3684+
3685+/*
3686+ * Translates a host ptr back to a RAMBlock, a ram_addr and an offset
3687+ * in that RAMBlock.
3688+ *
3689+ * ptr: Host pointer to look up
3690+ * round_offset: If true round the result offset down to a page boundary
3691+ * *ram_addr: set to result ram_addr
3692+ * *offset: set to result offset within the RAMBlock
3693+ *
3694+ * Returns: RAMBlock (or NULL if not found)
3695+ *
3696+ * By the time this function returns, the returned pointer is not protected
3697+ * by RCU anymore. If the caller is not within an RCU critical section and
3698+ * does not hold the iothread lock, it must have other means of protecting the
3699+ * pointer, such as a reference to the region that includes the incoming
3700+ * ram_addr_t.
3701+ */
3702+RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset,
3703+ ram_addr_t *ram_addr,
3704+ ram_addr_t *offset)
3705+{
3706+ RAMBlock *block;
3707+ uint8_t *host = ptr;
3708+
3709+ if (xen_enabled()) {
3710+ rcu_read_lock();
3711+ *ram_addr = xen_ram_addr_from_mapcache(ptr);
3712+ block = qemu_get_ram_block(*ram_addr);
3713+ if (block) {
3714+ *offset = (host - block->host);
3715+ }
3716+ rcu_read_unlock();
3717+ return block;
3718+ }
3719+
3720+ rcu_read_lock();
3721+ block = atomic_rcu_read(&ram_list.mru_block);
3722+ if (block && block->host && host - block->host < block->max_length) {
3723+ goto found;
3724+ }
3725+
3726+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3727+ /* This case append when the block is not mapped. */
3728+ if (block->host == NULL) {
3729+ continue;
3730+ }
3731+ if (host - block->host < block->max_length) {
3732+ goto found;
3733+ }
3734+ }
3735+
3736+ rcu_read_unlock();
3737+ return NULL;
3738+
3739+found:
3740+ *offset = (host - block->host);
3741+ if (round_offset) {
3742+ *offset &= TARGET_PAGE_MASK;
3743+ }
3744+ *ram_addr = block->offset + *offset;
3745+ rcu_read_unlock();
3746+ return block;
3747+}
3748+
3749+/*
3750+ * Finds the named RAMBlock
3751+ *
3752+ * name: The name of RAMBlock to find
3753+ *
3754+ * Returns: RAMBlock (or NULL if not found)
3755+ */
3756+RAMBlock *qemu_ram_block_by_name(const char *name)
3757+{
3758+ RAMBlock *block;
3759+
3760+ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
3761+ if (!strcmp(name, block->idstr)) {
3762+ return block;
3763+ }
3764+ }
3765+
3766+ return NULL;
3767+}
3768+
3769+/* Some of the softmmu routines need to translate from a host pointer
3770+ (typically a TLB entry) back to a ram offset. */
3771+MemoryRegion *qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr)
3772+{
3773+ RAMBlock *block;
3774+ ram_addr_t offset; /* Not used */
3775+
3776+ block = qemu_ram_block_from_host(ptr, false, ram_addr, &offset);
3777+
3778+ if (!block) {
3779+ return NULL;
3780+ }
3781+
3782+ return block->mr;
3783+}
3784+
3785+static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
3786+ uint64_t val, unsigned size)
3787+{
3788+ if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) {
3789+ tb_invalidate_phys_page_fast(ram_addr, size);
3790+ }
3791+ switch (size) {
3792+ case 1:
3793+ stb_p(qemu_get_ram_ptr(ram_addr), val);
3794+ break;
3795+ case 2:
3796+ stw_p(qemu_get_ram_ptr(ram_addr), val);
3797+ break;
3798+ case 4:
3799+ stl_p(qemu_get_ram_ptr(ram_addr), val);
3800+ break;
3801+ default:
3802+ abort();
3803+ }
3804+ /* Set both VGA and migration bits for simplicity and to remove
3805+ * the notdirty callback faster.
3806+ */
3807+ cpu_physical_memory_set_dirty_range(ram_addr, size,
3808+ DIRTY_CLIENTS_NOCODE);
3809+ /* we remove the notdirty callback only if the code has been
3810+ flushed */
3811+ if (!cpu_physical_memory_is_clean(ram_addr)) {
3812+ tlb_set_dirty(current_cpu, current_cpu->mem_io_vaddr);
3813+ }
3814+}
3815+
3816+static bool notdirty_mem_accepts(void *opaque, hwaddr addr,
3817+ unsigned size, bool is_write)
3818+{
3819+ return is_write;
3820+}
3821+
3822+static const MemoryRegionOps notdirty_mem_ops = {
3823+ .write = notdirty_mem_write,
3824+ .valid.accepts = notdirty_mem_accepts,
3825+ .endianness = DEVICE_NATIVE_ENDIAN,
3826+};
3827+
3828+/* Generate a debug exception if a watchpoint has been hit. */
3829+static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags)
3830+{
3831+ CPUState *cpu = current_cpu;
3832+ CPUArchState *env = cpu->env_ptr;
3833+ target_ulong pc, cs_base;
3834+ target_ulong vaddr;
3835+ CPUWatchpoint *wp;
3836+ int cpu_flags;
3837+
3838+ if (cpu->watchpoint_hit) {
3839+ /* We re-entered the check after replacing the TB. Now raise
3840+ * the debug interrupt so that is will trigger after the
3841+ * current instruction. */
3842+ cpu_interrupt(cpu, CPU_INTERRUPT_DEBUG);
3843+ return;
3844+ }
3845+ vaddr = (cpu->mem_io_vaddr & TARGET_PAGE_MASK) + offset;
3846+ QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
3847+ if (cpu_watchpoint_address_matches(wp, vaddr, len)
3848+ && (wp->flags & flags)) {
3849+ if (flags == BP_MEM_READ) {
3850+ wp->flags |= BP_WATCHPOINT_HIT_READ;
3851+ } else {
3852+ wp->flags |= BP_WATCHPOINT_HIT_WRITE;
3853+ }
3854+ wp->hitaddr = vaddr;
3855+ wp->hitattrs = attrs;
3856+ if (!cpu->watchpoint_hit) {
3857+ cpu->watchpoint_hit = wp;
3858+ tb_check_watchpoint(cpu);
3859+ if (wp->flags & BP_STOP_BEFORE_ACCESS) {
3860+ cpu->exception_index = EXCP_DEBUG;
3861+ cpu_loop_exit(cpu);
3862+ } else {
3863+ cpu_get_tb_cpu_state(env, &pc, &cs_base, &cpu_flags);
3864+ tb_gen_code(cpu, pc, cs_base, cpu_flags, 1);
3865+ cpu_resume_from_signal(cpu, NULL);
3866+ }
3867+ }
3868+ } else {
3869+ wp->flags &= ~BP_WATCHPOINT_HIT;
3870+ }
3871+ }
3872+}
3873+
3874+/* Watchpoint access routines. Watchpoints are inserted using TLB tricks,
3875+ so these check for a hit then pass through to the normal out-of-line
3876+ phys routines. */
3877+static MemTxResult watch_mem_read(void *opaque, hwaddr addr, uint64_t *pdata,
3878+ unsigned size, MemTxAttrs attrs)
3879+{
3880+ MemTxResult res;
3881+ uint64_t data;
3882+
3883+ check_watchpoint(addr & ~TARGET_PAGE_MASK, size, attrs, BP_MEM_READ);
3884+ switch (size) {
3885+ case 1:
3886+ data = address_space_ldub(&address_space_memory, addr, attrs, &res);
3887+ break;
3888+ case 2:
3889+ data = address_space_lduw(&address_space_memory, addr, attrs, &res);
3890+ break;
3891+ case 4:
3892+ data = address_space_ldl(&address_space_memory, addr, attrs, &res);
3893+ break;
3894+ default: abort();
3895+ }
3896+ *pdata = data;
3897+ return res;
3898+}
3899+
3900+static MemTxResult watch_mem_write(void *opaque, hwaddr addr,
3901+ uint64_t val, unsigned size,
3902+ MemTxAttrs attrs)
3903+{
3904+ MemTxResult res;
3905+
3906+ check_watchpoint(addr & ~TARGET_PAGE_MASK, size, attrs, BP_MEM_WRITE);
3907+ switch (size) {
3908+ case 1:
3909+ address_space_stb(&address_space_memory, addr, val, attrs, &res);
3910+ break;
3911+ case 2:
3912+ address_space_stw(&address_space_memory, addr, val, attrs, &res);
3913+ break;
3914+ case 4:
3915+ address_space_stl(&address_space_memory, addr, val, attrs, &res);
3916+ break;
3917+ default: abort();
3918+ }
3919+ return res;
3920+}
3921+
3922+static const MemoryRegionOps watch_mem_ops = {
3923+ .read_with_attrs = watch_mem_read,
3924+ .write_with_attrs = watch_mem_write,
3925+ .endianness = DEVICE_NATIVE_ENDIAN,
3926+};
3927+
3928+static MemTxResult subpage_read(void *opaque, hwaddr addr, uint64_t *data,
3929+ unsigned len, MemTxAttrs attrs)
3930+{
3931+ subpage_t *subpage = opaque;
3932+ uint8_t buf[8];
3933+ MemTxResult res;
3934+
3935+#if defined(DEBUG_SUBPAGE)
3936+ printf("%s: subpage %p len %u addr " TARGET_FMT_plx "\n", __func__,
3937+ subpage, len, addr);
3938+#endif
3939+ res = address_space_read(subpage->as, addr + subpage->base,
3940+ attrs, buf, len);
3941+ if (res) {
3942+ return res;
3943+ }
3944+ switch (len) {
3945+ case 1:
3946+ *data = ldub_p(buf);
3947+ return MEMTX_OK;
3948+ case 2:
3949+ *data = lduw_p(buf);
3950+ return MEMTX_OK;
3951+ case 4:
3952+ *data = ldl_p(buf);
3953+ return MEMTX_OK;
3954+ case 8:
3955+ *data = ldq_p(buf);
3956+ return MEMTX_OK;
3957+ default:
3958+ abort();
3959+ }
3960+}
3961+
3962+static MemTxResult subpage_write(void *opaque, hwaddr addr,
3963+ uint64_t value, unsigned len, MemTxAttrs attrs)
3964+{
3965+ subpage_t *subpage = opaque;
3966+ uint8_t buf[8];
3967+
3968+#if defined(DEBUG_SUBPAGE)
3969+ printf("%s: subpage %p len %u addr " TARGET_FMT_plx
3970+ " value %"PRIx64"\n",
3971+ __func__, subpage, len, addr, value);
3972+#endif
3973+ switch (len) {
3974+ case 1:
3975+ stb_p(buf, value);
3976+ break;
3977+ case 2:
3978+ stw_p(buf, value);
3979+ break;
3980+ case 4:
3981+ stl_p(buf, value);
3982+ break;
3983+ case 8:
3984+ stq_p(buf, value);
3985+ break;
3986+ default:
3987+ abort();
3988+ }
3989+ return address_space_write(subpage->as, addr + subpage->base,
3990+ attrs, buf, len);
3991+}
3992+
3993+static bool subpage_accepts(void *opaque, hwaddr addr,
3994+ unsigned len, bool is_write)
3995+{
3996+ subpage_t *subpage = opaque;
3997+#if defined(DEBUG_SUBPAGE)
3998+ printf("%s: subpage %p %c len %u addr " TARGET_FMT_plx "\n",
3999+ __func__, subpage, is_write ? 'w' : 'r', len, addr);
4000+#endif
4001+
4002+ return address_space_access_valid(subpage->as, addr + subpage->base,
4003+ len, is_write);
4004+}
4005+
4006+static const MemoryRegionOps subpage_ops = {
4007+ .read_with_attrs = subpage_read,
4008+ .write_with_attrs = subpage_write,
4009+ .impl.min_access_size = 1,
4010+ .impl.max_access_size = 8,
4011+ .valid.min_access_size = 1,
4012+ .valid.max_access_size = 8,
4013+ .valid.accepts = subpage_accepts,
4014+ .endianness = DEVICE_NATIVE_ENDIAN,
4015+};
4016+
4017+static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
4018+ uint16_t section)
4019+{
4020+ int idx, eidx;
4021+
4022+ if (start >= TARGET_PAGE_SIZE || end >= TARGET_PAGE_SIZE)
4023+ return -1;
4024+ idx = SUBPAGE_IDX(start);
4025+ eidx = SUBPAGE_IDX(end);
4026+#if defined(DEBUG_SUBPAGE)
4027+ printf("%s: %p start %08x end %08x idx %08x eidx %08x section %d\n",
4028+ __func__, mmio, start, end, idx, eidx, section);
4029+#endif
4030+ for (; idx <= eidx; idx++) {
4031+ mmio->sub_section[idx] = section;
4032+ }
4033+
4034+ return 0;
4035+}
4036+
4037+static subpage_t *subpage_init(AddressSpace *as, hwaddr base)
4038+{
4039+ subpage_t *mmio;
4040+
4041+ mmio = g_malloc0(sizeof(subpage_t));
4042+
4043+ mmio->as = as;
4044+ mmio->base = base;
4045+ memory_region_init_io(&mmio->iomem, NULL, &subpage_ops, mmio,
4046+ NULL, TARGET_PAGE_SIZE);
4047+ mmio->iomem.subpage = true;
4048+#if defined(DEBUG_SUBPAGE)
4049+ printf("%s: %p base " TARGET_FMT_plx " len %08x\n", __func__,
4050+ mmio, base, TARGET_PAGE_SIZE);
4051+#endif
4052+ subpage_register(mmio, 0, TARGET_PAGE_SIZE-1, PHYS_SECTION_UNASSIGNED);
4053+
4054+ return mmio;
4055+}
4056+
4057+static uint16_t dummy_section(PhysPageMap *map, AddressSpace *as,
4058+ MemoryRegion *mr)
4059+{
4060+ assert(as);
4061+ MemoryRegionSection section = {
4062+ .address_space = as,
4063+ .mr = mr,
4064+ .offset_within_address_space = 0,
4065+ .offset_within_region = 0,
4066+ .size = int128_2_64(),
4067+ };
4068+
4069+ return phys_section_add(map, &section);
4070+}
4071+
4072+MemoryRegion *iotlb_to_region(CPUState *cpu, hwaddr index)
4073+{
4074+ CPUAddressSpace *cpuas = &cpu->cpu_ases[0];
4075+ AddressSpaceDispatch *d = atomic_rcu_read(&cpuas->memory_dispatch);
4076+ MemoryRegionSection *sections = d->map.sections;
4077+
4078+ return sections[index & ~TARGET_PAGE_MASK].mr;
4079+}
4080+
4081+static void io_mem_init(void)
4082+{
4083+ memory_region_init_io(&io_mem_rom, NULL, &unassigned_mem_ops, NULL, NULL, UINT64_MAX);
4084+ memory_region_init_io(&io_mem_unassigned, NULL, &unassigned_mem_ops, NULL,
4085+ NULL, UINT64_MAX);
4086+ memory_region_init_io(&io_mem_notdirty, NULL, &notdirty_mem_ops, NULL,
4087+ NULL, UINT64_MAX);
4088+ memory_region_init_io(&io_mem_watch, NULL, &watch_mem_ops, NULL,
4089+ NULL, UINT64_MAX);
4090+}
4091+
4092+static void mem_begin(MemoryListener *listener)
4093+{
4094+ AddressSpace *as = container_of(listener, AddressSpace, dispatch_listener);
4095+ AddressSpaceDispatch *d = g_new0(AddressSpaceDispatch, 1);
4096+ uint16_t n;
4097+
4098+ n = dummy_section(&d->map, as, &io_mem_unassigned);
4099+ assert(n == PHYS_SECTION_UNASSIGNED);
4100+ n = dummy_section(&d->map, as, &io_mem_notdirty);
4101+ assert(n == PHYS_SECTION_NOTDIRTY);
4102+ n = dummy_section(&d->map, as, &io_mem_rom);
4103+ assert(n == PHYS_SECTION_ROM);
4104+ n = dummy_section(&d->map, as, &io_mem_watch);
4105+ assert(n == PHYS_SECTION_WATCH);
4106+
4107+ d->phys_map = (PhysPageEntry) { .ptr = PHYS_MAP_NODE_NIL, .skip = 1 };
4108+ d->as = as;
4109+ as->next_dispatch = d;
4110+}
4111+
4112+static void address_space_dispatch_free(AddressSpaceDispatch *d)
4113+{
4114+ phys_sections_free(&d->map);
4115+ g_free(d);
4116+}
4117+
4118+static void mem_commit(MemoryListener *listener)
4119+{
4120+ AddressSpace *as = container_of(listener, AddressSpace, dispatch_listener);
4121+ AddressSpaceDispatch *cur = as->dispatch;
4122+ AddressSpaceDispatch *next = as->next_dispatch;
4123+
4124+ phys_page_compact_all(next, next->map.nodes_nb);
4125+
4126+ atomic_rcu_set(&as->dispatch, next);
4127+ if (cur) {
4128+ call_rcu(cur, address_space_dispatch_free, rcu);
4129+ }
4130+}
4131+
4132+static void tcg_commit(MemoryListener *listener)
4133+{
4134+ CPUAddressSpace *cpuas;
4135+ AddressSpaceDispatch *d;
4136+
4137+ /* since each CPU stores ram addresses in its TLB cache, we must
4138+ reset the modified entries */
4139+ cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener);
4140+ cpu_reloading_memory_map();
4141+ /* The CPU and TLB are protected by the iothread lock.
4142+ * We reload the dispatch pointer now because cpu_reloading_memory_map()
4143+ * may have split the RCU critical section.
4144+ */
4145+ d = atomic_rcu_read(&cpuas->as->dispatch);
4146+ cpuas->memory_dispatch = d;
4147+ tlb_flush(cpuas->cpu, 1);
4148+}
4149+
4150+void address_space_init_dispatch(AddressSpace *as)
4151+{
4152+ as->dispatch = NULL;
4153+ as->dispatch_listener = (MemoryListener) {
4154+ .begin = mem_begin,
4155+ .commit = mem_commit,
4156+ .region_add = mem_add,
4157+ .region_nop = mem_add,
4158+ .priority = 0,
4159+ };
4160+ memory_listener_register(&as->dispatch_listener, as);
4161+}
4162+
4163+void address_space_unregister(AddressSpace *as)
4164+{
4165+ memory_listener_unregister(&as->dispatch_listener);
4166+}
4167+
4168+void address_space_destroy_dispatch(AddressSpace *as)
4169+{
4170+ AddressSpaceDispatch *d = as->dispatch;
4171+
4172+ atomic_rcu_set(&as->dispatch, NULL);
4173+ if (d) {
4174+ call_rcu(d, address_space_dispatch_free, rcu);
4175+ }
4176+}
4177+
4178+static void memory_map_init(void)
4179+{
4180+ system_memory = g_malloc(sizeof(*system_memory));
4181+
4182+ memory_region_init(system_memory, NULL, "system", UINT64_MAX);
4183+ address_space_init(&address_space_memory, system_memory, "memory");
4184+
4185+ system_io = g_malloc(sizeof(*system_io));
4186+ memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io",
4187+ 65536);
4188+ address_space_init(&address_space_io, system_io, "I/O");
4189+}
4190+
4191+MemoryRegion *get_system_memory(void)
4192+{
4193+ return system_memory;
4194+}
4195+
4196+MemoryRegion *get_system_io(void)
4197+{
4198+ return system_io;
4199+}
4200+
4201+#endif /* !defined(CONFIG_USER_ONLY) */
4202+
4203+/* physical memory access (slow version, mainly for debug) */
4204+#if defined(CONFIG_USER_ONLY)
4205+int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
4206+ uint8_t *buf, int len, int is_write)
4207+{
4208+ int l, flags;
4209+ target_ulong page;
4210+ void * p;
4211+
4212+ while (len > 0) {
4213+ page = addr & TARGET_PAGE_MASK;
4214+ l = (page + TARGET_PAGE_SIZE) - addr;
4215+ if (l > len)
4216+ l = len;
4217+ flags = page_get_flags(page);
4218+ if (!(flags & PAGE_VALID))
4219+ return -1;
4220+ if (is_write) {
4221+ if (!(flags & PAGE_WRITE))
4222+ return -1;
4223+ /* XXX: this code should not depend on lock_user */
4224+ if (!(p = lock_user(VERIFY_WRITE, addr, l, 0)))
4225+ return -1;
4226+ memcpy(p, buf, l);
4227+ unlock_user(p, addr, l);
4228+ } else {
4229+ if (!(flags & PAGE_READ))
4230+ return -1;
4231+ /* XXX: this code should not depend on lock_user */
4232+ if (!(p = lock_user(VERIFY_READ, addr, l, 1)))
4233+ return -1;
4234+ memcpy(buf, p, l);
4235+ unlock_user(p, addr, 0);
4236+ }
4237+ len -= l;
4238+ buf += l;
4239+ addr += l;
4240+ }
4241+ return 0;
4242+}
4243+
4244+#else
4245+
4246+static void invalidate_and_set_dirty(MemoryRegion *mr, hwaddr addr,
4247+ hwaddr length)
4248+{
4249+ uint8_t dirty_log_mask = memory_region_get_dirty_log_mask(mr);
4250+ /* No early return if dirty_log_mask is or becomes 0, because
4251+ * cpu_physical_memory_set_dirty_range will still call
4252+ * xen_modified_memory.
4253+ */
4254+ if (dirty_log_mask) {
4255+ dirty_log_mask =
4256+ cpu_physical_memory_range_includes_clean(addr, length, dirty_log_mask);
4257+ }
4258+ if (dirty_log_mask & (1 << DIRTY_MEMORY_CODE)) {
4259+ tb_invalidate_phys_range(addr, addr + length);
4260+ dirty_log_mask &= ~(1 << DIRTY_MEMORY_CODE);
4261+ }
4262+ cpu_physical_memory_set_dirty_range(addr, length, dirty_log_mask);
4263+}
4264+
4265+static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)
4266+{
4267+ unsigned access_size_max = mr->ops->valid.max_access_size;
4268+
4269+ /* Regions are assumed to support 1-4 byte accesses unless
4270+ otherwise specified. */
4271+ if (access_size_max == 0) {
4272+ access_size_max = 4;
4273+ }
4274+
4275+ /* Bound the maximum access by the alignment of the address. */
4276+ if (!mr->ops->impl.unaligned) {
4277+ unsigned align_size_max = addr & -addr;
4278+ if (align_size_max != 0 && align_size_max < access_size_max) {
4279+ access_size_max = align_size_max;
4280+ }
4281+ }
4282+
4283+ /* Don't attempt accesses larger than the maximum. */
4284+ if (l > access_size_max) {
4285+ l = access_size_max;
4286+ }
4287+ l = pow2floor(l);
4288+
4289+ return l;
4290+}
4291+
4292+static bool prepare_mmio_access(MemoryRegion *mr)
4293+{
4294+ bool unlocked = !qemu_mutex_iothread_locked();
4295+ bool release_lock = false;
4296+
4297+ if (unlocked && mr->global_locking) {
4298+ qemu_mutex_lock_iothread();
4299+ unlocked = false;
4300+ release_lock = true;
4301+ }
4302+ if (mr->flush_coalesced_mmio) {
4303+ if (unlocked) {
4304+ qemu_mutex_lock_iothread();
4305+ }
4306+ qemu_flush_coalesced_mmio_buffer();
4307+ if (unlocked) {
4308+ qemu_mutex_unlock_iothread();
4309+ }
4310+ }
4311+
4312+ return release_lock;
4313+}
4314+
4315+MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
4316+ uint8_t *buf, int len, bool is_write)
4317+{
4318+ hwaddr l;
4319+ uint8_t *ptr;
4320+ uint64_t val;
4321+ hwaddr addr1;
4322+ MemoryRegion *mr;
4323+ MemTxResult result = MEMTX_OK;
4324+ bool release_lock = false;
4325+
4326+ rcu_read_lock();
4327+ while (len > 0) {
4328+ l = len;
4329+ mr = address_space_translate(as, addr, &addr1, &l, is_write);
4330+
4331+ if (is_write) {
4332+ if (!memory_access_is_direct(mr, is_write)) {
4333+ release_lock |= prepare_mmio_access(mr);
4334+ l = memory_access_size(mr, l, addr1);
4335+ /* XXX: could force current_cpu to NULL to avoid
4336+ potential bugs */
4337+ switch (l) {
4338+ case 8:
4339+ /* 64 bit write access */
4340+ val = ldq_p(buf);
4341+ result |= memory_region_dispatch_write(mr, addr1, val, 8,
4342+ attrs);
4343+ break;
4344+ case 4:
4345+ /* 32 bit write access */
4346+ val = ldl_p(buf);
4347+ result |= memory_region_dispatch_write(mr, addr1, val, 4,
4348+ attrs);
4349+ break;
4350+ case 2:
4351+ /* 16 bit write access */
4352+ val = lduw_p(buf);
4353+ result |= memory_region_dispatch_write(mr, addr1, val, 2,
4354+ attrs);
4355+ break;
4356+ case 1:
4357+ /* 8 bit write access */
4358+ val = ldub_p(buf);
4359+ result |= memory_region_dispatch_write(mr, addr1, val, 1,
4360+ attrs);
4361+ break;
4362+ default:
4363+ abort();
4364+ }
4365+ } else {
4366+ addr1 += memory_region_get_ram_addr(mr);
4367+ /* RAM case */
4368+ ptr = qemu_get_ram_ptr(addr1);
4369+ memcpy(ptr, buf, l);
4370+ invalidate_and_set_dirty(mr, addr1, l);
4371+ }
4372+ } else {
4373+ if (!memory_access_is_direct(mr, is_write)) {
4374+ /* I/O case */
4375+ release_lock |= prepare_mmio_access(mr);
4376+ l = memory_access_size(mr, l, addr1);
4377+ switch (l) {
4378+ case 8:
4379+ /* 64 bit read access */
4380+ result |= memory_region_dispatch_read(mr, addr1, &val, 8,
4381+ attrs);
4382+ stq_p(buf, val);
4383+ break;
4384+ case 4:
4385+ /* 32 bit read access */
4386+ result |= memory_region_dispatch_read(mr, addr1, &val, 4,
4387+ attrs);
4388+ stl_p(buf, val);
4389+ break;
4390+ case 2:
4391+ /* 16 bit read access */
4392+ result |= memory_region_dispatch_read(mr, addr1, &val, 2,
4393+ attrs);
4394+ stw_p(buf, val);
4395+ break;
4396+ case 1:
4397+ /* 8 bit read access */
4398+ result |= memory_region_dispatch_read(mr, addr1, &val, 1,
4399+ attrs);
4400+ stb_p(buf, val);
4401+ break;
4402+ default:
4403+ abort();
4404+ }
4405+ } else {
4406+ /* RAM case */
4407+ ptr = qemu_get_ram_ptr(mr->ram_addr + addr1);
4408+ memcpy(buf, ptr, l);
4409+ }
4410+ }
4411+
4412+ if (release_lock) {
4413+ qemu_mutex_unlock_iothread();
4414+ release_lock = false;
4415+ }
4416+
4417+ len -= l;
4418+ buf += l;
4419+ addr += l;
4420+ }
4421+ rcu_read_unlock();
4422+
4423+ return result;
4424+}
4425+
4426+MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
4427+ const uint8_t *buf, int len)
4428+{
4429+ return address_space_rw(as, addr, attrs, (uint8_t *)buf, len, true);
4430+}
4431+
4432+MemTxResult address_space_read(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
4433+ uint8_t *buf, int len)
4434+{
4435+ return address_space_rw(as, addr, attrs, buf, len, false);
4436+}
4437+
4438+
4439+void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
4440+ int len, int is_write)
4441+{
4442+ address_space_rw(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
4443+ buf, len, is_write);
4444+}
4445+
4446+enum write_rom_type {
4447+ WRITE_DATA,
4448+ FLUSH_CACHE,
4449+};
4450+
4451+static inline void cpu_physical_memory_write_rom_internal(AddressSpace *as,
4452+ hwaddr addr, const uint8_t *buf, int len, enum write_rom_type type)
4453+{
4454+ hwaddr l;
4455+ uint8_t *ptr;
4456+ hwaddr addr1;
4457+ MemoryRegion *mr;
4458+
4459+ rcu_read_lock();
4460+ while (len > 0) {
4461+ l = len;
4462+ mr = address_space_translate(as, addr, &addr1, &l, true);
4463+
4464+ if (!(memory_region_is_ram(mr) ||
4465+ memory_region_is_romd(mr))) {
4466+ l = memory_access_size(mr, l, addr1);
4467+ } else {
4468+ addr1 += memory_region_get_ram_addr(mr);
4469+ /* ROM/RAM case */
4470+ ptr = qemu_get_ram_ptr(addr1);
4471+ switch (type) {
4472+ case WRITE_DATA:
4473+ memcpy(ptr, buf, l);
4474+ invalidate_and_set_dirty(mr, addr1, l);
4475+ break;
4476+ case FLUSH_CACHE:
4477+ flush_icache_range((uintptr_t)ptr, (uintptr_t)ptr + l);
4478+ break;
4479+ }
4480+ }
4481+ len -= l;
4482+ buf += l;
4483+ addr += l;
4484+ }
4485+ rcu_read_unlock();
4486+}
4487+
4488+/* used for ROM loading : can write in RAM and ROM */
4489+void cpu_physical_memory_write_rom(AddressSpace *as, hwaddr addr,
4490+ const uint8_t *buf, int len)
4491+{
4492+ cpu_physical_memory_write_rom_internal(as, addr, buf, len, WRITE_DATA);
4493+}
4494+
4495+void cpu_flush_icache_range(hwaddr start, int len)
4496+{
4497+ /*
4498+ * This function should do the same thing as an icache flush that was
4499+ * triggered from within the guest. For TCG we are always cache coherent,
4500+ * so there is no need to flush anything. For KVM / Xen we need to flush
4501+ * the host's instruction cache at least.
4502+ */
4503+ if (tcg_enabled()) {
4504+ return;
4505+ }
4506+
4507+ cpu_physical_memory_write_rom_internal(&address_space_memory,
4508+ start, NULL, len, FLUSH_CACHE);
4509+}
4510+
4511+typedef struct {
4512+ MemoryRegion *mr;
4513+ void *buffer;
4514+ hwaddr addr;
4515+ hwaddr len;
4516+ bool in_use;
4517+} BounceBuffer;
4518+
4519+static BounceBuffer bounce;
4520+
4521+typedef struct MapClient {
4522+ QEMUBH *bh;
4523+ QLIST_ENTRY(MapClient) link;
4524+} MapClient;
4525+
4526+QemuMutex map_client_list_lock;
4527+static QLIST_HEAD(map_client_list, MapClient) map_client_list
4528+ = QLIST_HEAD_INITIALIZER(map_client_list);
4529+
4530+static void cpu_unregister_map_client_do(MapClient *client)
4531+{
4532+ QLIST_REMOVE(client, link);
4533+ g_free(client);
4534+}
4535+
4536+static void cpu_notify_map_clients_locked(void)
4537+{
4538+ MapClient *client;
4539+
4540+ while (!QLIST_EMPTY(&map_client_list)) {
4541+ client = QLIST_FIRST(&map_client_list);
4542+ qemu_bh_schedule(client->bh);
4543+ cpu_unregister_map_client_do(client);
4544+ }
4545+}
4546+
4547+void cpu_register_map_client(QEMUBH *bh)
4548+{
4549+ MapClient *client = g_malloc(sizeof(*client));
4550+
4551+ qemu_mutex_lock(&map_client_list_lock);
4552+ client->bh = bh;
4553+ QLIST_INSERT_HEAD(&map_client_list, client, link);
4554+ if (!atomic_read(&bounce.in_use)) {
4555+ cpu_notify_map_clients_locked();
4556+ }
4557+ qemu_mutex_unlock(&map_client_list_lock);
4558+}
4559+
4560+void cpu_exec_init_all(void)
4561+{
4562+ qemu_mutex_init(&ram_list.mutex);
4563+ io_mem_init();
4564+ memory_map_init();
4565+ qemu_mutex_init(&map_client_list_lock);
4566+}
4567+
4568+void cpu_unregister_map_client(QEMUBH *bh)
4569+{
4570+ MapClient *client;
4571+
4572+ qemu_mutex_lock(&map_client_list_lock);
4573+ QLIST_FOREACH(client, &map_client_list, link) {
4574+ if (client->bh == bh) {
4575+ cpu_unregister_map_client_do(client);
4576+ break;
4577+ }
4578+ }
4579+ qemu_mutex_unlock(&map_client_list_lock);
4580+}
4581+
4582+static void cpu_notify_map_clients(void)
4583+{
4584+ qemu_mutex_lock(&map_client_list_lock);
4585+ cpu_notify_map_clients_locked();
4586+ qemu_mutex_unlock(&map_client_list_lock);
4587+}
4588+
4589+bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write)
4590+{
4591+ MemoryRegion *mr;
4592+ hwaddr l, xlat;
4593+
4594+ rcu_read_lock();
4595+ while (len > 0) {
4596+ l = len;
4597+ mr = address_space_translate(as, addr, &xlat, &l, is_write);
4598+ if (!memory_access_is_direct(mr, is_write)) {
4599+ l = memory_access_size(mr, l, addr);
4600+ if (!memory_region_access_valid(mr, xlat, l, is_write)) {
4601+ return false;
4602+ }
4603+ }
4604+
4605+ len -= l;
4606+ addr += l;
4607+ }
4608+ rcu_read_unlock();
4609+ return true;
4610+}
4611+
4612+/* Map a physical memory region into a host virtual address.
4613+ * May map a subset of the requested range, given by and returned in *plen.
4614+ * May return NULL if resources needed to perform the mapping are exhausted.
4615+ * Use only for reads OR writes - not for read-modify-write operations.
4616+ * Use cpu_register_map_client() to know when retrying the map operation is
4617+ * likely to succeed.
4618+ */
4619+void *address_space_map(AddressSpace *as,
4620+ hwaddr addr,
4621+ hwaddr *plen,
4622+ bool is_write)
4623+{
4624+ hwaddr len = *plen;
4625+ hwaddr done = 0;
4626+ hwaddr l, xlat, base;
4627+ MemoryRegion *mr, *this_mr;
4628+ ram_addr_t raddr;
4629+
4630+ if (len == 0) {
4631+ return NULL;
4632+ }
4633+
4634+ l = len;
4635+ rcu_read_lock();
4636+ mr = address_space_translate(as, addr, &xlat, &l, is_write);
4637+
4638+ if (!memory_access_is_direct(mr, is_write)) {
4639+ if (atomic_xchg(&bounce.in_use, true)) {
4640+ rcu_read_unlock();
4641+ return NULL;
4642+ }
4643+ /* Avoid unbounded allocations */
4644+ l = MIN(l, TARGET_PAGE_SIZE);
4645+ bounce.buffer = qemu_memalign(TARGET_PAGE_SIZE, l);
4646+ bounce.addr = addr;
4647+ bounce.len = l;
4648+
4649+ memory_region_ref(mr);
4650+ bounce.mr = mr;
4651+ if (!is_write) {
4652+ address_space_read(as, addr, MEMTXATTRS_UNSPECIFIED,
4653+ bounce.buffer, l);
4654+ }
4655+
4656+ rcu_read_unlock();
4657+ *plen = l;
4658+ return bounce.buffer;
4659+ }
4660+
4661+ base = xlat;
4662+ raddr = memory_region_get_ram_addr(mr);
4663+
4664+ for (;;) {
4665+ len -= l;
4666+ addr += l;
4667+ done += l;
4668+ if (len == 0) {
4669+ break;
4670+ }
4671+
4672+ l = len;
4673+ this_mr = address_space_translate(as, addr, &xlat, &l, is_write);
4674+ if (this_mr != mr || xlat != base + done) {
4675+ break;
4676+ }
4677+ }
4678+
4679+ memory_region_ref(mr);
4680+ rcu_read_unlock();
4681+ *plen = done;
4682+ return qemu_ram_ptr_length(raddr + base, plen);
4683+}
4684+
4685+/* Unmaps a memory region previously mapped by address_space_map().
4686+ * Will also mark the memory as dirty if is_write == 1. access_len gives
4687+ * the amount of memory that was actually read or written by the caller.
4688+ */
4689+void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
4690+ int is_write, hwaddr access_len)
4691+{
4692+ if (buffer != bounce.buffer) {
4693+ MemoryRegion *mr;
4694+ ram_addr_t addr1;
4695+
4696+ mr = qemu_ram_addr_from_host(buffer, &addr1);
4697+ assert(mr != NULL);
4698+ if (is_write) {
4699+ invalidate_and_set_dirty(mr, addr1, access_len);
4700+ }
4701+ if (xen_enabled()) {
4702+ xen_invalidate_map_cache_entry(buffer);
4703+ }
4704+ memory_region_unref(mr);
4705+ return;
4706+ }
4707+ if (is_write) {
4708+ address_space_write(as, bounce.addr, MEMTXATTRS_UNSPECIFIED,
4709+ bounce.buffer, access_len);
4710+ }
4711+ qemu_vfree(bounce.buffer);
4712+ bounce.buffer = NULL;
4713+ memory_region_unref(bounce.mr);
4714+ atomic_mb_set(&bounce.in_use, false);
4715+ cpu_notify_map_clients();
4716+}
4717+
4718+void *cpu_physical_memory_map(hwaddr addr,
4719+ hwaddr *plen,
4720+ int is_write)
4721+{
4722+ return address_space_map(&address_space_memory, addr, plen, is_write);
4723+}
4724+
4725+void cpu_physical_memory_unmap(void *buffer, hwaddr len,
4726+ int is_write, hwaddr access_len)
4727+{
4728+ return address_space_unmap(&address_space_memory, buffer, len, is_write, access_len);
4729+}
4730+
4731+/* warning: addr must be aligned */
4732+static inline uint32_t address_space_ldl_internal(AddressSpace *as, hwaddr addr,
4733+ MemTxAttrs attrs,
4734+ MemTxResult *result,
4735+ enum device_endian endian)
4736+{
4737+ uint8_t *ptr;
4738+ uint64_t val;
4739+ MemoryRegion *mr;
4740+ hwaddr l = 4;
4741+ hwaddr addr1;
4742+ MemTxResult r;
4743+ bool release_lock = false;
4744+
4745+ rcu_read_lock();
4746+ mr = address_space_translate(as, addr, &addr1, &l, false);
4747+ if (l < 4 || !memory_access_is_direct(mr, false)) {
4748+ release_lock |= prepare_mmio_access(mr);
4749+
4750+ /* I/O case */
4751+ r = memory_region_dispatch_read(mr, addr1, &val, 4, attrs);
4752+#if defined(TARGET_WORDS_BIGENDIAN)
4753+ if (endian == DEVICE_LITTLE_ENDIAN) {
4754+ val = bswap32(val);
4755+ }
4756+#else
4757+ if (endian == DEVICE_BIG_ENDIAN) {
4758+ val = bswap32(val);
4759+ }
4760+#endif
4761+ } else {
4762+ /* RAM case */
4763+ ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(mr)
4764+ & TARGET_PAGE_MASK)
4765+ + addr1);
4766+ switch (endian) {
4767+ case DEVICE_LITTLE_ENDIAN:
4768+ val = ldl_le_p(ptr);
4769+ break;
4770+ case DEVICE_BIG_ENDIAN:
4771+ val = ldl_be_p(ptr);
4772+ break;
4773+ default:
4774+ val = ldl_p(ptr);
4775+ break;
4776+ }
4777+ r = MEMTX_OK;
4778+ }
4779+ if (result) {
4780+ *result = r;
4781+ }
4782+ if (release_lock) {
4783+ qemu_mutex_unlock_iothread();
4784+ }
4785+ rcu_read_unlock();
4786+ return val;
4787+}
4788+
4789+uint32_t address_space_ldl(AddressSpace *as, hwaddr addr,
4790+ MemTxAttrs attrs, MemTxResult *result)
4791+{
4792+ return address_space_ldl_internal(as, addr, attrs, result,
4793+ DEVICE_NATIVE_ENDIAN);
4794+}
4795+
4796+uint32_t address_space_ldl_le(AddressSpace *as, hwaddr addr,
4797+ MemTxAttrs attrs, MemTxResult *result)
4798+{
4799+ return address_space_ldl_internal(as, addr, attrs, result,
4800+ DEVICE_LITTLE_ENDIAN);
4801+}
4802+
4803+uint32_t address_space_ldl_be(AddressSpace *as, hwaddr addr,
4804+ MemTxAttrs attrs, MemTxResult *result)
4805+{
4806+ return address_space_ldl_internal(as, addr, attrs, result,
4807+ DEVICE_BIG_ENDIAN);
4808+}
4809+
4810+uint32_t ldl_phys(AddressSpace *as, hwaddr addr)
4811+{
4812+ return address_space_ldl(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4813+}
4814+
4815+uint32_t ldl_le_phys(AddressSpace *as, hwaddr addr)
4816+{
4817+ return address_space_ldl_le(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4818+}
4819+
4820+uint32_t ldl_be_phys(AddressSpace *as, hwaddr addr)
4821+{
4822+ return address_space_ldl_be(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4823+}
4824+
4825+/* warning: addr must be aligned */
4826+static inline uint64_t address_space_ldq_internal(AddressSpace *as, hwaddr addr,
4827+ MemTxAttrs attrs,
4828+ MemTxResult *result,
4829+ enum device_endian endian)
4830+{
4831+ uint8_t *ptr;
4832+ uint64_t val;
4833+ MemoryRegion *mr;
4834+ hwaddr l = 8;
4835+ hwaddr addr1;
4836+ MemTxResult r;
4837+ bool release_lock = false;
4838+
4839+ rcu_read_lock();
4840+ mr = address_space_translate(as, addr, &addr1, &l,
4841+ false);
4842+ if (l < 8 || !memory_access_is_direct(mr, false)) {
4843+ release_lock |= prepare_mmio_access(mr);
4844+
4845+ /* I/O case */
4846+ r = memory_region_dispatch_read(mr, addr1, &val, 8, attrs);
4847+#if defined(TARGET_WORDS_BIGENDIAN)
4848+ if (endian == DEVICE_LITTLE_ENDIAN) {
4849+ val = bswap64(val);
4850+ }
4851+#else
4852+ if (endian == DEVICE_BIG_ENDIAN) {
4853+ val = bswap64(val);
4854+ }
4855+#endif
4856+ } else {
4857+ /* RAM case */
4858+ ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(mr)
4859+ & TARGET_PAGE_MASK)
4860+ + addr1);
4861+ switch (endian) {
4862+ case DEVICE_LITTLE_ENDIAN:
4863+ val = ldq_le_p(ptr);
4864+ break;
4865+ case DEVICE_BIG_ENDIAN:
4866+ val = ldq_be_p(ptr);
4867+ break;
4868+ default:
4869+ val = ldq_p(ptr);
4870+ break;
4871+ }
4872+ r = MEMTX_OK;
4873+ }
4874+ if (result) {
4875+ *result = r;
4876+ }
4877+ if (release_lock) {
4878+ qemu_mutex_unlock_iothread();
4879+ }
4880+ rcu_read_unlock();
4881+ return val;
4882+}
4883+
4884+uint64_t address_space_ldq(AddressSpace *as, hwaddr addr,
4885+ MemTxAttrs attrs, MemTxResult *result)
4886+{
4887+ return address_space_ldq_internal(as, addr, attrs, result,
4888+ DEVICE_NATIVE_ENDIAN);
4889+}
4890+
4891+uint64_t address_space_ldq_le(AddressSpace *as, hwaddr addr,
4892+ MemTxAttrs attrs, MemTxResult *result)
4893+{
4894+ return address_space_ldq_internal(as, addr, attrs, result,
4895+ DEVICE_LITTLE_ENDIAN);
4896+}
4897+
4898+uint64_t address_space_ldq_be(AddressSpace *as, hwaddr addr,
4899+ MemTxAttrs attrs, MemTxResult *result)
4900+{
4901+ return address_space_ldq_internal(as, addr, attrs, result,
4902+ DEVICE_BIG_ENDIAN);
4903+}
4904+
4905+uint64_t ldq_phys(AddressSpace *as, hwaddr addr)
4906+{
4907+ return address_space_ldq(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4908+}
4909+
4910+uint64_t ldq_le_phys(AddressSpace *as, hwaddr addr)
4911+{
4912+ return address_space_ldq_le(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4913+}
4914+
4915+uint64_t ldq_be_phys(AddressSpace *as, hwaddr addr)
4916+{
4917+ return address_space_ldq_be(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4918+}
4919+
4920+/* XXX: optimize */
4921+uint32_t address_space_ldub(AddressSpace *as, hwaddr addr,
4922+ MemTxAttrs attrs, MemTxResult *result)
4923+{
4924+ uint8_t val;
4925+ MemTxResult r;
4926+
4927+ r = address_space_rw(as, addr, attrs, &val, 1, 0);
4928+ if (result) {
4929+ *result = r;
4930+ }
4931+ return val;
4932+}
4933+
4934+uint32_t ldub_phys(AddressSpace *as, hwaddr addr)
4935+{
4936+ return address_space_ldub(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
4937+}
4938+
4939+/* warning: addr must be aligned */
4940+static inline uint32_t address_space_lduw_internal(AddressSpace *as,
4941+ hwaddr addr,
4942+ MemTxAttrs attrs,
4943+ MemTxResult *result,
4944+ enum device_endian endian)
4945+{
4946+ uint8_t *ptr;
4947+ uint64_t val;
4948+ MemoryRegion *mr;
4949+ hwaddr l = 2;
4950+ hwaddr addr1;
4951+ MemTxResult r;
4952+ bool release_lock = false;
4953+
4954+ rcu_read_lock();
4955+ mr = address_space_translate(as, addr, &addr1, &l,
4956+ false);
4957+ if (l < 2 || !memory_access_is_direct(mr, false)) {
4958+ release_lock |= prepare_mmio_access(mr);
4959+
4960+ /* I/O case */
4961+ r = memory_region_dispatch_read(mr, addr1, &val, 2, attrs);
4962+#if defined(TARGET_WORDS_BIGENDIAN)
4963+ if (endian == DEVICE_LITTLE_ENDIAN) {
4964+ val = bswap16(val);
4965+ }
4966+#else
4967+ if (endian == DEVICE_BIG_ENDIAN) {
4968+ val = bswap16(val);
4969+ }
4970+#endif
4971+ } else {
4972+ /* RAM case */
4973+ ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(mr)
4974+ & TARGET_PAGE_MASK)
4975+ + addr1);
4976+ switch (endian) {
4977+ case DEVICE_LITTLE_ENDIAN:
4978+ val = lduw_le_p(ptr);
4979+ break;
4980+ case DEVICE_BIG_ENDIAN:
4981+ val = lduw_be_p(ptr);
4982+ break;
4983+ default:
4984+ val = lduw_p(ptr);
4985+ break;
4986+ }
4987+ r = MEMTX_OK;
4988+ }
4989+ if (result) {
4990+ *result = r;
4991+ }
4992+ if (release_lock) {
4993+ qemu_mutex_unlock_iothread();
4994+ }
4995+ rcu_read_unlock();
4996+ return val;
4997+}
4998+
4999+uint32_t address_space_lduw(AddressSpace *as, hwaddr addr,
5000+ MemTxAttrs attrs, MemTxResult *result)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches