[PATCH v3 20/20] cputlb: Pass retaddr to tb_check_watchpoint

2019-09-21 Thread Richard Henderson
Fixes the previous TLB_WATCHPOINT patches because we are currently failing to set cpu->mem_io_pc with the call to cpu_check_watchpoint. Pass down the retaddr directly because it's readily available. Fixes: 50b107c5d61 Signed-off-by: Richard Henderson --- accel/tcg/translate-all.h | 2 +-

[PATCH v3 18/20] cputlb: Remove tb_invalidate_phys_page_range is_cpu_write_access

2019-09-21 Thread Richard Henderson
All callers pass false to this argument. Remove it and pass the constant on to tb_invalidate_phys_page_range__locked. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.h | 3 +-- accel/tcg/translate-all.c | 6 ++ exec.c| 4 ++-- 3 files changed, 5

Re: [PATCH v3 00/20] Move rom and notdirty handling to cputlb

2019-09-21 Thread Richard Henderson
On 9/21/19 8:54 PM, Richard Henderson wrote: > Richard Henderson (20): > exec: Use TARGET_PAGE_BITS_MIN for TLB flags > exec: Split out variable page size support to exec-vary.c > exec: Use const alias for TARGET_PAGE_BITS_VARY > exec: Restrict TARGET_PAGE_BITS_VARY assert to

[PATCH v3 19/20] cputlb: Pass retaddr to tb_invalidate_phys_page_fast

2019-09-21 Thread Richard Henderson
Rather than rely on cpu->mem_io_pc, pass retaddr down directly. Within tb_invalidate_phys_page_range__locked, the is_cpu_write_access parameter is non-zero exactly when retaddr would be non-zero, so that is a simple replacement. Recognize that current_tb_not_found is true only when mem_io_pc

[PATCH v3 16/20] cputlb: Handle TLB_NOTDIRTY in probe_access

2019-09-21 Thread Richard Henderson
We can use notdirty_write for the write and return a valid host pointer for this case. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index

[PATCH v3 17/20] cputlb: Remove cpu->mem_io_vaddr

2019-09-21 Thread Richard Henderson
With the merge of notdirty handling into store_helper, the last user of cpu->mem_io_vaddr was removed. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 2 -- accel/tcg/cputlb.c| 2 -- hw/core/cpu.c | 1 - 3 files changed, 5 deletions(-) diff --git

[PATCH v3 13/20] cputlb: Move NOTDIRTY handling from I/O path to TLB path

2019-09-21 Thread Richard Henderson
Pages that we want to track for NOTDIRTY are RAM. We do not really need to go through the I/O path to handle them. Signed-off-by: Richard Henderson --- include/exec/cpu-common.h | 2 -- accel/tcg/cputlb.c| 26 +--- exec.c| 50

[PATCH v3 14/20] cputlb: Partially inline memory_region_section_get_iotlb

2019-09-21 Thread Richard Henderson
There is only one caller, tlb_set_page_with_attrs. We cannot inline the entire function because the AddressSpaceDispatch structure is private to exec.c, and cannot easily be moved to include/exec/memory-internal.h. Compute is_ram and is_romd once within tlb_set_page_with_attrs. Fold the number

[PATCH v3 15/20] cputlb: Merge and move memory_notdirty_write_{prepare, complete}

2019-09-21 Thread Richard Henderson
Since 9458a9a1df1a, all readers of the dirty bitmaps wait for the rcu lock, which means that they wait until the end of any executing TranslationBlock. As a consequence, there is no need for the actual access to happen in between the _prepare and _complete. Therefore, we can improve things by

[PATCH v3 11/20] exec: Adjust notdirty tracing

2019-09-21 Thread Richard Henderson
The memory_region_tb_read tracepoint is unreachable, since notdirty is supposed to apply only to writes. The memory_region_tb_write tracepoint is mis-named, because notdirty is not only used for TB invalidation. It is also used for e.g. VGA RAM updates and migration. Replace

[PATCH v3 12/20] cputlb: Move ROM handling from I/O path to TLB path

2019-09-21 Thread Richard Henderson
It does not require going through the whole I/O path in order to discard a write. Signed-off-by: Richard Henderson --- include/exec/cpu-all.h| 5 - include/exec/cpu-common.h | 1 - accel/tcg/cputlb.c| 35 +++-- exec.c| 41

