Re: [PATCH v2 2/6] migration: Updated QAPI format for 'migrate' qemu monitor command

2023-02-10 Thread Het Gala
On 09/02/23 6:52 pm, Daniel P. Berrangé wrote: On Thu, Feb 09, 2023 at 06:41:41PM +0530, Het Gala wrote: On 09/02/23 3:59 pm, Daniel P. Berrangé wrote: On Wed, Feb 08, 2023 at 09:35:56AM +, Het Gala wrote: Existing 'migrate' QAPI design enforces transport mechanism, ip address of destina

Re: Expose support for HyperV features via QMP

2023-02-10 Thread manish.mishra
On 09/02/23 7:47 pm, Vitaly Kuznetsov wrote: Alex Bennée writes: "manish.mishra" writes: Hi Everyone, Checking if there is any feedback on this. I've expanded the CC list to some relevant maintainers and people who have touched that code in case this was missed. Thanks Manish Mishra

Re: [PATCH] hw/misc/sga: Remove the deprecated "sga" device

2023-02-10 Thread Gerd Hoffmann
On Thu, Feb 09, 2023 at 05:15:40PM +0100, Thomas Huth wrote: > It's been deprecated since QEMU v6.2, so it should be OK to > finally remove this now. > > Signed-off-by: Thomas Huth Acked-by: Gerd Hoffmann

Re: [PATCH V2 0/4] string list functions

2023-02-10 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Feb 07, 2023 at 10:48:43AM -0800, Steve Sistare wrote: >> Add some handy string list functions, for general use now, and for >> eventual use in the cpr/live update patches. >> >> Steve Sistare (4): >> qapi: strList_from_string >> qapi: QAPI_LIST_LENGTH >>

Re: [PATCH v3 2/6] migration: Updated QAPI format for 'migrate' qemu monitor command

2023-02-10 Thread Markus Armbruster
Just a quick one on naming before I forget: Het Gala writes: > Existing 'migrate' QAPI design enforces transport mechanism, ip address > of destination interface and corresponding port number in the form > of a unified string 'uri' parameter for initiating a migration stream. > This scheme has a

Re: [PATCH V2 1/4] qapi: strList_from_string

2023-02-10 Thread Markus Armbruster
Steven Sistare writes: > On 2/9/2023 1:59 PM, Markus Armbruster wrote: >> Steven Sistare writes: >>> On 2/9/2023 11:46 AM, Markus Armbruster wrote: Steven Sistare writes: [...] > For more context, this patch has been part of my larger series for live > update, > and I am sub

VM crashed while hot-plugging memory

2023-02-10 Thread Yangming via
Hello all: I found VM crashed while hot-plugging memory. Base infomation: qemu version: qemu-master requirements: hugepages, virtio-gpu It happens by the following steps: 1. Booting a VM with hugepages and a virtio-gpu device. 2. Connecting VNC of the VM. 3. After the VM booted, hot-plugging 512

Re: [PULL 01/30] migration: Fix migration crash when target psize larger than host

2023-02-10 Thread Michael Tokarev
07.02.2023 03:56, Juan Quintela wrote: From: Peter Xu Commit d9e474ea56 overlooked the case where the target psize is even larger than the host psize. One example is Alpha has 8K page size and migration will start to crash the source QEMU when running Alpha migration on x86. Fix it by detecti

Re: [PATCH v2 0/7] Python: Drop support for Python 3.6

2023-02-10 Thread Markus Armbruster
First, a plea. Supporting 3.6 has made a few of us prisoners dragging ball and chain. So, please, *please* let us cut of these leg irons! The series does not include follow-up cleanups. Fine with me.

Re: [PATCH v3 15/15] qapi: introduce query-hotplug command

2023-02-10 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Add a command that returns same information like HOTPLUG_STATE event. > > Signed-off-by: Vladimir Sementsov-Ogievskiy Events and queries commonly come paired: management applications want the event so they don't have to poll, and they want the query so the

Re: [PULL 09/11] target/i386: Fix BEXTR instruction

2023-02-10 Thread Michael Tokarev
08.02.2023 20:19, Paolo Bonzini wrote: From: Richard Henderson There were two problems here: not limiting the input to operand bits, and not correctly handling large extraction length. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1372 Signed-off-by: Richard Henderson Message-Id: <2

Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event

2023-02-10 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > For PCIe and SHPC hotplug it's important to track led indicators, > especially the power led. Add an event that helps. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > qapi/qdev.json | 62 > include

Re: [PATCH 6/7] CI: Stop building docs on centos8

2023-02-10 Thread Paolo Bonzini
On 2/10/23 00:32, John Snow wrote: It's possible to teach lcitool to use pip instead to install docutils, sphinx and sphinx-rtd-theme I will say that once upon a time, Peter Maydell expressed a preference to use the version(s) of sphinx managed by the distro instead of swallowing it into the py

Re: [PATCH v2 2/6] migration: Updated QAPI format for 'migrate' qemu monitor command

