History log of /openbmc/qemu/accel/ (Results 1101 – 1125 of 1260)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
a688e73b25-Jun-2018 Emilio G. Cota <cota@braap.org>

translate-all: fix locking of TBs whose two pages share the same physical page

Commit 0b5c91f ("translate-all: use per-page locking in !user-mode",
2018-06-15) introduced per-page locking. It assume

translate-all: fix locking of TBs whose two pages share the same physical page

Commit 0b5c91f ("translate-all: use per-page locking in !user-mode",
2018-06-15) introduced per-page locking. It assumed that the physical
pages corresponding to a TB (at most two pages) are always distinct,
which is wrong. For instance, an xtensa test provided by Max Filippov
is broken by the commit, since the test maps two virtual pages
to the same physical page:

virt1: 7fff, virt2: 8000
phys1 6000fff, phys2 6000000

Fix it by removing the assumption from page_lock_pair.
If the two physical page addresses are equal, we only lock
the PageDesc once. Note that the two callers of page_lock_pair,
namely page_unlock_tb and tb_link_page, are also updated so that
we do not try to unlock the same PageDesc twice.

Fixes: 0b5c91f74f3c83a36f37740969df8c775c997e69
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1529944302-14186-1-git-send-email-cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

c40d479202-Jul-2018 Paolo Bonzini <pbonzini@redhat.com>

tcg: simplify !CONFIG_TCG handling of tb_invalidate_*

There is no need for a stub, since tb_invalidate_phys_addr can be excised
altogether when TCG is disabled. This is a bit cleaner since it avoid

tcg: simplify !CONFIG_TCG handling of tb_invalidate_*

There is no need for a stub, since tb_invalidate_phys_addr can be excised
altogether when TCG is disabled. This is a bit cleaner since it avoids
using code that is clearly specific to user-mode emulation (it calls
mmap_lock/unlock) for the !CONFIG_TCG case.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


stubs/tcg-stub.c
/openbmc/qemu/block/vdi.c
/openbmc/qemu/bsd-user/main.c
/openbmc/qemu/chardev/char-serial.c
/openbmc/qemu/configure
/openbmc/qemu/exec.c
/openbmc/qemu/hw/alpha/typhoon.c
/openbmc/qemu/hw/arm/msf2-soc.c
/openbmc/qemu/hw/arm/msf2-som.c
/openbmc/qemu/hw/block/m25p80.c
/openbmc/qemu/hw/block/nvme.c
/openbmc/qemu/hw/block/tc58128.c
/openbmc/qemu/hw/block/xen_disk.c
/openbmc/qemu/hw/core/loader-fit.c
/openbmc/qemu/hw/core/machine.c
/openbmc/qemu/hw/cris/axis_dev88.c
/openbmc/qemu/hw/display/bochs-display.c
/openbmc/qemu/hw/display/cirrus_vga.c
/openbmc/qemu/hw/display/g364fb.c
/openbmc/qemu/hw/display/qxl.c
/openbmc/qemu/hw/display/sm501.c
/openbmc/qemu/hw/display/vga-isa-mm.c
/openbmc/qemu/hw/display/vga.c
/openbmc/qemu/hw/display/virtio-gpu.c
/openbmc/qemu/hw/display/vmware_vga.c
/openbmc/qemu/hw/display/xenfb.c
/openbmc/qemu/hw/hppa/dino.c
/openbmc/qemu/hw/hppa/machine.c
/openbmc/qemu/hw/i386/acpi-build.c
/openbmc/qemu/hw/i386/pc.c
/openbmc/qemu/hw/i386/pc_piix.c
/openbmc/qemu/hw/i386/pc_q35.c
/openbmc/qemu/hw/i386/pc_sysfw.c
/openbmc/qemu/hw/i386/xen/xen-mapcache.c
/openbmc/qemu/hw/ipack/tpci200.c
/openbmc/qemu/hw/lm32/lm32_boards.c
/openbmc/qemu/hw/lm32/milkymist.c
/openbmc/qemu/hw/m68k/mcf5208.c
/openbmc/qemu/hw/microblaze/petalogix_ml605_mmu.c
/openbmc/qemu/hw/microblaze/petalogix_s3adsp1800_mmu.c
/openbmc/qemu/hw/mips/boston.c
/openbmc/qemu/hw/mips/mips_fulong2e.c
/openbmc/qemu/hw/mips/mips_malta.c
/openbmc/qemu/hw/mips/mips_r4k.c
/openbmc/qemu/hw/misc/auxbus.c
/openbmc/qemu/hw/misc/edu.c
/openbmc/qemu/hw/misc/ivshmem.c
/openbmc/qemu/hw/misc/mips_itu.c
/openbmc/qemu/hw/net/e1000e.c
/openbmc/qemu/hw/net/e1000x_common.c
/openbmc/qemu/hw/net/eepro100.c
/openbmc/qemu/hw/net/ne2000.h
/openbmc/qemu/hw/nios2/boot.c
/openbmc/qemu/hw/nvram/spapr_nvram.c
/openbmc/qemu/hw/pci-host/prep.c
/openbmc/qemu/hw/pci-host/xilinx-pcie.c
/openbmc/qemu/hw/ppc/e500.c
/openbmc/qemu/hw/ppc/e500plat.c
/openbmc/qemu/hw/ppc/mac.h
/openbmc/qemu/hw/ppc/mac_newworld.c
/openbmc/qemu/hw/ppc/mac_oldworld.c
/openbmc/qemu/hw/ppc/pnv.c
/openbmc/qemu/hw/ppc/ppc405_boards.c
/openbmc/qemu/hw/ppc/ppc405_uc.c
/openbmc/qemu/hw/ppc/ppc440_bamboo.c
/openbmc/qemu/hw/ppc/ppc440_uc.c
/openbmc/qemu/hw/ppc/ppc4xx_devs.c
/openbmc/qemu/hw/ppc/ppce500_spin.c
/openbmc/qemu/hw/ppc/prep.c
/openbmc/qemu/hw/ppc/rs6000_mc.c
/openbmc/qemu/hw/ppc/sam460ex.c
/openbmc/qemu/hw/ppc/spapr.c
/openbmc/qemu/hw/ppc/spapr_rtas.c
/openbmc/qemu/hw/ppc/virtex_ml507.c
/openbmc/qemu/hw/rdma/vmw/pvrdma.h
/openbmc/qemu/hw/riscv/virt.c
/openbmc/qemu/hw/s390x/s390-skeys.c
/openbmc/qemu/hw/s390x/s390-stattrib.c
/openbmc/qemu/hw/s390x/sclp.c
/openbmc/qemu/hw/scsi/scsi-disk.c
/openbmc/qemu/hw/sd/sd.c
/openbmc/qemu/hw/sd/sdhci.c
/openbmc/qemu/hw/sh4/r2d.c
/openbmc/qemu/hw/smbios/smbios.c
/openbmc/qemu/hw/sparc/leon3.c
/openbmc/qemu/hw/sparc/sun4m.c
/openbmc/qemu/hw/sparc64/niagara.c
/openbmc/qemu/hw/sparc64/sun4u.c
/openbmc/qemu/hw/tricore/tricore_testboard.c
/openbmc/qemu/hw/usb/ccid-card-passthru.c
/openbmc/qemu/hw/usb/combined-packet.c
/openbmc/qemu/hw/usb/dev-smartcard-reader.c
/openbmc/qemu/hw/usb/redirect.c
/openbmc/qemu/hw/vfio/pci-quirks.c
/openbmc/qemu/hw/vfio/pci.c
/openbmc/qemu/hw/xenpv/xen_domainbuild.c
/openbmc/qemu/hw/xtensa/xtfpga.c
/openbmc/qemu/include/exec/exec-all.h
/openbmc/qemu/include/hw/acpi/tpm.h
/openbmc/qemu/include/hw/display/xlnx_dp.h
/openbmc/qemu/include/hw/intc/mips_gic.h
/openbmc/qemu/include/hw/mips/bios.h
/openbmc/qemu/include/hw/net/allwinner_emac.h
/openbmc/qemu/include/hw/ppc/spapr.h
/openbmc/qemu/include/hw/virtio/virtio-net.h
/openbmc/qemu/include/qemu/cutils.h
/openbmc/qemu/include/qemu/units.h
/openbmc/qemu/linux-user/main.c
/openbmc/qemu/monitor.c
/openbmc/qemu/scripts/checkpatch.pl
/openbmc/qemu/target/i386/cpu.c
/openbmc/qemu/target/i386/cpu.h
/openbmc/qemu/target/i386/excp_helper.c
/openbmc/qemu/target/i386/hyperv-proto.h
/openbmc/qemu/target/i386/kvm.c
/openbmc/qemu/target/i386/machine.c
/openbmc/qemu/target/i386/mem_helper.c
/openbmc/qemu/target/i386/monitor.c
/openbmc/qemu/target/i386/svm.h
/openbmc/qemu/target/i386/svm_helper.c
/openbmc/qemu/target/ppc/mmu_helper.c
/openbmc/qemu/target/xtensa/helper.c
/openbmc/qemu/tests/benchmark-crypto-cipher.c
/openbmc/qemu/tests/benchmark-crypto-hash.c
/openbmc/qemu/tests/benchmark-crypto-hmac.c
/openbmc/qemu/tests/test-cutils.c
/openbmc/qemu/tests/test-keyval.c
/openbmc/qemu/tests/test-qemu-opts.c
/openbmc/qemu/vl.c
646f34fa29-Jun-2018 Philippe Mathieu-Daudé <f4bug@amsat.org>