[PATCH v3 09/20] cputlb: Replace switches in load/store_helper with callback

2019-09-21 Thread Richard Henderson
Add a function parameter to perform the actual load/store to ram. With optimization, this results in identical code. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 159 +++-- 1 file changed, 83 insertions(+), 76 deletions(-) diff --git

[PATCH v3 05/20] exec: Promote TARGET_PAGE_MASK to target_long

2019-09-21 Thread Richard Henderson
There are some uint64_t uses that expect TARGET_PAGE_MASK to extend for a 32-bit, so this must continue to be a signed type. Define based on TARGET_PAGE_BITS not TARGET_PAGE_SIZE; this will make a following patch more clear. This should not have a functional effect so far. Reviewed-by: Paolo

[PATCH v3 08/20] cputlb: Disable __always_inline__ without optimization

2019-09-21 Thread Richard Henderson
This forced inlining can result in missing symbols, which makes a debugging build harder to follow. Reviewed-by: David Hildenbrand Reported-by: Peter Maydell Signed-off-by: Richard Henderson --- include/qemu/compiler.h | 11 +++ accel/tcg/cputlb.c | 4 ++-- 2 files changed, 13

[PATCH v3 10/20] cputlb: Introduce TLB_BSWAP

2019-09-21 Thread Richard Henderson
Handle bswap on ram directly in load/store_helper. This fixes a bug with the previous implementation in that one cannot use the I/O path for RAM. Fixes: a26fc6f5152b47f1 Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 4 +- accel/tcg/cputlb.c | 108

[PATCH v3 06/20] exec: Tidy TARGET_PAGE_ALIGN

2019-09-21 Thread Richard Henderson
Use TARGET_PAGE_MASK twice instead of TARGET_PAGE_SIZE once. This is functionally identical, but will help a following patch. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v3 07/20] exec: Cache TARGET_PAGE_MASK for TARGET_PAGE_BITS_VARY

2019-09-21 Thread Richard Henderson
This eliminates a set of runtime shifts. It turns out that we require TARGET_PAGE_MASK more often than TARGET_PAGE_SIZE, so redefine TARGET_PAGE_SIZE based on TARGET_PAGE_MASK instead of the other way around. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson ---

[PATCH v3 03/20] exec: Use const alias for TARGET_PAGE_BITS_VARY

2019-09-21 Thread Richard Henderson
Using a variable that is declared "const" for this tells the compiler that it may read the value once and assume that it does not change across function calls. For target_page_size, this means we have only one assert per function, and one read of the variable. This reduces the size of

[PATCH v3 04/20] exec: Restrict TARGET_PAGE_BITS_VARY assert to CONFIG_DEBUG_TCG

2019-09-21 Thread Richard Henderson
This reduces the size of a release build by about 10k. Noticably, within the tlb miss helpers. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH v3 02/20] exec: Split out variable page size support to exec-vary.c

2019-09-21 Thread Richard Henderson
The next patch will play a trick with "const" that will confuse the compiler about the uses of target_page_bits within exec.c. Moving everything to a new file prevents this confusion. No functional change so far. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Signed-off-by:

[PATCH v3 01/20] exec: Use TARGET_PAGE_BITS_MIN for TLB flags

2019-09-21 Thread Richard Henderson
These bits do not need to vary with the actual page size used by the guest. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/exec/cpu-all.h

[PATCH v3 00/20] Move rom and notdirty handling to cputlb

2019-09-21 Thread Richard Henderson
Ok! Third time is the charm, because this time it works. New to v3: * Covert io_mem_rom with a new TLB_ROM bit. * This in turn means that there are no longer any special RAM case along along the MMIO path -- they all have devices on the other end. * This in turn means that we

Re: [PATCH v1 4/6] riscv/sifive_u: Add the start-in-flash property

2019-09-21 Thread Bin Meng
On Sat, Sep 21, 2019 at 6:12 AM Alistair Francis wrote: > > On Thu, Sep 19, 2019 at 10:15 PM Bin Meng wrote: > > > > On Fri, Sep 20, 2019 at 6:32 AM Alistair Francis > > wrote: > > > > > > Add a property that when set to true QEMU will jump from the ROM code to > > > the start of flash memory

Re: [PATCH v1 5/6] riscv/virt: Add the PFlash CFI01 device

