Re: [PATCH 5/6] target/arm: Advertise FEAT_ETS for '-cpu max'

2022-08-19 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: The architectural feature FEAT_ETS (Enhanced Translation Synchronization) is a set of tightened guarantees about memory ordering involving translation table walks: * if memory access RW1 is ordered-before memory access RW2 then it is also ordered-befo

Re: [PATCH 6/6] target/arm: Add missing space in comment

2022-08-19 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: Fix a missing space before a comment terminator. Signed-off-by: Peter Maydell --- target/arm/cpu_tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 4/6] target/arm: Implement ID_DFR1

2022-08-19 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: In Armv8.6, a new AArch32 ID register ID_DFR1 is defined; implement it. We don't have any CPUs with features that they need to advertise here yet, but plumbing in the ID register gives it the right name when debugging and will help in future when we do add a

[PATCH v3] target/riscv: Use official extension names for AIA CSRs

2022-08-19 Thread Anup Patel
The arch review of AIA spec is completed and we now have official extension names for AIA: Smaia (M-mode AIA CSRs) and Ssaia (S-mode AIA CSRs). Refer, section 1.6 of the latest AIA v0.3.1 stable specification at https://github.com/riscv/riscv-aia/releases/download/0.3.1-draft.32/riscv-interrupts-0

Re: [PATCH v2] target/riscv: Use official extension names for AIA CSRs