tcg: Fix --disable-tcg build breakage

Fix the --disable-tcg breakage introduced by 8bca9a03ec60d:

$ configure --disable-tcg
[...]
$ make -C i386-softmmu exec.o
make: Entering direct

tcg: Fix --disable-tcg build breakage

Fix the --disable-tcg breakage introduced by 8bca9a03ec60d:

$ configure --disable-tcg
[...]
$ make -C i386-softmmu exec.o
make: Entering directory 'i386-softmmu'
CC exec.o
In file included from source/qemu/exec.c:62:0:
source/qemu/include/exec/ram_addr.h:96:6: error: conflicting types for ‘tb_invalidate_phys_range’
void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end);
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from source/qemu/exec.c:24:0:
source/qemu/include/exec/exec-all.h:309:6: note: previous declaration of ‘tb_invalidate_phys_range’ was here
void tb_invalidate_phys_range(target_ulong start, target_ulong end);
^~~~~~~~~~~~~~~~~~~~~~~~
source/qemu/exec.c:1043:6: error: conflicting types for ‘tb_invalidate_phys_addr’
void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from source/qemu/exec.c:24:0:
source/qemu/include/exec/exec-all.h:308:6: note: previous declaration of ‘tb_invalidate_phys_addr’ was here
void tb_invalidate_phys_addr(target_ulong addr);
^~~~~~~~~~~~~~~~~~~~~~~
make: *** [source/qemu/rules.mak:69: exec.o] Error 1
make: Leaving directory 'i386-softmmu'

Tested to build x86_64-softmmu and i386-softmmu targets.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180629200710.27626-1-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

show more ...


stubs/tcg-stub.c
/openbmc/qemu/block.c
/openbmc/qemu/block/copy-on-read.c
/openbmc/qemu/block/crypto.c
/openbmc/qemu/block/crypto.h
/openbmc/qemu/block/file-posix.c
/openbmc/qemu/block/file-win32.c
/openbmc/qemu/block/gluster.c
/openbmc/qemu/block/io.c
/openbmc/qemu/block/iscsi.c
/openbmc/qemu/block/nfs.c
/openbmc/qemu/block/parallels.c
/openbmc/qemu/block/qcow.c
/openbmc/qemu/block/qcow2-cluster.c
/openbmc/qemu/block/qcow2.c
/openbmc/qemu/block/qcow2.h
/openbmc/qemu/block/qed.c
/openbmc/qemu/block/raw-format.c
/openbmc/qemu/block/rbd.c
/openbmc/qemu/block/replication.c
/openbmc/qemu/block/sheepdog.c
/openbmc/qemu/block/ssh.c
/openbmc/qemu/block/vhdx.c
/openbmc/qemu/configure
/openbmc/qemu/crypto/hash-glib.c
/openbmc/qemu/crypto/hmac-glib.c
/openbmc/qemu/device_tree.c
/openbmc/qemu/docs/devel/qapi-code-gen.txt
/openbmc/qemu/exec.c
/openbmc/qemu/hmp.c
/openbmc/qemu/hw/9pfs/9p-local.c
/openbmc/qemu/hw/arm/boot.c
/openbmc/qemu/hw/arm/fsl-imx7.c
/openbmc/qemu/hw/arm/mcimx7d-sabre.c
/openbmc/qemu/hw/arm/sysbus-fdt.c
/openbmc/qemu/hw/arm/virt.c
/openbmc/qemu/hw/audio/hda-codec.c
/openbmc/qemu/hw/block/fdc.c
/openbmc/qemu/hw/block/nvme.c
/openbmc/qemu/hw/block/pflash_cfi01.c
/openbmc/qemu/hw/block/pflash_cfi02.c
/openbmc/qemu/hw/block/trace-events
/openbmc/qemu/hw/char/parallel.c
/openbmc/qemu/hw/char/serial.c
/openbmc/qemu/hw/char/trace-events
/openbmc/qemu/hw/input/trace-events
/openbmc/qemu/hw/input/tsc2005.c
/openbmc/qemu/hw/net/etraxfs_eth.c
/openbmc/qemu/hw/net/ne2000.c
/openbmc/qemu/hw/net/trace-events
/openbmc/qemu/hw/scsi/scsi-bus.c
/openbmc/qemu/hw/sd/bcm2835_sdhost.c
/openbmc/qemu/hw/sd/core.c
/openbmc/qemu/hw/sd/milkymist-memcard.c
/openbmc/qemu/hw/sd/omap_mmc.c
/openbmc/qemu/hw/sd/pl181.c
/openbmc/qemu/hw/sd/sdhci.c
/openbmc/qemu/hw/sd/ssi-sd.c
/openbmc/qemu/hw/sd/trace-events
/openbmc/qemu/hw/usb/dev-storage.c
/openbmc/qemu/include/block/block.h
/openbmc/qemu/include/block/block_int.h
/openbmc/qemu/include/block/raw-aio.h
/openbmc/qemu/include/chardev/char.h
/openbmc/qemu/include/exec/exec-all.h
/openbmc/qemu/include/glib-compat.h
/openbmc/qemu/include/hw/scsi/scsi.h
/openbmc/qemu/include/qemu/cutils.h
/openbmc/qemu/include/qemu/iova-tree.h
/openbmc/qemu/include/sysemu/device_tree.h
/openbmc/qemu/linux-user/elfload.c
/openbmc/qemu/monitor.c
/openbmc/qemu/qapi/job.json
/openbmc/qemu/qga/commands.c
/openbmc/qemu/qobject/block-qdict.c
/openbmc/qemu/scripts/simpletrace.py
/openbmc/qemu/scripts/tracetool/backend/log.py
/openbmc/qemu/target/arm/cpu.c
/openbmc/qemu/target/arm/cpu.h
/openbmc/qemu/target/arm/cpu64.c
/openbmc/qemu/target/arm/helper-sve.h
/openbmc/qemu/target/arm/helper.c
/openbmc/qemu/target/arm/helper.h
/openbmc/qemu/target/arm/kvm32.c
/openbmc/qemu/target/arm/sve.decode
/openbmc/qemu/target/arm/sve_helper.c
/openbmc/qemu/target/arm/translate-a64.c
/openbmc/qemu/target/arm/translate-sve.c
/openbmc/qemu/target/arm/translate.c
/openbmc/qemu/target/arm/vec_helper.c
/openbmc/qemu/target/xtensa/cpu.h
/openbmc/qemu/target/xtensa/op_helper.c
/openbmc/qemu/target/xtensa/overlay_tool.h
/openbmc/qemu/target/xtensa/translate.c
/openbmc/qemu/tests/ivshmem-test.c
/openbmc/qemu/tests/qemu-iotests/026
/openbmc/qemu/tests/qemu-iotests/026.out
/openbmc/qemu/tests/qemu-iotests/026.out.nocache
/openbmc/qemu/tests/qemu-iotests/060
/openbmc/qemu/tests/qemu-iotests/060.out
/openbmc/qemu/tests/qemu-iotests/063
/openbmc/qemu/tests/qemu-iotests/063.out
/openbmc/qemu/tests/test-qga.c
/openbmc/qemu/tests/test-qmp-event.c
/openbmc/qemu/tests/tpm-emu.h
/openbmc/qemu/tests/vhost-user-test.c
/openbmc/qemu/trace/simple.c
/openbmc/qemu/util/cutils.c
/openbmc/qemu/util/iova-tree.c
/openbmc/qemu/util/osdep.c
/openbmc/qemu/util/qemu-option.c
/openbmc/qemu/util/uri.c
2266d44322-Jun-2018 Michael S. Tsirkin <mst@redhat.com>