2019-09-21 Thread Bin Meng
On Sat, Sep 21, 2019 at 6:16 AM Alistair Francis wrote: > > On Thu, Sep 19, 2019 at 10:15 PM Bin Meng wrote: > > > > On Fri, Sep 20, 2019 at 6:36 AM Alistair Francis > > wrote: > > > > > > Add the CFI01 PFlash to the RISC-V virt board. This is the same PFlash > > > from the ARM Virt board and

Re: [RFC v2 0/5] Move notdirty handling to cputlb

2019-09-21 Thread Richard Henderson
On 9/18/19 11:02 AM, Richard Henderson wrote: > However this time the changes are extremely minimal, and now > I really *really* don't understand why they don't work, because > as far as I can tell the new locking is *identical* with the > current i/o path. The difference was failing to set

Re: [PATCH] hw/arm/boot: Use the IEC binary prefix definitions

2019-09-21 Thread Richard Henderson
On 9/21/19 3:34 AM, Philippe Mathieu-Daudé wrote: > IEC binary prefixes ease code review: the unit is explicit. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/boot.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH] hw/m68k/next-cube: Avoid static RTC variables and introduce control register

2019-09-21 Thread Richard Henderson
On 9/21/19 2:17 AM, Thomas Huth wrote: > Coverity currently complains that the "if (0x00 & (0x80 >> (phase - 8))" > in next-cube.c can never be true. Right it is. The "0x00" is meant as value > of the control register of the RTC, which is currently not implemented yet. > Thus, let's add a register

[PATCH 2/4] target/arm: Move cortex-m related functions to new file v7m.c

2019-09-21 Thread Thomas Huth
We are going to make CONFIG_ARM_V7M optional, so the related cortex-m CPUs should only be created if the switch is enabled. This can best be done if the code resides in a separate file, thus move the related functions to a new file v7m.c which only gets compiled if CONFIG_ARM_V7M is enabled.

[PATCH 3/4] hw/arm: Move armv7m_nvic.c to hw/arm/ and always enable it for arm builds

2019-09-21 Thread Thomas Huth
qemu-system-arm/-aarch64 currently can't be built without setting the switch CONFIG_ARM_V7M=y - which we currently always do in the config file default-configs/arm-softmmu.mak. This is because the code in target/arm/ calls many functions from this armv7m_nvic.c, and thus linking fails without this

[PATCH 1/4] target/arm: Make cpu_register() and set_feature() available for other files

2019-09-21 Thread Thomas Huth
Move the common set_feature() and unset_feature() functions from cpu.c and cpu64.c to internals.h, and make cpu_register() (renamed to arm_cpu_register()) available from there, too, so we can register CPUs also from other files in the future. Signed-off-by: Thomas Huth --- target/arm/cpu.c

[PATCH 4/4] default-configs: Do not enforce CONFIG_ARM_V7M anymore

2019-09-21 Thread Thomas Huth
The arm builds can now be done without CONFIG_ARM_V7M, so do not enforce this config switch anymore, it's getting selected in hw/arm/Kconfig automatically if needed. Signed-off-by: Thomas Huth --- default-configs/arm-softmmu.mak | 3 --- 1 file changed, 3 deletions(-) diff --git

[PATCH 0/4] Make it possible to compile with CONFIG_ARM_V7M=n

2019-09-21 Thread Thomas Huth
We've got CONFIG_ARM_V7M, but it currently can't be disabled. Here are some patches that should allow to disable the switch (if the corresponding boards are disabled, too). RFC -> v1: - Move the definitions into internals.h instead of cpu.h in the 1st patch - Instead of creating an ugly stubs

Re: Cannot login into emulated smartcard with OpenSC because it expects external PIN pad.

2019-09-21 Thread Thomas Huth
On 21/09/2019 10.54, Andrei Borzenkov wrote: > USB card reader emulated by QEMU announces presence of PIN pad. OpenSC > will not request PIN from user in this case and assumes PIN is being > entered off-band on external device. Unfortunately QEMU does not seem to > offer PIN entry and access to

RE: [Qemu-arm] [RFC PATCH 00/14] hw/arm: Add the Raspberry Pi 4B

2019-09-21 Thread Stewart Hildebrand
On Wednesday, September 4, 2019 1:13 PM, Philippe Mathieu-Daudé wrote: >Esteban wrote me over the weekend asking about raspi4 progress. >I cleaned up my patches/notes to pass him. Other help is also welcomed :) >I got scared trying to understand how to use the GIC, and wire the various >IRQs. >