2022-08-19 Thread Anup Patel
On Fri, Aug 19, 2022 at 8:40 PM Richard Henderson wrote: > > On 8/19/22 00:31, Anup Patel wrote: > > static int aia_hmode(CPURISCVState *env, int csrno) > > { > > -if (!riscv_feature(env, RISCV_FEATURE_AIA)) { > > +CPUState *cs = env_cpu(env); > > +RISCVCPU *cpu = RISCV_CPU(cs); >

Re: [PATCH 3/6] target/arm: Implement ID_MMFR5

2022-08-19 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: In Armv8.6 a new AArch32 ID register ID_MMFR5 is defined. Implement this; we want to be able to use it to report to the guest that we implement FEAT_ETS. Signed-off-by: Peter Maydell --- target/arm/cpu.h| 1 + target/arm/helper.c | 4 ++-- target/ar

Re: [PATCH 2/6] target/arm: Sort KVM reads of AArch32 ID registers into encoding order

2022-08-19 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: The code that reads the AArch32 ID registers from KVM in kvm_arm_get_host_cpu_features() does so almost but not quite in encoding order. Move the read of ID_PFR2 down so it's really in encoding order. Signed-off-by: Peter Maydell --- target/arm/kvm64.c |

Re: [PATCH 1/6] target/arm: Make cpregs 0, c0, c{3-15}, {0-7} correctly RAZ in v8

2022-08-19 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: In the AArch32 ID register scheme, coprocessor registers with encoding cp15, 0, c0, c{0-7}, {0-7} are all in the space covered by what in v6 and v7 was called the "CPUID scheme", and are supposed to RAZ if they're not allocated to a specific ID register. Fo

Re: [PATCH v2] scsi-disk: support setting CD-ROM block size via device options

2022-08-19 Thread John Millikin
Gentle ping On Thu, Aug 04, 2022 at 09:29:51PM +0900, John Millikin wrote: > SunOS expects CD-ROM devices to have a block size of 512, and will > fail to mount or install using QEMU's default block size of 2048. > > When initializing the SCSI device, allow the `physical_block_size' > block device

[PATCH v2 2/2] scsi: Reject commands if the CDB length exceeds buf_len

2022-08-19 Thread John Millikin
In scsi_req_parse_cdb(), if the CDB length implied by the command type exceeds the initialized portion of the command buffer, reject the request. Rejected requests are recorded by the `scsi_req_parse_bad` trace event. On example of a bug detected by this check is SunOS's use of interleaved DMA an

[PATCH v2 1/2] scsi: Add buf_len parameter to scsi_req_new()

2022-08-19 Thread John Millikin
When a SCSI command is received from the guest, the CDB length implied by the first byte might exceed the number of bytes the guest sent. In this case scsi_req_new() will read uninitialized data, causing unpredictable behavior. Adds the buf_len parameter to scsi_req_new() and plumbs it through the

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-19 Thread Kirill A. Shutemov
On Thu, Aug 18, 2022 at 08:00:41PM -0700, Hugh Dickins wrote: > On Thu, 18 Aug 2022, Kirill A . Shutemov wrote: > > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > > > > > If your memory could be swapped, that would be enough of a good reason > > > to make use of shmem.c: but it

Re: [PATCH v3] xio3130_upstream: Add ACS (Access Control Services) capability

2022-08-19 Thread Paul Schlacter
ping On Thu, Aug 18, 2022 at 10:25 PM Paul Schlacter wrote: > > If it is a pcie device, check that all devices on the path from > the device to the root complex have ACS enabled, and then the > device will become an iommu_group. > > pci_acs_path_enabled, this function in the Linux kernel, it mean

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-19 Thread Sean Christopherson
On Thu, Aug 18, 2022, Hugh Dickins wrote: > On Fri, 19 Aug 2022, Sean Christopherson wrote: > > On Thu, Aug 18, 2022, Kirill A . Shutemov wrote: > > > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > > > If your memory could be migrated, that would be some reason to use > > > > fil

Re: [PATCH for-7.2 v3 20/20] hmp, device_tree.c: add 'info fdt ' support

2022-08-19 Thread Daniel Henrique Barboza
On 8/17/22 22:34, David Gibson wrote: On Tue, Aug 16, 2022 at 02:34:28PM -0300, Daniel Henrique Barboza wrote: 'info fdt' is only able to print full nodes so far. It would be good to be able to also print single properties, since ometimes we just want to verify a single value from the FDT. l

Re: [PATCH] configure: improve error for ucontext coroutine backend

2022-08-19 Thread Richard Henderson
On 8/19/22 10:02, Paolo Bonzini wrote: Instead of using feature_not_found(), which is not a good match because there is no "remedy" to fix the lack of makecontext(), just print a custom error. This happens to remove the last use of feature_not_found(), so remove the definition and the documentat

Re: [PATCH v7 11/14] KVM: Register/unregister the guest private memory regions

2022-08-19 Thread Vishal Annapurve
> ... > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 230c8ff9659c..bb714c2a4b06 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -914,6 +914,35 @@ static int kvm_init_mmu_notifier(struct kvm *kvm) > > #endif /* CONFIG_MMU_NOTIFIER && KVM_ARCH_WANT_MMU_NOTIFIER

Re: [PULL for 7.1] Fix proberi instruction for qemu-hppa-user

2022-08-19 Thread Richard Henderson
On 8/19/22 07:19, Helge Deller wrote: Peter & Richard, would you please pull this one-line fix for target-hppa ? It fixes a mistranslation of the "proberi" hppa assembler instruction when run as linux-user. Without the fix many debian packages won't build in a hppa-chroot. There is no need to e

[RFC PATCH] qemu-options: try and clarify preferred block semantics

2022-08-19 Thread Alex Bennée
Try to correct any confusion about QEMU's Byzantine disk options by laying out the preferred "modern" options as-per: " (best: -device + -blockdev, 2nd obsolete syntax: -device + -drive, 3rd obsolete syntax: -drive, 4th obsolete syntax: -hdNN)" Signed-off-by: Alex Bennée Cc: qemu-bl...@

Re: [PATCH 08/62] target/arm: Create GetPhysAddrResult

2022-08-19 Thread Richard Henderson
On 8/10/22 06:02, Alex Bennée wrote: Richard Henderson writes: Combine 5 output pointer argument from get_phys_addr into a single struct. Adjust all callers. This looks to be an improvement - I guess the real benefit is the compiler isn't jamming so many closely aligned pointers on the sta

[PATCH 5/5] vdpa: Allow MQ feture in SVQ

2022-08-19 Thread Eugenio Pérez
Finally enable SVQ with MQ feature. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index d5bbda37a1..ccf933de2f 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -92,6 +92,7 @@ static const uint64_t

[PATCH 3/5] vdpa: validate MQ CVQ commands

2022-08-19 Thread Eugenio Pérez
So we are sure we can update the device model properly before sending to the device. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 9 + 1 file changed, 9 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 96fd3bc835..d5bbda37a1 100644 --- a/net/vhost-vdpa.c +++ b

[PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-19 Thread Eugenio Pérez
Same way as with the MAC, restore the expected number of queues at device's start. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 33 + 1 file changed, 33 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 1e0dbfcced..96fd3bc835 100644 ---

Re: [PATCH v6 00/21] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-19 Thread Vivian Wang
On 8/19/22 11:25, Richard Henderson wrote: > Hi Ilya, > > After adding support for riscv (similar to s390x, in that we can > find the total insn length from the first couple of bits, so, easy), > I find that the test case doesn't work without all of the other > changes for PROT_EXEC, including the

[PATCH 1/5] vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load

2022-08-19 Thread Eugenio Pérez
Since there may be many commands we need to issue to load the NIC state, let's split them in individual functions Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 39 +-- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/net/vhost-vdpa.c b/net

[PATCH] configure: improve error for ucontext coroutine backend

2022-08-19 Thread Paolo Bonzini
Instead of using feature_not_found(), which is not a good match because there is no "remedy" to fix the lack of makecontext(), just print a custom error. This happens to remove the last use of feature_not_found(), so remove the definition and the documentation. Signed-off-by: Paolo Bonzini ---

Re: [PATCH for-7.2 v3 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-19 Thread Daniel Henrique Barboza
On 8/17/22 23:07, David Gibson wrote: On Tue, Aug 16, 2022 at 02:34:18PM -0300, Daniel Henrique Barboza wrote: The pSeries machine never bothered with the common machine->fdt attribute. We do all the FDT related work using spapr->fdt_blob. We're going to introduce HMP commands to read and sa

[PATCH v9 12/12] vdpa: Delete CVQ migration blocker

2022-08-19 Thread Eugenio Pérez
We can restore the device state in the destination via CVQ now. Remove the migration blocker. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 1 - hw/virtio/vhost-vdpa.c | 15 --- net/vhost-vdpa.c | 2 -- 3 files changed

[PATCH 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-19 Thread Eugenio Pérez
It was returned as error before. Instead of it, simply update the corresponding field so qemu can send it in the migration data. Signed-off-by: Eugenio Pérez --- hw/net/virtio-net.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/ne

[PATCH v9 07/12] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo

2022-08-19 Thread Eugenio Pérez
Next patches will add a new info callback to restore NIC status through CVQ. Since only the CVQ vhost device is needed, create it with a new NetClientInfo. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v5: Create a new NetClientInfo instead of reusing the dataplane one. --- net/vhost-vd

[PATCH v9 09/12] vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail

2022-08-19 Thread Eugenio Pérez
So we can reuse it to inject state messages. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang -- v7: * Remove double free error v6: * Do not assume in buffer sent to the device is sizeof(virtio_net_ctrl_ack) v5: * Do not use an artificial !NULL VirtQueueElement * Use only out size instead of

Re: [PATCH v2 06/11] hw/ppc/pnv: Avoid dynamic stack allocation

2022-08-19 Thread Daniel Henrique Barboza
On 8/19/22 12:39, Peter Maydell wrote: From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell Reviewed-by: Daniel Henr

[PATCH 20/20] ppc4xx_sdram: Convert DDR SDRAM controller to new bank handling

2022-08-19 Thread BALATON Zoltan
Use the generic bank handling introduced in previous patch in the DDR SDRAM controller too. This also fixes previously broken region unmap due to sdram_ddr_unmap_bcr() ignoring container region so it crashed with an assert when the guest tried to disable the controller. Signed-off-by: BALATON Zolt

[PATCH 17/20] ppc4xx_sdram: Use hwaddr for memory bank size

2022-08-19 Thread BALATON Zoltan
This resolves the target_ulong dependency that's clearly wrong and was also noted in a fixme comment. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_sdram.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/ppc/ppc4xx_sdram.c b/hw/ppc/ppc4xx_sdram.c index 86

[PATCH v9 05/12] vhost_net: Add NetClientInfo start callback

2022-08-19 Thread Eugenio Pérez
This is used by the backend to perform actions before the device is started. In particular, vdpa net use it to map CVQ buffers to the device, so it can send control commands using them. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v9: Rename also in patch message v8: Rename NetClientIn

[PATCH v9 08/12] vdpa: Move command buffers map to start of net device

2022-08-19 Thread Eugenio Pérez
As this series will reuse them to restore the device state at the end of a migration (or a device start), let's allocate only once at the device start so we don't duplicate their map and unmap. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- net/vhost-vdpa.c | 123 ++--

[PATCH 0/5] Vhost-vdpa Shadow Virtqueue multiqueue support.

2022-08-19 Thread Eugenio Pérez
This series enables shadowed CVQ to intercept multiqueue commands through shadowed CVQ, update the virtio NIC device model so qemu send it in a migration, and the restore of that MQ state in the destination. It needs to be applied on top of [1]. [1] https://lists.gnu.org/archive/html/qemu-devel/2

[PATCH v9 04/12] vhost: Do not depend on !NULL VirtQueueElement on vhost_svq_flush

2022-08-19 Thread Eugenio Pérez
Since QEMU will be able to inject new elements on CVQ to restore the state, we need not to depend on a VirtQueueElement to know if a new element has been used by the device or not. Instead of check that, check if there are new elements only using used idx on vhost_svq_flush. Signed-off-by: Eugenio

[PATCH v9 01/12] vhost: stop transfer elem ownership in vhost_handle_guest_kick

2022-08-19 Thread Eugenio Pérez
It was easier to allow vhost_svq_add to handle the memory. Now that we will allow qemu to add elements to a SVQ without the guest's knowledge, it's better to handle it in the caller. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-shadow-virtqueue.c | 10 -- 1 file

[PATCH v9 11/12] vdpa: Add virtio-net mac address via CVQ at start

2022-08-19 Thread Eugenio Pérez
This is needed so the destination vdpa device see the same state a the guest set in the source. Signed-off-by: Eugenio Pérez --- v9: * Use guest acked features instead of device's. * Constify vhost_vdpa and VirtIONet variables. * Delete unneeded increment of cursor. v8: * Delete unneeded copy fr

[PATCH 16/20] ppc4xx_sdram: Move ppc4xx DDR and DDR2 SDRAM controller models together

2022-08-19 Thread BALATON Zoltan
Move the PPC4xx DDR and DDR2 SDRAM contrller models into a new file called ppc4xx_sdram to separate from other device models and put them in one place allowing sharing some code between them. Signed-off-by: BALATON Zoltan --- hw/ppc/meson.build | 3 +- hw/ppc/ppc440_uc.c | 321 --

[PATCH v9 02/12] vhost: use SVQ element ndescs instead of opaque data for desc validation

2022-08-19 Thread Eugenio Pérez
Since we're going to allow SVQ to add elements without the guest's knowledge and without its own VirtQueueElement, it's easier to check if an element is a valid head checking a different thing than the VirtQueueElement. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-shado

[PATCH 18/20] ppc4xx_sdram: Rename local state variable for brevity

2022-08-19 Thread BALATON Zoltan
Rename the sdram local state variable to s in dcr read/write functions and reset methods for better readability and to match realize methods. Other places not converted will be changed or removed in subsequent patches. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_sdram.c | 158 +++

[PATCH 19/20] ppc4xx_sdram: Generalise bank setup

2022-08-19 Thread BALATON Zoltan
Currently only base and size are set on initial bank creation and bcr value is computed on mapping the region. Set bcr at init so the bcr encoding method becomes local to the controller model and mapping and unmapping can operate on the bank so it can be shared between different controller models.

[PATCH v9 10/12] vhost_net: add NetClientState->load() callback

2022-08-19 Thread Eugenio Pérez
It allows per-net client operations right after device's successful start. In particular, to load the device status. Vhost-vdpa net will use it to add the CVQ buffers to restore the device status. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v5: Rename start / load, naming it more spec

[PATCH 14/20] ppc440_sdram: Move RAM size check to ppc440_sdram_init

2022-08-19 Thread BALATON Zoltan
Move the check for valid memory sizes from board to sdram contrller init. Board now only checks for additinal restrictions imposed by firmware then sdram init checks for valid sizes for SoC. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440.h| 4 ++-- hw/ppc/ppc440_uc.c | 15 +++

[PATCH 12/20] ppc440_sdram: Rename local variable for readibility

2022-08-19 Thread BALATON Zoltan
Rename local sdram variable in ppc440_sdram_init to s for readibility. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index bd3d60f278..72eb75d

[PATCH 07/20] ppc4xx_sdram: QOM'ify

2022-08-19 Thread BALATON Zoltan
Change the ppc4xx_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr. This is mostly modelling the DDR SDRAM controller found in the 440EP (used on the bamboo board) but also backward compatible with the older DDR controllers on some 405 SoCs so we also use i

[PATCH v9 06/12] vhost_net: Add NetClientInfo stop callback

2022-08-19 Thread Eugenio Pérez
Used by the backend to perform actions after the device is stopped. In particular, vdpa net use it to unmap CVQ buffers to the device, cleaning the actions performed in prepare(). Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v9: Replace performend by performed in patch message --- inc

[PATCH 15/20] ppc440_sdram: QOM'ify

2022-08-19 Thread BALATON Zoltan
Change the ppc440_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr2. This is mostly modelling the DDR2 SDRAM controller found in the 460EX (used on the sam460ex board). Newer SoCs (regardless of their PPC core, e.g. 405EX) may have this controller but we on

[PATCH v9 03/12] vhost: Delete useless read memory barrier

2022-08-19 Thread Eugenio Pérez
As discussed in previous series [1], this memory barrier is useless with the atomic read of used idx at vhost_svq_more_used. Deleting it. [1] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02616.html Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-shadow-virt

[PATCH 09/20] ppc440_sdram: Split off map/unmap of sdram banks for later reuse

2022-08-19 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 3507c35b63..c33f91e134 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -561,26 +561,

[PATCH 13/20] ppc4xx_sdram: Rename functions to prevent name clashes

2022-08-19 Thread BALATON Zoltan
Rename functions to avoid name clashes when moving the DDR2 controller model currently called ppc440_sdram to ppc4xx_devs. This also more clearly shows which function belongs to which model. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 69 ++--

[PATCH 08/20] ppc4xx_sdram: Drop extra zeros for readability

2022-08-19 Thread BALATON Zoltan
Constants that are written zero padded for no good reason are hard to read, it's easier to see what is meant if it's just 0 or 1 instead. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_devs.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff

[PATCH 10/20] ppc440_sdram: Implement enable bit in the DDR2 SDRAM controller

2022-08-19 Thread BALATON Zoltan
To allow removing the do_init hack we need to improve the DDR2 SDRAM controller model to handle the enable/disable bit that it ignored so far. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --gi

[PATCH v9 00/12] NIC vhost-vdpa state restore via Shadow CVQ

2022-08-19 Thread Eugenio Pérez
CVQ of net vhost-vdpa devices can be intercepted since the addition of x-svq. The virtio-net device model is updated. The migration was blocked because although the state can be megrated between VMM it was not possible to restore on the destination NIC. This series add support for SVQ to inject ex

[PATCH 00/20] ppc4xx_sdram QOMify and clean ups

2022-08-19 Thread BALATON Zoltan
Hello, This is based on gitlab.com/danielhb/qemu/tree/ppc-7.2 This is the end of the QOMify series started by Cédric. This series handles the SDRAM controller models to clean them up, QOMify and unify them and at least partially clean up the mess that has accumulated around these in the past. Thi

[PATCH 01/20] ppc440_bamboo: Remove unnecessary memsets

2022-08-19 Thread BALATON Zoltan
In ppc4xx_sdram_init() the struct is allocated with g_new0() so no need to clear its elements. In the bamboo machine init memset can be replaced with array initialiser which is shorter. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 6 ++ hw/ppc/ppc4xx_devs.c | 8 ++-- 2 fi

[PATCH 05/20] ppc440_bamboo: Add missing 4 MiB valid memory size

2022-08-19 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 2aac8a3fe9..2bd5e41140 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -51,7 +51,7 @@ #define PPC

[PATCH 11/20] ppc440_sdram: Get rid of the init RAM hack

2022-08-19 Thread BALATON Zoltan
Remove the do_init parameter of ppc440_sdram_init and enable SDRAM controller from the board via DCR access instead. Firmware does this so it may not be needed when booting firmware only with -kernel but we enable it unconditionally to preserve previous behaviour. Signed-off-by: BALATON Zoltan --

[PATCH 06/20] ppc4xx_sdram: Move size check to ppc4xx_sdram_init()

2022-08-19 Thread BALATON Zoltan
Instead of checking if memory size is valid in board code move this check to ppc4xx_sdram_init() as this is a restriction imposed by the SDRAM controller. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 2 -- hw/ppc/ppc405_boards.c | 10 -- hw/ppc/ppc405_uc.c | 11 ++--

[PATCH 04/20] ppc4xx: Use Ppc4xxSdramBank in ppc4xx_sdram_banks()

2022-08-19 Thread BALATON Zoltan
Change ppc4xx_sdram_banks() to take one Ppc4xxSdramBank array instead of the separate arrays and adjust ppc4xx_sdram_init() and ppc440_sdram_init() accordingly as well as machines using these. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 4 +--- hw/ppc/ppc405_uc.c | 10 +

[PATCH 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-08-19 Thread BALATON Zoltan
The do_init parameter of ppc4xx_sdram_init() is used to map memory regions that is normally done by the firmware by programming the SDRAM controller. This is needed when booting a kernel directly from -kernel without a firmware. Do this from board code accesing normal SDRAM controller registers the

[PATCH 1/7] vdpa: Skip the maps not in the iova tree

2022-08-19 Thread Eugenio Pérez
Next patch will skip the registering of dma maps that the vdpa device rejects in the iova tree. We need to consider that here or we cause a SIGSEGV accessing result. Reported-by: Lei Yang Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 4 1 file changed, 4 i

[PATCH 4/7] vdpa: Remove SVQ vring from iova_tree at shutdown

2022-08-19 Thread Eugenio Pérez
Although the device will be reset before usage, the right thing to do is to clean it. Reported-by: Lei Yang Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[PATCH 3/7] util: make a copy of iova_tree_remove_parameter

2022-08-19 Thread Eugenio Pérez
It's convenient to call iova_tree_remove from a map returned from iova_tree_find or iova_tree_find_iova. With the current code this is not possible, since we will free it, and then we will try to search for it again. Fix it making a copy of the argument. Not applying a fixes tag, since there is no

[PATCH 02/20] ppc4xx: Introduce Ppc4xxSdramBank struct

2022-08-19 Thread BALATON Zoltan
Instead of storing sdram bank parameters in unrelated arrays put them in a struct so it's clear they belong to the same bank and simplify the state struct using this bank type. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 49 +- hw/ppc/ppc4xx_devs.c

[PATCH 6/7] vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd

2022-08-19 Thread Eugenio Pérez
We can unbind twice a file descriptor if we call twice vhost_svq_set_svq_kick_fd because of this. Since it comes from vhost and not from SVQ, that file descriptor could be a different thing that guest's vhost notifier. Likewise, it can happens the same if a guest start and stop the device multiple

[PATCH 5/7] vdpa: Make SVQ vring unmapping return void

2022-08-19 Thread Eugenio Pérez
Nothing actually reads the return value, but an error in cleaning some entries could cause device stop to abort, making a restart impossible. Better ignore explicitely the return value. Reported-by: Lei Yang Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Eugenio P

[PATCH 2/7] vdpa: do not save failed dma maps in SVQ iova tree

2022-08-19 Thread Eugenio Pérez
If a map fails for whatever reason, it must not be saved in the tree. Otherwise, qemu will try to unmap it in cleanup, leaving to more errors. Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Reported-by: Lei Yang Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/

[PATCH 7/7] vdpa: Use ring hwaddr at vhost_vdpa_svq_unmap_ring

2022-08-19 Thread Eugenio Pérez
Reduce code duplication. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 07d00f5284..45d6e86b45 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/

[PATCH 0/7] vDPA shadow virtqueue iova tree fixes.

2022-08-19 Thread Eugenio Pérez
Collection of iova tree fixes detected preparing live migration with real devices and multiqueue. These cannot be triggered in simple setups (vdpa_sim_net, no display, no device reset with different features) but it's possible to trigger them with real devices or if the kernel fails some step like

Python test QMP Server implementation / version reply

2022-08-19 Thread John Snow
Hi Eric: Once upon a time I mentioned writing a QMP server implementation in Python. Now that the dust of the fork has (mostly) settled, I've rebased and uploaded that WIP here: https://gitlab.com/jsnow/python-qemu-qmp/-/commits/create_server/ Tracking issue: https://gitlab.com/qemu-project/pyth

Re: [PULL 0/1] query-stats-schemas crash fix for QEMU 7.1

2022-08-19 Thread Richard Henderson
On 8/19/22 02:12, Paolo Bonzini wrote: The following changes since commit c7208a6e0d049f9e8af15df908168a79b1f99685: Update version for v7.1.0-rc3 release (2022-08-16 20:45:19 -0500) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to

Re: [RFC PATCH v2 2/8] qapi: golang: Generate qapi's alternate types in Go

2022-08-19 Thread Andrea Bolognani
On Wed, Aug 17, 2022 at 04:04:19PM +0200, Victor Toso wrote: > On Tue, Jul 05, 2022 at 08:45:06AM -0700, Andrea Bolognani wrote: > > On Fri, Jun 17, 2022 at 02:19:26PM +0200, Victor Toso wrote: > > > func (s *BlockdevRef) UnmarshalJSON(data []byte) error { > > > // Check for json-null first > >

Re: [PATCH 0/4] Speed up migration tests

2022-08-19 Thread Alex Bennée
Thomas Huth writes: > We are currently facing the problem that the "gcov-gprof" CI jobs > in the gitlab-CI are running way too long - which happens since > the migration-tests have been enabled there recently. > > These patches now speed up the migration tests, so that the > CI job should be fi

Re: [PATCH v1 0/2] i386: KVM: Fix 'system_reset' failures when vCPU is in VMX root operation

2022-08-19 Thread Paolo Bonzini
On 8/18/22 17:01, Vitaly Kuznetsov wrote: Changes since RFC: - Call kvm_put_msr_feature_control() before kvm_put_sregs2() to achieve the same result [Paolo]. - Add Maxim's R-b to PATCH1. It was discovered that Windows 11 with WSL2 (Hyper-V) enabled guests fail to reboot when QEMU's 'system_res

Re: [qemu-web PATCH] Add signing pubkey for python-qemu-qmp package

2022-08-19 Thread Paolo Bonzini
On 8/18/22 18:53, John Snow wrote: Add the pubkey currently used for signing PyPI releases of qemu.qmp to a stable location where it can be referenced by e.g. Fedora RPM specfiles. At present, the key happens to just simply be my own -- but future releases may be signed by a different key. In th

Re: [PATCH 1/2] block: pass OnOffAuto instead of bool to block_acct_setup()

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/17/22 12:28, Denis V. Lunev wrote: We would have one more place for block_acct_setup() calling, which should not corrupt original value. Signed-off-by: Denis V. Lunev CC: Peter Krempa CC: Markus Armbruster CC: John Snow CC: Kevin Wolf CC: Hanna Reitz CC: Vladimir Sementsov-Ogievskiy

Re: [PATCH 1/2] scsi: Add buf_len parameter to scsi_req_new()

2022-08-19 Thread Paolo Bonzini
On 8/17/22 07:34, John Millikin wrote: The sigil SCSI_CMD_BUF_LEN_TODO() is used to indicate that the buffer length calculation is TODO it should be replaced by a better value, such as the length of a successful DMA read. Let's just do it right: diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi5

Re: [RFC PATCH 06/13] target/ppc: remove embedded interrupts from ppc_pending_interrupt_p9

2022-08-19 Thread Fabiano Rosas
"Matheus K. Ferst" writes: > On 15/08/2022 18:23, Fabiano Rosas wrote: >> Matheus Ferst writes: >> >>> Critical Input, Watchdog Timer, and Fixed Interval Timer are only >>> defined for embedded CPUs. The Programmable Interval Timer is 40x-only. >>> >>> Signed-off-by: Matheus Ferst >>> --- >>>

Re: [PATCH 1/2] block: use bdrv_is_sg() helper instead of raw bs->sg reading

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/17/22 11:37, Denis V. Lunev wrote: I believe that if the helper exists, it must be used always for reading of the value. It breaks expectations in the other case. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Stefan Hajnoczi CC: Fam Zheng CC: Ronnie Sahlberg CC: Paolo Bon

Re: [PATCH 2/2] block: make serializing requests functions 'void'

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/17/22 11:37, Denis V. Lunev wrote: Return codes of the following functions are never used in the code: * bdrv_wait_serialising_requests_locked * bdrv_wait_serialising_requests * bdrv_make_request_serialising Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Stefan Hajnoczi CC

Re: [PATCH v2] target/arm: Add cortex-a35

2022-08-19 Thread Peter Maydell
On Fri, 19 Aug 2022 at 01:20, Hao Wu wrote: > > Add cortex A35 core and enable it for virt board. > > Signed-off-by: Hao Wu > Reviewed-by: Joe Komlodi Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v10 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/18/22 10:46, Emanuele Giuseppe Esposito wrote: Am 17/08/2022 um 20:54 schrieb Vladimir Sementsov-Ogievskiy: On 8/16/22 15:52, Emanuele Giuseppe Esposito wrote:    } @@ -501,8 +481,12 @@ void job_unref_locked(Job *job)> assert(!job->txn);      if (job->driver->free) { + 

Re: [PATCH] esp: Handle CMD_BUSRESET by resetting the SCSI bus

2022-08-19 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH v2 11/11] tests/unit/test-vmstate: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- tests/unit/test-vmstate.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-

[PATCH v2 10/11] ui/curses: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- ui/curses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/cu

[PATCH v2 04/11] io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé The combined_key[... QIO_CHANNEL_WEBSOCK_GUID_LEN ...] array in qio_channel_websock_handshake_send_res_ok() expands to a call to strlen(QIO_CHANNEL_WEBSOCK_GUID), and the compiler doesn't realize the string is const, so consider combined_key[] being a variable-length

[PATCH v2 06/11] hw/ppc/pnv: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- hw/ppc/pnv.c | 4 ++-- hw/ppc/spapr.c |

[PATCH v2 08/11] hw/i386/multiboot: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Replace the snprintf() call by g_strdup_printf(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- hw/i386/multiboot.c | 5 ++--- 1 fi

[PATCH v2 07/11] hw/intc/xics: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: Peter Maydell --- hw/intc/xics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v2 01/11] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell --- chardev/baum.c | 11 +++ 1 file changed, 7 insertions(+

[PATCH v2 05/11] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé The compiler isn't clever enough to figure 'min_buf_size' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Jason Wang Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- hw/net/e1000e_core.c |

[PATCH v2 09/11] hw/usb/hcd-ohci: Use definition to avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé The compiler isn't clever enough to figure 'width' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- hw/usb/hcd-ohci.c | 7 --- 1 file changed, 4 ins

[PATCH v2 03/11] chardev/baum: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell --- chardev/baum.c | 3 ++- 1 file changed, 2 insertions(+)

[PATCH v2 00/11] misc: Remove variable-length arrays on the stack

2022-08-19 Thread Peter Maydell
This is a resend of a subset of patches from a series that Philippe sent out last year: https://patchew.org/QEMU/20210505211047.1496765-1-phi...@redhat.com/ Basically I just pulled out the patches which: (1) trivially applied on a rebase (2) had got a Reviewed-by: or at least an Acked-by: since

[PATCH v2 02/11] chardev/baum: Use definitions to avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé We know 'x * y' will be at most 'X_MAX * Y_MAX' (which is not a big value, it is actually 84). Instead of having the compiler use variable-length array, declare an array able to hold the maximum 'x * y'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André

Re: [RFC PATCH v2 4/8] qapi: golang: Generate qapi's union types in Go

2022-08-19 Thread Andrea Bolognani
On Fri, Aug 19, 2022 at 09:20:52AM +0200, Victor Toso wrote: > > > On Wed, Jul 06, 2022 at 10:37:54AM +0100, Daniel P. Berrangé wrote: > > > > On Wed, Jul 06, 2022 at 04:28:16AM -0500, Andrea Bolognani wrote: > > > > > You're right, that is undesirable. What about something like this? > > > > > > >

Re: [PATCH v2] target/riscv: Use official extension names for AIA CSRs

2022-08-19 Thread Richard Henderson
On 8/19/22 00:31, Anup Patel wrote: static int aia_hmode(CPURISCVState *env, int csrno) { -if (!riscv_feature(env, RISCV_FEATURE_AIA)) { +CPUState *cs = env_cpu(env); +RISCVCPU *cpu = RISCV_CPU(cs); Better as RISCVCPU *cpu = env_archcpu(env); r~

  1   2   >