Re: -only-migrate and the two different uses of migration blockers

2021-07-19 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> We appear to use migration blockers in two ways: >> >> (1) Prevent migration for an indefinite time, typically due to use of >> some feature that isn't compatible with migration. >> >> (2) Delay migration for

[PATCH qemu v2] ppc/vof: Fix Coverity issues

2021-07-19 Thread Alexey Kardashevskiy
Coverity reported issues which are caused by mixing of signed return codes from DTC and unsigned return codes of the client interface. This introduces PROM_ERROR and makes distinction between the error types. This fixes NEGATIVE_RETURNS, OVERRUN issues reported by Coverity. This adds a comment

Re:[PATCH 02/17] target/riscv: Introduce gpr_src, gpr_dst

2021-07-19 Thread LIU Zhiwei
Hi Richard, Notice gen_arith is also used by trans_div.  We will modify the source register for div instruction after this patch set. Thanks, Zhiwei

R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

2021-07-19 Thread luigi burdo
I Zoltan, i was able to build on my quad qemu, a ram bank was die and make me the issue with gcc.. this is what happening if i run pegasos 2 with --enable-kvm. via_superio_cfg: unimplemented register 0xf2 via_superio_cfg: unimplemented register 0xf4 via_superio_cfg: unimplemented register 0xf6

Re: [PATCH] util: fix abstract socket path copy

2021-07-19 Thread zhao xiao qiang
在 2021/7/19 21:01, marcandre.lur...@redhat.com 写道: > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > support" neglected to update socket_sockaddr_to_address_unix() and > copied the whole sun_path without taking "salen" into account. > > Later, commit 3b14b4ec49 "sockets: Fix

Re: [PATCH RFC 12/19] vfio-user: probe remote device's BARs

2021-07-19 Thread Alex Williamson
On Tue, 20 Jul 2021 01:39:21 + John Johnson wrote: > > On Jul 19, 2021, at 3:59 PM, Alex Williamson > > wrote: > > > > On Sun, 18 Jul 2021 23:27:51 -0700 > > Elena Ufimtseva wrote: > >> @@ -3442,6 +3448,22 @@ static void vfio_user_pci_realize(PCIDevice *pdev, > >> Error **errp) > >>

Re: [PATCH for-6.1 v5 00/15] tcg: breakpoint reorg

2021-07-19 Thread Richard Henderson
On 7/19/21 3:17 PM, Richard Henderson wrote: Patches lacking review are all new: 03-target-alpha-Drop-goto_tb-path-in-gen_call_pal.patch 08-hw-core-Introduce-TCGCPUOps.debug_check_breakpoin.patch 09-target-arm-Implement-debug_check_breakpoint.patch

Re: [PATCH RFC 12/19] vfio-user: probe remote device's BARs

2021-07-19 Thread John Johnson
> On Jul 19, 2021, at 3:59 PM, Alex Williamson > wrote: > > On Sun, 18 Jul 2021 23:27:51 -0700 > Elena Ufimtseva wrote: >> @@ -3442,6 +3448,22 @@ static void vfio_user_pci_realize(PCIDevice *pdev, >> Error **errp) >> /* QEMU can also add or extend BARs */ >>

[PATCH for-6.1 v5 14/15] accel/tcg: Hoist tb_cflags to a local in translator_loop

2021-07-19 Thread Richard Henderson
The access internal to tb_cflags() is atomic. Avoid re-reading it as such for the multiple uses. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/accel/tcg/translator.c

[PATCH for-6.1 v5 15/15] accel/tcg: Record singlestep_enabled in tb->cflags

2021-07-19 Thread Richard Henderson
Set CF_SINGLE_STEP when single-stepping is enabled. This avoids the need to flush all tb's when turning single-stepping on or off. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1 + accel/tcg/cpu-exec.c | 7 ++- accel/tcg/translate-all.c | 4

[PATCH for-6.1 v5 12/15] accel/tcg: Move breakpoint recognition outside translation

2021-07-19 Thread Richard Henderson
Trigger breakpoints before beginning translation of a TB that would begin with a BP. Thus we never generate code for the BP at all. Single-step instructions within a page containing a BP so that we are sure to check each insn for the BP as above. We no longer need to flush any TBs when changing

Re: [RFC 3/3] qom: Improve error message in module_object_class_by_name()

2021-07-19 Thread Jose R. Ziviani
On Mon, Jul 19, 2021 at 05:29:49PM +0200, Claudio Fontana wrote: > On 7/1/21 1:27 AM, Jose R. Ziviani wrote: > > module_object_class_by_name() calls module_load_qom_one if the object > > is provided by a dynamically linked library. Such library might not be > > available at this moment - for

[PATCH for-6.1 v5 11/15] accel/tcg: Merge tb_find into its only caller

2021-07-19 Thread Richard Henderson
We are going to want two things: (1) check for breakpoints will want to break out of the loop here, (2) cflags can only be calculated with pc in hand. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 83 ++-- 1 file changed, 41 insertions(+),