i386/cpu: make -cpu host support monitor/mwait

When guest CPU PM is enabled, and with -cpu host, expose the host CPU
MWAIT leaf in the CPUID so guest can make good PM decisions.

Note: the result is

i386/cpu: make -cpu host support monitor/mwait

When guest CPU PM is enabled, and with -cpu host, expose the host CPU
MWAIT leaf in the CPUID so guest can make good PM decisions.

Note: the result is 100% CPU utilization reported by host as host
no longer knows that the CPU is halted.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20180622192148.178309-3-mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


tcg/user-exec-stub.c
/openbmc/qemu/backends/hostmem.c
/openbmc/qemu/configure
/openbmc/qemu/docs/COLO-FT.txt
/openbmc/qemu/docs/can.txt
/openbmc/qemu/docs/multi-thread-compression.txt
/openbmc/qemu/docs/multiseat.txt
/openbmc/qemu/docs/specs/tpm.txt
/openbmc/qemu/hmp-commands-info.hx
/openbmc/qemu/hw/block/dataplane/virtio-blk.c
/openbmc/qemu/hw/i386/kvm/ioapic.c
/openbmc/qemu/hw/i386/pc.c
/openbmc/qemu/hw/intc/ioapic.c
/openbmc/qemu/hw/intc/ioapic_common.c
/openbmc/qemu/hw/mem/nvdimm.c
/openbmc/qemu/hw/mem/pc-dimm.c
/openbmc/qemu/hw/mips/mips_jazz.c
/openbmc/qemu/hw/misc/ivshmem.c
/openbmc/qemu/hw/ppc/spapr.c
/openbmc/qemu/hw/scsi/esp.c
/openbmc/qemu/hw/scsi/virtio-scsi-dataplane.c
/openbmc/qemu/include/exec/memory.h
/openbmc/qemu/include/hw/i386/ioapic_internal.h
/openbmc/qemu/include/hw/i386/pc.h
/openbmc/qemu/include/hw/mem/nvdimm.h
/openbmc/qemu/include/hw/mem/pc-dimm.h
/openbmc/qemu/include/hw/scsi/esp.h
/openbmc/qemu/include/qemu/osdep.h
/openbmc/qemu/include/qemu/thread-posix.h
/openbmc/qemu/include/qemu/thread-win32.h
/openbmc/qemu/include/scsi/pr-manager.h
/openbmc/qemu/include/sysemu/hostmem.h
/openbmc/qemu/include/sysemu/sysemu.h
/openbmc/qemu/memory.c
/openbmc/qemu/monitor.c
/openbmc/qemu/numa.c
/openbmc/qemu/qapi/block.json
/openbmc/qemu/qemu-doc.texi
/openbmc/qemu/qemu-options.hx
/openbmc/qemu/scsi/Makefile.objs
/openbmc/qemu/scsi/pr-manager-helper.c
/openbmc/qemu/scsi/pr-manager-stub.c
/openbmc/qemu/scsi/pr-manager.c
/openbmc/qemu/scsi/qemu-pr-helper.c
/openbmc/qemu/target/i386/cpu.c
/openbmc/qemu/target/i386/cpu.h
/openbmc/qemu/target/i386/kvm.c
/openbmc/qemu/target/i386/monitor.c
/openbmc/qemu/target/i386/seg_helper.c
/openbmc/qemu/target/i386/svm_helper.c
/openbmc/qemu/target/i386/translate.c
/openbmc/qemu/target/i386/whpx-all.c
/openbmc/qemu/tests/atomic_add-bench.c
/openbmc/qemu/util/qemu-thread-common.h
/openbmc/qemu/util/qemu-thread-posix.c
/openbmc/qemu/util/qemu-thread-win32.c
/openbmc/qemu/vl.c
6c090d4a16-May-2018 Shannon Zhao <zhaoshenglong@huawei.com>

kvm: Delete the slot if and only if the KVM_MEM_READONLY flag is changed

According to KVM commit 75d61fbc, it needs to delete the slot before
changing the KVM_MEM_READONLY flag. But QEMU commit 235e

kvm: Delete the slot if and only if the KVM_MEM_READONLY flag is changed

According to KVM commit 75d61fbc, it needs to delete the slot before
changing the KVM_MEM_READONLY flag. But QEMU commit 235e8982 only check
whether KVM_MEM_READONLY flag is set instead of changing. It doesn't
need to delete the slot if the KVM_MEM_READONLY flag is not changed.

This fixes a issue that migrating a VM at the OVMF startup stage and
VM is executing the codes in rom. Between the deleting and adding the
slot in kvm_set_user_memory_region, there is a chance that guest access
rom and trap to KVM, then KVM can't find the corresponding memslot.
While KVM (on ARM) injects an abort to guest due to the broken hva, then
guest will get stuck.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Message-Id: <1526462314-19720-1-git-send-email-zhaoshenglong@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

8bca9a0330-May-2018 Paolo Bonzini <pbonzini@redhat.com>

move public invalidate APIs out of translate-all.{c,h}, clean up

Place them in exec.c, exec-all.h and ram_addr.h. This removes
knowledge of translate-all.h (which is an internal header) from
severa

move public invalidate APIs out of translate-all.{c,h}, clean up

Place them in exec.c, exec-all.h and ram_addr.h. This removes
knowledge of translate-all.h (which is an internal header) from
several files outside accel/tcg and removes knowledge of
AddressSpace from translate-all.c (as it only operates on ram_addr_t).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

