Re: [PATCH] disas/m68k: clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Laurent Vivier writes: > Fix following warnings > > .../disas/m68k.c: In function ‘print_insn_arg’: > .../disas/m68k.c:1635:13: warning: declaration of ‘val’ shadows a previous > local [-Wshadow=compatible-local] > 1635 | int val = fetch_arg (buffer, place, 5, info); > |

Re: [PATCH] hw/nvme: Clean up local variable shadowing in nvme_ns_init()

2023-09-28 Thread Markus Armbruster
Klaus Jensen writes: > From: Klaus Jensen > > Fix local variable shadowing in nvme_ns_init(). > > Reported-by: Markus Armbruster > Signed-off-by: Klaus Jensen Queued, thanks!

Re: [PATCH 0/4] RISC-V: Work towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Daniel Henrique Barboza writes: > CCing Markus since he might want to add these in his shadow-next tree. Queued, thanks!

Re: [PATCH] qemu-nbd: changes towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Eric Blake writes: > Address all compiler complaints from -Wshadow in qemu-nbd. Several > instances of 'int ret' became shadows when commit 4fbec260 added 'ret' > at a higher scope in main. More interesting was the 'void *ret' > capturing the result of a pthread; where we were conceptually doin

Re: [PATCH 0/2] remove some variable shadowing

2023-09-28 Thread Markus Armbruster
Queued, thanks!

Re: [PATCH 2/2] seccomp: avoid shadowing of 'action' variable

2023-09-28 Thread Markus Armbruster
Daniel P. Berrangé writes: > This is confusing as one 'action' variable is used for storing > a SCMP_ enum value, while the other 'action' variable is used > for storing a SECCOMP_ enum value. > > Signed-off-by: Daniel P. Berrangé > --- > softmmu/qemu-seccomp.c | 4 ++-- > 1 file changed, 2 ins

Re: [PATCH] intel_iommu: Fix shadow local variables on "size"

2023-09-28 Thread Markus Armbruster
Peter Xu writes: > This patch fixes the warning of shadowed local variable: > > ../hw/i386/intel_iommu.c: In function ‘vtd_address_space_unmap’: > ../hw/i386/intel_iommu.c:3773:18: warning: declaration of ‘size’ shadows a > previous local [-Wshadow=compatible-local] > 3773 | uint64_t si

Re: [PATCH 0/4] aspeed: Clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Cédric Le Goater writes: > Hello, > > Here are cleanups for local variable shadowing warnings in aspeed models. > > Joel, Andrew, > > Could you please double check patch 4 ? > > Thanks, > > C. Queued, thanks!

[PULL v3 07/16] target/tricore: Implement hptof insn

2023-09-28 Thread Bastian Koppelmann
Reviewed-by: Richard Henderson Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1667 Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-8-kbast...@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 36 +++ target/tricore/helper.h

[PULL v3 05/16] target/tricore: Clarify special case for FTOUZ insn

2023-09-28 Thread Bastian Koppelmann
this is not something other ISAs do, so clarify it with a comment. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-6-kbast...@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 5 + 1 file changed, 5 insertions(+) diff --git a/targe

Re: [PATCH v2 00/22] (few more) Steps towards enabling -Wshadow

2023-09-28 Thread Markus Armbruster
Markus Armbruster writes: > Philippe Mathieu-Daudé writes: > >> Since v1: >> - Addressed review comments >> - Added R-b tags >> - More patches >> >> For rational see Markus cover on >> https://lore.kernel.org/qemu-devel/20230831132546.3525721-1-arm...@redhat.com/ >> >> This series contains few m

[PULL v3 12/16] tests/tcg/tricore: Extended and non-extened regs now match

2023-09-28 Thread Bastian Koppelmann
RSx for d regs and e regs now use the same numbering. This makes sure that mixing d and e registers in an insn test will not overwrite data between registers. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-2-kbast...@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h

[PULL v3 15/16] target/tricore: Remove CSFRs from cpu.h

2023-09-28 Thread Bastian Koppelmann
these are already defined in 'csfr.h.inc'. We don't need to duplicate these registers. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-10-kbast...@mail.uni-paderborn.de> --- target/tricore/cpu.h | 143 +++ 1 file changed, 9 insertions(+

[PULL v3 04/16] target/tricore: Implement FTOU insn

2023-09-28 Thread Bastian Koppelmann
Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-5-kbast...@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 32 +++ target/tricore/helper.h | 1 + target/tricore/translate.c