Re: Question on memory commit during MR finalize()

2021-07-19 Thread Peter Xu
On Mon, Jul 19, 2021 at 08:58:44PM +, John Johnson wrote: > > > > On Jul 19, 2021, at 12:59 PM, Peter Xu wrote: > > > > > > Here vfio_user_send_recv() looks tricky to me - it releases the bql within a > > memory update procedure, and IMHO it needs some serious justification on > > why it

[PATCH for-6.1 v5 10/15] target/i386: Implement debug_check_breakpoint

2021-07-19 Thread Richard Henderson
Return false for RF set, as we do in i386_tr_breakpoint_check. Signed-off-by: Richard Henderson --- target/i386/tcg/tcg-cpu.c | 12 1 file changed, 12 insertions(+) diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index e96ec9bbcc..238e3a9395 100644 ---

Re: [PATCH qemu] ppc/vof: Fix Coverity issues

2021-07-19 Thread David Gibson
On Mon, Jul 19, 2021 at 06:25:53PM +1000, Alexey Kardashevskiy wrote: > > > On 7/19/21 13:57, David Gibson wrote: > > On Tue, Jul 13, 2021 at 11:46:38PM +1000, Alexey Kardashevskiy wrote: > > > This fixes NEGATIVE_RETURNS, OVERRUN issues reported by the Coverity. > > > > > > This adds a comment

Re: [PATCH] target/ppc: Ease L=0 requirement on cmp/cmpi/cmpl/cmpli for ppc32

2021-07-19 Thread David Gibson
On Mon, Jul 19, 2021 at 12:21:11PM +0200, BALATON Zoltan wrote: > On Mon, 19 Jul 2021, David Gibson wrote: > > On Thu, Jul 15, 2021 at 09:29:50AM -0300, matheus.fe...@eldorado.org.br > > wrote: > > > From: Matheus Ferst > > > > > > In commit 8f0a4b6a9, we started to require L=0 for ppc32 to

[PATCH for-6.1 v5 13/15] accel/tcg: Remove TranslatorOps.breakpoint_check

2021-07-19 Thread Richard Henderson
The hook is now unused, with breakpoints checked outside translation. Signed-off-by: Richard Henderson --- include/exec/translator.h | 11 --- target/arm/helper.h | 2 -- target/alpha/translate.c | 16 target/arm/debug_helper.c | 7 ---

[PATCH for-6.1 v5 03/15] target/alpha: Drop goto_tb path in gen_call_pal

2021-07-19 Thread Richard Henderson
We are certain of a page crossing here, entering the PALcode image, so the call to use_goto_tb that should have been here will never succeed. We are shortly going to add an assert to tcg_gen_goto_tb that would trigger for this case. Signed-off-by: Richard Henderson --- target/alpha/translate.c

[PATCH for-6.1 v5 07/15] accel/tcg: Use CF_NO_GOTO_{TB, PTR} in cpu_exec_step_atomic

2021-07-19 Thread Richard Henderson
Request that the one TB returns immediately, so that we release the exclusive lock as soon as possible. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Alex Bennée Message-Id: <20210717221851.2124573-7-richard.hender...@linaro.org> --- accel/tcg/cpu-exec.c | 11

[PATCH for-6.1 v5 06/15] accel/tcg: Handle -singlestep in curr_cflags

2021-07-19 Thread Richard Henderson
Exchange the test in translator_use_goto_tb for CF_NO_GOTO_TB, and the test in tb_gen_code for setting CF_COUNT_MASK to 1. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20210717221851.2124573-6-richard.hender...@linaro.org> --- accel/tcg/cpu-exec.c | 8 +++-

[PATCH for-6.1 v5 08/15] hw/core: Introduce TCGCPUOps.debug_check_breakpoint

2021-07-19 Thread Richard Henderson
New hook to return true when an architectural breakpoint is to be recognized and false when it should be suppressed. First use must wait until other pieces are in place. Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH for-6.1 v5 02/15] accel/tcg: Move curr_cflags into cpu-exec.c

2021-07-19 Thread Richard Henderson
We will shortly have more than a simple member read here, with stuff not necessarily exposed to exec/exec-all.h. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PATCH for-6.1 v5 09/15] target/arm: Implement debug_check_breakpoint

2021-07-19 Thread Richard Henderson
Reuse the code at the bottom of helper_check_breakpoints, which is what we currently call from *_tr_breakpoint_check. Signed-off-by: Richard Henderson --- target/arm/internals.h| 3 +++ target/arm/cpu.c | 1 + target/arm/cpu_tcg.c | 1 + target/arm/debug_helper.c | 7 +++

[PATCH for-6.1 v5 04/15] accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR

2021-07-19 Thread Richard Henderson
Move the -d nochain check to bits on tb->cflags. These will be used for more than -d nochain shortly. Set bits during curr_cflags, test them in translator_use_goto_tb, assert we're not doing anything odd in tcg_gen_goto_tb. The test in tcg_gen_exit_tb is redundant with the assert for

[PATCH for-6.1 v5 05/15] accel/tcg: Drop CF_NO_GOTO_PTR from -d nochain

2021-07-19 Thread Richard Henderson
The purpose of suppressing goto_ptr from -d nochain had been to return to the main loop so that -d cpu would be recognized. But we now include -d cpu logging in helper_lookup_tb_ptr so there is no need to exclude goto_ptr. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id:

[PATCH for-6.1 v5 01/15] accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS

2021-07-19 Thread Richard Henderson
The space reserved for CF_COUNT_MASK was overly large. Reduce to free up cflags bits and eliminate an extra test. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell Message-Id: <20210717221851.2124573-2-richard.hender...@linaro.org> ---

[PATCH for-6.1 v5 00/15] tcg: breakpoint reorg

2021-07-19 Thread Richard Henderson
This is fixing #404 ("windows xp boot takes much longer...") and several other similar reports. Changes for v5: * Include missing hunk in tb_gen_code, as noted in reply to v4. * Remove helper_check_breakpoints from target/arm/. * Reorg cflags_for_breakpoints into check_for_breakpoints;

Re: Failing iotest 206