f18793b014-Jun-2018 Stefan Hajnoczi <stefanha@redhat.com>

compiler: add a sizeof_field() macro

Determining the size of a field is useful when you don't have a struct
variable handy. Open-coding this is ugly.

This patch adds the sizeof_field() macro, whic

compiler: add a sizeof_field() macro

Determining the size of a field is useful when you don't have a struct
variable handy. Open-coding this is ugly.

This patch adds the sizeof_field() macro, which is similar to
typeof_field(). Existing instances are updated to use the macro.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 20180614164431.29305-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

show more ...

d071f4cd22-May-2018 Emilio G. Cota <cota@braap.org>

trace: enable tracing of TCG atomics

We do not trace guest atomic accesses. Fix it.

Tested with a modified atomic_add-bench so that it executes
a deterministic number of instructions, i.e. fixed se

trace: enable tracing of TCG atomics

We do not trace guest atomic accesses. Fix it.

Tested with a modified atomic_add-bench so that it executes
a deterministic number of instructions, i.e. fixed seeding,
no threading and fixed number of loop iterations instead
of running for a certain time.

Before:
- With parallel_cpus = false (no clone syscall so it is never set to true):
220070 memory accesses
- With parallel_cpus = true (hard-coded):
212105 memory accesses <-- we're not tracing the atomics!

After:
220070 memory accesses regardless of parallel_cpus.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-id: 1527028012-21888-6-git-send-email-cota@braap.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

show more ...

55df6fcf26-Jun-2018 Peter Maydell <peter.maydell@linaro.org>

tcg: Support MMU protection regions smaller than TARGET_PAGE_SIZE

Add support for MMU protection regions that are smaller than
TARGET_PAGE_SIZE. We do this by marking the TLB entry for those
pages w

tcg: Support MMU protection regions smaller than TARGET_PAGE_SIZE

Add support for MMU protection regions that are smaller than
TARGET_PAGE_SIZE. We do this by marking the TLB entry for those
pages with a flag TLB_RECHECK. This flag causes us to always
take the slow-path for accesses. In the slow path we can then
special case them to always call tlb_fill() again, so we have
the correct information for the exact address being accessed.

This change allows us to handle reading and writing from small
regions; we cannot deal with execution from the small region.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180620130619.11362-2-peter.maydell@linaro.org

show more ...


/openbmc/qemu/MAINTAINERS
tcg/cputlb.c
tcg/softmmu_template.h
/openbmc/qemu/audio/audio.c
/openbmc/qemu/hw/arm/omap1.c
/openbmc/qemu/hw/arm/stellaris.c
/openbmc/qemu/hw/audio/hda-codec.c
/openbmc/qemu/hw/audio/intel-hda.c
/openbmc/qemu/hw/audio/trace-events
/openbmc/qemu/hw/dma/omap_dma.c
/openbmc/qemu/hw/i2c/omap_i2c.c
/openbmc/qemu/hw/i386/pc_piix.c
/openbmc/qemu/hw/ide/ahci.c
/openbmc/qemu/hw/ide/ahci_internal.h
/openbmc/qemu/hw/input/pckbd.c
/openbmc/qemu/hw/input/tsc2005.c
/openbmc/qemu/hw/net/smc91c111.c
/openbmc/qemu/hw/net/stellaris_enet.c
/openbmc/qemu/hw/sd/omap_mmc.c
/openbmc/qemu/hw/ssi/aspeed_smc.c
/openbmc/qemu/hw/ssi/omap_spi.c
/openbmc/qemu/hw/ssi/xilinx_spips.c
/openbmc/qemu/include/exec/cpu-all.h
/openbmc/qemu/include/hw/arm/omap.h
/openbmc/qemu/include/hw/boards.h
/openbmc/qemu/include/hw/compat.h
/openbmc/qemu/include/hw/i386/pc.h
/openbmc/qemu/include/hw/ssi/xilinx_spips.h
/openbmc/qemu/include/ui/egl-helpers.h
/openbmc/qemu/include/ui/gtk.h
/openbmc/qemu/qemu-doc.texi
/openbmc/qemu/scripts/qmp/qemu-ga-client
/openbmc/qemu/scripts/qmp/qmp
/openbmc/qemu/scripts/qmp/qmp-shell
/openbmc/qemu/scripts/qmp/qom-fuse
/openbmc/qemu/scripts/qmp/qom-get
/openbmc/qemu/scripts/qmp/qom-list
/openbmc/qemu/scripts/qmp/qom-set
/openbmc/qemu/scripts/qmp/qom-tree
/openbmc/qemu/target/i386/cpu.c
/openbmc/qemu/target/i386/kvm.c
/openbmc/qemu/tests/libqos/ahci.c
/openbmc/qemu/tests/libqos/ahci.h
/openbmc/qemu/ui/egl-context.c
/openbmc/qemu/ui/egl-headless.c
/openbmc/qemu/ui/egl-helpers.c
/openbmc/qemu/ui/gtk-egl.c
/openbmc/qemu/ui/gtk.c
/openbmc/qemu/ui/sdl2.c
/openbmc/qemu/ui/spice-core.c
/openbmc/qemu/vl.c
f28d0dfd22-Jun-2018 Emilio G. Cota <cota@braap.org>

tcg: fix --disable-tcg build breakage

Fix the --disable-tcg breakage introduced by tb_lock's removal by
relying on the fact that tcg_enabled() is set to 0 at
compile-time under --disable-tcg.

While

tcg: fix --disable-tcg build breakage

Fix the --disable-tcg breakage introduced by tb_lock's removal by
relying on the fact that tcg_enabled() is set to 0 at
compile-time under --disable-tcg.

While at it, add further asserts to fix builds that enable both
--disable-tcg and --enable-debug, which were broken even before
tb_lock's removal.

Tested to build x86_64-softmmu and i386-softmmu targets.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

show more ...


