Re: [PATCH] QIO: Add force_quit to the QIOChannel to ensure QIO exits cleanly in some corner case

2021-12-13 Thread Rao, Lei
On 12/3/2021 9:26 AM, Rao, Lei wrote: On 12/2/2021 5:54 PM, Vladimir Sementsov-Ogievskiy wrote: 02.12.2021 11:53, Daniel P. Berrangé wrote: On Thu, Dec 02, 2021 at 01:14:47PM +0800, Rao, Lei wrote: Sorry, resending with correct indentation and quoting. On 12/1/2021 10:27 PM, Vladimir Sem

Re: [PATCH 10/26] hw/intc/arm_gicv3_its: Use FIELD macros for DTEs

2021-12-13 Thread Philippe Mathieu-Daudé
On Sun, Dec 12, 2021 at 10:16 PM Philippe Mathieu-Daudé wrote: > On 12/11/21 20:11, Peter Maydell wrote: > > Currently the ITS code that reads and writes DTEs uses open-coded > > shift-and-mask to assemble the various fields into the 64-bit DTE > > word. The names of the macros used for mask and

Re: [PATCH] QIO: Add force_quit to the QIOChannel to ensure QIO exits cleanly in some corner case

2021-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2021 11:02, Rao, Lei wrote: On 12/3/2021 9:26 AM, Rao, Lei wrote: On 12/2/2021 5:54 PM, Vladimir Sementsov-Ogievskiy wrote: 02.12.2021 11:53, Daniel P. Berrangé wrote: On Thu, Dec 02, 2021 at 01:14:47PM +0800, Rao, Lei wrote: Sorry, resending with correct indentation and quoting. O

Re: [PATCH for-7.0] gitlab-ci: Add cirrus-ci based tests for NetBSD and OpenBSD

2021-12-13 Thread Thomas Huth
On 10/12/2021 13.10, Daniel P. Berrangé wrote: On Thu, Dec 09, 2021 at 11:31:24AM +0100, Thomas Huth wrote: Cirrus-CI provides KVM in their Linux containers, so we can also run our VM-based NetBSD and OpenBSD build jobs there. Since the VM installation might take a while, we only run the "help"

Re: [PATCH v3 23/23] migration: Use multifd before we check for the zero page

2021-12-13 Thread Juan Quintela
Peter Xu wrote: > On Thu, Dec 02, 2021 at 06:38:27PM +0100, Juan Quintela wrote: >> This needs to be improved to be compatible with old versions. > > Any plan to let new binary work with old binary? Yes, but I was waiting for 7.0 to get out. Basically I need to do: if (old) run the old code

Re: [PATCH v3 0/4] s390x/pci: some small fixes

2021-12-13 Thread Thomas Huth
On 03/12/2021 15.27, Matthew Rosato wrote: A collection of small fixes for s390x PCI (not urgent). The first 3 are fixes related to always using the host-provided CLP value when provided vs a hard-coded value. The last patch adds logic for QEMU to report a proper DTSM clp response rather than j

Re: [PATCH v7 0/8] virtio-iommu: Add ACPI support (Arm part + tests)

2021-12-13 Thread Jean-Philippe Brucker
On Sun, Dec 12, 2021 at 10:19:47AM +0530, Ani Sinha wrote: > On Fri, Dec 10, 2021 at 10:35 PM Jean-Philippe Brucker > wrote: > > > > Add ACPI support for virtio-iommu on the virt machine, by instantiating > > a VIOT table. Also add the tests for the ACPI table. > > > > Since last posting [1], I re

Re: [PULL 0/1] Block patches

2021-12-13 Thread Stefan Hajnoczi
On Thu, Dec 09, 2021 at 08:53:25AM -0800, Richard Henderson wrote: > On 12/9/21 8:34 AM, Stefan Hajnoczi wrote: > > > I'm not running the release cycle this time around, but: it's > > > already rc4, pull requests by this point need a clear justification > > > in the cover letter for why they're rea

Re: [PATCH] MAINTAINERS: Add a separate entry for acpi/VIOT tables

2021-12-13 Thread Jean-Philippe Brucker
On Mon, Dec 13, 2021 at 10:29:24AM +0530, Ani Sinha wrote: > All work related to VIOT tables are being done by Jean. Adding him as the > maintainer for acpi VIOT table code in qemu. > > Signed-off-by: Ani Sinha Acked-by: Jean-Philippe Brucker > --- > MAINTAINERS | 7 +++ > 1 file changed,

Re: [PATCH v3 03/23] multifd: Rename used field to num

2021-12-13 Thread Zheng Chuan via
Hi, Juan, Sorry, forget to send to qemu-devel, resend it. On 2021/11/24 18:05, Juan Quintela wrote: > We will need to split it later in zero_num (number of zero pages) and > normal_num (number of normal pages). This name is better. > > Signed-off-by: Juan Quintela > --- > migration/multifd.h

Re: [RFC] block-backend: prevent dangling BDS pointer in blk_drain()

2021-12-13 Thread Stefan Hajnoczi
On Thu, Dec 09, 2021 at 07:51:02PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 09.12.2021 19:32, Stefan Hajnoczi wrote: > > On Thu, Dec 09, 2021 at 04:45:13PM +0100, Hanna Reitz wrote: > > > On 09.12.21 15:23, Stefan Hajnoczi wrote: > > > > The BlockBackend root child can change during bdrv_draine