2021-07-19 Thread Eric Blake
On Mon, Jul 19, 2021 at 10:06:01AM +0200, Thomas Huth wrote: > Hi, > > iotest 206 fails for me with: > > --- 206.out > +++ 206.out.bad > @@ -99,55 +99,19 @@ > > {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": > {"driver": "qcow2", "encrypt": {"cipher-alg":

Re: [PATCH 2/2] qom: use correct field name when getting/setting alias properties

2021-07-19 Thread Eric Blake
On Mon, Jul 19, 2021 at 12:40:33PM +0200, Paolo Bonzini wrote: > Alias targets have a different name than the alias property itself > (e.g. a machine's pflash0 might be an alias of a property named 'drive'). > When the target's getter or setter invokes the visitor, it will use > a different name

Re: [PATCH 1/2] qapi: introduce forwarding visitor

2021-07-19 Thread Eric Blake
On Mon, Jul 19, 2021 at 12:40:32PM +0200, Paolo Bonzini wrote: > This new adaptor visitor takes a single field of the adaptee, and exposes it > with a different name. > > This will be used for QOM alias properties. Alias targets can of course > have a different name than the alias property

Re: [PATCH for-6.2 v2 06/11] hw: Add compat machines for 6.2

2021-07-19 Thread Pankaj Gupta
> Add 6.2 machine types for arm/i440fx/q35/s390x/spapr. > > Signed-off-by: Yanan Wang > --- > hw/arm/virt.c | 9 - > hw/core/machine.c | 3 +++ > hw/i386/pc.c | 3 +++ > hw/i386/pc_piix.c | 14 +- > hw/i386/pc_q35.c |

Re: [PATCH v5 2/5] hw/nvme: use symbolic names for registers

2021-07-19 Thread Keith Busch
On Tue, Jul 20, 2021 at 12:46:44AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add the NvmeBarRegs enum and use these instead of explicit register > offsets. Thanks, this is a very nice cleanup. For a suggested follow-up companion patch, we should add "ASSERT_OFFSET()" checks for each

Re: [PATCH v1 1/2] hw/tricore: fix inclusion of tricore_testboard

2021-07-19 Thread Philippe Mathieu-Daudé
On 7/19/21 9:50 PM, Alex Bennée wrote: > We inadvertently added a symbol clash causing the build not to include > the testboard needed for check-tcg. > > Fixes: f4063f9c31 ("meson: Introduce target-specific Kconfig") Sorry for the mess, I remember having tested this carefully. OK, so my patch

Re: [PATCH v3 02/13] accel/tcg: Move curr_cflags into cpu-exec.c

2021-07-19 Thread Philippe Mathieu-Daudé
On 7/18/21 12:18 AM, Richard Henderson wrote: > We will shortly have more than a simple member read here, > with stuff not necessarily exposed to exec/exec-all.h. > > Reviewed-by: Peter Maydell > Reviewed-by: Alex Bennée > Signed-off-by: Richard Henderson > --- > include/exec/exec-all.h | 5

Re: [PATCH v2 2/3] hw: aspeed_gpio: Simplify 1.8V defines

2021-07-19 Thread Philippe Mathieu-Daudé
On 7/13/21 8:58 AM, Joel Stanley wrote: > There's no need to define the registers relative to the 0x800 offset > where the controller is mapped, as the device is instantiated as it's > own model at the correct memory address. > > Simplify the defines and remove the offset to save future

Re: [PATCH RFC 12/19] vfio-user: probe remote device's BARs

2021-07-19 Thread Alex Williamson
On Sun, 18 Jul 2021 23:27:51 -0700 Elena Ufimtseva wrote: > @@ -3442,6 +3448,22 @@ static void vfio_user_pci_realize(PCIDevice *pdev, > Error **errp) > /* QEMU can also add or extend BARs */ > memset(vdev->emulated_config_bits + PCI_BASE_ADDRESS_0, 0xff, 6 * 4); > > +/* > + *

Re: [PATCH v2 2/2] gitlab: enable a very minimal build with the tricore container

2021-07-19 Thread Richard Henderson
On 7/19/21 11:48 AM, Alex Bennée wrote: diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker index 985925134c..4ea9112289 100644 --- a/tests/docker/dockerfiles/debian-tricore-cross.docker +++

Re: [PATCH v2 1/2] hw/tricore: fix inclusion of tricore_testboard

2021-07-19 Thread Richard Henderson
On 7/19/21 11:48 AM, Alex Bennée wrote: We inadvertently added a symbol clash causing the build not to include the testboard needed for check-tcg. Fixes: f4063f9c31 ("meson: Introduce target-specific Kconfig") Signed-off-by: Alex Bennée --- configs/devices/tricore-softmmu/default.mak | 1 +

[PATCH v5 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The new PMR test unearthed a long-standing issue with MMIO reads on big-endian hosts. Fix this by unconditionally storing all controller registers in little endian. Cc: Gollu Appalanaidu Reported-by: Peter Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 290

[PATCH v5 5/5] tests/qtest/nvme-test: add mmio read test

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add a regression test for mmio read on big-endian hosts. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu --- tests/qtest/nvme-test.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/qtest/nvme-test.c b/tests/qtest/nvme-test.c

[PATCH v5 1/5] hw/nvme: split pmrmsc register into upper and lower

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The specification uses a set of 32 bit PMRMSCL and PMRMSCU registers to make up the 64 bit logical PMRMSC register. Make it so. Signed-off-by: Klaus Jensen --- include/block/nvme.h | 31 --- hw/nvme/ctrl.c | 9 + 2 files changed,

[PATCH v5 3/5] hw/nvme: fix out-of-bounds reads

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Peter noticed that mmio access may read into the NvmeParams member in the NvmeCtrl struct. Fix the bounds check. Reported-by: Peter Maydell Signed-off-by: Klaus Jensen Reviewed-by: Stefan Hajnoczi Reviewed-by: Peter Maydell --- hw/nvme/ctrl.c | 27

[PATCH v5 2/5] hw/nvme: use symbolic names for registers

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add the NvmeBarRegs enum and use these instead of explicit register offsets. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Philippe Mathieu-Daudé --- include/block/nvme.h | 29 - hw/nvme/ctrl.c | 44

[PATCH v5 0/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Fix mmio read issues on big-endian hosts. The core issue is that values in the BAR is not stored in little endian as required. Fix that and add a regression test for this. This required a bit of cleanup, so it blew up into a series. v5: * "hw/nvme: fix mmio read" -

Error in accel/tcg?

2021-07-19 Thread Kenneth Adam Miller
Hello, I get the following error: -c ../accel/tcg/cputlb.c ../qemu/accel/tcg/cputlb.c: In function 'tlb_flush_page_by_mmuidx': ../qemu/accel/tcg/cputlb.c:602:23: error: comparison is always true due to limited range of data type [-Werror=type-limits] } else if (idxmap < TARGET_PAGE_SIZE) {

Re: [PATCH] tests/qtest/migration-test.c: use 127.0.0.1 instead of 0

2021-07-19 Thread Daniel P . Berrangé
On Mon, Jul 19, 2021 at 07:52:17PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > OpenBSD doesn't like :0 as an address, switch to using 127.0.0.1 > in baddest; it's really testing the :0 port number that isn't allowed > on anything. > > (The test doesn't

[PATCH v2 1/2] hw/core/register: Add more 64-bit utilities

2021-07-19 Thread Joe Komlodi
We already have some utilities to handle 64-bit wide registers, so this just adds some more for: - Initializing 64-bit registers - Extracting and depositing to an array of 64-bit registers Signed-off-by: Joe Komlodi --- hw/core/register.c | 12 include/hw/register.h

[PATCH v2 2/2] hw/registerfields: Use 64-bit bitfield for FIELD_DP64

2021-07-19 Thread Joe Komlodi
If we have a field that's wider than 32-bits, we need a data type wide enough to be able to create the bitfield used to deposit the value. Signed-off-by: Joe Komlodi --- include/hw/registerfields.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/registerfields.h

[PATCH v2 0/2] Add more 64-bit utilities

2021-07-19 Thread Joe Komlodi
Changelog: v1 -> v2 - 2/2: Use uint64_t for 64-bit value Hi all, This adds more utilities for 64-bit registers. As part of it, it also fixes FIELD_DP64 to work with bit fields wider than 32-bits. Thanks! Joe Joe Komlodi (2): hw/core/register: Add more 64-bit utilities hw/registerfields:

[PATCH v2 2/2] gitlab: enable a very minimal build with the tricore container

2021-07-19 Thread Alex Bennée
We do the same thing as hexagon and do a two stage build that provides the minimal dependencies to build qemu-tricore-system and its check-tcg tests. Signed-off-by: Alex Bennée --- .gitlab-ci.d/buildtest.yml| 11 + .../dockerfiles/debian-tricore-cross.docker | 40

[PATCH for 6.1 v2 0/2] tricore fixes

2021-07-19 Thread Alex Bennée
Hi, This fixes check-tcg for tricore and adds a test to the gitlab matrix so we don't miss it breaking again. New for v2: actually works and isn't an unholy mash of two docker container definitions. Please review: - gitlab: enable a very minimal build with the tricore container - hw/tricore:

[PATCH v2 1/2] hw/tricore: fix inclusion of tricore_testboard

2021-07-19 Thread Alex Bennée
We inadvertently added a symbol clash causing the build not to include the testboard needed for check-tcg. Fixes: f4063f9c31 ("meson: Introduce target-specific Kconfig") Signed-off-by: Alex Bennée --- configs/devices/tricore-softmmu/default.mak | 1 + hw/tricore/Kconfig

Re: [PATCH for-6.1 v4 15/15] accel/tcg: Record singlestep_enabled in tb->cflags

2021-07-19 Thread Richard Henderson
On 7/19/21 11:22 AM, Richard Henderson wrote: Set CF_SINGLE_STEP when single-stepping is enabled. This avoids the need to flush all tb's when turning single-stepping on or off. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1 + accel/tcg/cpu-exec.c| 12

[PATCH 1/2] ui/gtk: detach_all option for making all VCs detached upon starting

2021-07-19 Thread Dongwon Kim
With "detach-all=on" for display, all VCs are detached from the beginning. This is useful when there are multiple displays assigned to a guest OS. Signed-off-by: Dongwon Kim Signed-off-by: Khairul Anuar Romli --- qapi/ui.json | 4 +++- ui/gtk.c | 7 +++ 2 files changed, 10

[PATCH 2/2] ui/gtk: specify detached window's size and location

2021-07-19 Thread Dongwon Kim
Specify location and size of detached window based on top level window's location and size info when detachment happens. Signed-off-by: Dongwon Kim --- ui/gtk.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/ui/gtk.c b/ui/gtk.c index a07e5a049e..9b4e85624a 100644 ---

Re: [PATCH v1 2/2] gitlab: enable a very minimal build with the tricore container

2021-07-19 Thread Alex Bennée
Alex Bennée writes: > We do the same thing as hexagon and do a two stage build that provides > the minimal dependencies to build qemu-tricore-system and it's > check-tcg tests. > > Signed-off-by: Alex Bennée > --- > .gitlab-ci.d/buildtest.yml| 11 + >

[PATCH for-6.1 v4 15/15] accel/tcg: Record singlestep_enabled in tb->cflags

2021-07-19 Thread Richard Henderson
Set CF_SINGLE_STEP when single-stepping is enabled. This avoids the need to flush all tb's when turning single-stepping on or off. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1 + accel/tcg/cpu-exec.c| 12 accel/tcg/translator.c | 7 +-- cpu.c

[PATCH for-6.1 v4 13/15] accel/tcg: Remove TranslatorOps.breakpoint_check

2021-07-19 Thread Richard Henderson
The hook is now unused, with breakpoints checked outside translation. Signed-off-by: Richard Henderson --- include/exec/translator.h | 11 --- target/alpha/translate.c | 16 target/arm/translate-a64.c| 25 - target/arm/translate.c

[PATCH for-6.1 v4 10/15] target/arm: Implement debug_check_breakpoint

2021-07-19 Thread Richard Henderson
Reuse the code at the bottom of helper_check_breakpoints, which is what we currently call from *_tr_breakpoint_check. Signed-off-by: Richard Henderson --- target/arm/internals.h| 3 +++ target/arm/cpu.c | 1 + target/arm/cpu_tcg.c | 1 + target/arm/debug_helper.c | 7 +++

[PATCH for-6.1 v4 12/15] accel/tcg: Move breakpoint recognition outside translation

2021-07-19 Thread Richard Henderson
Trigger breakpoints before beginning translation of a TB that would begin with a BP. Thus we never generate code for the BP at all. Single-step instructions within a page containing a BP so that we are sure to check each insn for the BP as above. We no longer need to flush any TBs when changing

Re: [PATCH 2/2] hw/registerfields: Use 64-bit bitfield for FIELD_DP64

2021-07-19 Thread Richard Henderson
On 7/19/21 10:16 AM, Joe Komlodi wrote: #define FIELD_DP64(storage, reg, field, val) ({ \ struct { \ -unsigned int v:R_ ## reg ## _ ## field ## _LENGTH;\ +unsigned long

[PATCH for-6.1 v4 08/15] accel/tcg: Move cflags lookup into tb_find

2021-07-19 Thread Richard Henderson
We will shortly require the guest pc for computing cflags, so move the choice just after cpu_get_tb_cpu_state. Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20210717221851.2124573-8-richard.hender...@linaro.org> --- accel/tcg/cpu-exec.c | 34

[PATCH for-6.1 v4 07/15] accel/tcg: Use CF_NO_GOTO_{TB, PTR} in cpu_exec_step_atomic

2021-07-19 Thread Richard Henderson
Request that the one TB returns immediately, so that we release the exclusive lock as soon as possible. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Alex Bennée Message-Id: <20210717221851.2124573-7-richard.hender...@linaro.org> --- accel/tcg/cpu-exec.c | 11

[PATCH for-6.1 v4 06/15] accel/tcg: Handle -singlestep in curr_cflags

2021-07-19 Thread Richard Henderson
Exchange the test in translator_use_goto_tb for CF_NO_GOTO_TB, and the test in tb_gen_code for setting CF_COUNT_MASK to 1. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20210717221851.2124573-6-richard.hender...@linaro.org> --- accel/tcg/cpu-exec.c | 8 +++-

[PATCH for-6.1 v4 03/15] target/alpha: Drop goto_tb path in gen_call_pal

2021-07-19 Thread Richard Henderson
We are certain of a page crossing here, entering the PALcode image, so the call to use_goto_tb that should have been here will never succeed. We are shortly going to add an assert to tcg_gen_goto_tb that would trigger for this case. Signed-off-by: Richard Henderson --- target/alpha/translate.c

[PATCH for-6.1 v4 04/15] accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR

2021-07-19 Thread Richard Henderson
Move the -d nochain check to bits on tb->cflags. These will be used for more than -d nochain shortly. Set bits during curr_cflags, test them in translator_use_goto_tb, assert we're not doing anything odd in tcg_gen_goto_tb. The test in tcg_gen_exit_tb is redundant with the assert for

[PATCH for-6.1 v4 02/15] accel/tcg: Move curr_cflags into cpu-exec.c

2021-07-19 Thread Richard Henderson
We will shortly have more than a simple member read here, with stuff not necessarily exposed to exec/exec-all.h. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Alex Bennée Message-Id: <20210717221851.2124573-3-richard.hender...@linaro.org> --- include/exec/exec-all.h

[PATCH for-6.1 v4 14/15] accel/tcg: Hoist tb_cflags to a local in translator_loop

2021-07-19 Thread Richard Henderson
The access internal to tb_cflags() is atomic. Avoid re-reading it as such for the multiple uses. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/accel/tcg/translator.c

[PATCH for-6.1 v4 05/15] accel/tcg: Drop CF_NO_GOTO_PTR from -d nochain

2021-07-19 Thread Richard Henderson
The purpose of suppressing goto_ptr from -d nochain had been to return to the main loop so that -d cpu would be recognized. But we now include -d cpu logging in helper_lookup_tb_ptr so there is no need to exclude goto_ptr. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id:

[PATCH for-6.1 v4 01/15] accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS

2021-07-19 Thread Richard Henderson
The space reserved for CF_COUNT_MASK was overly large. Reduce to free up cflags bits and eliminate an extra test. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell Message-Id: <20210717221851.2124573-2-richard.hender...@linaro.org> ---

[PATCH for-6.1 v4 11/15] target/i386: Implement debug_check_breakpoint

2021-07-19 Thread Richard Henderson
Return false for RF set, as we do in i386_tr_breakpoint_check. Signed-off-by: Richard Henderson --- target/i386/tcg/tcg-cpu.c | 12 1 file changed, 12 insertions(+) diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index e96ec9bbcc..238e3a9395 100644 ---

[PATCH for-6.1 v4 00/15] tcg: breakpoint reorg

2021-07-19 Thread Richard Henderson
This is fixing #404 ("windows xp boot takes much longer...") and several other similar reports. Changes for v4: * Issue breakpoints directly from cflags_for_breakpoints. Do not generate code for a TB beginning with a BP at all. * Drop the problematic TranslatorOps.breakpoint_check hook

[PATCH for-6.1 v4 09/15] hw/core: Introduce TCGCPUOps.debug_check_breakpoint

2021-07-19 Thread Richard Henderson
New hook to return true when an architectural breakpoint is to be recognized and false when it should be suppressed. First use must wait until other pieces are in place. Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

Re: [PATCH v1 1/2] hw/tricore: fix inclusion of tricore_testboard

2021-07-19 Thread Peter Maydell
On Mon, 19 Jul 2021 at 20:52, Alex Bennée wrote: > > We inadvertently added a symbol clash causing the build not to include > the testboard needed for check-tcg. > > Fixes: f4063f9c31 ("meson: Introduce target-specific Kconfig") > Signed-off-by: Alex Bennée > --- >

Re: [PATCH for-6.2 v6 7/7] memory_hotplug.c: send DEVICE_UNPLUG_ERROR in acpi_memory_hotplug_write()

2021-07-19 Thread Michael S. Tsirkin
On Mon, Jul 19, 2021 at 05:08:27PM -0300, Daniel Henrique Barboza wrote: > MEM_UNPLUG_ERROR is deprecated since the introduction of > DEVICE_UNPLUG_ERROR. Keep emitting both while the deprecation of > MEM_UNPLUG_ERROR is pending. > > CC: Michael S. Tsirkin > CC: Igor Mammedov > Reviewed-by:

[PATCH 1/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid

2021-07-19 Thread Joe Komlodi
The bit to see if a CD is valid is the last bit of the first word of the CD. Signed-off-by: Joe Komlodi --- hw/arm/smmuv3-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h index 3dac576..d1885ae 100644 ---

Re: Question on memory commit during MR finalize()

2021-07-19 Thread John Johnson
> On Jul 19, 2021, at 12:59 PM, Peter Xu wrote: > > > Here vfio_user_send_recv() looks tricky to me - it releases the bql within a > memory update procedure, and IMHO it needs some serious justification on why > it > can do so. For example, what if memory layout changed when waiting for the

[PATCH 0/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid

2021-07-19 Thread Joe Komlodi
Hi all, This fixes an off-by-1 error when checking to see if a context descriptor is valid in SMMUv3. I think it hasn't caused problems yet because Linux will also set the 30th bit, which is the bit CD_VALID currently checks. Thanks! Joe Joe Komlodi (1): hw/arm/smmuv3: Check 31st bit to see

Re: [PATCH v5 08/10] tests: Use QMP to check whether a TPM device model is available

2021-07-19 Thread Stefan Berger
I would need a tag for this one. I will only send the PR after 6.1 is out.    Stefan On 7/13/21 4:15 PM, Stefan Berger wrote: Use QMP to check whether a given TPM device model is available and if it is not the case then do not register the tests that require it. Signed-off-by: Stefan Berger

Re: [PATCH v4 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
On Jul 19 22:07, Klaus Jensen wrote: > From: Klaus Jensen > > The new PMR test unearthed a long-standing issue with MMIO reads on > big-endian hosts. > > Fix this by unconditionally storing all controller registers in little > endian. > > Cc: Gollu Appalanaidu > Reported-by: Peter Maydell >

Re: [PATCH RFC server 01/11] vfio-user: build library

2021-07-19 Thread John Levon
On Mon, Jul 19, 2021 at 04:00:03PM -0400, Jagannathan Raman wrote: > add the libvfio-user library as a submodule. build it as part of QEMU > > diff --git a/meson.build b/meson.build > index 6e4d2d8..f2f9f86 100644 > --- a/meson.build > +++ b/meson.build > @@ -1894,6 +1894,41 @@ if

[PATCH v4 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The new PMR test unearthed a long-standing issue with MMIO reads on big-endian hosts. Fix this by unconditionally storing all controller registers in little endian. Cc: Gollu Appalanaidu Reported-by: Peter Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 290

[PATCH v4 2/5] hw/nvme: use symbolic names for registers

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add the NvmeBarRegs enum and use these instead of explicit register offsets. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Philippe Mathieu-Daudé --- include/block/nvme.h | 29 - hw/nvme/ctrl.c | 44

[PATCH 0/2] hw/core/register: Add more 64-bit utilities

2021-07-19 Thread Joe Komlodi
Hi all, This adds more utilities for 64-bit registers. As part of it, it also fixes FIELD_DP64 to work with bit fields wider than 32-bits. Thanks! Joe Joe Komlodi (2): hw/core/register: Add more 64-bit utilities hw/registerfields: Use 64-bit bitfield for FIELD_DP64 hw/core/register.c

[PATCH for-6.2 v6 7/7] memory_hotplug.c: send DEVICE_UNPLUG_ERROR in acpi_memory_hotplug_write()

2021-07-19 Thread Daniel Henrique Barboza
MEM_UNPLUG_ERROR is deprecated since the introduction of DEVICE_UNPLUG_ERROR. Keep emitting both while the deprecation of MEM_UNPLUG_ERROR is pending. CC: Michael S. Tsirkin CC: Igor Mammedov Reviewed-by: Greg Kurz Signed-off-by: Daniel Henrique Barboza --- hw/acpi/memory_hotplug.c | 10

[PATCH for-6.2 v6 4/7] qapi/qdev.json: fix DEVICE_DELETED parameters doc

2021-07-19 Thread Daniel Henrique Barboza
Clarify that @device is optional and that 'path' is the device path from QOM. This change follows Markus' suggestion verbatim, provided in full context here: https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01891.html Suggested-by: Markus Armbruster Reviewed-by: Greg Kurz

[PATCH for-6.2 v6 3/7] spapr_drc.c: do not error_report() when drc->dev->id == NULL

2021-07-19 Thread Daniel Henrique Barboza
The error_report() call in drc_unisolate_logical() is not considering that drc->dev->id can be NULL, and the underlying functions error_report() calls to do its job (vprintf(), g_strdup_printf() ...) has undefined behavior when trying to handle "%s" with NULL arguments. Besides, there is no

[PATCH v4 3/5] hw/nvme: fix out-of-bounds reads

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Peter noticed that mmio access may read into the NvmeParams member in the NvmeCtrl struct. Fix the bounds check. Reported-by: Peter Maydell Signed-off-by: Klaus Jensen Reviewed-by: Stefan Hajnoczi Reviewed-by: Peter Maydell --- hw/nvme/ctrl.c | 27

[PATCH for-6.2 v6 1/7] hw/acpi/memory_hotplug.c: avoid sending MEM_UNPLUG_ERROR if dev->id is NULL

2021-07-19 Thread Daniel Henrique Barboza
qapi_event_send_mem_unplug_error() deals with @device being NULL by replacing it with an empty string ("") when emitting the event. Aside from the fact that this is a side effect that can be patched someday, there's also the lack of utility that the event brings to listeners, e.g. "a memory

[PATCH for-6.2 v6 0/7] DEVICE_UNPLUG_ERROR QAPI event

2021-07-19 Thread Daniel Henrique Barboza
Hi, This version was rebased with QEMU master @ 7457b407edd6e8555e4b4 and has a few simple changes based on Greg's review. changes from v5: - patch 1: * fixed function name in commit msg -patch 6: * kept error message in a single line - all patches: * added Greg's R-b - v5 link:

[PATCH 1/2] hw/core/register: Add more 64-bit utilities

2021-07-19 Thread Joe Komlodi
We already have some utilities to handle 64-bit wide registers, so this just adds some more for: - Initializing 64-bit registers - Extracting and depositing to an array of 64-bit registers Signed-off-by: Joe Komlodi --- hw/core/register.c | 12 include/hw/register.h

[PATCH v4 0/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Fix mmio read issues on big-endian hosts. The core issue is that values in the BAR is not stored in little endian as required. Fix that and add a regression test for this. This required a bit of cleanup, so it blew up into a series. v4: * "hw/nvme: split pmrmsc register

[PATCH v4 5/5] tests/qtest/nvme-test: add mmio read test

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add a regression test for mmio read on big-endian hosts. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu --- tests/qtest/nvme-test.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/qtest/nvme-test.c b/tests/qtest/nvme-test.c

[PATCH RFC server 04/11] vfio-user: find and init PCI device

2021-07-19 Thread Jagannathan Raman
Find the PCI device with specified id. Initialize the device context with the QEMU PCI device Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/remote/vfio-user-obj.c | 28 1 file changed, 28 insertions(+) diff

[PATCH 2/2] hw/registerfields: Use 64-bit bitfield for FIELD_DP64

2021-07-19 Thread Joe Komlodi
If we have a field that's wider than 32-bits, we need a data type wide enough to be able to create the bitfield used to deposit the value. Signed-off-by: Joe Komlodi --- include/hw/registerfields.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/registerfields.h

[PATCH RFC server 03/11] vfio-user: instantiate vfio-user context

2021-07-19 Thread Jagannathan Raman
create a context with the vfio-user library for a device Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/remote/vfio-user-obj.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/hw/remote/vfio-user-obj.c

[PATCH for-6.2 v6 6/7] spapr: use DEVICE_UNPLUG_ERROR to report unplug errors

2021-07-19 Thread Daniel Henrique Barboza
Linux Kernel 5.12 is now unisolating CPU DRCs in the device_removal error path, signalling that the hotunplug process wasn't successful. This allow us to send a DEVICE_UNPLUG_ERROR in drc_unisolate_logical() to signal this error to the management layer. We also have another error path in

[PATCH RFC server 00/11] vfio-user server in QEMU

2021-07-19 Thread Jagannathan Raman
Hi, This series adds on to the following series from Elena Ufimtseva : [PATCH RFC 00/19] vfio-user implementation QEMU enabled out-of-process device emulation with multi-process [1]. multi-process used a custom protocol to interact between the client and server, which is not desirable. The

[PATCH for-6.2 v6 5/7] qapi/qdev.json: add DEVICE_UNPLUG_ERROR QAPI event

2021-07-19 Thread Daniel Henrique Barboza
At this moment we only provide one event to report a hotunplug error, MEM_UNPLUG_ERROR. As of Linux kernel 5.12 and QEMU 6.0.0, the pseries machine is now able to report unplug errors for other device types, such as CPUs. Instead of creating a (device_type)_UNPLUG_ERROR for each new device,

  1   2   3   4   >