/openbmc/qemu/.travis.yml
/openbmc/qemu/MAINTAINERS
/openbmc/qemu/Makefile
/openbmc/qemu/Makefile.target
stubs/tcg-stub.c
/openbmc/qemu/block.c
/openbmc/qemu/block/backup.c
/openbmc/qemu/block/block-backend.c
/openbmc/qemu/block/dirty-bitmap.c
/openbmc/qemu/block/io.c
/openbmc/qemu/block/mirror.c
/openbmc/qemu/block/qcow2.c
/openbmc/qemu/block/vvfat.c
/openbmc/qemu/blockdev-nbd.c
/openbmc/qemu/blockdev.c
/openbmc/qemu/blockjob.c
/openbmc/qemu/configure
/openbmc/qemu/cpus.c
/openbmc/qemu/default-configs/arm-softmmu.mak
/openbmc/qemu/default-configs/ppc-softmmu.mak
/openbmc/qemu/default-configs/ppcemb-softmmu.mak
/openbmc/qemu/docs/devel/qapi-code-gen.txt
/openbmc/qemu/docs/devel/testing.rst
/openbmc/qemu/docs/interop/nbd.txt
/openbmc/qemu/exec.c
/openbmc/qemu/hmp-commands-info.hx
/openbmc/qemu/hmp-commands.hx
/openbmc/qemu/hmp.c
/openbmc/qemu/hmp.h
/openbmc/qemu/hw/arm/iotkit.c
/openbmc/qemu/hw/arm/mps2-tz.c
/openbmc/qemu/hw/arm/sysbus-fdt.c
/openbmc/qemu/hw/arm/virt-acpi-build.c
/openbmc/qemu/hw/arm/virt.c
/openbmc/qemu/hw/arm/xlnx-zcu102.c
/openbmc/qemu/hw/arm/xlnx-zynqmp.c
/openbmc/qemu/hw/core/bus.c
/openbmc/qemu/hw/display/Makefile.objs
/openbmc/qemu/hw/display/ramfb-standalone.c
/openbmc/qemu/hw/display/ramfb.c
/openbmc/qemu/hw/display/sm501.c
/openbmc/qemu/hw/i2c/ppc4xx_i2c.c
/openbmc/qemu/hw/i386/pc_piix.c
/openbmc/qemu/hw/i386/pc_q35.c
/openbmc/qemu/hw/input/adb-kbd.c
/openbmc/qemu/hw/input/adb-mouse.c
/openbmc/qemu/hw/input/adb.c
/openbmc/qemu/hw/input/ps2.c
/openbmc/qemu/hw/intc/arm_gic_kvm.c
/openbmc/qemu/hw/intc/arm_gicv3.c
/openbmc/qemu/hw/intc/arm_gicv3_common.c
/openbmc/qemu/hw/intc/arm_gicv3_dist.c
/openbmc/qemu/hw/intc/arm_gicv3_its_kvm.c
/openbmc/qemu/hw/intc/arm_gicv3_kvm.c
/openbmc/qemu/hw/intc/arm_gicv3_redist.c
/openbmc/qemu/hw/intc/xics_kvm.c
/openbmc/qemu/hw/isa/smc37c669-superio.c
/openbmc/qemu/hw/misc/Makefile.objs
/openbmc/qemu/hw/misc/iotkit-secctl.c
/openbmc/qemu/hw/misc/macio/Makefile.objs
/openbmc/qemu/hw/misc/macio/gpio.c
/openbmc/qemu/hw/misc/macio/macio.c
/openbmc/qemu/hw/misc/macio/pmu.c
/openbmc/qemu/hw/misc/macio/trace-events
/openbmc/qemu/hw/misc/mos6522.c
/openbmc/qemu/hw/misc/trace-events
/openbmc/qemu/hw/misc/tz-mpc.c
/openbmc/qemu/hw/ppc/mac.h
/openbmc/qemu/hw/ppc/mac_newworld.c
/openbmc/qemu/hw/ppc/pnv.c
/openbmc/qemu/hw/ppc/pnv_core.c
/openbmc/qemu/hw/ppc/pnv_lpc.c
/openbmc/qemu/hw/ppc/spapr.c
/openbmc/qemu/hw/ppc/spapr_caps.c
/openbmc/qemu/hw/ppc/spapr_cpu_core.c
/openbmc/qemu/hw/ppc/spapr_events.c
/openbmc/qemu/hw/ppc/spapr_hcall.c
/openbmc/qemu/hw/ppc/spapr_pci.c
/openbmc/qemu/hw/ppc/spapr_vio.c
/openbmc/qemu/hw/s390x/css.c
/openbmc/qemu/hw/s390x/ipl.c
/openbmc/qemu/hw/s390x/virtio-ccw.c
/openbmc/qemu/hw/sparc/sun4m.c
/openbmc/qemu/hw/sparc64/sun4u.c
/openbmc/qemu/hw/usb/dev-smartcard-reader.c
/openbmc/qemu/hw/usb/dev-storage.c
/openbmc/qemu/hw/usb/dev-uas.c
/openbmc/qemu/hw/vfio/ccw.c
/openbmc/qemu/hw/xen/xen_pt.h
/openbmc/qemu/hw/xen/xen_pt_graphics.c
/openbmc/qemu/hw/xen/xen_pt_load_rom.c
/openbmc/qemu/include/block/aio-wait.h
/openbmc/qemu/include/block/block.h
/openbmc/qemu/include/block/block_int.h
/openbmc/qemu/include/block/blockjob_int.h
/openbmc/qemu/include/block/dirty-bitmap.h
/openbmc/qemu/include/block/nbd.h
/openbmc/qemu/include/exec/ramlist.h
/openbmc/qemu/include/hw/arm/iotkit.h
/openbmc/qemu/include/hw/arm/virt.h
/openbmc/qemu/include/hw/display/ramfb.h
/openbmc/qemu/include/hw/i2c/ppc4xx_i2c.h
/openbmc/qemu/include/hw/input/adb.h
/openbmc/qemu/include/hw/intc/arm_gicv3_common.h
/openbmc/qemu/include/hw/misc/iotkit-secctl.h
/openbmc/qemu/include/hw/misc/macio/gpio.h
/openbmc/qemu/include/hw/misc/macio/macio.h
/openbmc/qemu/include/hw/misc/macio/pmu.h
/openbmc/qemu/include/hw/misc/mos6522.h
/openbmc/qemu/include/hw/misc/tz-mpc.h
/openbmc/qemu/include/hw/ppc/pnv.h
/openbmc/qemu/include/hw/ppc/pnv_core.h
/openbmc/qemu/include/hw/ppc/pnv_lpc.h
/openbmc/qemu/include/hw/ppc/ppc.h
/openbmc/qemu/include/hw/ppc/spapr.h
/openbmc/qemu/include/hw/ppc/spapr_cpu_core.h
/openbmc/qemu/include/migration/vmstate.h
/openbmc/qemu/include/qemu/hbitmap.h
/openbmc/qemu/include/qemu/job.h
/openbmc/qemu/include/qemu/typedefs.h
/openbmc/qemu/include/standard-headers/linux/pci_regs.h
/openbmc/qemu/include/standard-headers/linux/virtio_gpu.h
/openbmc/qemu/include/standard-headers/linux/virtio_net.h
/openbmc/qemu/job.c
/openbmc/qemu/linux-headers/LICENSES/exceptions/Linux-syscall-note
/openbmc/qemu/linux-headers/LICENSES/preferred/GPL-2.0
/openbmc/qemu/linux-headers/asm-arm/kvm.h
/openbmc/qemu/linux-headers/asm-arm/unistd-common.h
/openbmc/qemu/linux-headers/asm-arm64/kvm.h
/openbmc/qemu/linux-headers/asm-generic/unistd.h
/openbmc/qemu/linux-headers/asm-powerpc/unistd.h
/openbmc/qemu/linux-headers/asm-x86/unistd_32.h
/openbmc/qemu/linux-headers/asm-x86/unistd_64.h
/openbmc/qemu/linux-headers/asm-x86/unistd_x32.h
/openbmc/qemu/linux-headers/linux/kvm.h
/openbmc/qemu/linux-headers/linux/psp-sev.h
/openbmc/qemu/migration/block-dirty-bitmap.c
/openbmc/qemu/migration/migration.c
/openbmc/qemu/migration/migration.h
/openbmc/qemu/migration/qjson.h
/openbmc/qemu/migration/ram.c
/openbmc/qemu/migration/rdma.c
/openbmc/qemu/migration/trace-events
/openbmc/qemu/monitor.c
/openbmc/qemu/nbd/common.c
/openbmc/qemu/nbd/server.c
/openbmc/qemu/nbd/trace-events
/openbmc/qemu/pc-bios/README
/openbmc/qemu/pc-bios/openbios-ppc
/openbmc/qemu/pc-bios/openbios-sparc32
/openbmc/qemu/pc-bios/openbios-sparc64
/openbmc/qemu/pc-bios/s390-ccw/Makefile
/openbmc/qemu/pc-bios/s390-ccw/iplb.h
/openbmc/qemu/pc-bios/s390-ccw/main.c
/openbmc/qemu/pc-bios/s390-ccw/netboot.mak
/openbmc/qemu/pc-bios/s390-ccw/netmain.c
/openbmc/qemu/pc-bios/s390-ccw/sclp.c
/openbmc/qemu/pc-bios/s390-ccw/sclp.h
/openbmc/qemu/pc-bios/s390-netboot.img
/openbmc/qemu/pc-bios/slof.bin
/openbmc/qemu/qapi/block-core.json
/openbmc/qemu/qapi/block.json
/openbmc/qemu/qapi/char.json
/openbmc/qemu/qapi/crypto.json
/openbmc/qemu/qapi/migration.json
/openbmc/qemu/qapi/misc.json
/openbmc/qemu/qapi/net.json
/openbmc/qemu/qapi/ui.json
/openbmc/qemu/qobject/block-qdict.c
/openbmc/qemu/roms/SLOF
/openbmc/qemu/roms/openbios
/openbmc/qemu/scripts/qapi/common.py
/openbmc/qemu/scripts/qapi/events.py
/openbmc/qemu/scripts/qapi/introspect.py
/openbmc/qemu/scripts/qapi/types.py
/openbmc/qemu/scripts/qapi/visit.py
/openbmc/qemu/scripts/qemu.py
/openbmc/qemu/stubs/fdset.c
/openbmc/qemu/target/arm/cpu.c
/openbmc/qemu/target/arm/cpu.h
/openbmc/qemu/target/arm/kvm.c
/openbmc/qemu/target/arm/kvm_arm.h
/openbmc/qemu/target/arm/translate.c
/openbmc/qemu/target/ppc/compat.c
/openbmc/qemu/target/ppc/cpu.h
/openbmc/qemu/target/ppc/fpu_helper.c
/openbmc/qemu/target/ppc/kvm.c
/openbmc/qemu/target/ppc/kvm_ppc.h
/openbmc/qemu/target/ppc/mmu-hash64.c
/openbmc/qemu/target/ppc/mmu-hash64.h
/openbmc/qemu/target/ppc/translate.c
/openbmc/qemu/target/ppc/translate_init.inc.c
/openbmc/qemu/target/s390x/cpu_models.c
/openbmc/qemu/target/sparc/translate.c
/openbmc/qemu/tcg/aarch64/tcg-target.inc.c
/openbmc/qemu/tcg/arm/tcg-target.inc.c
/openbmc/qemu/tcg/i386/tcg-target.inc.c
/openbmc/qemu/tcg/mips/tcg-target.inc.c
/openbmc/qemu/tcg/ppc/tcg-target.inc.c
/openbmc/qemu/tcg/s390/tcg-target.inc.c
/openbmc/qemu/tcg/sparc/tcg-target.inc.c
/openbmc/qemu/tcg/tcg.c
/openbmc/qemu/tcg/tcg.h
/openbmc/qemu/tcg/tci/tcg-target.inc.c
/openbmc/qemu/tests/.gitignore
/openbmc/qemu/tests/Makefile.include
/openbmc/qemu/tests/acceptance/README.rst
/openbmc/qemu/tests/acceptance/avocado_qemu/__init__.py
/openbmc/qemu/tests/acceptance/boot_linux_console.py
/openbmc/qemu/tests/acceptance/version.py
/openbmc/qemu/tests/acceptance/vnc.py
/openbmc/qemu/tests/check-block-qdict.c
/openbmc/qemu/tests/docker/Makefile.include
/openbmc/qemu/tests/docker/docker.py
/openbmc/qemu/tests/docker/dockerfiles/debian-alpha-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-hppa-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-m68k-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-mips64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-powerpc-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-riscv64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-sh4-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-sid.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-sparc64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian8.docker
/openbmc/qemu/tests/qapi-schema/qapi-schema-test.json
/openbmc/qemu/tests/qapi-schema/qapi-schema-test.out
/openbmc/qemu/tests/qemu-iotests/151
/openbmc/qemu/tests/qemu-iotests/151.out
/openbmc/qemu/tests/qemu-iotests/group
/openbmc/qemu/tests/tcg/Makefile
/openbmc/qemu/tests/tcg/Makefile.include
/openbmc/qemu/tests/tcg/Makefile.probe
/openbmc/qemu/tests/tcg/README
/openbmc/qemu/tests/tcg/aarch64/Makefile.include
/openbmc/qemu/tests/tcg/aarch64/Makefile.target
/openbmc/qemu/tests/tcg/aarch64/fcvt.ref
/openbmc/qemu/tests/tcg/alpha/Makefile.include
/openbmc/qemu/tests/tcg/alpha/Makefile.target
/openbmc/qemu/tests/tcg/alpha/hello-alpha.c
/openbmc/qemu/tests/tcg/alpha/test-cond.c
/openbmc/qemu/tests/tcg/alpha/test-ovf.c
/openbmc/qemu/tests/tcg/arm/Makefile.include
/openbmc/qemu/tests/tcg/arm/Makefile.target
/openbmc/qemu/tests/tcg/arm/README
/openbmc/qemu/tests/tcg/arm/fcvt.c
/openbmc/qemu/tests/tcg/arm/fcvt.ref
/openbmc/qemu/tests/tcg/arm/hello-arm.c
/openbmc/qemu/tests/tcg/arm/test-arm-iwmmxt.S
/openbmc/qemu/tests/tcg/hppa/Makefile.include
/openbmc/qemu/tests/tcg/hppa/Makefile.target
/openbmc/qemu/tests/tcg/i386/Makefile.include
/openbmc/qemu/tests/tcg/i386/Makefile.target
/openbmc/qemu/tests/tcg/i386/README
/openbmc/qemu/tests/tcg/i386/hello-i386.c
/openbmc/qemu/tests/tcg/i386/pi_10.com
/openbmc/qemu/tests/tcg/i386/runcom.c
/openbmc/qemu/tests/tcg/i386/test-i386-code16.S
/openbmc/qemu/tests/tcg/i386/test-i386-fprem.c
/openbmc/qemu/tests/tcg/i386/test-i386-muldiv.h
/openbmc/qemu/tests/tcg/i386/test-i386-shift.h
/openbmc/qemu/tests/tcg/i386/test-i386-ssse3.c
/openbmc/qemu/tests/tcg/i386/test-i386-vm86.S
/openbmc/qemu/tests/tcg/i386/test-i386.c
/openbmc/qemu/tests/tcg/i386/test-i386.h
/openbmc/qemu/tests/tcg/m68k/Makefile.include
/openbmc/qemu/tests/tcg/m68k/Makefile.target
/openbmc/qemu/tests/tcg/mips/Makefile.include
/openbmc/qemu/tests/tcg/mips/Makefile.target
/openbmc/qemu/tests/tcg/mips/README
/openbmc/qemu/tests/tcg/mips/hello-mips.c
/openbmc/qemu/tests/tcg/multiarch/Makefile.target
/openbmc/qemu/tests/tcg/multiarch/README
/openbmc/qemu/tests/tcg/multiarch/linux-test.c
/openbmc/qemu/tests/tcg/multiarch/sha1.c
/openbmc/qemu/tests/tcg/multiarch/test-mmap.c
/openbmc/qemu/tests/tcg/multiarch/testthread.c
/openbmc/qemu/tests/tcg/ppc/Makefile.include
/openbmc/qemu/tests/tcg/ppc/Makefile.target
/openbmc/qemu/tests/tcg/riscv/Makefile.include
/openbmc/qemu/tests/tcg/s390x/Makefile.include
/openbmc/qemu/tests/tcg/sh4/Makefile.include
/openbmc/qemu/tests/tcg/sh4/Makefile.target
/openbmc/qemu/tests/tcg/sparc64/Makefile.include
/openbmc/qemu/tests/tcg/sparc64/Makefile.target
/openbmc/qemu/tests/tcg/x86_64/Makefile.target
/openbmc/qemu/tests/test-bdrv-drain.c
/openbmc/qemu/tests/test-hbitmap.c
/openbmc/qemu/util/hbitmap.c
/openbmc/qemu/util/osdep.c
/openbmc/qemu/vl.c
0ac2031804-Aug-2017 Emilio G. Cota <cota@braap.org>