2023-02-10 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Feb 09, 2023 at 10:23:43AM +, Daniel P. Berrangé wrote: [...] >> I don't know the backstory on this limitation. Is it something that >> is very difficult to resolve ? I think it is highly desirable to have >> 'socket': 'SocketAddress' here. It would be a

Re: [PATCH 5/7] testing: Add Python >= 3.7 to Centos, OpenSuSE

2023-02-10 Thread Daniel P . Berrangé
On Thu, Feb 09, 2023 at 10:40:32AM -0500, John Snow wrote: > This is just a proof-of-concept patch, as these files are lcitool > generated. The real fix will involve updating the lcitool configuration > and updating these files that way. Paolo has been working on this https://lists.gnu.org/arch

Re: [PATCH v2 6/7] CI: Stop building docs on centos8

2023-02-10 Thread Peter Maydell
On Fri, 10 Feb 2023 at 00:31, John Snow wrote: > > CentOS 8 does not ship with a sphinx new enough for our purposes (It > necessarily uses Python 3.6), so drop this from this build. We can > resume building docs on CentOS 9 if we wish, but we also currently test > and build docs on Fedora, Ubuntu,

Re: [PATCH v2 3/7] configure: Look for auxiliary Python installations

2023-02-10 Thread Paolo Bonzini
On 2/10/23 01:31, John Snow wrote: At the moment, we look for just "python3" and "python", which is good enough almost all of the time. But ... if you are on a platform that uses an older Python by default and only offers a newer Python as an option, you'll have to specify --python=/usr/bin/foo e

Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event

2023-02-10 Thread Vladimir Sementsov-Ogievskiy
On 10.02.23 00:28, Philippe Mathieu-Daudé wrote: On 9/2/23 21:08, Vladimir Sementsov-Ogievskiy wrote: For PCIe and SHPC hotplug it's important to track led indicators, especially the power led. Add an event that helps. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   qapi/qdev.json   | 62

Re: [PULL 0/6] Block patches

2023-02-10 Thread Peter Maydell
On Thu, 9 Feb 2023 at 15:25, Stefan Hajnoczi wrote: > > The following changes since commit 417296c8d8588f782018d01a317f88957e9786d6: > > tests/qtest/netdev-socket: Raise connection timeout to 60 seconds > (2023-02-09 11:23:53 +) > > are available in the Git repository at: > > https://gitl

[PATCH] include/hw/i386: Clean up includes in x86.h

2023-02-10 Thread Thomas Huth
nmi.h and notify.h are not needed here. Signed-off-by: Thomas Huth --- include/hw/i386/x86.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 62fa5774f8..b5dd3979a0 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -18,11 +1

[RFC PATCH] Do not include "qemu/error-report.h" in headers that do not need it

2023-02-10 Thread Thomas Huth
Include it in the .c files instead that use the error reporting functions. Signed-off-by: Thomas Huth --- RFC since it's more lines of code - but I think it's still cleaner this way. include/hw/arm/allwinner-a10.h | 1 - include/qemu/vhost-user-server.h | 1 - include/ui/console.h

Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event

2023-02-10 Thread Philippe Mathieu-Daudé
On 10/2/23 11:47, Vladimir Sementsov-Ogievskiy wrote: On 10.02.23 00:28, Philippe Mathieu-Daudé wrote: On 9/2/23 21:08, Vladimir Sementsov-Ogievskiy wrote: For PCIe and SHPC hotplug it's important to track led indicators, especially the power led. Add an event that helps. Signed-off-by: Vladim

[PATCH] include/hw: Do not include "hw/registerfields.h" in headers that don't need it

2023-02-10 Thread Thomas Huth
Include "hw/registerfields.h" in the .c files instead (if needed). Signed-off-by: Thomas Huth --- include/hw/arm/smmuv3.h| 1 - include/hw/char/ibex_uart.h| 1 - include/hw/ssi/ibex_spi_host.h | 1 - hw/char/ibex_uart.c| 1 + hw/ssi/ibex_spi_host.c | 1 + 5 files

[PATCH] include/hw: Do not include hw.h from headers

2023-02-10 Thread Thomas Huth
This include is not needed here, so drop that line. Signed-off-by: Thomas Huth --- include/hw/ssi/ibex_spi_host.h | 1 - include/hw/tricore/tricore_testdevice.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/hw/ssi/ibex_spi_host.h b/include/hw/ssi/ibex_spi_host.h index 808

Re: [PATCH RFC 6/7] Revert "x86: return modified setup_data only if read as memory, not as file"