[PULL v3 16/16] target/tricore: Change effective address (ea) to target_ulong

2023-09-28 Thread Bastian Koppelmann
as this is an effective address and those cannot be signed, it should not be a signed integer. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-11-kbast...@mail.uni-paderborn.de> --- target/tricore/op_helper.c | 16 1 file changed, 8 insertions(+), 8 deletions

[PULL v3 09/16] target/tricore: Swap src and dst reg for RCRR_INSERT

2023-09-28 Thread Bastian Koppelmann
Acked-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-10-kbast...@mail.uni-paderborn.de> --- target/tricore/translate.c | 8 tests/tcg/tricore/asm/macros.h | 9 + tests/tcg/tricore/asm/test_insert.S | 5 + 3 files chan

[PULL v3 02/16] target/tricore: Implement CRCN insn

2023-09-28 Thread Bastian Koppelmann
reported in https://gitlab.com/qemu-project/qemu/-/issues/1667 Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-3-kbast...@mail.uni-paderborn.de> --- target/tricore/helper.h | 1 + target/tricore/op_helper.c|

[PULL v3 03/16] target/tricore: Correctly handle FPU RM from PSW

2023-09-28 Thread Bastian Koppelmann
when we reconstructed PSW using psw_read(), we were trying to clear the cached USB bits out of env->PSW. The mask was wrong and we would clear PSW.RM as well. when we write the PSW using psw_write() we update the rounding modes in env->fp_status for softfloat. The order of bits used by TriCore is

[PULL v3 13/16] hw/tricore: Log failing test in testdevice

2023-09-28 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-3-kbast...@mail.uni-paderborn.de> --- hw/tricore/tricore_testdevice.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevice.c index a1563aa568..9028d970b0 100644 -

[PULL v3 10/16] target/tricore: Replace cpu_*_code with translator_*

2023-09-28 Thread Bastian Koppelmann
Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-11-kbast...@mail.uni-paderborn.de> --- target/tricore/translate.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c

[PULL v3 11/16] target/tricore: Fix FTOUZ being ISA v1.3.1 up

2023-09-28 Thread Bastian Koppelmann
Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-12-kbast...@mail.uni-paderborn.de> --- target/tricore/translate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c i

[PULL v3 06/16] target/tricore: Implement ftohp insn

2023-09-28 Thread Bastian Koppelmann
reported in https://gitlab.com/qemu-project/qemu/-/issues/1667 Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-7-kbast...@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 38 +++ target/tricore/helper.

[PULL v3 14/16] tests/tcg: Reset result register after each test

2023-09-28 Thread Bastian Koppelmann
some insns use the result register implicitly as an input. Thus, we could end up with data from the previous insn spilling over. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-4-kbast...@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h | 3 ++- 1 file changed, 2 ins

[PULL v3 00/16] tricore queue

2023-09-28 Thread Bastian Koppelmann
The following changes since commit 36e9aab3c569d4c9ad780473596e18479838d1aa: migration: Move return path cleanup to main migration thread (2023-09-27 13:58:02 -0400) are available in the Git repository at: https://github.com/bkoppelmann/qemu.git tags/pull-tricore-20230929 for you to fetch

[PULL v3 01/16] tests/tcg/tricore: Bump cpu to tc37x

2023-09-28 Thread Bastian Koppelmann
we don't want to exclude ISA v1.6.2 insns from our tests. Acked-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-Id: <20230828112651.522058-2-kbast...@mail.uni-paderborn.de> --- tests/tcg/tricore/Makefile.softmmu-target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PULL v3 08/16] target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0

2023-09-28 Thread Bastian Koppelmann
we would crash if width was 0 for these insns, as tcg_gen_deposit() is undefined for that case. For TriCore, width = 0 is a mov from the src reg to the dst reg, so we special case this here. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Mes

Re: [PULL v2 00/21] tricore queue

2023-09-28 Thread Bastian Koppelmann
Hi, On Thu, Sep 28, 2023 at 10:26:18AM -0400, Stefan Hajnoczi wrote: > Please take a look at these CI test failures: > https://gitlab.com/qemu-project/qemu/-/jobs/5185201978 > https://gitlab.com/qemu-project/qemu/-/jobs/5185202098 I'll fix the build failure and drop the patches that fail the TriC

Re: [PATCH v2] tests/qtest: Fix npcm7xx_timer-test.c flaky test