tcg: remove tb_lock

Use mmap_lock in user-mode to protect TCG state and the page descriptors.
In !user-mode, each vCPU has its own TCG state, so no locks needed.
Per-page locks are used to protect t

tcg: remove tb_lock

Use mmap_lock in user-mode to protect TCG state and the page descriptors.
In !user-mode, each vCPU has its own TCG state, so no locks needed.
Per-page locks are used to protect the page descriptors.

Per-TB locks are used in both modes to protect TB jumps.

Some notes:

- tb_lock is removed from notdirty_mem_write by passing a
locked page_collection to tb_invalidate_phys_page_fast.

- tcg_tb_lookup/remove/insert/etc have their own internal lock(s),
so there is no need to further serialize access to them.

- do_tb_flush is run in a safe async context, meaning no other
vCPU threads are running. Therefore acquiring mmap_lock there
is just to please tools such as thread sanitizer.

- Not visible in the diff, but tb_invalidate_phys_page already
has an assert_memory_lock.

- cpu_io_recompile is !user-only, so no mmap_lock there.

- Added mmap_unlock()'s before all siglongjmp's that could
be called in user-mode while mmap_lock is held.
+ Added an assert for !have_mmap_lock() after returning from
the longjmp in cpu_exec, just like we do in cpu_exec_step_atomic.