2023-02-10 Thread Daniel P . Berrangé
On Thu, Feb 09, 2023 at 04:52:32PM +0100, Jason A. Donenfeld wrote: > On Wed, Feb 08, 2023 at 04:12:51PM -0500, Michael S. Tsirkin wrote: > > This reverts commit e935b735085dfa61d8e6d276b6f9e7687796a3c7. > > > > Fixes: e935b73508 ("x86: return modified setup_data only if read as memory, > > not a

Re: [PATCH RFC 0/7] revert RNG seed mess

2023-02-10 Thread Daniel P . Berrangé
On Wed, Feb 08, 2023 at 04:12:23PM -0500, Michael S. Tsirkin wrote: > All attempts to fix up passing RNG seed via setup_data entry failed. > Let's just rip out all of it. We'll start over. > > > Warning: all I did was git revert the relevant patches and resolve the > (trivial) conflicts. Not eve

Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event

2023-02-10 Thread Vladimir Sementsov-Ogievskiy
On 10.02.23 13:23, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: For PCIe and SHPC hotplug it's important to track led indicators, especially the power led. Add an event that helps. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/qdev.json | 62 ++

Re: [PATCH 12/22] target/arm: NSTable is RES0 for the RME EL3 regime

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:01, Richard Henderson wrote: > > Test in_space instead of in_secure so that we don't switch > out of Root space. Handle the output space change immediately, > rather than try and combine the NSTable and NS bits later. > > Signed-off-by: Richard Henderson > --- > target

Re: [PATCH 13/22] target/arm: Handle Block and Page bits for security space

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:06, Richard Henderson wrote: > > With Realm security state, bit 55 of a block or page descriptor during > the stage2 walk becomes the NS bit; during the stage1 walk the bit 5 > NS bit is RES0. With Root security state, bit 11 of the block or page > descriptor during the

Re: [PATCH 14/22] target/arm: Handle no-execute for Realm and Root regimes

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:02, Richard Henderson wrote: > > While Root and Realm may read and write data from other spaces, > neither may execute from other pa spaces. > > This happens for Stage1 EL3, EL2, EL2&0, but stage2 EL1&0. > > Signed-off-by: Richard Henderson > --- > target/arm/ptw.c | 66

Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event

2023-02-10 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > On 10.02.23 13:23, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> For PCIe and SHPC hotplug it's important to track led indicators, >>> especially the power led. Add an event that helps. >>> >>> Signed-off-by: Vladimir Sementsov-Og

Re: [PULL 01/30] migration: Fix migration crash when target psize larger than host

2023-02-10 Thread Juan Quintela
Michael Tokarev wrote: > 07.02.2023 03:56, Juan Quintela wrote: >> From: Peter Xu >> Commit d9e474ea56 overlooked the case where the target psize is even >> larger >> than the host psize. One example is Alpha has 8K page size and migration >> will start to crash the source QEMU when running Alph

Re: [PATCH v3 3/7] qapi/expr: Split check_expr out from check_exprs

2023-02-10 Thread Markus Armbruster
John Snow writes: > Primarily, this reduces a nesting level of a particularly long > block. It's mostly code movement, but a new docstring is created. > > It also has the effect of creating a fairly convenient "catch point" in > check_exprs for exception handling without making the nesting level

Re: [PATCH v3 3/7] qapi/expr: Split check_expr out from check_exprs

2023-02-10 Thread Markus Armbruster
Another observation... John Snow writes: > Primarily, this reduces a nesting level of a particularly long > block. It's mostly code movement, but a new docstring is created. > > It also has the effect of creating a fairly convenient "catch point" in > check_exprs for exception handling without m

Re: [PATCH 00/27] tcg: Simplify temporary usage

2023-02-10 Thread Emilio Cota
Hi Richard, On Mon, Jan 30, 2023 at 10:59:07 -1000, Richard Henderson wrote: (snip) > With this, and by not recycling TEMP_LOCAL, we can get identical code > out of the backend even when changing the front end translators are > adjusted to use TEMP_LOCAL for everything. > > Benchmarking one test

[PATCH] target/riscv: avoid env_archcpu() in cpu_get_tb_cpu_state()

2023-02-10 Thread Daniel Henrique Barboza
We have a RISCVCPU *cpu pointer available at the start of the function. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index ad8d82662c..3a9472a2ff 1006

Re: [RFC PATCH] Do not include "qemu/error-report.h" in headers that do not need it

2023-02-10 Thread Philippe Mathieu-Daudé
On 10/2/23 12:19, Thomas Huth wrote: Include it in the .c files instead that use the error reporting functions. Signed-off-by: Thomas Huth --- RFC since it's more lines of code - but I think it's still cleaner this way. This is less pressure on the various .c files including these .h, so

Re: [PATCH] include/hw: Do not include "hw/registerfields.h" in headers that don't need it

2023-02-10 Thread Philippe Mathieu-Daudé
On 10/2/23 12:23, Thomas Huth wrote: Include "hw/registerfields.h" in the .c files instead (if needed). Signed-off-by: Thomas Huth --- include/hw/arm/smmuv3.h| 1 - include/hw/char/ibex_uart.h| 1 - include/hw/ssi/ibex_spi_host.h | 1 - hw/char/ibex_uart.c| 1 + hw

Re: [PATCH] include/hw: Do not include hw.h from headers

2023-02-10 Thread Philippe Mathieu-Daudé
On 10/2/23 12:28, Thomas Huth wrote: This include is not needed here, so drop that line. Signed-off-by: Thomas Huth --- include/hw/ssi/ibex_spi_host.h | 1 - include/hw/tricore/tricore_testdevice.h | 1 - 2 files changed, 2 deletions(-) Possibly more? $ git grep hw/hw.h $(git gr

Re: [PATCH v1 1/4] migration/multifd: Change multifd_load_cleanup() signature and usage

2023-02-10 Thread Juan Quintela
Leonardo Bras wrote: > Since it's introduction in commit f986c3d256 ("migration: Create multifd > migration threads"), multifd_load_cleanup() never returned any value > different than 0, neither set up any error on errp. > > Even though, on process_incoming_migration_bh() an if clause uses it's >

Re: [PATCH v1 2/4] migration/multifd: Remove unnecessary assignment on multifd_load_cleanup()

2023-02-10 Thread Juan Quintela
Leonardo Bras wrote: > Before assigning "p->quit = true" for every multifd channel, > multifd_load_cleanup() will call multifd_recv_terminate_threads() which > already does the same assignment, while protected by a mutex. > > So there is no point doing the same assignment again. > > Signed-off-by:

Re: [PATCH v1 3/4] migration/multifd: Join all multifd threads in order to avoid leaks

2023-02-10 Thread Juan Quintela
Leonardo Bras wrote: > Current approach will only join threads that are still running. > > For the threads not joined, resources or private memory are always kept in > the process space and never reclaimed before process end, and this risks > serious memory leaks. > > This should usually not repre

Re: [PATCH v1 4/4] migration/multifd: Move load_cleanup inside incoming_state_destroy

2023-02-10 Thread Juan Quintela
Leonardo Bras wrote: > Currently running migration_incoming_state_destroy() without first running > multifd_load_cleanup() will cause a yank error: > > qemu-system-x86_64: ../util/yank.c:107: yank_unregister_instance: > Assertion `QLIST_EMPTY(&entry->yankfns)' failed. > (core dumped) > > The above

Re: [PATCH] target/riscv: avoid env_archcpu() in cpu_get_tb_cpu_state()

2023-02-10 Thread Philippe Mathieu-Daudé
On 10/2/23 13:38, Daniel Henrique Barboza wrote: We have a RISCVCPU *cpu pointer available at the start of the function. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH] target/i386: Remove pointless env_archcpu() in helper_rdmsr()

2023-02-10 Thread Philippe Mathieu-Daudé
We have a X86CPU *cpu pointer available at the start of the function. Inspired-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- target/i386/tcg/sysemu/misc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/sysemu/misc_helper.c b/t

Re: [PATCH] include/hw: Do not include hw.h from headers

2023-02-10 Thread Thomas Huth
On 10/02/2023 13.45, Philippe Mathieu-Daudé wrote: On 10/2/23 12:28, Thomas Huth wrote: This include is not needed here, so drop that line. Signed-off-by: Thomas Huth ---   include/hw/ssi/ibex_spi_host.h  | 1 -   include/hw/tricore/tricore_testdevice.h | 1 -   2 files changed, 2 deleti

Re: [PATCH v2 00/13] Dynamycally switch to vhost shadow virtqueues at vdpa net migration

2023-02-10 Thread Gautam Dawar
Hi Eugenio, I've tested this patch series on Xilinx/AMD SN1022 device without control vq and VM Live Migration between two hosts worked fine. Tested-by: Gautam Dawar Here is some minor feedback: Pls fix the typo (Dynamycally -> Dynamically) in the Subject. On 2/8/23 15:12, Eugenio Pérez w

Re: [PATCH 15/22] target/arm: Use get_phys_addr_with_struct in S1_ptw_translate

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:01, Richard Henderson wrote: > > Do not provide a fast-path for physical addresses, > as those will need to be validated for GPC. > > Signed-off-by: Richard Henderson > --- > target/arm/ptw.c | 35 ++- > 1 file changed, 14 insertions(+),

Re: [PATCH 16/22] target/arm: Move s1_is_El0 into S1Translate

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:02, Richard Henderson wrote: > > Instead of passing this to get_phys_addr_lpae, stash it > in the S1Translate structure. > > Signed-off-by: Richard Henderson > --- > target/arm/ptw.c | 21 +++-- > 1 file changed, 7 insertions(+), 14 deletions(-) > > diff

Re: [PATCH v15 00/11] s390x: CPU Topology

2023-02-10 Thread Pierre Morel
On 2/9/23 18:14, Nina Schoetterl-Glausch wrote: IMO this series looks good overall and like it's nearing the final stages. Thank you for your helping this. You use "polarity" instead of "polarization" a lot. Since the PoP uses polarization I think that term would be preferred. OK Wit

Re: [PATCH v10 30/59] hw/xen: Implement EVTCHNOP_close

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse It calls an internal close_port() helper which will also be used from EVTCHNOP_reset and will actually do the work to disconnect/unbind a port once any of that is actually implemented in the first place. That in turn calls a fre

Re: [PATCH] include/hw: Do not include hw.h from headers

2023-02-10 Thread Bastian Koppelmann
On Fri, Feb 10, 2023 at 12:28:35PM +0100, Thomas Huth wrote: > This include is not needed here, so drop that line. > > Signed-off-by: Thomas Huth > --- > include/hw/ssi/ibex_spi_host.h | 1 - > include/hw/tricore/tricore_testdevice.h | 1 - > 2 files changed, 2 deletions(-) > > diff --

Re: [PATCH 17/22] target/arm: Use get_phys_addr_with_struct for stage2

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:01, Richard Henderson wrote: > > This fixes a bug in which we failed to initialize > the result attributes properly after the memset. > > Signed-off-by: Richard Henderson > --- > target/arm/ptw.c | 13 + > 1 file changed, 1 insertion(+), 12 deletions(-) > >

Re: QAPI unions as branches / unifying struct and union types (was: [PATCH v2 2/6] migration: Updated QAPI format for 'migrate' qemu monitor command)

2023-02-10 Thread Het Gala
On 10/02/23 12:54 pm, Markus Armbruster wrote: Daniel P. Berrangé writes: [...] +## +# @MigrateAddress: +# +# The options available for communication transport mechanisms for migration +# +# Since 8.0 +## +{ 'union' : 'MigrateAddress', + 'base' : { 'transport' : 'MigrateTransport'}, + 'di

Re: [PATCH] target/i386: Remove pointless env_archcpu() in helper_rdmsr()

2023-02-10 Thread Daniel Henrique Barboza
On 2/10/23 09:57, Philippe Mathieu-Daudé wrote: We have a X86CPU *cpu pointer available at the start of the function. Inspired-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- Reviewed-by: Daniel Henrique Barboza target/i386/tcg/sysemu/misc_helper.c | 2 +- 1 f

Re: [PATCH 18/22] target/arm: Add GPC syndrome

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:02, Richard Henderson wrote: > > The function takes the fields as filled in by > the Arm ARM pseudocode for TakeGPCException. > > Signed-off-by: Richard Henderson > --- > target/arm/syndrome.h | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/target/arm/

Re: [PATCH v10 31/59] hw/xen: Implement EVTCHNOP_unmask

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse This finally comes with a mechanism for actually injecting events into the guest vCPU, with all the atomic-test-and-set that's involved in setting the bit in the shinfo, then the index in the vcpu_info, and injecting either the l

[PATCH 04/11] target/riscv: introduce riscv_cpu_cfg()

2023-02-10 Thread Daniel Henrique Barboza
We're going to do changes that requires accessing the RISCVCPUConfig struct from the RISCVCPU, having access only to a CPURISCVState 'env' pointer. Add a helper to make the code easier to read. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 5 + 1 file changed, 5 insertions(

[PATCH 11/11] target/riscv/cpu: remove CPUArchState::features and friends

2023-02-10 Thread Daniel Henrique Barboza
The attribute is no longer used since we can retrieve all the enabled features in the hart by using cpu->cfg instead. Remove env->feature, riscv_feature() and riscv_set_feature(). We also need to bump vmstate_riscv_cpu version_id and minimal_version_id since 'features' is no longer being migrated.

[PATCH 09/11] hw/riscv/virt.c: do not use RISCV_FEATURE_MMU in create_fdt_socket_cpus()

2023-02-10 Thread Daniel Henrique Barboza
Read cpu_ptr->cfg.mmu directly. As a bonus, use cpu_ptr in riscv_isa_string(). Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 86c4adc0c9..8ab6a3ec16 100644 --- a/hw/risc

[PATCH 02/11] target/riscv: allow users to actually write the MISA CSR

2023-02-10 Thread Daniel Henrique Barboza
At this moment, and apparently since ever, we have no way of enabling RISCV_FEATURE_MISA. This means that all the code from write_misa(), all the nuts and bolts that handles how to properly write this CSR, has always been a no-op as well because write_misa() will always exit earlier. This seems to

[PATCH 00/11] enable write_misa() and RISCV_FEATURE_* cleanups

2023-02-10 Thread Daniel Henrique Barboza
Hi, Initially this was supposed to be just the first 2 patches, where we enable users to be able to actually write the MISA CSR (yes, at this moment all the code in write_misa() is a no-op). During an internal discussion of that code, Andrew Jones pointed out that I was setting RISCV_FEATURE_MISA

Re: [PULL 00/17] Migration 20230209 patches

2023-02-10 Thread Peter Maydell
On Thu, 9 Feb 2023 at 23:35, Juan Quintela wrote: > > The following changes since commit 417296c8d8588f782018d01a317f88957e9786d6: > > tests/qtest/netdev-socket: Raise connection timeout to 60 seconds > (2023-02-09 11:23:53 +) > > are available in the Git repository at: > > https://gitlab

[PATCH 07/11] target/riscv: remove RISCV_FEATURE_EPMP

2023-02-10 Thread Daniel Henrique Barboza
RISCV_FEATURE_EPMP is always set to the same value as the cpu->cfg.epmp flag. Use the flag directly. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 10 +++--- target/riscv/cpu.h | 1 - target/riscv/csr.c | 2 +- target/riscv/pmp.c | 4 ++-- 4 files changed, 6 insertions(+

[PATCH 05/11] target/riscv: remove RISCV_FEATURE_DEBUG

2023-02-10 Thread Daniel Henrique Barboza
RISCV_FEATURE_DEBUG will always follow the value defined by cpu->cfg.debug flag. Read the flag instead. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c| 6 +- target/riscv/cpu.h| 1 - target/riscv/cpu_helper.c | 2 +- target/riscv/csr.c| 2 +- target/ris

[PATCH 06/11] target/riscv/cpu.c: error out if EPMP is enabled without PMP

2023-02-10 Thread Daniel Henrique Barboza
Instead of silently ignoring the EPMP setting if there is no PMP available, error out informing the user that EPMP depends on PMP support: $ ./qemu-system-riscv64 -cpu rv64,pmp=false,x-epmp=true qemu-system-riscv64: Invalid configuration: EPMP requires PMP support This will force users to pick sa

[PATCH 01/11] target/riscv: do not mask unsupported QEMU extensions in write_misa()

2023-02-10 Thread Daniel Henrique Barboza
The masking done using env->misa_ext_mask already filters any extension that QEMU doesn't support. If the hart supports the extension then QEMU supports it as well. If the masking done by env->misa_ext_mask is somehow letting unsupported QEMU extensions pass by, misa_ext_mask itself needs to be fi

[PATCH 08/11] target/riscv: remove RISCV_FEATURE_PMP

2023-02-10 Thread Daniel Henrique Barboza
RISCV_FEATURE_PMP is being set via riscv_set_feature() by mirroring the cpu->cfg.pmp flag. Use the flag instead. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c| 4 target/riscv/cpu.h| 1 - target/riscv/cpu_helper.c | 2 +- target/riscv/csr.c| 2 +- tar

[PATCH 10/11] target/riscv: remove RISCV_FEATURE_MMU

2023-02-10 Thread Daniel Henrique Barboza
RISCV_FEATURE_MMU is set whether cpu->cfg.mmu is set, so let's just use the flag directly instead. With this change the enum is also removed. It is worth noticing that this enum, and all the RISCV_FEATURES_* that were contained in it, predates the existence of the cpu->cfg object. Today, using cpu

[PATCH 03/11] target/riscv: remove RISCV_FEATURE_MISA

2023-02-10 Thread Daniel Henrique Barboza
This enum is no longer used after write_misa() started reading the value from cpu->cfg.misa_w. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 103963b386..6509ffa951 100644 --- a/target

Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event

2023-02-10 Thread Vladimir Sementsov-Ogievskiy
On 10.02.23 15:01, Markus Armbruster wrote: What do @hotplug-device and @device name? Are these qdev-id? What kind of paths are @hotplug-path and @path? Are these paths to an object device in the QOM tree? Which object? device / path is same name and path as for DEVICE_DELETED Got it. But

[PATCH] libvhost-user: check for NULL when allocating a virtqueue element

2023-02-10 Thread Carlos López
Check the return value for malloc(), avoiding a NULL pointer dereference, and propagate error in function callers. Found with GCC 13 and -fanalyzer: ../subprojects/libvhost-user/libvhost-user.c: In function ‘virtqueue_alloc_element’: ../subprojects/libvhost-user/libvhost-user.c:2556:19: error: d

[PATCH] vhost: avoid a potential use of an uninitialized variable in vhost_svq_poll()

2023-02-10 Thread Carlos López
In vhost_svq_poll(), if vhost_svq_get_buf() fails due to a device providing invalid descriptors, len is left uninitialized and returned to the caller, potentally leaking stack data or causing undefined behavior. Fix this by initializing len to 0. Found with GCC 13 and -fanalyzer (abridged): ../h

[PATCH v1] Adding new machine Yosemitev2 in QEMU

2023-02-10 Thread Karthikeyan Pasupathi
This patch support Yosemitev2 in QEMU environment. Signed-off-by: Karthikeyan Pasupathi --- hw/arm/aspeed.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 27dda58338..74dc07190d 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm

Re: [RFC PATCH] Do not include "qemu/error-report.h" in headers that do not need it

2023-02-10 Thread Markus Armbruster
Thomas Huth writes: > Include it in the .c files instead that use the error reporting > functions. > > Signed-off-by: Thomas Huth > --- > RFC since it's more lines of code - but I think it's still cleaner > this way. Yes, please! Reviewed-by: Markus Armbruster

[PATCH v1] Adding new machine Tiogapass in QEMU

2023-02-10 Thread Karthikeyan Pasupathi
This patch support tiogapass in QEMU environment. Signed-off-by: Karthikeyan Pasupathi --- hw/arm/aspeed.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 27dda58338..279ba60743 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm

Re: [PATCH v10 32/59] hw/xen: Implement EVTCHNOP_bind_virq

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse Add the array of virq ports to each vCPU so that we can deliver timers, debug ports, etc. Global virqs are allocated against vCPU 0 initially, but can be migrated to other vCPUs (when we implement that). The kernel needs to know

Re: [PATCH v3 14/15] qapi: introduce DEVICE_ON event

2023-02-10 Thread Vladimir Sementsov-Ogievskiy
On 10.02.23 00:37, Philippe Mathieu-Daudé wrote: On 9/2/23 21:08, Vladimir Sementsov-Ogievskiy wrote: We have DEVICE_DELETED event, that signals that device_del command is actually complited. But we don't have a counter-part for device_add. Still it's sensible for SHPC and PCIe-native hotplug, a

Re: [PATCH v3 15/15] qapi: introduce query-hotplug command

2023-02-10 Thread Vladimir Sementsov-Ogievskiy
On 10.02.23 13:09, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add a command that returns same information like HOTPLUG_STATE event. Signed-off-by: Vladimir Sementsov-Ogievskiy Events and queries commonly come paired: management applications want the event so they don't h

Re: [PATCH 19/22] target/arm: Implement GPC exceptions

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:02, Richard Henderson wrote: > > Handle GPC Fault types in arm_deliver_fault, reporting as > either a GPC exception at EL3, or falling through to insn > or data aborts at various exception levels. > > Signed-off-by: Richard Henderson > +static unsigned encode_gpcsc(A

Re: [PATCH v10 33/59] hw/xen: Implement EVTCHNOP_bind_ipi

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 69 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 + 3 files changed, 86 insertions(+) diff

Re: [PATCH v10 06/12] vfio/migration: Block multiple devices migration

2023-02-10 Thread Cédric Le Goater
On 2/9/23 20:20, Avihai Horon wrote: Currently VFIO migration doesn't implement some kind of intermediate quiescent state in which P2P DMAs are quiesced before stopping or running the device. This can cause problems in multi-device migration where the devices are doing P2P DMAs, since the devices

Re: [PATCH v10 34/59] hw/xen: Implement EVTCHNOP_send

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 180 ++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 12 +++ 3 files changed, 194 insertions(+) Review

Re: [RFC PATCH] target/arm: disable FEAT_SME if we turn off SVE

2023-02-10 Thread Markus Armbruster
Alex Bennée writes: > Fabiano Rosas writes: > >> Alex Bennée writes: >> >>> Before this change booting a -cpu max,sve=off would trigger and >>> assert: >>> >>> qemu-system-aarch64: ../../target/arm/helper.c:6647: sve_vqm1_for_el_sm: >>> Assertion `sm' failed. >>> >>> when the guest attempts

Re: [PATCH] vhost-user-fs: add capability to allow migration

2023-02-10 Thread Anton Kuchin
On 02/02/2023 11:59, Juan Quintela wrote: Anton Kuchin wrote: On 01/02/2023 16:26, Juan Quintela wrote: Anton Kuchin wrote: On 19/01/2023 18:02, Stefan Hajnoczi wrote: On Thu, 19 Jan 2023 at 10:29, Anton Kuchin wrote: On 19/01/2023 16:30, Stefan Hajnoczi wrote: On Thu, 19 Jan 2023 at 07:

Re: [PATCH v10 35/59] hw/xen: Implement EVTCHNOP_alloc_unbound

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 32 hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 +++ 3 files changed, 49 insertions(+) diff

Re: [PATCH v10 33/59] hw/xen: Implement EVTCHNOP_bind_ipi

2023-02-10 Thread David Woodhouse
On Fri, 2023-02-10 at 13:55 +, Paul Durrant wrote: > > > +    ret = allocate_port(s, ipi->vcpu, EVTCHNSTAT_ipi, 0, &ipi->port); > > +    if (!ret && s->evtchn_in_kernel) { > > +    assign_kernel_port(EVTCHNSTAT_ipi, ipi->port, ipi->vcpu); > > Should the error not be propagated here? Nah

Re: [PATCH v15 03/11] target/s390x/cpu topology: handle STSI(15) and build the SYSIB

2023-02-10 Thread Pierre Morel
On 2/9/23 17:39, Nina Schoetterl-Glausch wrote: On Wed, 2023-02-01 at 14:20 +0100, Pierre Morel wrote: On interception of STSI(15.1.x) the System Information Block (SYSIB) is built from the list of pre-ordered topology entries. Signed-off-by: Pierre Morel --- include/hw/s390x/cpu-topology

Re: [PATCH v10 35/59] hw/xen: Implement EVTCHNOP_alloc_unbound

2023-02-10 Thread David Woodhouse
On Fri, 2023-02-10 at 14:13 +, Paul Durrant wrote: > > --- a/target/i386/kvm/xen-emu.c > > +++ b/target/i386/kvm/xen-emu.c > > @@ -918,6 +918,21 @@ static bool kvm_xen_hcall_evtchn_op(struct > > kvm_xen_exit *exit, X86CPU *cpu, > >    err = xen_evtchn_send_op(&send); > >    bre

Re: [PATCH 20/22] target/arm: Implement the granule protection check

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:01, Richard Henderson wrote: > > Place the check at the end of get_phys_addr_with_struct, > so that we check all physical results. > > Signed-off-by: Richard Henderson > --- > target/arm/ptw.c | 253 +++ > 1 file changed, 234

Re: [PATCH v15 01/11] s390x/cpu topology: adding s390 specificities to CPU topology

2023-02-10 Thread Pierre Morel
On 2/8/23 18:50, Nina Schoetterl-Glausch wrote: On Wed, 2023-02-01 at 14:20 +0100, Pierre Morel wrote: S390 adds two new SMP levels, drawers and books to the CPU topology. The S390 CPU have specific toplogy features like dedication and polarity to give to the guest indications on the host vCP

Re: [PATCH 21/22] target/arm: Enable RME for -cpu max

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:01, Richard Henderson wrote: > > Add a cpu property to set GPCCR_EL3.L0GPTSZ, for testing > various possible configurations. > > Signed-off-by: Richard Henderson Looks OK, but I think we probably shouldn't enable RME by default until we're happy with what we're planning

Re: [PULL 00/17] Migration 20230209 patches

2023-02-10 Thread Juan Quintela
Peter Maydell wrote: > On Thu, 9 Feb 2023 at 23:35, Juan Quintela wrote: >> >> The following changes since commit 417296c8d8588f782018d01a317f88957e9786d6: >> >> tests/qtest/netdev-socket: Raise connection timeout to 60 seconds >> (2023-02-09 11:23:53 +) >> >> are available in the Git repo

Re: [RFC PATCH 22/22] hw/arm/virt: Add some memory for Realm Management Monitor

2023-02-10 Thread Peter Maydell
On Tue, 24 Jan 2023 at 00:02, Richard Henderson wrote: > > This is arbitrary, but used by the Huawei TF-A test code. I guess we should look at how TF-A expects this to work in real-hardware setups. Presumably the idea is that TF-A carves out the RAM it wants to use for the RMM and modifies the de

Re: [PATCH v10 33/59] hw/xen: Implement EVTCHNOP_bind_ipi

2023-02-10 Thread Paul Durrant
On 10/02/2023 14:15, David Woodhouse wrote: On Fri, 2023-02-10 at 13:55 +, Paul Durrant wrote: +    ret = allocate_port(s, ipi->vcpu, EVTCHNSTAT_ipi, 0, &ipi->port); +    if (!ret && s->evtchn_in_kernel) { +    assign_kernel_port(EVTCHNSTAT_ipi, ipi->port, ipi->vcpu); Should the erro

Re: [PATCH v10 35/59] hw/xen: Implement EVTCHNOP_alloc_unbound

2023-02-10 Thread Paul Durrant
On 10/02/2023 14:17, David Woodhouse wrote: On Fri, 2023-02-10 at 14:13 +, Paul Durrant wrote: --- a/target/i386/kvm/xen-emu.c +++ b/target/i386/kvm/xen-emu.c @@ -918,6 +918,21 @@ static bool kvm_xen_hcall_evtchn_op(struct kvm_xen_exit *exit, X86CPU *cpu,    err = xen_evtchn_send_o

Re: [PATCH v10 36/59] hw/xen: Implement EVTCHNOP_bind_interdomain

2023-02-10 Thread Paul Durrant
On 01/02/2023 14:31, David Woodhouse wrote: From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 78 +++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 16 3 files changed, 96 insertions(+) Revi

[PATCH v2 2/3] dma-helpers: prevent dma_blk_cb() vs dma_aio_cancel() race

2023-02-10 Thread Stefan Hajnoczi
dma_blk_cb() only takes the AioContext lock around ->io_func(). That means the rest of dma_blk_cb() is not protected. In particular, the DMAAIOCB field accesses happen outside the lock. There is a race when the main loop thread holds the AioContext lock and invokes scsi_device_purge_requests() ->

[PATCH v2 0/3] virtio-scsi: fix SCSIDevice hot unplug with IOThread

2023-02-10 Thread Stefan Hajnoczi
Unplugging SCSIDevices when virtio-scsi is using an IOThread suffers from race conditions: - scsi_device_purge_requests() is called from the IOThread in TMF emulation. This is unsafe, it should only be called from the BQL. - SCSIRequest->aiocb is not protected by a lock, so there are races betwee

[PATCH v2 1/3] scsi: protect req->aiocb with AioContext lock

2023-02-10 Thread Stefan Hajnoczi
If requests are being processed in the IOThread when a SCSIDevice is unplugged, scsi_device_purge_requests() -> scsi_req_cancel_async() races with I/O completion callbacks. Both threads load and store req->aiocb. This can lead to assert(r->req.aiocb == NULL) failures and undefined behavior. Protec

  1   2   3   >