Re: [PATCH] QIO: Add force_quit to the QIOChannel to ensure QIO exits cleanly in some corner case

2021-12-13 Thread Rao, Lei
On 12/13/2021 4:38 PM, Vladimir Sementsov-Ogievskiy wrote: 13.12.2021 11:02, Rao, Lei wrote: On 12/3/2021 9:26 AM, Rao, Lei wrote: On 12/2/2021 5:54 PM, Vladimir Sementsov-Ogievskiy wrote: 02.12.2021 11:53, Daniel P. Berrangé wrote: On Thu, Dec 02, 2021 at 01:14:47PM +0800, Rao, Lei wr

Re: [PATCH 11/26] hw/intc/arm_gicv3_its: Use 1ULL when shifting by (DTE.SIZE + 1)

2021-12-13 Thread Peter Maydell
On Sun, 12 Dec 2021 at 20:43, Richard Henderson wrote: > > On 12/11/21 11:11 AM, Peter Maydell wrote: > > > > if (dte_valid) { > > -max_eventid = 1UL << (FIELD_EX64(dte, DTE, SIZE) + 1); > > +max_eventid = 1ULL << (FIELD_EX64(dte, DTE, SIZE) + 1); > > Without changing the typ

Qemu Userspace Emulator with library + method

2021-12-13 Thread Marcus Engene
Hi, I'd like to do instruction traces with library+function name included. From what I understand *in_asm* only shows instructions when they are being JIT:ed. If I call a function twice I only see the instructions once so it makes sense. As a workaround, I tried to do a plugin. I looked at t

Re: [PATCH v2 0/4] hw/display: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/6/21 23:45, Philippe Mathieu-Daudé wrote: > Convert the open-coded vga_mmio_init() to a sysbus device. > Philippe Mathieu-Daudé (4): > hw/display: Rename VGA_ISA_MM -> VGA_MMIO > hw/display/vga-mmio: Inline vga_mm_init() > hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO >

Re: [PATCH v6 0/4] virtio-iommu: config related fixes and qtest

2021-12-13 Thread Thomas Huth
On 27/11/2021 08.29, Eric Auger wrote: Introduce a qtest for the virtio-iommu device. The test allowed to identify an endianess bug in the get_config(). We also remove the unneeded set_config() and fix the value for domain_range.end field. Best Regards Eric Thanks, I've queued the series now

Re: [PATCH v7 0/8] virtio-iommu: Add ACPI support (Arm part + tests)

2021-12-13 Thread Peter Maydell
On Mon, 13 Dec 2021 at 09:28, Jean-Philippe Brucker wrote: > > On Sun, Dec 12, 2021 at 10:19:47AM +0530, Ani Sinha wrote: > > On Fri, Dec 10, 2021 at 10:35 PM Jean-Philippe Brucker > > wrote: > > > > > > Add ACPI support for virtio-iommu on the virt machine, by instantiating > > > a VIOT table. A

Re: [RFC] block-backend: prevent dangling BDS pointer in blk_drain()

2021-12-13 Thread Stefan Hajnoczi
On Fri, Dec 10, 2021 at 03:00:38PM +0100, Kevin Wolf wrote: > Am 09.12.2021 um 15:23 hat Stefan Hajnoczi geschrieben: > > The BlockBackend root child can change during bdrv_drained_begin() when > > aio_poll() is invoked. In fact the BlockDriverState can reach refcnt 0 > > and blk_drain() is left wi

Re: [PATCH] MIPS - fix cycle counter timing calculations

2021-12-13 Thread Philippe Mathieu-Daudé
On 11/16/21 08:26, Simon Burge wrote: > The cp0_count_ns value is calculated from the CP0_COUNT_RATE_DEFAULT > constant in target/mips/cpu.c. The cycle counter resolution is defined > per-CPU in target/mips/cpu-defs.c.inc; use this value for calculating > cp0_count_ns. Fixings timing problems on

Re: [PATCH v5 01/37] bsd-user/mips*: Remove mips support

2021-12-13 Thread Philippe Mathieu-Daudé
On 11/8/21 04:51, Warner Losh wrote: > FreeBSD is dropping support for mips starting with FreeBSD 14. mips > support has been removed from the bsd-user fork because updating it for > new signal requirements will take too much time. Remove it here since it > is a distraction. > > Signed-off-by: War

Re: [PATCH v2 4/4] hw/mips/jazz: Inline vga_mmio_init() and remove it

2021-12-13 Thread Thomas Huth
On 06/12/2021 23.45, Philippe Mathieu-Daudé wrote: vga_mmio_init() is used only one time and not very helpful, inline and remove it. Reviewed-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daudé --- include/hw/display/vga.h | 5 - hw/display/vga-mmio.c| 19 ---

[PATCH] target/mips: Remove duplicated MIPSCPU::cp0_count_rate

2021-12-13 Thread Philippe Mathieu-Daudé
Since the previous commit 9ea89876f9d ("target/mips: Fix cycle counter timing calculations"), MIPSCPU::cp0_count_rate is not used anymore. We don't need it since it is already expressed as mips_def_t::CCRes. Remove the duplicate and clean. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <2021

Re: [PATCH] MIPS - fix cycle counter timing calculations

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/13/21 11:10, Philippe Mathieu-Daudé wrote: > On 11/16/21 08:26, Simon Burge wrote: >> The cp0_count_ns value is calculated from the CP0_COUNT_RATE_DEFAULT >> constant in target/mips/cpu.c. The cycle counter resolution is defined >> per-CPU in target/mips/cpu-defs.c.inc; use this value for ca

Re: Fwd: QEMU | READ memory access in /hw/acpi/pcihp.c (#770)

2021-12-13 Thread Michael S. Tsirkin
On Mon, Dec 13, 2021 at 08:43:55AM +0100, Thomas Huth wrote: > > Hi Michael, hi Igor, > > just FYI, a crash has been reported in the ACPI code ... > by the way, do you have a gitlab account, so you could be put on CC: for > such bugs there, too? > > Regards, > Thomas > > > Forward

[RFC PATCH 0/6] Removal of Aiocontext lock and usage of subtree drains in aborted transactions

2021-12-13 Thread Emanuele Giuseppe Esposito
Hello everyone, As you know already, my current goal is to try to remove the AioContext lock from the QEMU block layer. Currently the AioContext is used pretty much throughout the whole block layer, it is a little bit confusing to understand what it exactly protects, and I am starting to think

[RFC PATCH 2/6] introduce BDRV_POLL_WHILE_UNLOCKED

2021-12-13 Thread Emanuele Giuseppe Esposito
Same as BDRV_POLL_WHILE, but uses AIO_WAIT_WHILE_UNLOCKED. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block-global-state.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h index 7a6b065101..818164a0

[RFC PATCH 3/6] block/io.c: introduce bdrv_subtree_drained_{begin/end}_unlocked

2021-12-13 Thread Emanuele Giuseppe Esposito
Same as the locked version, but use BDRV_POLL_UNLOCKED Signed-off-by: Emanuele Giuseppe Esposito --- block/io.c | 35 ++- include/block/block-io.h | 2 ++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/block/io.c b/block/io.c index

[RFC PATCH 5/6] test-bdrv-drain.c: adapt test to the new subtree drains

2021-12-13 Thread Emanuele Giuseppe Esposito
There are a couple of problems in this test when we add subtree drains in bdrv_replace_child_noperm: - First of all, inconsistency between block_job_create under aiocontext lock that internally calls blk_insert_bs and therefore bdrv_replace_child_noperm, and blk_insert_bs that is called two lines

[RFC PATCH 4/6] block.c: add subtree_drains where needed

2021-12-13 Thread Emanuele Giuseppe Esposito
Protect bdrv_replace_child_noperm, as it modifies the graph by adding/removing elements to .children and .parents list of a bs. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 24 1 file changed, 24 insertions(+) diff --git a/block.c b/block.c index 3c3c90704c..

[RFC PATCH 1/6] tests/unit/test-bdrv-drain.c: graph setup functions can't run in coroutines

2021-12-13 Thread Emanuele Giuseppe Esposito
Graph initialization functions like blk_new(), bdrv_new() and so on should not run in a coroutine. In fact, they might invoke a drain (for example blk_insert_bs eventually calls bdrv_replace_child_noperm) that in turn can invoke callbacks like bdrv_do_drained_begin_quiesce(), that asserts exactly t

[RFC PATCH 6/6] block/io.c: enable assert_bdrv_graph_writable

2021-12-13 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/io.c b/block/io.c index a031691860..c2f1a494c4 100644 --- a/block/io.c +++ b/block/io.c @@ -759,6 +759,7 @@ void assert_bdrv_graph_writable(BlockDriverState *bs) * Once the nec

Re: [PATCH v2 3/4] hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO

2021-12-13 Thread Thomas Huth
On 06/12/2021 23.45, Philippe Mathieu-Daudé wrote: Introduce TYPE_VGA_MMIO, a sysbus device. While there is no change in the vga_mmio_init() interface, this is a migration compatibility break of the MIPS Acer Pica 61 Jazz machine (pica61). It's unfortunate, but as far as I know, it would be pr

Re: Redesign of QEMU startup & initial configuration

2021-12-13 Thread Damien Hedde
On 12/10/21 14:54, Markus Armbruster wrote: Daniel P. Berrangé writes: On Thu, Dec 02, 2021 at 07:57:38AM +0100, Markus Armbruster wrote: = Motivation = QEMU startup and initial configuration were designed many years ago for a much, much simpler QEMU. They have since changed beyond recog

Re: [PATCH v7 0/8] virtio-iommu: Add ACPI support (Arm part + tests)

2021-12-13 Thread Jean-Philippe Brucker
On Mon, Dec 13, 2021 at 10:04:57AM +, Peter Maydell wrote: > On Mon, 13 Dec 2021 at 09:28, Jean-Philippe Brucker > wrote: > > > > On Sun, Dec 12, 2021 at 10:19:47AM +0530, Ani Sinha wrote: > > > On Fri, Dec 10, 2021 at 10:35 PM Jean-Philippe Brucker > > > wrote: > > > > > > > > Add ACPI suppo

Re: [PATCH 11/26] hw/intc/arm_gicv3_its: Use 1ULL when shifting by (DTE.SIZE + 1)

2021-12-13 Thread Peter Maydell
On Mon, 13 Dec 2021 at 09:48, Peter Maydell wrote: > > On Sun, 12 Dec 2021 at 20:43, Richard Henderson > wrote: > > > > On 12/11/21 11:11 AM, Peter Maydell wrote: > > > > > > if (dte_valid) { > > > -max_eventid = 1UL << (FIELD_EX64(dte, DTE, SIZE) + 1); > > > +max_eventid =

Re: [RFC] vhost-vdpa-net: add vhost-vdpa-net host device support

2021-12-13 Thread Stefano Garzarella
On Mon, Dec 13, 2021 at 10:47:00AM +0800, Jason Wang wrote: On Sun, Dec 12, 2021 at 5:30 PM Michael S. Tsirkin wrote: On Sat, Dec 11, 2021 at 03:00:27AM +, Longpeng (Mike, Cloud Infrastructure Service Product Dept.) wrote: > > > > -Original Message- > > From: Stefan Hajnoczi [mail

Re: [PATCH v2 3/4] hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/13/21 11:48, Thomas Huth wrote: > On 06/12/2021 23.45, Philippe Mathieu-Daudé wrote: >> Introduce TYPE_VGA_MMIO, a sysbus device. >> >> While there is no change in the vga_mmio_init() >> interface, this is a migration compatibility break >> of the MIPS Acer Pica 61 Jazz machine (pica61). > >

Re: [PATCH v7 0/8] virtio-iommu: Add ACPI support (Arm part + tests)

2021-12-13 Thread Peter Maydell
On Mon, 13 Dec 2021 at 10:56, Jean-Philippe Brucker wrote: > > On Mon, Dec 13, 2021 at 10:04:57AM +, Peter Maydell wrote: > > On Mon, 13 Dec 2021 at 09:28, Jean-Philippe Brucker > > wrote: > > > > > > On Sun, Dec 12, 2021 at 10:19:47AM +0530, Ani Sinha wrote: > > > > On Fri, Dec 10, 2021 at 1

Re: [RFC] vhost-vdpa-net: add vhost-vdpa-net host device support

2021-12-13 Thread Stefano Garzarella
On Sat, Dec 11, 2021 at 04:11:04AM +, Longpeng (Mike, Cloud Infrastructure Service Product Dept.) wrote: -Original Message- From: Stefano Garzarella [mailto:sgarz...@redhat.com] Sent: Thursday, December 9, 2021 11:55 PM To: Longpeng (Mike, Cloud Infrastructure Service Product Dept

[PATCH 3/5] gqa-win: get_pci_info: Free parent_dev_info properly

2021-12-13 Thread Kostiantyn Kostiuk
In case when the function fails to get parent device data, the parent_dev_info variable will be initialized, but not freed. Signed-off-by: Kostiantyn Kostiuk Signed-off-by: Kostiantyn Kostiuk --- qga/commands-win32.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qga

[PATCH 1/5] gqa-win: get_pci_info: Clean dev_info if handle is valid

2021-12-13 Thread Kostiantyn Kostiuk
Signed-off-by: Kostiantyn Kostiuk Signed-off-by: Kostiantyn Kostiuk --- qga/commands-win32.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 4e84afd83b..3dd74fe225 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win

[PATCH 2/5] gqa-win: get_pci_info: Use common 'cleanup' label

2021-12-13 Thread Kostiantyn Kostiuk
To prevent memory leaks, always try to free initialized variables. Signed-off-by: Kostiantyn Kostiuk Signed-off-by: Kostiantyn Kostiuk --- qga/commands-win32.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win

[PATCH 5/5] gqa-win: get_pci_info: Add g_autofree for few variables

2021-12-13 Thread Kostiantyn Kostiuk
Signed-off-by: Kostiantyn Kostiuk Signed-off-by: Kostiantyn Kostiuk --- qga/commands-win32.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 6bde5260e8..96737f33e1 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win

[PATCH 0/5] gqa-win: get_pci_info: Fix memory leak

2021-12-13 Thread Kostiantyn Kostiuk
This set of patches fixes memory leaks in the get_pci_info function when it fails to get parent device data. In this case the parent_dev_info and the parent_dev_id variables will be initialized, but not freed. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1958825 Kostiantyn Kostiuk (5): gq

[PATCH 4/5] gqa-win: get_pci_info: Replace 'while' with 2 calls of the function

2021-12-13 Thread Kostiantyn Kostiuk
Microsoft suggests this solution in the documentation: https://docs.microsoft.com/en-us/windows/win32/api/setupapi/nf-setupapi-setupdigetdeviceinterfacedetaila Signed-off-by: Kostiantyn Kostiuk Signed-off-by: Kostiantyn Kostiuk --- qga/commands-win32.c | 30 -- 1 fil

Re: [PATCH 02/26] hw/intc/arm_gicv3_its: Correct off-by-one bounds check on rdbase

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The checks in the ITS on the rdbase values in guest commands are > off-by-one: they permit the guest to pass us a value equal to > s->gicv3->num_cpu, but the valid values are 0...num_cpu-1. This > meant the guest could cause us to index off the end of the > s->gicv3->cp

Re: [PATCH 04/26] hw/intc/arm_gicv3_its: Remove maxids union from TableDesc

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The TableDesc struct defines properties of the in-guest-memory tables > which the guest tells us about by writing to the GITS_BASER > registers. This struct currently has a union 'maxids', but all the > fields of the union have the same type (uint32_t) and do the same >

Re: [PATCH 05/26] hw/intc/arm_gicv3_its: Don't return early in extract_table_params() loop

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > In extract_table_params() we process each GITS_BASER register. If > the register's Valid bit is not set, this means there is no > in-guest-memory table and so we should not try to interpret the other > fields in the register. This was incorrectly coded as a 'return' >

Re: [PATCH 06/26] hw/intc/arm_gicv3_its: Reduce code duplication in extract_table_params()

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The extract_table_params() decodes the fields in the GITS_BASER > registers into TableDesc structs. Since the fields are the same for > all the GITS_BASER registers, there is currently a lot of code > duplication within the switch (type) statement. Refactor so that the

Re: [PATCH 07/26] hw/intc/arm_gicv3_its: Correct setting of TableDesc entry_sz

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > We set the TableDesc entry_sz field from the appropriate > GITS_BASER.ENTRYSIZE field. That ID register field specifies the > number of bytes per table entry minus one. However when we use > td->entry_sz we assume it to be the number of bytes per table entry > (for ins

Re: [PATCH] COLO: Move some trace code behind qemu_mutex_unlock_iothread()

2021-12-13 Thread Dr. David Alan Gilbert
* Rao, Lei (lei@intel.com) wrote: > Signed-off-by: Lei Rao You don't say why you want to move it - it's just a trace, what's the advantage? Dave > --- > migration/colo.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/migration/colo.c b/migration/colo.c > in

Re: [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The GITS_TYPE_PHYSICAL define is the value we set the > GITS_TYPER.Physical field to -- this is 1 to indicate that we support > physical LPIs. (Support for virtual LPIs is the GITS_TYPER.Virtual > field.) We also use this define as the *value* that we write into an > in

Re: [PATCH 09/26] hw/intc/arm_gicv3_its: Correct handling of MAPI

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The MAPI command takes arguments DeviceID, EventID, ICID, and is > defined to be equivalent to MAPTI DeviceID, EventID, EventID, ICID. > (That is, where MAPTI takes an explicit pINTID, MAPI uses the EventID > as the pINTID.) > > We didn't quite get this right. In partic

Re: [PATCH 03/26] hw/intc/arm_gicv3_its: Remove redundant ITS_CTLR_ENABLED define

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > We currently define a bitmask for the GITS_CTLR ENABLED bit in > two ways: as ITS_CTLR_ENABLED, and via the FIELD() macro as > R_GITS_CTLR_ENABLED_MASK. Consistently use the FIELD macro version > everywhere and remove the redundant ITS_CTLR_ENABLED define. > > Signed-off

Re: [PATCH 10/26] hw/intc/arm_gicv3_its: Use FIELD macros for DTEs

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > Currently the ITS code that reads and writes DTEs uses open-coded > shift-and-mask to assemble the various fields into the 64-bit DTE > word. The names of the macros used for mask and shift values are > also somewhat inconsistent, and don't follow our usual convention >

[PATCH v2 0/4] target/ppc: Fix VSX instructions register access

2021-12-13 Thread Victor Colombo
Instructions xscvqpdp, xsmaxcdp, xsmincdp, xsmaxjdp, and xsminjdp are using the wrong registers, which yields the wrong result when using them. This patch series fixes this issue by correcting the registers used. It also takes the opportunity to move these instructions to decodetree. v2: - Change

[PATCH v2 2/4] target/ppc: Move xs{max,min}[cj]dp to decodetree

2021-12-13 Thread Victor Colombo
Reviewed-by: Richard Henderson Signed-off-by: Victor Colombo --- target/ppc/insn32.decode| 17 +--- target/ppc/translate/vsx-impl.c.inc | 30 + target/ppc/translate/vsx-ops.c.inc | 4 3 files changed, 40 insertions(+), 11 deletions(-) d

[PATCH v2 3/4] target/ppc: fix xscvqpdp register access

2021-12-13 Thread Victor Colombo
From: Matheus Ferst This instruction has VRT and VRB fields instead of T/TX and B/BX. Reviewed-by: Richard Henderson Signed-off-by: Matheus Ferst --- target/ppc/translate/vsx-impl.c.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate/vsx-impl.c.in

[PATCH v2 1/4] target/ppc: Fix xs{max, min}[cj]dp to use VSX registers

2021-12-13 Thread Victor Colombo
PPC instruction xsmaxcdp, xsmincdp, xsmaxjdp, and xsminjdp are using vector registers when they should be using VSX ones. This happens because the instructions are using GEN_VSX_HELPER_R3, which adds 32 to the register numbers, effectively making them vector registers. This patch fixes it by chang

[PATCH v2 4/4] target/ppc: move xscvqpdp to decodetree

2021-12-13 Thread Victor Colombo
From: Matheus Ferst Reviewed-by: Richard Henderson Signed-off-by: Matheus Ferst --- target/ppc/fpu_helper.c | 10 +++--- target/ppc/helper.h | 2 +- target/ppc/insn32.decode| 4 target/ppc/translate/vsx-impl.c.inc | 24 +---

Re: [PATCH] COLO: Move some trace code behind qemu_mutex_unlock_iothread()

2021-12-13 Thread Rao, Lei
On 12/13/2021 7:45 PM, Dr. David Alan Gilbert wrote: * Rao, Lei (lei@intel.com) wrote: Signed-off-by: Lei Rao You don't say why you want to move it - it's just a trace, what's the advantage? I think it's not necessary to put trace code in the critical section. So, moving it behind qe

[RFC PATCH] target/ppc: do not silence snan in xscvspdpn

2021-12-13 Thread matheus . ferst
From: Matheus Ferst The non-signalling versions of VSX scalar convert to shorter/longer precision insns doesn't silence SNaNs in the hardware. We are currently honoring this behavior in xscvdpspn, since helper_xscvdpspn handles the conversion with extracts/deposits/etc. OTOH, xscvspdpn uses float

Re: [PATCH-for-6.2 0/2] hw/scsi/megasas: Avoid overflowing the SGL buffer

2021-12-13 Thread Philippe Mathieu-Daudé
Too late for 6.2 now, so Cc'ing qemu-trivial (series reviewed). On 11/19/21 21:11, Philippe Mathieu-Daudé wrote: > Fix issue #521 reported by Alex some months ago: > https://gitlab.com/qemu-project/qemu/-/issues/521 > > Philippe Mathieu-Daudé (2): > hw/scsi/megasas: Fails command if SGL buffer

Re: [RFC PATCH] target/ppc: do not silence snan in xscvspdpn

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/13/21 13:13, matheus.fe...@eldorado.org.br wrote: > From: Matheus Ferst > > The non-signalling versions of VSX scalar convert to shorter/longer > precision insns doesn't silence SNaNs in the hardware. We are currently > honoring this behavior in xscvdpspn, since helper_xscvdpspn handles the

Re: [PATCH 15/26] hw/intc/arm_gicv3_its: Rename max_l2_entries to num_l2_entries

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > In several places we have a local variable max_l2_entries which is > the number of entries which will fit in a level 2 table. The > calculations done on this value are correct; rename it to > num_l2_entries to fit the convention we're using in this code. >

Re: [PATCH 16/26] hw/intc/arm_gicv3_its: Fix event ID bounds checks

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > In process_its_cmd() and process_mapti() we must check the > event ID against a limit defined by the size field in the DTE, > which specifies the number of ID bits minus one. Convert > this code to our num_foo convention, fixing the off-by-one error. > > S

Re: [PATCH 20/26] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > When an ITS detects an error in a command, it has an > implementation-defined (CONSTRAINED UNPREDICTABLE) choice of whether > to ignore the command, proceeding to the next one in the queue, or to > stall the ITS command queue, processing nothing further. T

Re: [PATCH 18/26] hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value

2021-12-13 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > process_its_cmd() returns a bool, like all the other process_ functions. > However we were putting its return value into 'res', not 'result', > which meant we would ignore it when deciding whether to continue > or stall the command queue. Fix the typo. > >

Re: [PATCH 12/26] hw/intc/arm_gicv3_its: Correct comment about CTE RDBase field size

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The comment says that in our CTE format the RDBase field is 36 bits; > in fact for us it is only 16 bits, because we use the RDBase format > where it specifies a 16-bit CPU number. The code already uses > RDBASE_PROCNUM_LENGTH (16) as the field width, so fix the comment

Re: [PATCH 13/26] hw/intc/arm_gicv3_its: Use FIELD macros for CTEs

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > Use FIELD macros to handle CTEs, rather than ad-hoc mask-and-shift. > > Signed-off-by: Peter Maydell > --- > hw/intc/gicv3_internal.h | 3 ++- > hw/intc/arm_gicv3_its.c | 7 --- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/hw/intc/gicv3_inte

[PATCH v2 02/19] ppc/pnv: Introduce a "chip" property under PHB3

2021-12-13 Thread Cédric Le Goater
This change will help us move the mapping of XSCOM regions under the PHB3 realize routine, which will be necessary for user created PHB3 devices. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- include/hw/pci-host/pnv_phb3.h | 3 +++ hw/pci

[PATCH v2 11/19] ppc/pnv: Compute the PHB index from the PHB4 PEC model

2021-12-13 Thread Cédric Le Goater
Use the num_stacks class attribute to compute the PHB index depending on the PEC index : * PEC0 provides 1 PHB (PHB0) * PEC1 provides 2 PHBs (PHB1 and PHB2) * PEC2 provides 3 PHBs (PHB3, PHB4 and PHB5) The routine pnv_pec_phb_offset() is a bit complex but it also prepares ground for PHB5 w

[PATCH v2 08/19] ppc/pnv: Introduce version and device_id class atributes for PHB4 devices

2021-12-13 Thread Cédric Le Goater
It prepares ground for PHB5 which has different values. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- include/hw/pci-host/pnv_phb4.h | 2 ++ hw/pci-host/pnv_phb4_pec.c | 2 ++ hw/ppc/pnv.c | 4 ++-- 3 files changed,

[PATCH v2 10/19] ppc/pnv: Introduce a num_stack class attribute

2021-12-13 Thread Cédric Le Goater
Each PEC device of the POWER9 chip has a predefined number of stacks, equivalent of a root port complex: PEC0 -> 1 stack PEC1 -> 2 stacks PEC2 -> 3 stacks Introduce a class attribute to hold these values and remove the "num-stacks" property. Reviewed-by: Daniel Henrique Barboza Reviewed-b

[PATCH v2 01/19] ppc/pnv: Change the maximum of PHB3 devices for Power8NVL

2021-12-13 Thread Cédric Le Goater
The POWER8 processors with a NVLink logic unit have 4 PHB3 devices per chip. Signed-off-by: Cédric Le Goater --- hw/ppc/pnv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 44ae41a9cb6b..6359bce549ca 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pn

[PATCH v2 06/19] ppc/pnv: Use QOM hierarchy to scan PHB3 devices

2021-12-13 Thread Cédric Le Goater
When -nodefaults is supported for PHB3 devices, the phbs array under the chip will be empty. This will break the XICSFabric handlers, and all interrupt delivery, and the 'info pic' HMP command. Do a QOM loop on the chip children and look for PHB3 devices instead. Signed-off-by: Cédric Le Goater

[PATCH v2 05/19] ppc/pnv: Move mapping of the PHB3 CQ regions under pnv_pbcq_realize()

2021-12-13 Thread Cédric Le Goater
This change will help us providing support for user created PHB3 devices. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- hw/pci-host/pnv_phb3_pbcq.c | 11 +++ hw/ppc/pnv.c| 12 2 files changed, 11 inser

[PATCH v2 15/19] ppc/pnv: Introduce support for user created PHB3 devices

2021-12-13 Thread Cédric Le Goater
PHB3 devices and PCI devices can now be added to the powernv8 machine using : -device pnv-phb3,chip-id=0,index=1 \ -device nec-usb-xhci,bus=pci.1,addr=0x0 The 'index' property identifies the PHB3 in the chip. In case of user created devices, a lookup on 'chip-id' is required to assign the own

[PATCH v2 12/19] ppc/pnv: Remove "system-memory" property from PHB4 PEC

2021-12-13 Thread Cédric Le Goater
This is not useful and will be in the way for support of user created PHB4 devices. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- hw/pci-host/pnv_phb4_pec.c | 6 +- hw/ppc/pnv.c | 2 -- 2 files changed, 1 insertion(+), 7

[PATCH v2 17/19] ppc/pnv: Complete user created PHB3 devices

2021-12-13 Thread Cédric Le Goater
PHB3s ared SysBus devices and should be allowed to be dynamically created. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Cédric Le Goater --- hw/pci-host/pnv_phb3.c | 9 + hw/ppc/pnv.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/hw/pci-host/pnv_phb3.c b/hw/pc

[PATCH v2 00/19] ppc/pnv: Add support for user created PHB3/PHB4 devices

2021-12-13 Thread Cédric Le Goater
Hello, On the POWER8 processor, powernv8 machine, PHB3 devices can simply be created with : -device pnv-phb3,chip-id=0,index=1 with a maximum of 3 PHB3s per chip, each PHB3 adding a new PCIe bus. On the POWER9 processor, powernv9 machine, the logic is different. The the chip comes with 3 PH

[PATCH v2 03/19] ppc/pnv: Use the chip class to check the index of PHB3 devices

2021-12-13 Thread Cédric Le Goater
The maximum number of PHB3 devices per chip can be different depending on the POWER8 processor model. Signed-off-by: Cédric Le Goater --- hw/pci-host/pnv_phb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 3aa42ef9d4b9.

[PATCH v2 07/19] ppc/pnv: Introduce a num_pecs class attribute for PHB4 PEC devices

2021-12-13 Thread Cédric Le Goater
POWER9 processor comes with 3 PHB4 PEC (PCI Express Controller) and each PEC can have several PHBs : * PEC0 provides 1 PHB (PHB0) * PEC1 provides 2 PHBs (PHB1 and PHB2) * PEC2 provides 3 PHBs (PHB3, PHB4 and PHB5) A num_pecs class attribute represents better the logic units of the POWER9 c

[PATCH v2 18/19] ppc/pnv: Introduce support for user created PHB4 devices

2021-12-13 Thread Cédric Le Goater
PHB4 devices and PCI devices can now be added to the powernv9 machine using: -device pnv-phb4-pec,chip-id=0,index=0 -device nec-usb-xhci,bus=pci.0,addr=0x0 In case of user created devices, a lookup on 'chip-id' is required to assign the owning chip. To be noted, that the PEC PHB4 devices can

[PATCH v2 16/19] ppc/pnv: Reparent user created PHB3 devices to the PnvChip

2021-12-13 Thread Cédric Le Goater
The powernv machine uses the object hierarchy to populate the device tree and each device should be parented to the chip it belongs to. This is not the case for user created devices which are parented to the container "/unattached". Make sure a PHB3 device is parented to its chip by reparenting th

[PATCH v2 14/19] ppc/pnv: Use QOM hierarchy to scan PEC PHB4 devices

2021-12-13 Thread Cédric Le Goater
When -nodefaults is supported for PHB4 devices, the pecs array under the chip will be empty. This will break the 'info pic' HMP command. Do a QOM loop on the chip children and look for PEC PHB4 devices instead. Signed-off-by: Cédric Le Goater --- hw/ppc/pnv.c | 20 +--- 1 file c

Re: [PATCH 16/26] hw/intc/arm_gicv3_its: Fix event ID bounds checks

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > In process_its_cmd() and process_mapti() we must check the > event ID against a limit defined by the size field in the DTE, > which specifies the number of ID bits minus one. Convert > this code to our num_foo convention, fixing the off-by-one error. > > Signed-off-by: P

[PATCH v2 19/19] ppc/pnv: Move num_phbs under Pnv8Chip

2021-12-13 Thread Cédric Le Goater
It is not used elsewhere so that's where it belongs. Signed-off-by: Cédric Le Goater --- include/hw/ppc/pnv.h | 4 ++-- hw/ppc/pnv.c | 7 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index ca27bd39f0ac..251c9854329d 10

[PATCH v2 09/19] ppc/pnv: Introduce a "chip" property under the PHB4 model

2021-12-13 Thread Cédric Le Goater
And check the PEC index using the chip class. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- include/hw/pci-host/pnv_phb4.h | 2 ++ hw/pci-host/pnv_phb4_pec.c | 7 +++ hw/ppc/pnv.c | 2 ++ 3 files changed, 11 inse

[PATCH v2 13/19] ppc/pnv: Move realize of PEC stacks under the PEC model

2021-12-13 Thread Cédric Le Goater
This change will help us providing support for user created PHB4 devices. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Cédric Le Goater --- hw/pci-host/pnv_phb4_pec.c | 34 ++ hw/ppc/pnv.c | 37 - 2 files c

Re: [PATCH 14/26] hw/intc/arm_gicv3_its: Fix various off-by-one errors

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The ITS code has to check whether various parameters passed in > commands are in-bounds, where the limit is defined in terms of the > number of bits that are available for the parameter. (For example, > the GITS_TYPER.Devbits ID register field specifies the number of >

Re: [PATCH 15/26] hw/intc/arm_gicv3_its: Rename max_l2_entries to num_l2_entries

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > In several places we have a local variable max_l2_entries which is > the number of entries which will fit in a level 2 table. The > calculations done on this value are correct; rename it to > num_l2_entries to fit the convention we're using in this code. > > Signed-off-

[PATCH v2 04/19] ppc/pnv: Drop the "num-phbs" property

2021-12-13 Thread Cédric Le Goater
It is never used. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- hw/ppc/pnv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 74c25c1c5d98..0413d221b311 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -

[PATCH] target/ppc: Fix e6500 boot

2021-12-13 Thread Fabiano Rosas
When Altivec support was added to the e6500 kernel in 2012[1], the QEMU code was not changed, so we don't register the VPU/VPUA exceptions for the e6500: qemu: fatal: Raised an exception without defined vector 73 Note that the error message says 73, instead of 32, which is the IVOR for VPU. Thi

Re: [PATCH 17/26] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > The bounds check on the number of interrupt IDs is correct, but > doesn't match our convention; change the variable name, initialize it > to the 2^n value rather than (2^n)-1, and use >= instead of > in the > comparison. > > Signed-off-by: Peter Maydell Reviewed-by: Al

Re: [PATCH 18/26] hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value

2021-12-13 Thread Alex Bennée
Peter Maydell writes: > process_its_cmd() returns a bool, like all the other process_ functions. > However we were putting its return value into 'res', not 'result', > which meant we would ignore it when deciding whether to continue > or stall the command queue. Fix the typo. Arguably having t

[PATCH v2] MIPS - fix cycle counter timing calculations

2021-12-13 Thread Simon Burge
The cp0_count_ns value is calculated from the CP0_COUNT_RATE_DEFAULT constant in target/mips/cpu.c. The cycle counter resolution is defined per-CPU in target/mips/cpu-defs.c.inc; use this value for calculating cp0_count_ns. Fixings timing problems on guest OSs for the 20Kc CPU which has a CCRes o

Re: [RFC v3 0/4] tls: add macros for coroutine-safe TLS variables

2021-12-13 Thread Stefan Hajnoczi
On Tue, Dec 07, 2021 at 01:55:34PM +, Peter Maydell wrote: > On Tue, 7 Dec 2021 at 13:53, Stefan Hajnoczi wrote: > > > > On Mon, Dec 06, 2021 at 02:34:45PM +, Peter Maydell wrote: > > > On Mon, 6 Dec 2021 at 14:33, Stefan Hajnoczi wrote: > > > > > > > > v3: > > > > - Added __attribute__((

Re: [PATCH] MIPS - fix cycle counter timing calculations

2021-12-13 Thread Simon Burge
Hi Phil, =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= wrote: > Oops, missing your Signed-off-by tag, see: > https://www.qemu.org/docs/master/devel/submitting-a-patch.html#patch-emails-must-includ e-a-signed-off-by-line > > Do you mind re-sending with your S-o-b? Meanwhile, patch dropped. Hopefully I'

Re: [PATCH] target/ppc: Fix e6500 boot

2021-12-13 Thread Cédric Le Goater
On 12/13/21 14:35, Fabiano Rosas wrote: When Altivec support was added to the e6500 kernel in 2012[1], the QEMU code was not changed, so we don't register the VPU/VPUA exceptions for the e6500: qemu: fatal: Raised an exception without defined vector 73 Note that the error message says 73, in

  1   2   3   >