Performance numbers before/after:

Host: AMD Opteron(tm) Processor 6376

ubuntu 17.04 ppc64 bootup+shutdown time

700 +-+--+----+------+------------+-----------+------------*--+-+
| + + + + + *B |
| before ***B*** ** * |
|tb lock removal ###D### *** |
600 +-+ *** +-+
| ** # |
| *B* #D |
| *** * ## |
500 +-+ *** ### +-+
| * *** ### |
| *B* # ## |
| ** * #D# |
400 +-+ ** ## +-+
| ** ### |
| ** ## |
| ** # ## |
300 +-+ * B* #D# +-+
| B *** ### |
| * ** #### |
| * *** ### |
200 +-+ B *B #D# +-+
| #B* * ## # |
| #* ## |
| + D##D# + + + + |
100 +-+--+----+------+------------+-----------+------------+--+-+
1 8 16 Guest CPUs 48 64
png: https://imgur.com/HwmBHXe

debian jessie aarch64 bootup+shutdown time

90 +-+--+-----+-----+------------+------------+------------+--+-+
| + + + + + + |
| before ***B*** B |
80 +tb lock removal ###D### **D +-+
| **### |
| **## |
70 +-+ ** # +-+
| ** ## |
| ** # |
60 +-+ *B ## +-+
| ** ## |
| *** #D |
50 +-+ *** ## +-+
| * ** ### |
| **B* ### |
40 +-+ **** # ## +-+
| **** #D# |
| ***B** ### |
30 +-+ B***B** #### +-+
| B * * # ### |
| B ###D# |
20 +-+ D ##D## +-+
| D# |
| + + + + + + |
10 +-+--+-----+-----+------------+------------+------------+--+-+
1 8 16 Guest CPUs 48 64
png: https://imgur.com/iGpGFtv

The gains are high for 4-8 CPUs. Beyond that point, however, unrelated
lock contention significantly hurts scalability.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

705ad1ff05-Aug-2017 Emilio G. Cota <cota@braap.org>

translate-all: remove tb_lock mention from cpu_restore_state_from_tb