2023-09-28 Thread Thomas Huth
On 29/09/2023 02.08, Chris Rauer wrote: npcm7xx_timer-test occasionally fails due to the state of the timers from the previous test iteration. Advancing the clock step after the reset resolves this issue. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1897 Signed-off-by: Chris Rauer ---

Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt()

2023-09-28 Thread Harsh Prateek Bora
On 9/29/23 11:37, Cédric Le Goater wrote: On 9/29/23 07:39, Markus Armbruster wrote: Harsh Prateek Bora writes: On Tue, 19 Sept, 2023, 5:39 pm Cédric Le Goater, wrote: On 9/19/23 10:48, Harsh Prateek Bora wrote: On 9/18/23 20:28, Cédric Le Goater wrote: Rename 'name' variable to avo

Re: [PATCH 0/4] arm: fix some -Wshadow warnings

2023-09-28 Thread Markus Armbruster
Peter Maydell writes: > These patches fix some -Wshadow warnings in arm related code. Queued, thanks!

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-28 Thread Ani Sinha
> On 29-Sep-2023, at 11:43 AM, Markus Armbruster wrote: > > Ani Sinha writes: > >>> On 29-Sep-2023, at 11:17 AM, Markus Armbruster wrote: >>> >>> Ani Sinha writes: >>> Code changes in acpi that addresses all compiler complaints coming from enabling -Wshadow flags. Enablin

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Ani Sinha writes: >> On 29-Sep-2023, at 11:17 AM, Markus Armbruster wrote: >> >> Ani Sinha writes: >> >>> Code changes in acpi that addresses all compiler complaints coming from >>> enabling >>> -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing >>> other local vari

Re: [PATCH 2/8] pnv/psi: Clean up local variable shadowing

2023-09-28 Thread Cédric Le Goater
On 9/29/23 07:30, Markus Armbruster wrote: Cédric Le Goater writes: On 9/19/23 08:57, Harsh Prateek Bora wrote: On 9/18/23 20:28, Cédric Le Goater wrote: to fix :    ../hw/ppc/pnv_psi.c: In function ‘pnv_psi_p9_mmio_write’:    ../hw/ppc/pnv_psi.c:741:24: warning: declaration of ‘addr’ sha

Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt()

2023-09-28 Thread Cédric Le Goater
On 9/29/23 07:39, Markus Armbruster wrote: Harsh Prateek Bora writes: On Tue, 19 Sept, 2023, 5:39 pm Cédric Le Goater, wrote: On 9/19/23 10:48, Harsh Prateek Bora wrote: On 9/18/23 20:28, Cédric Le Goater wrote: Rename 'name' variable to avoid this warning : ../hw/ppc/spapr_drc.c:

Re: [PATCH v3 0/7] Steps towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Markus Armbruster writes: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: PATCH 1. > > Enabling -Wshadow would prevent bugs like this one. But we'd have to > clean up all the offenders fir

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-28 Thread Ani Sinha
> On 29-Sep-2023, at 11:17 AM, Markus Armbruster wrote: > > Ani Sinha writes: > >> Code changes in acpi that addresses all compiler complaints coming from >> enabling >> -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing >> other local variables or parameters. Thes

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Ani Sinha writes: > Code changes in acpi that addresses all compiler complaints coming from > enabling > -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing > other local variables or parameters. These makes the code confusing and/or > adds > bugs that are difficult to

Re: [PATCH 6/8] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector()

2023-09-28 Thread Harsh Prateek Bora
On 9/29/23 11:04, Markus Armbruster wrote: Harsh Prateek Bora writes: On Tue, 19 Sept, 2023, 5:33 pm Cédric Le Goater, wrote: On 9/19/23 10:29, Harsh Prateek Bora wrote: On 9/18/23 20:28, Cédric Le Goater wrote: Remove extra 'drc_index' variable to avoid this warning : ../hw/ppc

Re: [PATCH] test-throttle: don't shadow 'index' variable in do_test_accounting()

2023-09-28 Thread Markus Armbruster
Alberto Garcia writes: > Fixes build with -Wshadow=local > > Signed-off-by: Alberto Garcia > --- > tests/unit/test-throttle.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c > index cb587e33e7..ac35d65d19 100644 >

Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt()

2023-09-28 Thread Markus Armbruster
Harsh Prateek Bora writes: > On Tue, 19 Sept, 2023, 5:39 pm Cédric Le Goater, wrote: > >> On 9/19/23 10:48, Harsh Prateek Bora wrote: >> > >> > >> > On 9/18/23 20:28, Cédric Le Goater wrote: >> >> Rename 'name' variable to avoid this warning : >> >> >> >>../hw/ppc/spapr_drc.c: In function ‘p

