Re: [PATCH] virtiofsd: Reverse req_list before processing it

2021-08-24 Thread Vivek Goyal
On Tue, Aug 24, 2021 at 03:11:58PM +0200, Sergio Lopez wrote: > With the thread pool disabled, we add the requests in the queue to a > GList, processing by iterating over there afterwards. > > For adding them, we're using "g_list_prepend()", which is more > efficient but causes the requests to be

[PATCH 0/9] block/nvme: Rework error reporting

2021-08-24 Thread Philippe Mathieu-Daudé
Hi, This series contains various patches sent last year with review comments addressed, few more cleanups, and a new patch which remove the spurious "VFIO_MAP_DMA failed: No space left on device" now poping up since commit 15a730e7a. (it is the expected behavior, which is why we retry the same

Re: [RFC PATCH v2 5/5] softmmu/physmem: Have flaview API check MemTxAttrs::bus_perm field

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 14:50, Philippe Mathieu-Daudé wrote: > > On 8/24/21 3:15 PM, Stefan Hajnoczi wrote: > > On Mon, Aug 23, 2021 at 06:41:57PM +0200, Philippe Mathieu-Daudé wrote: > >> Check bus permission in flatview_access_allowed() before > >> running any bus transaction. > >> > >> There is

[PATCH 04/19] host-utils: add 128-bit quotient support to divu128/divs128

2021-08-24 Thread Luis Pires
These will be used to implement new decimal floating point instructions from Power ISA 3.1. A new argument, prem, was added to divu128/divs128 to receive the remainder, freeing up phigh to receive the high 64 bits of the quotient. For scenarios supported by the previous implementation (<= 64-bit

[PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-24 Thread Luis Pires
Move abs64 to host-utils so it can be reused elsewhere. Also made it inline. Signed-off-by: Luis Pires --- hw/i386/kvm/i8254.c | 5 - include/qemu/host-utils.h | 8 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index

[PATCH 16/19] target/ppc: Move dquai[q], drint{x,n}[q] to decodetree

2021-08-24 Thread Luis Pires
Move the following instructions to decodetree: dquai: DFP Quantize Immediate dquaiq: DFP Quantize Immediate Quad drintx: DFP Round to FP Integer With Inexact drintxq: DFP Round to FP Integer With Inexact Quad drintn: DFP Round to FP Integer Without Inexact drintnq: DFP Round to FP Integer

[RFC 05/10] hw/mos6522: Don't clear T1 interrupt flag on latch write

2021-08-24 Thread Finn Thain
The Synertek datasheet says, "A write to T1L-H loads an 8-bit count value into the latch. A read of T1L-H transfers the contents of the latch to the data bus. Neither operation has an affect [sic] on the interrupt flag." Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 1 - 1 file changed, 1

[RFC 03/10] hw/mos6522: Remove redundant mos6522_timer1_update() calls

2021-08-24 Thread Finn Thain
Reads and writes to the TL and TC registers have no immediate effect on a running timer, with the exception of a write to TCH. Hence these mos6522_timer_update() calls are not needed. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 7 --- 1 file changed, 7 deletions(-) diff --git

[RFC 07/10] hw/mos6522: Fix initial timer counter reload

2021-08-24 Thread Finn Thain
The first reload of timer 1 is early by half of a clock cycle as it gets measured from a falling edge. By contrast, the succeeding reloads are measured from rising edge to rising edge. Neglecting that complication, the behaviour of the counter should be the same from one reload to the next. The

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Ani Sinha
On Tue, 24 Aug 2021, Igor Mammedov wrote: > On Mon, 23 Aug 2021 19:06:47 -0400 > "Michael S. Tsirkin" wrote: > > > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > > Bsel property of the pci bus indicates whether the bus supports acpi > > > hotplug. > > > We need to validate

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Markus Armbruster
Peter Maydell writes: > On Tue, 24 Aug 2021 at 09:14, Markus Armbruster wrote: >> In functions with an Error **errp parameter, use of _fatal is >> almost always wrong. > > What are the cases where it is not wrong? I can't think of a use that isn't wrong. Doesn't mean no such use could exist.

Re: [RFC PATCH v2 2/5] hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 23, 2021 at 06:41:54PM +0200, Philippe Mathieu-Daudé wrote: > We are going to introduce more MemTxResult bits, so it is > safer to check for !MEMTX_OK rather than MEMTX_ERROR. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/intc/arm_gicv3_dist.c | 4 ++-- >

Re: [RFC PATCH v2 1/5] softmmu/physmem: Simplify flatview_write and address_space_access_valid

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 23, 2021 at 06:41:53PM +0200, Philippe Mathieu-Daudé wrote: > Remove unuseful local 'result' variables. > > Signed-off-by: Philippe Mathieu-Daudé > --- > softmmu/physmem.c | 11 +++ > 1 file changed, 3 insertions(+), 8 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [PATCH] MAINTAINERS: Add myself as a reviewer for Device Fuzzing

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 4:04 PM, Darren Kenny wrote: > Should have done this much sooner given the amount of reviewing I'm > already doing in this area. > > Signed-off-by: Darren Kenny > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) :) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 14:58, Eduardo Habkost wrote: > > On Tue, Aug 24, 2021 at 01:16:40PM +0100, Peter Maydell wrote: > > On Tue, 24 Aug 2021 at 13:05, Markus Armbruster wrote: > > > When you know that all callers handle errors like _fatal does, use > > > of _fatal doesn't produce wrong

[PATCH 15/19] target/ppc: Move dcmp{u, o}[q], dts{tex, tsf, tsfi}[q] to decodetree

2021-08-24 Thread Luis Pires
Move the following instructions to decodetree: dcmpu:DFP Compare Unordered dcmpuq: DFP Compare Unordered Quad dcmpo:DFP Compare Ordered dcmpoq: DFP Compare Ordered Quad dtstex: DFP Test Exponent dtstexq: DFP Test Exponent Quad dtstsf: DFP Test Significance dtstsfq: DFP Test

Re: [RFC PATCH 1/1] QEMU plugin interface extension

2021-08-24 Thread Florian Hauschild
Am 21.08.21 um 15:18 schrieb Peter Maydell: > On Sat, 21 Aug 2021 at 10:48, Florian Hauschild > wrote: >> >> This extension covers functions: >> * to read and write guest memory >> * to read and write guest registers >> * to flush tb cache >> * to control single stepping of qemu from

[RFC 10/10] hw/mos6522: Synchronize timer interrupt and timer counter

2021-08-24 Thread Finn Thain
We rely on a QEMUTimer callback to set the interrupt flag, and this races with counter register accesses, such that the guest might see the counter reloaded but might not see the interrupt flagged. According to the datasheet, a real 6522 device counts down to , then raises the relevant IRQ.

[PATCH v2 1/3] simplebench: add img_bench_templater.py

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Add simple grammar-parsing template benchmark. New tool consume test template written in bash with some special grammar injections and produces multiple tests, run them and finally print a performance comparison table of different tests produced from one template. Signed-off-by: Vladimir

Re: [RFC 00/10] hw/mos6522: VIA timer emulation fixes and improvements

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > On a real Quadra, accesses to the SY6522 chips are slow because they are > synchronous with the 783360 Hz "phase 2" clock. In QEMU, they are slow > only because of the division operation in the timer count calculation. > > This patch series improves the

Re: [PATCH v2 1/5] qemu/qarray.h: introduce QArray

2021-08-24 Thread Christian Schoenebeck
On Dienstag, 24. August 2021 10:22:52 CEST Markus Armbruster wrote: > Christian Schoenebeck writes: > > Implements deep auto free of arrays while retaining common C-style > > squared bracket access. > > > > Signed-off-by: Christian Schoenebeck > > You provide some motivation for this, but only

Re: [PATCH v2 1/5] qemu/qarray.h: introduce QArray

2021-08-24 Thread Christian Schoenebeck
On Sonntag, 22. August 2021 15:16:46 CEST Christian Schoenebeck wrote: > Implements deep auto free of arrays while retaining common C-style > squared bracket access. > > Signed-off-by: Christian Schoenebeck > --- > include/qemu/qarray.h | 150 ++ > 1 file

[PATCH v6 1/5] hw/arm/virt: Only describe cpu topology since virt-6.2

2021-08-24 Thread Yanan Wang
On existing older machine types, without cpu topology described in ACPI or DT, the guest will populate one by default. With the topology described, it will read the information and set up its topology as instructed, but that may not be the same as what was getting used by default. It's possible

[PATCH v3 0/4] hw/arm/smmuv3: Support non PCI/PCIe devices

2021-08-24 Thread lik008
From: LCM The current SMMU v3 model only support PCI/PCIe devices, so we update it for non-PCI/PCIe devices. . Add independent IOMMU memory regions for non-PCI/PCIe devices . Add SID value property setting for non-PCI/PCIe devices . Add PL330 DMA controller into "virt" machine and connect

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 23, 2021 at 08:10:50PM +0100, Peter Maydell wrote: > On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé > wrote: > > > > This series aim to kill a recent class of bug, the infamous > > "DMA reentrancy" issues found by Alexander while fuzzing. > > > > Introduce the 'bus_perm' field

Re: [PATCH v8 25/34] python:QEMUMachine: template typing for self returning methods

2021-08-24 Thread Hanna Reitz
On 24.08.21 10:38, Vladimir Sementsov-Ogievskiy wrote: mypy thinks that return value of these methods in subclusses is QEMUMachine, which is wrong. So, make typing smarter. Suggested-by: John Snow Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 10 +++---

[PATCH 12/19] target/ppc: Implement DCTFIXQQ

2021-08-24 Thread Luis Pires
Implement the following PowerISA v3.1 instruction: dctfixqq: DFP Convert To Fixed Quadword Quad Signed-off-by: Luis Pires --- target/ppc/dfp_helper.c | 53 + target/ppc/helper.h | 1 + target/ppc/insn32.decode| 5 +++

[PATCH 08/19] target/ppc: Introduce REQUIRE_FPU

2021-08-24 Thread Luis Pires
From: Fernando Valle Signed-off-by: Fernando Valle Signed-off-by: Luis Pires --- target/ppc/translate.c | 8 1 file changed, 8 insertions(+) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 4749ecdaa9..5489b4b6e0 100644 --- a/target/ppc/translate.c +++

[PATCH 07/19] target/ppc: Move REQUIRE_ALTIVEC/VECTOR to translate.c

2021-08-24 Thread Luis Pires
From: Bruno Larsen Move REQUIRE_ALTIVEC to translate.c and rename it to REQUIRE_VECTOR. Signed-off-by: Bruno Larsen Signed-off-by: Matheus Ferst Signed-off-by: Fernando Valle Signed-off-by: Luis Pires --- target/ppc/translate.c | 8

[PATCH 18/19] target/ppc: Move dct{dp, qpq}, dr{sp, dpq}, dc{f, t}fix[q], dxex[q] to decodetree

2021-08-24 Thread Luis Pires
Move the following instructions to decodetree: dctdp: DFP Convert To DFP Long dctqpq: DFP Convert To DFP Extended drsp:DFP Round To DFP Short drdpq: DFP Round To DFP Long dcffix: DFP Convert From Fixed dcffixq: DFP Convert From Fixed Quad dctfix: DFP Convert To Fixed dctfixq: DFP

[RFC 02/10] hw/mos6522: Remove get_counter_value() methods and functions

2021-08-24 Thread Finn Thain
This code appears to be unnecessary. Also, these routines don't return the counter value but a time interval between counter values, so they are misnamed. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git

[RFC 04/10] hw/mos6522: Rename timer callback functions

2021-08-24 Thread Finn Thain
This improves readability. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 1d4a56077e..c0d6bee4cc 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -154,7 +154,7 @@

Re: [PATCH v5 2/5] python/aqmp-tui: Add AQMP TUI

2021-08-24 Thread Niteesh G. S.
On Tue, Aug 24, 2021 at 12:30 AM John Snow wrote: > > > On Mon, Aug 23, 2021 at 12:31 PM G S Niteesh Babu > wrote: > >> Added AQMP TUI. >> >> Implements the follwing basic features: >> 1) Command transmission/reception. >> 2) Shows events asynchronously. >> 3) Shows server status in the bottom