Cannot login into emulated smartcard with OpenSC because it expects external PIN pad.

2019-09-21 Thread Andrei Borzenkov
USB card reader emulated by QEMU announces presence of PIN pad. OpenSC will not request PIN from user in this case and assumes PIN is being entered off-band on external device. Unfortunately QEMU does not seem to offer PIN entry and access to card always fails. Changing device to not announce

Re: [Qemu-devel] [PATCH v3] virtio-mmio: implement modern (v2), personality (virtio-1)

2019-09-21 Thread Vasyl Vavrychuk
Hi, Sergio, > For this reason, the v2 personality is disabled, keeping the legacy > behavior as default. Machine types willing to use v2, can enable it > using MachineClass's compat_props. ... > +    DEFINE_PROP_BOOL("force-legacy", VirtIOMMIOProxy, legacy, true), Currently, I am not enable to

Re: [PATCH v2 1/2] riscv: hw: Drop "clock-frequency" property of cpu nodes

2019-09-21 Thread Bin Meng
Hi Philippe, On Sat, Sep 21, 2019 at 4:51 PM Philippe Mathieu-Daudé wrote: > > Hi Bin, > > On 9/21/19 7:41 AM, Bin Meng wrote: > > The "clock-frequency" property of cpu nodes isn't required. Drop it. > > > > This is to keep in sync with Linux kernel commit below: > >

[Bug 1842787] Re: Writes permanently hang with very heavy I/O on virtio-scsi - worse on virtio-blk

2019-09-21 Thread James Harvey
Apologies, it looks like I ran into two separate bugs, one with XFS, and one with BTRFS, that had the same symptom, initially making me to think this must be a QEMU issue. Using blktrace, I was able to see within the VM, that the virtio block device wasn't getting the writes that were going into

[PATCH] hw/arm/boot: Use the IEC binary prefix definitions

2019-09-21 Thread Philippe Mathieu-Daudé
IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/boot.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index bf97ef3e33..59bb2fa0d3 100644 --- a/hw/arm/boot.c +++

[PATCH] hw/ptimer: Assert next_event is newer than last_event

2019-09-21 Thread Philippe Mathieu-Daudé
If the period is too big, the 'delta * period' product result might overflow, resulting in a negative number, then the next_event ends before the last_event. This is buggy, as there is no forward progress. Assert this can not happen. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/ptimer.c |

Re: [PATCH 3/3] docker: remove unused debian-sid and debian-ports

2019-09-21 Thread Philippe Mathieu-Daudé
Hi John, On 9/20/19 2:14 AM, John Snow wrote: > These are listed as "partial" images, but have no user. > Remove them. > > Signed-off-by: John Snow > --- > tests/docker/Makefile.include| 4 +-- > tests/docker/dockerfiles/debian-ports.docker | 36 >

[PATCH] hw/m68k/next-cube: Avoid static RTC variables and introduce control register

2019-09-21 Thread Thomas Huth
Coverity currently complains that the "if (0x00 & (0x80 >> (phase - 8))" in next-cube.c can never be true. Right it is. The "0x00" is meant as value of the control register of the RTC, which is currently not implemented yet. Thus, let's add a register variable for this now. However, the RTC

Re: [PATCH 5/5] .travis.yml: Build and install EDK2 roms

2019-09-21 Thread Philippe Mathieu-Daudé
On 6/14/19 8:44 PM, Alex Bennée wrote: > Laszlo Ersek writes: >> On 06/13/19 18:59, Philippe Mathieu-Daudé wrote: >>> Hi Laszlo, >>> >>> On 3/12/19 5:29 PM, Laszlo Ersek wrote: On 03/11/19 01:30, Philippe Mathieu-Daudé wrote: > Add a job to build and install the EDK2 platform firmware

Re: [Qemu-devel] [PATCH v1 1/2] RISC-V: Handle bus errors in the page table walker

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/18/19 1:22 AM, Alistair Francis wrote: > From: Palmer Dabbelt > > We directly access physical memory while walking the page tables on > RISC-V, but while doing so we were using cpu_ld*() which does not report > bus errors. This patch converts the page table walker over to use >