Re: [PATCH 6/8] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector()

2023-09-28 Thread Markus Armbruster
Harsh Prateek Bora writes: > On Tue, 19 Sept, 2023, 5:33 pm Cédric Le Goater, wrote: > >> On 9/19/23 10:29, Harsh Prateek Bora wrote: >> > >> > >> > On 9/18/23 20:28, Cédric Le Goater wrote: >> >> Remove extra 'drc_index' variable to avoid this warning : >> >> >> >>../hw/ppc/spapr_drc.c: In

Re: [PATCH 0/2] riscv: add extension properties for all cpus

2023-09-28 Thread Alistair Francis
On Wed, Sep 27, 2023 at 4:32 AM Daniel Henrique Barboza wrote: > > Hi, > > At this moment we do not expose extension properties for vendor CPUs > because that would allow users to enable extensions in them. But that > comes at a cost: if we were to add an API that shows all CPU properties, > e.g.

Re: [PATCH 2/8] pnv/psi: Clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Cédric Le Goater writes: > On 9/19/23 08:57, Harsh Prateek Bora wrote: >> On 9/18/23 20:28, Cédric Le Goater wrote: >>> to fix : >>> >>>    ../hw/ppc/pnv_psi.c: In function ‘pnv_psi_p9_mmio_write’: >>>    ../hw/ppc/pnv_psi.c:741:24: warning: declaration of ‘addr’ shadows a >>> parameter [-Wshado

Re: [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more]

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Just missed while posting v2 eh :/ > (https://lore.kernel.org/qemu-devel/20230904161235.84651-1-phi...@linaro.org/) PATCH 3 has become commit 82fdcd3e140c8d4c63f177ece554f90f2bccdf68. Remainder queued. Thanks!

Re: [PATCH 2/2] target/riscv/tcg-cpu.c: add extension properties for all cpus

2023-09-28 Thread Alistair Francis
On Wed, Sep 27, 2023 at 4:32 AM Daniel Henrique Barboza wrote: > > At this moment we do not expose extension properties for vendor CPUs > because that would allow users to change them via command line. The > drawback is that if we were to add an API that shows all CPU properties, > e.g. qmp-query-

Re: [PATCH v2 00/22] (few more) Steps towards enabling -Wshadow

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Since v1: > - Addressed review comments > - Added R-b tags > - More patches > > For rational see Markus cover on > https://lore.kernel.org/qemu-devel/20230831132546.3525721-1-arm...@redhat.com/ > > This series contains few more, my take. > > Based-on: <20230831132

Re: [PATCH v2 1/6] target/riscv/kvm/kvm-cpu.c: add missing property getters()

2023-09-28 Thread Alistair Francis
On Wed, Sep 27, 2023 at 6:10 AM Daniel Henrique Barboza wrote: > > We got along without property getters in the KVM driver because we never > needed them. But the incoming query-cpu-model-expansion API will use > property getters and setters to retrieve the CPU characteristics. > > Add the missing

Re: [PATCH v2 11/22] hw/ide/ahci: Clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > hw/ide/ahci.c:1577:23: error: declaration shadows a local variable > [-Werror,-Wshadow] > IDEState *s = &ad->port.ifs[j]; > ^ > hw/ide/ahci.c:1569:29: note: previous declaration is here > void ahci_uninit(AHCIState *s) >

Re: [PATCH v2 20/22] sysemu/device_tree: Clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Fix: > > hw/mips/boston.c:472:5: error: declaration shadows a local variable > [-Werror,-Wshadow] > qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size); > ^ > include/sysemu/device_tree.h:129:13: note: expanded from macro > 'qemu_fdt_setprop

Re: [PATCH RFC V2 35/37] hw/arm: Support hotplug capability check using _OSC method

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:36, Salil Mehta wrote: Physical CPU hotplug results in (un)setting of ACPI _STA.Present bit. AARCH64 platforms do not support physical CPU hotplug. Virtual CPU hotplug support being implemented toggles ACPI _STA.Enabled Bit to achieve hotplug functionality. This is not sa

Re: [PATCH RFC V2 34/37] target/arm/kvm,tcg: Register/Handle SMCCC hypercall exits to VMM/Qemu

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:36, Salil Mehta wrote: From: Author Salil Mehta Add registration and Handling of HVC/SMC hypercall exits to VMM Co-developed-by: Salil Mehta Signed-off-by: Salil Mehta Co-developed-by: Jean-Philippe Brucker Signed-off-by: Jean-Philippe Brucker Signed-off-by: Salil

Re: [PATCH v2 00/33] linux-user: Improve host and guest page size handling

2023-09-28 Thread Richard Henderson
Ping. r~ On 8/31/23 19:22, Richard Henderson wrote: Based-on: 20230829220228.928506-1-richard.hender...@linaro.org ("[PATCH v5 00/20] linux-user: Implement VDSOs") Changes for v2: * Minor adjustments to bsd-user. * Update docs for deprecation. * Philippe's r-b. Blurb from v1: While

Re: [PATCH 2/8] target/sparc: Fix VIS fmul8x16au instruction.

2023-09-28 Thread Richard Henderson
On 9/28/23 17:41, Nick Bowler wrote: On 2023-09-28, Richard Henderson wrote: Belated follow-up suggestion: - if ((tmp & 0xff) > 0x7f) { - tmp += 0x100; - } + tmp += 0x80; 7 occurrences throughout vis_helper.c. I agree with making this particular change but I think since it doesn

Re: [PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-09-28 Thread Raphael Norwitz
One comment on the logging stuff in vhost-scsi. As far as I can tell the logging in vhost-user-scsi looks good. Markus - does this look better to you? Otherwise do you think we should also fix up the vhost-user-blk realize function? > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > If the bac

Re: [PATCH v6 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > Let's keep the same behavior as vhost-user-blk. > > Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. > Reviewed-by: Raphael Norwitz > Signed-off-by: Li Feng > --- > hw/scsi/vhost-user-scsi.c | 48 ++

Re: [PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not be retriggered forever. > > The reason is: > When the vhost-user fails

Re: [PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not be retriggered forever. > > The reason is: > When the vhost-user fails

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > Currently the get_inflight_fd will be sent every time the device is started, > and > the backend will allocate shared memory to save the inflight state. If the > backend finds that it receives the second get_inflight_fd, it will release the > p

Re: [PATCH 2/8] target/sparc: Fix VIS fmul8x16au instruction.

2023-09-28 Thread Nick Bowler
On 2023-09-28, Richard Henderson wrote: > Belated follow-up suggestion: > > - if ((tmp & 0xff) > 0x7f) { > - tmp += 0x100; > - } > + tmp += 0x80; > > 7 occurrences throughout vis_helper.c. I agree with making this particular change but I think since it doesn't fix a bug, it should go

Re: [PATCH 6/8] target/sparc: Fix VIS fpmerge input registers.

2023-09-28 Thread Nick Bowler
On 2023-09-28, Richard Henderson wrote: > On 9/24/23 01:03, Nick Bowler wrote: >> case 0x04b: /* VIS I fpmerge */ >> CHECK_FPU_FEATURE(dc, VIS1); >> -gen_ne_fop_DDD(dc, rd, rs1, rs2, >> gen_helper_fpmerge); >> +cpu_src

Re: [PATCH 8/8] target/sparc: Fix VIS subtraction instructions.

2023-09-28 Thread Nick Bowler
On 2023-09-28, Richard Henderson wrote: > On 9/24/23 01:03, Nick Bowler wrote: >> All of the VIS subtraction instructions are documented to subtract the >> second input operand from the first. This is also consistent with how >> the instructions actually work on a real UltraSparc II. >> >> But th

Re: [PATCH RFC V2 29/37] arm/virt: Update the guest(via GED) about CPU hot-(un)plug events

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: During any vCPU hot-(un)plug, running guest VM needs to be intimated about the new vCPU being added or request the deletion of the vCPU which is already part of the guest VM. This is done using the ACPI GED event which eventually gets demultiplexed

Re: [PATCH RFC V2 25/37] arm/virt: Add/update basic hot-(un)plug framework

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: Add CPU hot-unplug hooks and update hotplug hooks with additional sanity checks for use in hotplug paths. Note, Functional contents of the hooks(now left with TODO comment) shall be gradually filled in the subsequent patches in an incremental appro

[PATCH v2] tests/qtest: Fix npcm7xx_timer-test.c flaky test

2023-09-28 Thread Chris Rauer
npcm7xx_timer-test occasionally fails due to the state of the timers from the previous test iteration. Advancing the clock step after the reset resolves this issue. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1897 Signed-off-by: Chris Rauer --- tests/qtest/npcm7xx_timer-test.c | 1 + 1

Re: [PATCH] tests/qtest: Fix npcm7xx_timer-test.c flaky test

2023-09-28 Thread Chris Rauer
Ack. will send out v2. On Wed, Sep 27, 2023 at 9:44 PM Thomas Huth wrote: > On 28/09/2023 05.45, Chris Rauer wrote: > > Could you please add a proper patch description how this is fixing the > issue? > > Thanks, >Thomas > > > > Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1897 > >

Re: [PATCH RFC V2 23/37] arm/virt: Release objects for *disabled* possible vCPUs after init

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: During machvirt_init(), QOM ARMCPU objects are also pre-created along with the corresponding KVM vCPUs in the host for all possible vCPUs. This necessary because of the architectural constraint, KVM restricts the deferred creation of the KVM vCPUs a

Re: [PATCH RFC V2 22/37] hw/acpi: Make _MAT method optional

2023-09-28 Thread Gavin Shan
On 9/26/23 20:04, Salil Mehta wrote: From: Jean-Philippe Brucker The GICC interface on arm64 vCPUs is statically defined in the MADT, and doesn't require a _MAT entry. Although the GICC is indicated as present by the MADT entry, it can only be used from vCPU sysregs, which aren't accessible unt

Re: [PATCH RFC V2 21/37] hw/arm: MADT Tbl change to size the guest with possible vCPUs

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: Changes required during building of MADT Table by QEMU to accomodate disabled possible vCPUs. This info shall be used by the guest kernel to size up its resources during boot time. This pre-sizing of the guest kernel done on possible vCPUs will faci

Re: [PATCH RFC V2 20/37] hw/acpi: Update GED _EVT method AML with cpu scan

2023-09-28 Thread Gavin Shan
On 9/26/23 20:04, Salil Mehta wrote: OSPM evaluates _EVT method to map the event. The cpu hotplug event eventually results in start of the cpu scan. Scan figures out the cpu and the kind of event(plug/unplug) and notifies it back to the guest. The change in this patch updates the GED AML _EVT me

Re: [PATCH RFC V2 19/37] hw/acpi: ACPI/AML Changes to reflect the correct _STA.{PRES,ENA} Bits to Guest

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ACPI AML changes to properly reflect the _STA.PRES and _STA.ENA Bits to the guest during initialzation, when CPUs are hotplugged and after CPUs are hot-unplugged. Signed-off-by: Salil Mehta --- hw/acpi/cpu.c | 49 +++

Re: [PATCH RFC V2 18/37] arm/virt: Make ARM vCPU *present* status ACPI *persistent*

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ARM arch does not allow CPUs presence to be changed [1] after kernel has booted. Hence, firmware/ACPI/Qemu must ensure persistent view of the vCPUs to the Guest kernel even when they are not present in the QoM i.e. are unplugged or are yet-to-be-plu

Re: [PATCH 0/4] tcg: Optimize loads and stores to env

2023-09-28 Thread Richard Henderson
Ping. r~ On 8/30/23 22:57, Richard Henderson wrote: This is aimed at improving gvec generated code, which involves large numbers of loads and stores to the env slots of the guest cpu vector registers. The final patch helps eliminate redundant zero-extensions that can appear with e.g. avx2 and

Re: [PATCH 8/8] target/sparc: Fix VIS subtraction instructions.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: All of the VIS subtraction instructions are documented to subtract the second input operand from the first. This is also consistent with how the instructions actually work on a real UltraSparc II. But the emulator is implementing the subtraction in the wrong

Re: [PATCH 7/8] target/sparc: Fix VIS fexpand input register.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: This instruction is documented to get its input from the second single-precision input operand; the first operand is ignored. This is exactly what a real UltraSparc II does. Meanwhile, the the emulator uses only the irrelevant first operand, treating it as a

Re: [PATCH 6/8] target/sparc: Fix VIS fpmerge input registers.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: case 0x04b: /* VIS I fpmerge */ CHECK_FPU_FEATURE(dc, VIS1); -gen_ne_fop_DDD(dc, rd, rs1, rs2, gen_helper_fpmerge); +cpu_src1_32 = gen_load_fpr_F(dc, rs1); +cpu

Re: [PATCH 5/8] target/sparc: Fix VIS fmuld8ulx16 instruction.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: On a real UltraSparc II, the fmuld8ulx16 instruction takes two single- precision input operands and returns a double-precision result. However, the emulation is taking two double-precision input operands, which are unlikely to contain the correct values, so t

Re: [PATCH 4/8] target/sparc: Fix VIS fmuld8sux16 instruction.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: On a real UltraSparc II, the fmuld8sux16 instruction takes two single- precision input operands and returns a double-precision result. However, the emulation is taking two double-precision input operands, which are unlikely to contain the correct values. Eve

Re: [PATCH 3/8] target/sparc: Fix VIS fmul8x16al instruction.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: On a real UltraSparc II, the fmul8x16al instruction takes two single- precision input operands and returns a double-precision result. For the second operand, bits 15:0 are used, and bits 31:16 are ignored. However, the emulation is taking two double-precisio

Re: [PATCH 2/8] target/sparc: Fix VIS fmul8x16au instruction.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: On a real UltraSparc II, the fmul8x16au instruction takes two single- precision input operands and returns a double-precision result. For the second operand, bits 31:16 are used, and bits 15:0 are ignored. However, the emulation is taking two double-precisio

Re: [PATCH 1/8] target/sparc: Fix VIS fmul8x16 input register.

2023-09-28 Thread Richard Henderson
On 9/24/23 01:03, Nick Bowler wrote: On a real UltraSparc II CPU, the fmul8x16 instruction reads its first input from any of the single-precision floating point registers. But the emulator is reading the input as if the first operand encodes a double-precision register, which in most cases will

Re: [PATCH v7 01/12] nbd/server: Support a request payload

2023-09-28 Thread Vladimir Sementsov-Ogievskiy
On 28.09.23 17:33, Eric Blake wrote: On Thu, Sep 28, 2023 at 12:09:51PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 27.09.23 18:59, Eric Blake wrote: We could also try to be a bit more complicated by peeking at the next few bytes: if they look like a magic number of the next request, assume t

Re: [PATCH] target/arm: Permit T32 LDM with single register

2023-09-28 Thread Richard Henderson
On 9/27/23 06:18, Peter Maydell wrote: For the Thumb T32 encoding of LDM, if only a single register is specified in the register list this instruction is UNPREDICTABLE, with the following choices: * instruction UNDEFs * instruction is a NOP * instruction loads a single register * instruct

Re: [PATCH v2 12/20] swim: split into separate IWM and ISM register blocks

2023-09-28 Thread Mark Cave-Ayland
On 26/09/2023 09:09, Laurent Vivier wrote: Le 09/09/2023 à 11:48, Mark Cave-Ayland a écrit : The swim chip provides an implementation of both Apple's IWM and ISM floppy disk controllers. Split the existing implementation into separate register banks for each controller, whilst also switching the

Re: [PATCH v2 15/20] mac_via: workaround NetBSD ADB bus enumeration issue

2023-09-28 Thread Mark Cave-Ayland
On 26/09/2023 09:04, Laurent Vivier wrote: Le 09/09/2023 à 11:48, Mark Cave-Ayland a écrit : NetBSD assumes it can send its first ADB command after sending the ADB_BUSRESET command in ADB_STATE_NEW without changing the state back to ADB_STATE_IDLE first as detailed in the ADB protocol. Add a w

Re: [PATCH v2 08/20] asc: generate silence if FIFO empty but engine still running

2023-09-28 Thread Mark Cave-Ayland
On 25/09/2023 18:19, Laurent Vivier wrote: Le 09/09/2023 à 11:48, Mark Cave-Ayland a écrit : MacOS (un)helpfully leaves the FIFO engine running even when all the samples have been written to the hardware, and expects the FIFO status flags and IRQ to be updated continuously. There is an additi

Re: [PATCH] target/arm/arm-powerctl: Correctly init CPUs when powered on to lower EL

2023-09-28 Thread Richard Henderson
On 9/26/23 11:56, Peter Maydell wrote: Resolves:https://gitlab.com/qemu-project/qemu/-/issues/1899 Signed-off-by: Peter Maydell --- target/arm/cpu.h | 22 + hw/arm/boot.c | 95 ++- target/arm/arm-powerctl.c | 53 +---

Re: [PATCH 0/8] SPARC VIS fixes

2023-09-28 Thread Mark Cave-Ayland
On 25/09/2023 06:03, Nick Bowler wrote: I noticed that the fmul8x16 instruction did not appear to be emulated correctly[1]. It would seem that emulation was not using a single- precision input register like the real hardware does, but rather a double-precision register, causing it to operate on

[PATCH v2] mips: fix abort on integer overflow

2023-09-28 Thread Mikulas Patocka
On Thu, 28 Sep 2023, Richard Henderson wrote: > Just call force_sig_fault directly. > > > r~ OK. Here I'm resending it. Mikulas From: Mikulas Patocka Qemu mips userspace emulation crashes with "qemu: unhandled CPU exception 0x15 - aborting" when one of the integer arithmetic instructi

Re: [PATCH] target/arm/common-semi-target.h: Remove unnecessary boot.h include

2023-09-28 Thread Richard Henderson
On 9/25/23 07:22, Peter Maydell wrote: The hw/arm/boot.h include in common-semi-target.h is not actually needed, and it's a bit odd because it pulls a hw/arm header into a target/arm file. This include was originally needed because the semihosting code used the arm_boot_info struct to get the ba

[PULL 1/6] accel/tcg: Avoid load of icount_decr if unused

2023-09-28 Thread Richard Henderson
With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used. Avoid emitting it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/tr

[PULL 2/6] accel/tcg: Hoist CF_MEMI_ONLY check outside translation loop

2023-09-28 Thread Richard Henderson
The condition checked is loop invariant; check it only once. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index a

[PULL 4/6] accel/tcg: Improve setting of can_do_io at start of TB

2023-09-28 Thread Richard Henderson
Initialize can_do_io to true if this the TB has CF_LAST_IO and will consist of a single instruction. This avoids a set to 0 followed immediately by a set to 1. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 4 ++-- 1 file changed, 2 insertions

[PULL 3/6] accel/tcg: Track current value of can_do_io in the TB

2023-09-28 Thread Richard Henderson
Simplify translator_io_start by recording the current known value of can_do_io within DisasContextBase. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h | 2 ++ accel/tcg/translator.c| 31 ++- 2 files changed, 16

[PULL 0/6] tcg patch queue

2023-09-28 Thread Richard Henderson
/rth7680/qemu.git tags/pull-tcg-20230928 for you to fetch changes up to 18a536f1f8d6222e562f59179e837fdfd8b92718: accel/tcg: Always require can_do_io (2023-09-28 10:08:13 -0700) accel/tcg: Always require can_do_io, for #1866

[PULL 6/6] accel/tcg: Always require can_do_io

2023-09-28 Thread Richard Henderson
Require i/o as the last insn of a TranslationBlock always, not only with icount. This is required for i/o that alters the address space, such as a pci config space write. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1866 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Hende

[PULL 5/6] accel/tcg: Always set CF_LAST_IO with CF_NOIRQ

2023-09-28 Thread Richard Henderson
Without this we can get see loops through cpu_io_recompile, in which the cpu makes no progress. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/a

Re: [PATCH] mips: fix abort on integer overflow

2023-09-28 Thread Richard Henderson
On 9/24/23 07:16, Mikulas Patocka wrote: Qemu mips userspace emulation crashes with "qemu: unhandled CPU exception 0x15 - aborting" when one of the integer arithmetic instructions detects an overflow. This patch fixes it so that it delivers SIGFPE with FPE_INTOVF instead. Signed-off-by: Mikulas

Re: [PATCH] target/arm: Implement FEAT_HPMN0

2023-09-28 Thread Richard Henderson
On 9/21/23 14:54, Peter Maydell wrote: FEAT_HPMN0 is a small feature which defines that it is valid for MDCR_EL2.HPMN to be set to 0, meaning "no PMU event counters provided to an EL1 guest" (previously this setting was reserved). QEMU's implementation almost gets HPMN == 0 right, but we need to

Re: [PATCH v4 3/4] qcow2: add zoned emulation capability

2023-09-28 Thread Eric Blake
On Mon, Sep 18, 2023 at 05:53:12PM +0800, Sam Li wrote: > By adding zone operations and zoned metadata, the zoned emulation > capability enables full emulation support of zoned device using > a qcow2 file. The zoned device metadata includes zone type, > zoned device state and write pointer of each

Re: [PATCH 05/19] hw/pci-bridge/cxl_upstream: Move defintion of device to header.

2023-09-28 Thread Fan Ni
On Mon, Sep 25, 2023 at 05:11:10PM +0100, Jonathan Cameron wrote: > To avoid repetition of switch upstream port specific data in the > CXLDeviceState structure it will be necessary to access the switch USP > specific data from mailbox callbacks. Hence move it to cxl_device.h so it > is no longer an

  1   2   3   >