[PATCH v2 3/3] qcow2: handle_dependencies(): relax conflict detection

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
There is no conflict and no dependency if we have parallel writes to different subclusters of one cluster when the cluster itself is already allocated. So, relax extra dependency. Measure performance: First, prepare build/qemu-img-old and build/qemu-img-new images. cd scripts/simplebench

Re: [RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > It necessary to call mos6522_update_irq() when the interrupt flags > change and unnecessary when they haven't. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Philippe

Re: [PATCH] softmmu/physmem: Improve guest memory allocation failure error message

2021-08-24 Thread Igor Mammedov
On Tue, 24 Aug 2021 09:37:54 +0100 "Dr. David Alan Gilbert" wrote: > * David Hildenbrand (da...@redhat.com) wrote: > > On 23.08.21 12:34, Philippe Mathieu-Daudé wrote: > > > On 8/23/21 12:24 PM, David Hildenbrand wrote: > > > > On 23.08.21 12:12, Philippe Mathieu-Daudé wrote: > > > > > On

Re: [RFC PATCH v2 4/5] softmmu/physmem: Introduce flatview_access_allowed() to check bus perms

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 23, 2021 at 06:41:56PM +0200, Philippe Mathieu-Daudé wrote: > Introduce flatview_access_allowed() to check bus permission > before running any bus transaction. For now this is a simple > stub. > > Signed-off-by: Philippe Mathieu-Daudé > --- > softmmu/physmem.c | 37

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Ani Sinha
On Tue, 24 Aug 2021, Philippe Mathieu-Daudé wrote: > On 8/24/21 1:06 PM, Ani Sinha wrote: > > On Tue, 24 Aug 2021, Ani Sinha wrote: > >> On Tue, 24 Aug 2021, Igor Mammedov wrote: > >>> On Mon, 23 Aug 2021 19:06:47 -0400 > >>> "Michael S. Tsirkin" wrote: > >>> > On Sat, Aug 21, 2021 at

Re: [PATCH RFC v2 03/16] vfio-user: Define type vfio_user_pci_dev_info

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 16, 2021 at 09:42:36AM -0700, Elena Ufimtseva wrote: > +static Property vfio_user_pci_dev_properties[] = { > +DEFINE_PROP_STRING("socket", VFIOUserPCIDevice, sock_name), > +DEFINE_PROP_BOOL("secure-dma", VFIOUserPCIDevice, secure_dma, false), > +DEFINE_PROP_END_OF_LIST(), >

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Eduardo Habkost
On Tue, Aug 24, 2021 at 01:16:40PM +0100, Peter Maydell wrote: > On Tue, 24 Aug 2021 at 13:05, Markus Armbruster wrote: > > When you know that all callers handle errors like _fatal does, use > > of _fatal doesn't produce wrong behavior. It's still kind of > > wrong, because relying on such a

Re: [PATCH RFC v2 04/16] vfio-user: connect vfio proxy to remote server

2021-08-24 Thread Stefan Hajnoczi
On Mon, Aug 16, 2021 at 09:42:37AM -0700, Elena Ufimtseva wrote: > @@ -3361,13 +3362,35 @@ static void vfio_user_pci_realize(PCIDevice *pdev, > Error **errp) > VFIOUserPCIDevice *udev = VFIO_USER_PCI(pdev); > VFIOPCIDevice *vdev = VFIO_PCI_BASE(pdev); > VFIODevice *vbasedev =

Re: [RFC PATCH 1/1] QEMU plugin interface extension

2021-08-24 Thread Peter Maydell
On Tue, 24 Aug 2021 at 15:34, Florian Hauschild wrote: > > > > Am 21.08.21 um 15:18 schrieb Peter Maydell: > > On Sat, 21 Aug 2021 at 10:48, Florian Hauschild > > wrote: > >> > >> This extension covers functions: > >> * to read and write guest memory > >> * to read and write guest registers

[PATCH v2 0/3] qcow2: relax subclusters allocation dependencies

2021-08-24 Thread Vladimir Sementsov-Ogievskiy
Hi all! v2: 01: improve documentation 02: add Hanna's and Eric's r-bs, add tiny grammar fix 03: fix test by filtering instead of reducing number of writes Parallel small writes to unallocated cluster works bad when subclusters enabled. Look, without subclusters, one of write requests will

[RFC 09/10] hw/mos6522: Avoid using discrepant QEMU clock values

2021-08-24 Thread Finn Thain
mos6522_read() and mos6522_write() may call various functions to determine timer irq state, timer counter value and QEMUTimer deadline. All called functions must use the same value for the present time. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 51

[RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate

2021-08-24 Thread Finn Thain
It necessary to call mos6522_update_irq() when the interrupt flags change and unnecessary when they haven't. Signed-off-by: Finn Thain --- hw/misc/mos6522.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 0a241fe9f8..0dd3ccf945

Re: [RFC 04/10] hw/mos6522: Rename timer callback functions

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > This improves readability. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [RFC 01/10] hw/mos6522: Remove get_load_time() methods and functions

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > This code appears to be unnecessary. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 22 +- > 1 file changed, 1 insertion(+), 21 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [RFC 02/10] hw/mos6522: Remove get_counter_value() methods and functions

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 12:09 PM, Finn Thain wrote: > This code appears to be unnecessary. > > Also, these routines don't return the counter value but a time interval > between counter values, so they are misnamed. > > Signed-off-by: Finn Thain > --- > hw/misc/mos6522.c | 22 ++ > 1

Re: [PATCH] hw/acpi/pcihp: validate bsel property of the bus before unplugging device

2021-08-24 Thread Igor Mammedov
On Tue, 24 Aug 2021 16:07:30 +0530 (IST) Ani Sinha wrote: > On Tue, 24 Aug 2021, Igor Mammedov wrote: > > > On Mon, 23 Aug 2021 19:06:47 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > > > Bsel property of the pci bus indicates

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Gerd Hoffmann
Hi, > I was vaguely tossing an idea around in the back of my mind > about whether you could have a flag on devices that marked > them as "this device is currently involved in IO", such that > you could then just fail the last DMA (or qemu_irq_set, or > whatever) that would complete the loop

[PATCH v6 5/5] hw/acpi/aml-build: Generate PPTT table

2021-08-24 Thread Yanan Wang
From: Andrew Jones Add the Processor Properties Topology Table (PPTT) to expose CPU topology information defined by users to ACPI guests. Note, a DT-boot Linux guest with a non-flat CPU topology will see socket and core IDs being sequential integers starting from zero, which is different from

[PATCH v6 4/5] hw/acpi/aml-build: Add Processor hierarchy node structure

2021-08-24 Thread Yanan Wang
Add a generic API to build Processor hierarchy node structure (Type 0), which is strictly consistent with descriptions in ACPI 6.2: 5.2.29.1. This function will be used to build ACPI PPTT table for cpu topology. Co-developed-by: Ying Fang Co-developed-by: Henglong Fan Co-developed-by: Yanan

[PATCH 8/9] util/vfio-helpers: Let qemu_vfio_do_mapping() propagate Error

2021-08-24 Thread Philippe Mathieu-Daudé
Pass qemu_vfio_do_mapping() an Error* argument so it can propagate any error to callers. Replace error_report() which only report to the monitor by the more generic error_setg_errno(). Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH 7/9] util/vfio-helpers: Have qemu_vfio_dma_map() propagate Error

2021-08-24 Thread Philippe Mathieu-Daudé
Now that all qemu_vfio_dma_map() callers provide an Error* argument, fill it with relevant / more descriptive message. Reduce 'ret' (returned value) scope by returning errno directly to simplify (removing the goto / 'out' label). Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c|

Re: [PATCH v2 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed

2021-08-24 Thread Markus Armbruster
Peter Maydell writes: > On Tue, 24 Aug 2021 at 13:05, Markus Armbruster wrote: >> When you know that all callers handle errors like _fatal does, use >> of _fatal doesn't produce wrong behavior. It's still kind of >> wrong, because relying on such a non-local argument without a genuine >> need

[PATCH 14/19] target/ppc: Move d{add, sub, mul, div, iex}[q] to decodetree

2021-08-24 Thread Luis Pires
Move the following instructions to decodetree: dadd: DFP Add daddq: DFP Add Quad dsub: DFP Subtract dsubq: DFP Subtract Quad dmul: DFP Multiply dmulq: DFP Multiply Quad ddiv: DFP Divide ddivq: DFP Divide Quad diex: DFP Insert Biased Exponent diexq: DFP Insert Biased Exponent Quad

[PATCH 09/19] target/ppc: Implement DCFFIXQQ

2021-08-24 Thread Luis Pires
Implement the following PowerISA v3.1 instruction: dcffixqq: DFP Convert From Fixed Quadword Quad Signed-off-by: Luis Pires --- target/ppc/dfp_helper.c | 11 +++ target/ppc/helper.h | 1 + target/ppc/insn32.decode| 8

[PATCH 10/19] host-utils: Introduce mulu128

2021-08-24 Thread Luis Pires
Signed-off-by: Luis Pires --- include/qemu/host-utils.h | 38 ++ 1 file changed, 38 insertions(+) diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h index 8e8cab9a3e..2e3b5ad989 100644 --- a/include/qemu/host-utils.h +++

Re: [PATCH 4/4] vl: Prioritize realizations of devices

2021-08-24 Thread Peter Xu
On Tue, Aug 24, 2021 at 06:24:27PM +0200, David Hildenbrand wrote: > > > Not so much; here's the list of priorities and the devices using it: > > > > > > |+-| > > > | priority | devices | > > > |+-| > > >

[ANNOUNCE] QEMU 6.1.0 is now available

2021-08-24 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the QEMU 6.1.0 release. This release contains 3000+ commits from 221 authors. You can grab the tarball from our download page here: https://www.qemu.org/download/#source The full list of changes are available at:

[PATCH 1/2] Use EGL device extension in display initialization.

2021-08-24 Thread Eugene Huang
Signed-off-by: Eugene Huang --- ui/egl-helpers.c | 41 + 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 6d0cb2b5cb..ce0971422b 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -1,6 +1,8 @@

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

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

[PATCH v7 4/7] qapi/qdev.json: fix DEVICE_DELETED parameters doc

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

[PATCH 2/2] target/ppc: fix vextu[bhw][lr]x helpers

2021-08-24 Thread matheus . ferst
From: Matheus Ferst These helpers shouldn't depend on the host endianness, as they only use shifts, , and int128_* methods. Fixes: 60caf2216bf0 ("target-ppc: add vextu[bhw][lr]x instructions") Signed-off-by: Matheus Ferst --- target/ppc/int_helper.c | 38 ++

Re: [RFC PATCH v2 0/5] physmem: Have flaview API check bus permission from MemTxAttrs argument

2021-08-24 Thread Peter Xu
Hi, Peter, Gerd, On Tue, Aug 24, 2021 at 02:01:53PM +0200, Gerd Hoffmann wrote: > Hi, > > > I was vaguely tossing an idea around in the back of my mind > > about whether you could have a flag on devices that marked > > them as "this device is currently involved in IO", such that > > you could

[PATCH v4] block/file-win32: add reopen handlers

2021-08-24 Thread Viktor Prutyanov
Make 'qemu-img commit' work on Windows. Command 'commit' requires reopening backing file in RW mode. So, add reopen prepare/commit/abort handlers and change dwShareMode for CreateFile call in order to allow further read/write reopening. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/418

[PATCH v7 7/7] memory_hotplug.c: send DEVICE_UNPLUG_GUEST_ERROR in acpi_memory_hotplug_write()

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

[PATCH v7 2/7] spapr.c: handle dev->id in spapr_memory_unplug_rollback()

2021-08-24 Thread Daniel Henrique Barboza
As done in hw/acpi/memory_hotplug.c, pass an empty string if dev->id is NULL to qapi_event_send_mem_unplug_error() to avoid relying on a behavior that can be changed in the future. Suggested-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza --- hw/ppc/spapr.c | 2 +- 1 file changed,

[PATCH 2/2] Add comment for qemu_egl_get_display

2021-08-24 Thread Eugene Huang
Signed-off-by: Eugene Huang --- ui/egl-helpers.c | 4 1 file changed, 4 insertions(+) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index ce0971422b..dee31c6fbb 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -346,6 +346,10 @@ EGLSurface qemu_egl_init_surface_x11(EGLContext

[PATCH v7 1/7] memory_hotplug.c: handle dev->id = NULL in acpi_memory_hotplug_write()

2021-08-24 Thread Daniel Henrique Barboza
qapi_event_send_mem_unplug_error() deals with @device being NULL by replacing it with an empty string ("") when emitting the event. Aside from the fact that this behavior (qapi visitor mapping NULL pointer to "") can be patched/changed someday, there's also the lack of utility that the event

[PATCH v7 0/7] DEVICE_UNPLUG_GUEST_ERROR QAPI event

2021-08-24 Thread Daniel Henrique Barboza
Hi, In this version the event was renamed and the optional 'msg' attribute was removed. It also contains smaller changes based on Markus' comments in v6. changes from v6: - patches 1 and 2: * handle dev->id = NULL explicitly with empty string - patch 3: * added Markus' reviewed-by - patch 4:

[PATCH v7 5/7] qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event

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

Re: [PATCH 2/2] dump-guest-memory: Block live migration

2021-08-24 Thread Peter Xu
On Tue, Aug 24, 2021 at 10:04:19PM +0400, Marc-André Lureau wrote: > Hi Hello, Marc-Andre, > > On Tue, Aug 24, 2021 at 7:27 PM Peter Xu wrote: > > > Both dump-guest-memory and live migration caches vm state at the beginning. > > Either of them entering the other one will cause race on the vm

edid support for a Mac OS 10.8 guest

2021-08-24 Thread Programmingkid
Hi, I recently tried using the edid feature in QEMU for my Mac OS 10.8 guest like this: -device VGA,edid=on,xres=1280,yres=800. When the guest operating system loaded there were no additional options available in the Display settings. Would you know what is wrong? Thank you.

Re: Fw: [EXTERNAL] Re: [RFC PATCH 00/13] Add support for Mirror VM.

2021-08-24 Thread Tobin Feldman-Fitzthum
On Mon, Aug 16, 2021 at 04:15:46PM +0200, Paolo Bonzini wrote: > Hi, > > first of all, thanks for posting this work and starting the discussion. > > However, I am not sure if the in-guest migration helper vCPUs should use > the existing KVM support code. For example, they probably can just >

[PATCH 0/2] target/ppc: Fix vextu[bhw][lr]x on big endian hosts

2021-08-24 Thread matheus . ferst
From: Matheus Ferst The definition of struct Int128 is currently independent of the host endianness, causing different results when using the member s128 of union ppc_vsr_t in big-endian builds with CONFIG_INT128 or !CONFIG_INT128. The only PPC instructions that seem to be affected by this

[PATCH 1/2] include/qemu/int128.h: define struct Int128 according to the host endianness

2021-08-24 Thread matheus . ferst
From: Matheus Ferst Suggested-by: Peter Maydell Signed-off-by: Matheus Ferst --- include/qemu/int128.h | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/include/qemu/int128.h b/include/qemu/int128.h index 64500385e3..e36c6e6db5 100644 ---

Re: [PATCH V2] block/rbd: implement bdrv_co_block_status

2021-08-24 Thread Ilya Dryomov
On Mon, Aug 23, 2021 at 11:38 AM Peter Lieven wrote: > > Am 22.08.21 um 23:02 schrieb Ilya Dryomov: > > On Tue, Aug 10, 2021 at 3:41 PM Peter Lieven wrote: > >> the qemu rbd driver currently lacks support for bdrv_co_block_status. > >> This results mainly in incorrect progress during block

[PATCH v7 6/7] spapr: use DEVICE_UNPLUG_GUEST_ERROR to report unplug errors

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

Re: [RFC 00/10] hw/mos6522: VIA timer emulation fixes and improvements

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 08:09:36PM +1000, Finn Thain wrote: > This is a patch series that I started last year. The aim was to try to > get a monotonic clocksource for Linux/m68k guests. That aim hasn't been > achieved yet (for q800 machines) but I'm submitting the patch series as > an RFC

Re: [PATCH v7 5/7] qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 09:48:33PM -0300, Daniel Henrique Barboza wrote: > At this moment we only provide one event to report a hotunplug error, > MEM_UNPLUG_ERROR. As of Linux kernel 5.12 and QEMU 6.0.0, the pseries > machine is now able to report unplug errors for other device types, such > as

Re: [PATCH v7 4/7] qapi/qdev.json: fix DEVICE_DELETED parameters doc

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 09:48:32PM -0300, Daniel Henrique Barboza wrote: > Clarify that @device is optional and that 'path' is the device > path from QOM. > > This change follows Markus' suggestion verbatim, provided in full > context here: > >

Re: edid support for a Mac OS 10.8 guest

2021-08-24 Thread Chen Zhang
> On Tue, Aug 24, 2021 at 05:46:43PM -0400, Programmingkid wrote: > > Hi, I recently tried using the edid feature in QEMU for my Mac OS 10.8 > > guest > > like this: -device VGA,edid=on,xres=1280,yres=800. When the guest operating > > system loaded there were no additional options available in

Re: [PATCH 0/2] target/ppc: Fix vextu[bhw][lr]x on big endian hosts

2021-08-24 Thread Philippe Mathieu-Daudé
On 8/24/21 10:11 PM, matheus.fe...@eldorado.org.br wrote: > From: Matheus Ferst > > The definition of struct Int128 is currently independent of the host > endianness, causing different results when using the member s128 of > union ppc_vsr_t in big-endian builds with CONFIG_INT128 or >

Re: [PATCH v2 04/16] target/ppc: PMU basic cycle count for pseries TCG

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 01:30:20PM -0300, Daniel Henrique Barboza wrote: > This patch adds the barebones of the PMU logic by enabling cycle > counting, done via the performance monitor counter 6. The overall logic > goes as follows: > > - a helper is added to control the PMU state on each MMCR0

Re: [PATCH v2 07/16] target/ppc/power8_pmu.c: add PM_RUN_INST_CMPL (0xFA) event

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 01:30:23PM -0300, Daniel Henrique Barboza wrote: > PM_RUN_INST_CMPL, instructions completed with the run latch set, is > the architected PowerISA v3.1 event defined with PMC4SEL = 0xFA. > > Implement it by checking for the CTRL RUN bit before incrementing the > counter. >

[PATCH 4/5] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place

2021-08-24 Thread Ani Sinha
Now that we have "acpi-pci-hotplug-with-bridge-support" PIIX4 PM property being used for both q35 and i440fx machine types, it is better that we defined this property string at a single place within a header file like other PIIX4 properties. We can then use this single definition at all the places

Re: [PATCH 08/19] target/ppc: Introduce REQUIRE_FPU

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 11:27:19AM -0300, Luis Pires wrote: > From: Fernando Valle > > Signed-off-by: Fernando Valle > Signed-off-by: Luis Pires Reviewed-by: David Gibson > --- > target/ppc/translate.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/target/ppc/translate.c

Re: [PATCH v7 7/7] memory_hotplug.c: send DEVICE_UNPLUG_GUEST_ERROR in acpi_memory_hotplug_write()

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 09:48:35PM -0300, Daniel Henrique Barboza wrote: > MEM_UNPLUG_ERROR is deprecated since the introduction of > DEVICE_UNPLUG_GUEST_ERROR. Keep emitting both while the deprecation of > MEM_UNPLUG_ERROR is pending. > > CC: Michael S. Tsirkin > CC: Igor Mammedov >

Re: [PATCH v2 03/16] target/ppc: add exclusive user write function for MMCR0

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 01:30:19PM -0300, Daniel Henrique Barboza wrote: > From: Gustavo Romero > > Similar to the previous patch, user write on some PowerPC > PMU regs, in this case, MMCR0, is limited. Create a new > function to handle that. Ok.. ok, this fixes my concern on the previous

Re: [PATCH v2 02/16] target/ppc: add user read functions for MMCR0 and MMCR2

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 01:30:18PM -0300, Daniel Henrique Barboza wrote: > From: Gustavo Romero > > This patch adds handling of UMMCR0 and UMMCR2 user read which, > according to PowerISA 3.1, has some bits ommited to the Nit: One 'm' in "omited". > userspace. > > CC: Gustavo Romero >

Re: [PATCH v2 06/16] target/ppc: PMU: add instruction counting

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 01:30:22PM -0300, Daniel Henrique Barboza wrote: > The PMU is already counting cycles by calculating time elapsed in > nanoseconds. Counting instructions is a different matter and requires > another approach. > > This patch adds the capability of counting completed

Re: [PATCH v7 1/7] memory_hotplug.c: handle dev->id = NULL in acpi_memory_hotplug_write()

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 09:48:29PM -0300, Daniel Henrique Barboza wrote: > qapi_event_send_mem_unplug_error() deals with @device being NULL by > replacing it with an empty string ("") when emitting the event. Aside > from the fact that this behavior (qapi visitor mapping NULL pointer to > "") can

[PATCH v4 1/4] hw/arm/smmuv3: Support non PCI/PCIe device connect with SMMU v3

2021-08-24 Thread Li, Chunming
. Add sid-map property to store non PCI/PCIe devices SID . Create IOMMU memory regions for non PCI/PCIe devices based on their SID . Update SID getting strategy for PCI/PCIe and non PCI/PCIe devices Signed-off-by: Li, Chunming --- hw/arm/smmuv3.c | 46

[PATCH 2/5] hw/acpi: use existing references to pci device struct within functions

2021-08-24 Thread Ani Sinha
There is no need to use fresh typecasts to get references to pci device structs when there is an existing reference to pci device struct. Use existing reference. Minor cleanup. Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé --- hw/acpi/pcihp.c | 6 +++--- 1 file changed, 3

Re: [PATCH v2 05/16] target/ppc/power8_pmu.c: enable PMC1-PMC4 events

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 01:30:21PM -0300, Daniel Henrique Barboza wrote: > This patch enable all PMCs but PMC5 to count cycles. To do that we > need to implement MMCR1 bits where the event are stored, retrieve > them, see if the PMC was configured with a PM_CYC event, and > calculate cycles if

[PATCH 1/5] hw/pci: remove all references to find_i440fx function

2021-08-24 Thread Ani Sinha
commit c0e427d6eb5fefc538 ("hw/acpi/ich9: Enable ACPI PCI hot-plug") removed all uses of find_i440fx() function. This has been replaced by the more generic call acpi_get_i386_pci_host() which maybe able to find the root bus both for i440fx machine type as well as for the q35 machine type. There

[PATCH 3/5] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem

2021-08-24 Thread Ani Sinha
I have developed an interest in this space and hopefully can lend some helping hand to Igor and Michael in reviewing simpler patches. Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Acked-by: Igor Mammedov --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 5/5] hw/arm/Kconfig: no need to enable ACPI_MEMORY_HOTPLUG/ACPI_NVDIMM explicitly

2021-08-24 Thread Ani Sinha
Since commit 36b79e3219d ("hw/acpi/Kconfig: Add missing Kconfig dependencies (build error)"), ACPI_MEMORY_HOTPLUG and ACPI_NVDIMM is implicitly turned on when ACPI_HW_REDUCED is selected. ACPI_HW_REDUCED is already enabled. No need to turn on ACPI_MEMORY_HOTPLUG or ACPI_NVDIMM explicitly. This is

Re: [PATCH 0/2] target/ppc: Fix vextu[bhw][lr]x on big endian hosts

2021-08-24 Thread David Gibson
On Tue, Aug 24, 2021 at 05:11:03PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Matheus Ferst > > The definition of struct Int128 is currently independent of the host > endianness, causing different results when using the member s128 of > union ppc_vsr_t in big-endian builds with

<    1   2   3   4   >