tb_lock was needed when the function did retranslation. However,
since fca8a500d519 ("tcg: Save insn data and use it in
cpu_resto

translate-all: remove tb_lock mention from cpu_restore_state_from_tb

tb_lock was needed when the function did retranslation. However,
since fca8a500d519 ("tcg: Save insn data and use it in
cpu_restore_state_from_tb") we don't do retranslation.

Get rid of the comment.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

b7542f7f04-Aug-2017 Emilio G. Cota <cota@braap.org>

cputlb: remove tb_lock from tlb_flush functions

The acquisition of tb_lock was added when the async tlb_flush
was introduced in e3b9ca810 ("cputlb: introduce tlb_flush_* async work.")

tb_lock was t

cputlb: remove tb_lock from tlb_flush functions

The acquisition of tb_lock was added when the async tlb_flush
was introduced in e3b9ca810 ("cputlb: introduce tlb_flush_* async work.")

tb_lock was there to allow us to do memset() on the tb_jmp_cache's.
However, since f3ced3c5928 ("tcg: consistently access cpu->tb_jmp_cache
atomically") all accesses to tb_jmp_cache are atomic, so tb_lock
is not needed here. Get rid of it.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

194125e302-Aug-2017 Emilio G. Cota <cota@braap.org>

translate-all: protect TB jumps with a per-destination-TB lock

This applies to both user-mode and !user-mode emulation.

Instead of relying on a global lock, protect the list of incoming
jumps with

translate-all: protect TB jumps with a per-destination-TB lock

This applies to both user-mode and !user-mode emulation.

Instead of relying on a global lock, protect the list of incoming
jumps with tb->jmp_lock. This lock also protects tb->cflags,
so update all tb->cflags readers outside tb->jmp_lock to use
atomic reads via tb_cflags().

In order to find the destination TB (and therefore its jmp_lock)
from the origin TB, we introduce tb->jmp_dest[].

I considered not using a linked list of jumps, which simplifies
code and makes the struct smaller. However, it unnecessarily increases
memory usage, which results in a performance decrease. See for
instance these numbers booting+shutting down debian-arm:
Time (s) Rel. err (%) Abs. err (s) Rel. slowdown (%)
------------------------------------------------------------------------------
before 20.88 0.74 0.154512 0.
after 20.81 0.38 0.079078 -0.33524904
GTree 21.02 0.28 0.058856 0.67049808
GHashTable + xxhash 21.63 1.08 0.233604 3.5919540

Using a hash table or a binary tree to keep track of the jumps
doesn't really pay off, not only due to the increased memory usage,
but also because most TBs have only 0 or 1 jumps to them. The maximum
number of jumps when booting debian-arm that I measured is 35, but
as we can see in the histogram below a TB with that many incoming jumps
is extremely rare; the average TB has 0.80 incoming jumps.

n_jumps: 379208; avg jumps/tb: 0.801099
dist: [0.0,1.0)|▄█▁▁▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁ ▁▁▁ ▁▁▁ ▁|[34.0,35.0]

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

95590e2401-Aug-2017 Emilio G. Cota <cota@braap.org>

translate-all: discard TB when tb_link_page returns an existing matching TB

Use the recently-gained QHT feature of returning the matching TB if it
already exists. This allows us to get rid of the lo

translate-all: discard TB when tb_link_page returns an existing matching TB

Use the recently-gained QHT feature of returning the matching TB if it
already exists. This allows us to get rid of the lookup we perform
right after acquiring tb_lock.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

faa9372c22-Feb-2018 Emilio G. Cota <cota@braap.org>

translate-all: introduce assert_no_pages_locked

The appended adds assertions to make sure we do not longjmp with page
locks held. Note that user-mode has nothing to check, since page_locks
are !user

translate-all: introduce assert_no_pages_locked

The appended adds assertions to make sure we do not longjmp with page
locks held. Note that user-mode has nothing to check, since page_locks
are !user-mode only.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

6d9abf8505-Apr-2018 Emilio G. Cota <cota@braap.org>

translate-all: add page_locked assertions

This is only compiled under CONFIG_DEBUG_TCG to avoid
bloating the binary.

In user-mode, assert_page_locked is equivalent to assert_mmap_lock.

Note: There

translate-all: add page_locked assertions

This is only compiled under CONFIG_DEBUG_TCG to avoid
bloating the binary.

In user-mode, assert_page_locked is equivalent to assert_mmap_lock.

Note: There are some tb_lock assertions left that will be
removed by later patches.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

0b5c91f726-Jul-2017 Emilio G. Cota <cota@braap.org>

translate-all: use per-page locking in !user-mode

Groundwork for supporting parallel TCG generation.

Instead of using a global lock (tb_lock) to protect changes
to pages, use fine-grained, per-page

translate-all: use per-page locking in !user-mode

Groundwork for supporting parallel TCG generation.

Instead of using a global lock (tb_lock) to protect changes
to pages, use fine-grained, per-page locks in !user-mode.
User-mode stays with mmap_lock.

Sometimes changes need to happen atomically on more than one
page (e.g. when a TB that spans across two pages is
added/invalidated, or when a range of pages is invalidated).
We therefore introduce struct page_collection, which helps
us keep track of a set of pages that have been locked in
the appropriate locking order (i.e. by ascending page index).

This commit first introduces the structs and the function helpers,
to then convert the calling code to use per-page locking. Note
that tb_lock is not removed yet.

While at it, rename tb_alloc_page to tb_page_add, which pairs with
tb_page_remove.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

45c73de505-Aug-2017 Emilio G. Cota <cota@braap.org>

translate-all: move tb_invalidate_phys_page_range up in the file

This greatly simplifies next commit's diff.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <

translate-all: move tb_invalidate_phys_page_range up in the file

This greatly simplifies next commit's diff.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

ae5486e205-Aug-2017 Emilio G. Cota <cota@braap.org>

translate-all: work page-by-page in tb_invalidate_phys_range_1

So that we pass a same-page range to tb_invalidate_phys_page_range,
instead of always passing an end address that could be on a differe

translate-all: work page-by-page in tb_invalidate_phys_range_1

So that we pass a same-page range to tb_invalidate_phys_page_range,
instead of always passing an end address that could be on a different
page.

As discussed with Peter Maydell on the list [1], tb_invalidate_phys_page_range
doesn't actually do much with 'end', which explains why we have never
hit a bug despite going against what the comment on top of
tb_invalidate_phys_page_range requires:

> * Invalidate all TBs which intersect with the target physical address range
> * [start;end[. NOTE: start and end must refer to the *same* physical page.

The appended honours the comment, which avoids confusion.

While at it, rework the loop into a for loop, which is less error prone
(e.g. "continue" won't result in an infinite loop).

[1] https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg09165.html

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

94da9aec29-Jul-2017 Emilio G. Cota <cota@braap.org>

translate-all: remove hole in PageDesc

Groundwork for supporting parallel TCG generation.

Move the hole to the end of the struct, so that a u32
field can be added there without bloating the struct.

translate-all: remove hole in PageDesc

Groundwork for supporting parallel TCG generation.

Move the hole to the end of the struct, so that a u32
field can be added there without bloating the struct.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

78722ed026-Jul-2017 Emilio G. Cota <cota@braap.org>

translate-all: make l1_map lockless

Groundwork for supporting parallel TCG generation.

We never remove entries from the radix tree, so we can use cmpxchg
to implement lockless insertions.

Reviewed

translate-all: make l1_map lockless

Groundwork for supporting parallel TCG generation.

We never remove entries from the radix tree, so we can use cmpxchg
to implement lockless insertions.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

1e05197f03-Aug-2017 Emilio G. Cota <cota@braap.org>

translate-all: iterate over TBs in a page with PAGE_FOR_EACH_TB

This commit does several things, but to avoid churn I merged them all
into the same commit. To wit:

- Use uintptr_t instead of Transl

translate-all: iterate over TBs in a page with PAGE_FOR_EACH_TB

This commit does several things, but to avoid churn I merged them all
into the same commit. To wit:

- Use uintptr_t instead of TranslationBlock * for the list of TBs in a page.
Just like we did in (c37e6d7e "tcg: Use uintptr_t type for
jmp_list_{next|first} fields of TB"), the rationale is the same: these
are tagged pointers, not pointers. So use a more appropriate type.

- Only check the least significant bit of the tagged pointers. Masking
with 3/~3 is unnecessary and confusing.

- Introduce the TB_FOR_EACH_TAGGED macro, and use it to define
PAGE_FOR_EACH_TB, which improves readability. Note that
TB_FOR_EACH_TAGGED will gain another user in a subsequent patch.

- Update tb_page_remove to use PAGE_FOR_EACH_TB. In case there
is a bug and we attempt to remove a TB that is not in the list, instead
of segfaulting (since the list is NULL-terminated) we will reach
g_assert_not_reached().

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

128ed22701-Aug-2017 Emilio G. Cota <cota@braap.org>

tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx

Thereby making it per-TCGContext. Once we remove tb_lock, this will
avoid an atomic increment every time a TB is invalidated.

Reviewed-by: Richa

tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx

Thereby making it per-TCGContext. Once we remove tb_lock, this will
avoid an atomic increment every time a TB is invalidated.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

be2cdc5e26-Jul-2017 Emilio G. Cota <cota@braap.org>

tcg: track TBs with per-region BST's

This paves the way for enabling scalable parallel generation of TCG code.

Instead of tracking TBs with a single binary search tree (BST), use a
BST for each TCG

tcg: track TBs with per-region BST's

This paves the way for enabling scalable parallel generation of TCG code.

Instead of tracking TBs with a single binary search tree (BST), use a
BST for each TCG region, protecting it with a lock. This is as scalable
as it gets, since each TCG thread operates on a separate region.

The core of this change is the introduction of struct tcg_region_tree,
which contains a pointer to a GTree and an associated lock to serialize
accesses to it. We then allocate an array of tcg_region_tree's, adding
the appropriate padding to avoid false sharing based on
qemu_dcache_linesize.

Given a tc_ptr, we first find the corresponding region_tree. This
is done by special-casing the first and last regions first, since they
might be of size != region.size; otherwise we just divide the offset
by region.stride. I was worried about this division (several dozen
cycles of latency), but profiling shows that this is not a fast path.
Note that region.stride is not required to be a power of two; it
is only required to be a multiple of the host's page size.

Note that with this design we can also provide consistent snapshots
about all region trees at once; for instance, tcg_tb_foreach
acquires/releases all region_tree locks before/after iterating over them.
For this reason we now drop tb_lock in dump_exec_info().

As an alternative I considered implementing a concurrent BST, but this
can be tricky to get right, offers no consistent snapshots of the BST,
and performance and scalability-wise I don't think it could ever beat
having separate GTrees, given that our workload is insert-mostly (all
concurrent BST designs I've seen focus, understandably, on making
lookups fast, which comes at the expense of convoluted, non-wait-free
insertions/removals).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

show more ...

1...<<4142434445464748495051