Merge ~paelzer/ubuntu/+source/qemu:lp-1783140-xenial into ubuntu/+source/qemu:ubuntu/xenial-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 31b77ae93fe7f73eb2e4c733b4248eaef284348c
Merge reported by: Christian Ehrhardt 
Merged at revision: 31b77ae93fe7f73eb2e4c733b4248eaef284348c
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-1783140-xenial
Merge into: ubuntu/+source/qemu:ubuntu/xenial-devel
Diff against target: 1348328 lines (+1324018/-0)
4048 files modified
debian/changelog (+9/-0)
debian/patches/series (+2/-0)
debian/patches/ubuntu/lp-1783140-Revert-virtio-net-unbreak-self-announcement.patch (+94/-0)
debian/patches/ubuntu/lp-1783140-virtio-set-low-features-early-on-load.patch (+59/-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
Ryan Harper (community) Approve
Robie Basak Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+354695@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

PPA at: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3412

The only trigger we found so far is on ppc64el migrating guests that have a kernel running with commit 3f93522 "virtio-net: switch off offloads on demand if possible on XDP set".
That would be Bionic guest on Xenial Host and then doing a live migration.

I'll run a multi-arch regression check on the PPA and a test for the reported case anyway once it is ready.
I'd mostly be interested in packaging review (tags/versions/...) and a general review of the backported patches - on the latter I read and thought a while but I think as long as we carry both patches (and not just the second) we should be ok.

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

Case Test completed: still migrating a xenial guest fine and with the fix also doing fine for a bionic guest.

Revision history for this message
Robie Basak (racb) wrote :

Need SRU information in the bug before upload please. Minor dep3 issue inline.

> a general review of the backported patches

I don't feel remotely qualified to give you this without spending a ton of time understanding qemu internals. Could we ask Ryan maybe?

Apart from all that, +1 for upload.

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

Thanks Robie, I adapted the dep3 header (which then also doesn't need Author/Original-Author) and updated my template.

I'll ask Ryan for the review on the case

31b77ae... by Christian Ehrhardt 

fix Origin Dep-3 reference in d/p/ubuntu/lp-1783140-*

Signed-off-by: Christian Ehrhardt <email address hidden>

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

With the exception that I have to skip the cross release migrations due to issues with todays Cosmic image the regression runs completed and found no issue.

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

I realized that we also had this in 2.6.1 in Yakkety and thereby maybe also in UCA-Newton, so it actually is pretty tested already.

Revision history for this message
Ryan Harper (raharper) wrote :

After discussion in IRC, it appears the the launchpad diff is showing more than is really changing; it's only the application of two patches.

The patches look fine.

review: Approve

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

Subscribers

People subscribed via source and target branches