Re: [Qemu-devel] [PATCH v1 2/2] RISC-V: Implement cpu_do_transaction_failed

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/18/19 1:23 AM, Alistair Francis wrote: > From: Palmer Dabbelt > > This converts our port over from cpu_do_unassigned_access to > cpu_do_transaction_failed, as cpu_do_unassigned_access has been > deprecated. > > Signed-off-by: Palmer Dabbelt > Signed-off-by: Alistair Francis > --- >

Re: [PATCH 4/7] exec: Restrict TARGET_PAGE_BITS_VARY assert to CONFIG_DEBUG_TCG

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/20/19 1:29 AM, Richard Henderson wrote: > This reduces the size of a release build by about 10k. > Noticably, within the tlb miss helpers. > > Signed-off-by: Richard Henderson > --- > include/exec/cpu-all.h | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 2/7] exec: Split out variable page size support to exec-vary.c

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/20/19 1:29 AM, Richard Henderson wrote: > The next patch will play a trick with "const" that will > confuse the compiler about the uses of target_page_bits > within exec.c. Moving everything to a new file prevents > this confusion. > > No functional change so far. > > Signed-off-by:

Re: [PATCH 7/7] target/alpha: Tidy helper_fp_exc_raise_s

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 6:32 AM, Richard Henderson wrote: > Remove a redundant masking of ignore. Once that's gone it is > obvious that the system-mode inner test is redundant with the > outer test. Move the fpcr_exc_enable masking up and tidy. > > No functional change. > > Signed-off-by: Richard Henderson

Re: [PATCH 5/7] target/alpha: Write to fpcr_flush_to_zero once

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 6:32 AM, Richard Henderson wrote: > Tidy the computation of the value; no functional change. > > Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé > --- > target/alpha/helper.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git

Re: [PATCH 1/7] target/alpha: Use array for FPCR_DYN conversion

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 6:32 AM, Richard Henderson wrote: > This is a bit more straight-forward than using a switch statement. > No functional change. > > Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé > --- > target/alpha/helper.c | 24 > 1 file changed, 8

Re: [PATCH v2 2/2] riscv: sifive_u: Add ethernet0 to the aliases node

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 7:41 AM, Bin Meng wrote: > U-Boot expects this alias to be in place in order to fix up the mac > address of the ethernet node. > > This is to keep in sync with Linux kernel commit below: > https://patchwork.kernel.org/patch/11133033/ > > Signed-off-by: Bin Meng > Reviewed-by:

Re: [PATCH v2 1/2] riscv: hw: Drop "clock-frequency" property of cpu nodes

2019-09-21 Thread Philippe Mathieu-Daudé
Hi Bin, On 9/21/19 7:41 AM, Bin Meng wrote: > The "clock-frequency" property of cpu nodes isn't required. Drop it. > > This is to keep in sync with Linux kernel commit below: > https://patchwork.kernel.org/patch/11133031/ What happens if you run a older kernel that doesn't contain the

Re: [PATCH v2 1/5] docker: move tests from python2 to python3

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 12:12 AM, John Snow wrote: > As part of the push to drop python2 support, replace any explicit python2 > dependencies with python3 versions. > > For centos, python2 still exists as an implicit dependency, but by adding > python3 we will be able to build even if the configure script

Re: [PATCH v2 3/5] docker: remove debian8-mxe definitions

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 12:12 AM, John Snow wrote: > We don't have a debian8-mxe dockerfile anymore. > > Signed-off-by: John Snow > Message-id: 20190920001413.22567-3-js...@redhat.com ^ remove? Fixes: 67bd36beda1ae Reviewed-by: Philippe Mathieu-Daudé > --- > tests/docker/Makefile.include | 2 +- > 1

Re: [PATCH v2 5/5] docker: removed unused debian8 partial image

2019-09-21 Thread Philippe Mathieu-Daudé
On 9/21/19 12:12 AM, John Snow wrote: > debian8 partial base is also not consumed by any image, so remove it. Reviewed-by: Philippe Mathieu-Daudé > > Signed-off-by: John Snow > --- > tests/docker/Makefile.include | 3 +-- > tests/docker/dockerfiles/debian8.docker | 33

Re: [PATCH v2 0/3] testing: Build WHPX enabled binaries

2019-09-21 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190920113329.16787-1-phi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190920113329.16787-1-phi...@redhat.com Subject: [PATCH v2 0/3] testing: Build WHPX enabled binaries