[PATCH 0/5] target/arm: Support variable sized coprocessor registers

2022-04-11 Thread Gavin Shan
There are two arrays for each CPU, to store the indexes and values of the coprocessor registers. Currently, 8 bytes fixed storage space is reserved for each coprocessor register. However, larger coprocessor registers have been defined and exposed by KVM. Except SVE registers, no coprocessor registe

[PATCH 2/5] target/arm/hvf: Indirect addressing for coprocessor register storage

2022-04-11 Thread Gavin Shan
Similar to what we did for TCG, this uses @cpreg_value_indexes[] to track the storage space for the corresponding coprocessor register. As all coprocessor register have fixed 8 bytes storage space, so the indirect and direct addressing mechanisms can co-exist and interchangeable, even in migration

[PATCH 3/5] target/arm/kvm: Indirect addressing for coprocessor register storage

2022-04-11 Thread Gavin Shan
Similar to what we did for TCG, this uses @cpreg_value_indexes[] to track the storage space for the corresponding coprocessor register. As all coprocessor register have fixed 8 bytes storage space, so the indirect and direct addressing mechanisms can co-exist and interchangeable, even in migration

[PATCH 4/5] target/arm: Migrate coprocessor register indirect addressing information

2022-04-11 Thread Gavin Shan
This migrates @cpreg_value_array_len and @cpreg_value_indexes, which are used to indirectly addressing the storage space for the corresponding coprocessor register. Signed-off-by: Gavin Shan --- target/arm/machine.c | 30 -- 1 file changed, 24 insertions(+), 6 deletio

[PATCH 5/5] target/arm/kvm: Support coprocessor register with variable size

2022-04-11 Thread Gavin Shan
With the indirect addressing mechanism, we can support large-sized coprocessor registers. This calculates the length of @cpreg_values and allocate the storage space accordingly. @cpreg_value_indexes is also initialized according to the coprocessor register size. For those registers whose sizes are

Re: [RFC PATCH for-7.1] Remove the slirp submodule (and only compile with an external libslirp)

2022-04-11 Thread Paolo Bonzini
On 4/8/22 18:47, Thomas Huth wrote: The only one that still seems to be missing a libslirp package is OpenBSD - but I assume that they can add it to their ports system quickly if required. So there is no real urgent need for keeping the slirp submodule in the QEMU tree anymore. Thus let's drop t

Re: [PATCH v1] hw/ppc: change indentation to spaces from TABs

2022-04-11 Thread Thomas Huth
On 11/04/2022 08.57, Bin Meng wrote: On Mon, Apr 11, 2022 at 2:45 PM Thomas Huth wrote: On 08/04/2022 21.19, Daniel Henrique Barboza wrote: On 4/6/22 07:08, Bin Meng wrote: On Tue, Apr 5, 2022 at 10:36 PM Guo Zhi wrote: There are still some files in the QEMU PPC code base that use TABs

Re: [RFC PATCH for-7.1] Remove the slirp submodule (and only compile with an external libslirp)

2022-04-11 Thread Paolo Bonzini
On 4/11/22 09:11, Paolo Bonzini wrote: On 4/8/22 18:47, Thomas Huth wrote: The only one that still seems to be missing a libslirp package is OpenBSD - but I assume that they can add it to their ports system quickly if required. So there is no real urgent need for keeping the slirp submodule in

Re: [PATCH v5 0/9] Add support for AST1030 SoC

2022-04-11 Thread Cédric Le Goater
Hello Jamin, [ ... ] Do we want to be in sync with the zephyr naming and use ast10x0.c ? https://github.com/zephyrproject-rtos/zephyr/tree/main/soc/arm/aspeed We used aspeed_ast10xx.c to support minibmc family such as ast1030 and may support ast1060 in the future. If need, I can submit

Re: [PATCH 1/3] vhost: Refactor vhost_reset_device() in VhostOps

2022-04-11 Thread Jason Wang
On Sat, Apr 9, 2022 at 1:17 AM Si-Wei Liu wrote: > > > > On 4/8/2022 1:38 AM, Michael Qiu wrote: > > > > > > 在 2022/4/7 15:35, Jason Wang 写道: > >> > >> 在 2022/4/2 下午1:14, Michael Qiu 写道: > >>> > >>> > >>> On 2022/4/2 10:38, Jason Wang wrote: > > 在 2022/4/1 下午7:06, Michael Qiu 写道: > >

Re: [PATCH 4/7] virtio: don't read pending event on host notifier if disabled

2022-04-11 Thread Jason Wang
On Fri, Apr 8, 2022 at 9:02 AM Si-Wei Liu wrote: > > > > On 4/7/2022 12:05 AM, Jason Wang wrote: > > > > 在 2022/4/6 上午3:18, Si-Wei Liu 写道: > >> > >> > >> On 4/1/2022 7:00 PM, Jason Wang wrote: > >>> On Sat, Apr 2, 2022 at 4:37 AM Si-Wei Liu > >>> wrote: > > > On 3/31/2022 1:36 AM,

Re: [PATCH v5 0/9] Add support for AST1030 SoC

2022-04-11 Thread Jamin Lin
The 04/11/2022 08:23, Cédric Le Goater wrote: > Hello Jamin, > > [ ... ] > > >> Do we want to be in sync with the zephyr naming and use ast10x0.c ? > >> > >> https://github.com/zephyrproject-rtos/zephyr/tree/main/soc/arm/aspeed > >> > > We used aspeed_ast10xx.c to support minibmc family such

Re: [PATCH 0/5] target/arm: Support variable sized coprocessor registers

2022-04-11 Thread Peter Maydell
On Mon, 11 Apr 2022 at 07:59, Gavin Shan wrote: > > There are two arrays for each CPU, to store the indexes and values of the > coprocessor registers. Currently, 8 bytes fixed storage space is reserved > for each coprocessor register. However, larger coprocessor registers have > been defined and e

Re: [PATCH 0/5] target/arm: Support variable sized coprocessor registers

2022-04-11 Thread Gavin Shan
Hi Peter, On 4/11/22 5:22 PM, Peter Maydell wrote: On Mon, 11 Apr 2022 at 07:59, Gavin Shan wrote: There are two arrays for each CPU, to store the indexes and values of the coprocessor registers. Currently, 8 bytes fixed storage space is reserved for each coprocessor register. However, larger

Re: [PATCH 00/17] tests/docker and tests/tcg cleanup and diet

2022-04-11 Thread Alex Bennée
Paolo Bonzini writes: > The first eight patches simplify and clean up a bit the > tests/docker/Makefile.include file. Queued to testing/next, thanks. -- Alex Bennée

Re: [PATCH 0/5] target/arm: Support variable sized coprocessor registers

2022-04-11 Thread Peter Maydell
On Mon, 11 Apr 2022 at 10:50, Gavin Shan wrote: > On 4/11/22 5:22 PM, Peter Maydell wrote: > > So, can you give an example of coprocessor registers which are > > not 8 bytes in size? How are they accessed by the guest? > > If we need to support them then we need to support them, but this > > cover

Re: [PATCH v1 0/2] hw/arm: zynqmp: Add the 4 TTC timers

2022-04-11 Thread Peter Maydell
On Thu, 31 Mar 2022 at 23:20, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > This adds the 4 TTC timers in the Xilinx ZynqMP. > This is for after the 7.0.0 release. > > Cheers, > Edgar > > Edgar E. Iglesias (2): > timer: cadence_ttc: Break out header file to allow embedding > hw/a

[PATCH v4 0/8] Introduce akcipher service for virtio-crypto

2022-04-11 Thread zhenwei pi
v3 -> v4: - Coding style fix: Akcipher -> AkCipher, struct XXX -> XXX, Rsa -> RSA, XXX-alg -> XXX-algo. - Change version info in qapi/crypto.json, from 7.0 -> 7.1. - Remove ecdsa from qapi/crypto.json, it would be introduced with the implemetion later. - Use QCryptoHashAlgothrim instead of QCrypto

[PATCH v4 1/8] virtio-crypto: header update

2022-04-11 Thread zhenwei pi
Update header from linux, support akcipher service. Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi --- .../standard-headers/linux/virtio_crypto.h| 82 ++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/include/standard-headers/linux/virt

[PATCH v4 3/8] crypto: Introduce akcipher crypto class

2022-04-11 Thread zhenwei pi
Support basic asymmetric operations: encrypt, decrypt, sign and verify. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi --- crypto/akcipher.c | 102 + crypto/akcipherpriv.h | 43 +++ crypto/meson.build| 1 + include

[PATCH v4 2/8] crypto-akcipher: Introduce akcipher types to qapi

2022-04-11 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA related types. Signed-off-by: Lei He Signed-off-by: zhenwei pi --- qapi/crypto.json | 64 1 file changed, 64 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json index 1ec54c15c

[PATCH v4 4/8] crypto: add ASN.1 decoder

2022-04-11 Thread zhenwei pi
From: Lei He Add an ANS.1 decoder which is used to parse asymmetric cipher keys Signed-off-by: zhenwei pi Signed-off-by: Lei He --- crypto/asn1_decoder.c | 161 ++ crypto/asn1_decoder.h | 75 +++ crypto/meson.build| 1 + t

Re: [PATCH v1 0/4] hw/arm: versal: Add Cortex-R5s and CRL

2022-04-11 Thread Peter Maydell
On Wed, 6 Apr 2022 at 18:43, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > This adds the Versal Cortex-R5s in the Real-Time Processing Unit > (RPU) subsystem. > > A model of the Clock/Reset Low-power domain (CRL) is also added > allowing runtime release of the Cortex-R5s. The RPU sub

[PATCH v4 8/8] crypto: Introduce RSA algorithm

2022-04-11 Thread zhenwei pi
There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and

[PATCH v4 5/8] crypto: Implement RSA algorithm by hogweed

2022-04-11 Thread zhenwei pi
From: Lei He Implement RSA algorithm by hogweed from nettle. Thus QEMU supports a 'real' RSA backend to handle request from guest side. It's important to test RSA offload case without OS & hardware requirement. Signed-off-by: Lei He Signed-off-by: zhenwei pi --- crypto/akcipher-nettle.c.inc |

[PATCH v4 6/8] crypto: Implement RSA algorithm by gcrypt

2022-04-11 Thread zhenwei pi
From: Lei He Added gcryt implementation of RSA algorithm, RSA algorithm implemented by gcrypt has a higher priority than nettle because it supports raw padding. Signed-off-by: Lei He --- crypto/akcipher-gcrypt.c.inc | 531 +++ crypto/akcipher.c| 4

[PATCH v4 7/8] tests/crypto: Add test suite for crypto akcipher

2022-04-11 Thread zhenwei pi
From: lei he Add unit test and benchmark test for crypto akcipher. Signed-off-by: lei he Signed-off-by: zhenwei pi --- tests/bench/benchmark-crypto-akcipher.c | 161 ++ tests/bench/meson.build | 4 + tests/bench/test_akcipher_keys.inc | 537 ++ tests

Re: [PATCH 1/2] hw/misc: Add PWRON STRAP bit fields in GCR module

2022-04-11 Thread Peter Maydell
On Wed, 6 Apr 2022 at 23:34, Hao Wu wrote: > > Similar to the Aspeed code in include/misc/aspeed_scu.h, we define > the PWRON STRAP fields in their corresponding module for NPCM7XX. > > Signed-off-by: Hao Wu > Reviewed-by: Patrick Venture > --- > include/hw/misc/npcm7xx_gcr.h | 30 +

Re: [PATCH 2/2] hw/arm: Use bit fields for NPCM7XX PWRON STRAPs

2022-04-11 Thread Peter Maydell
On Wed, 6 Apr 2022 at 23:34, Hao Wu wrote: > > This patch uses the defined fields to describe PWRON STRAPs for > better readability. > > Signed-off-by: Hao Wu > Reviewed-by: Patrick Venture > --- > hw/arm/npcm7xx_boards.c | 24 +++- > 1 file changed, 19 insertions(+), 5 dele

Re: [PATCH] migration/dirtyrate: Replace malloc with g_new

2022-04-11 Thread Dr. David Alan Gilbert
* jianchunfu (jianchu...@cmss.chinamobile.com) wrote: > Using macro g_new() to handling potential memory allocation failures > in dirtyrate. > > Signed-off-by: jianchunfu > --- > migration/dirtyrate.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/migration/dirtyra

Re: [PATCH 0/5] target/arm: Support variable sized coprocessor registers

2022-04-11 Thread Andrew Jones
On Mon, Apr 11, 2022 at 10:22:59AM +0100, Peter Maydell wrote: > On Mon, 11 Apr 2022 at 07:59, Gavin Shan wrote: > > > > There are two arrays for each CPU, to store the indexes and values of the > > coprocessor registers. Currently, 8 bytes fixed storage space is reserved > > for each coprocessor

Re: [PATCH 0/5] target/arm: Support variable sized coprocessor registers

2022-04-11 Thread Peter Maydell
On Mon, 11 Apr 2022 at 13:02, Andrew Jones wrote: > > On Mon, Apr 11, 2022 at 10:22:59AM +0100, Peter Maydell wrote: > > Also, we support SVE today, and we don't have variable size > > coprocessor registers. Is there a bug here that we would be > > fixing ? > > SVE registers are KVM_REG_SIZE_U2048

Re: [PATCH 4/5] docs: introduce RSS support in Vhost-user specification

2022-04-11 Thread Dr. David Alan Gilbert
* Maxime Coquelin (maxime.coque...@redhat.com) wrote: > This patch documents RSS feature in Vhost-user specification. > Two new requests are introduced backed by a dedicated > protocol feature. > > First one is to query the Vhost-user slave RSS capabilities > such as supported hash types, maximum

Re: [PATCH 01/16] target/arm: Add isar predicates for FEAT_Debugv8p2

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:10, Richard Henderson wrote: > > Signed-off-by: Richard Henderson > --- > target/arm/cpu.h | 15 +++ > 1 file changed, 15 insertions(+) > Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH 02/16] target/arm: Adjust definition of CONTEXTIDR_EL2

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:09, Richard Henderson wrote: > > This register is present for either VHE or Debugv8p2, and is > RES0 from EL3 when EL2 is not present. Move the definition > out of vhe_reginfo and provide a fallback for missing EL2. > > Signed-off-by: Richard Henderson > --- > target/ar

Re: [PATCH 04/16] target/arm: Set ID_DFR0.PerfMon for qemu-system-arm -cpu max

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:10, Richard Henderson wrote: > > We set this for qemu-system-aarch64, but failed to do so > for the strictly 32-bit emulation. > > Fixes: 3bec78447a9 ("target/arm: Provide ARMv8.4-PMU in '-cpu max'") > Signed-off-by: Richard Henderson > --- > target/arm/cpu_tcg.c | 4 +++

Re: [PATCH 05/16] target/arm: Split out arm32_max_features

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:14, Richard Henderson wrote: > > Share the code to set AArch32 max features so that we no > longer have code drift between qemu{-system,}-{arm,aarch64}. > > Signed-off-by: Richard Henderson > --- > target/arm/internals.h | 2 + > target/arm/cpu64.c | 51 +-

Re: [PATCH 06/16] target/arm: Annotate arm_max_initfn with FEAT identifiers

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:14, Richard Henderson wrote: > > Update the legacy feature names to the current names. > Provide feature names for id changes that were not marked. > Sort the field updates into increasing bitfield order. > > Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell

Re: [PATCH 07/16] target/arm: Use field names for manipulating EL2 and EL3 modes

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:08, Richard Henderson wrote: > > Use FIELD_DP{32,64} to manipulate id_pfr1 and id_aa64pfr0 > during arm_cpu_realizefn. > > Signed-off-by: Richard Henderson > --- > target/arm/cpu.c | 22 +- > 1 file changed, 13 insertions(+), 9 deletions(-) > Reviewe

[PATCH] target/ppc: Add two missing register callbacks on POWER10

2022-04-11 Thread Frederic Barrat
This patch adds tcg accessors for 2 SPRs which were missing on P10: - the TBU40 register is used to write the upper 40 bits of the timebase register. It is used by kvm to update the timebase when entering/exiting the guest on P9 and above. The missing definition was causing erratic decrementer int

Re: [PATCH 08/16] target/arm: Enable FEAT_Debugv8p2 for -cpu max

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:18, Richard Henderson wrote: > > The only portion of FEAT_Debugv8p2 that is relevant to QEMU > is CONTEXTIDR_EL2, which is also conditionally implemented > with FEAT_VHE. The rest of the debug extension concerns the > External debug interface, which is outside the scope o

Re: [PATCH 09/16] target/arm: Enable FEAT_Debugv8p4 for -cpu max

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:18, Richard Henderson wrote: > > This extension concerns changes to the External Debug interface, > with Secure and Non-secure access to the debug registers, and all > of it is outside the scope of QEMU. Indicating support for this > is mandatory with FEAT_SEL2, which we

Re: [PATCH 10/16] target/arm: Add isar_feature_{aa64,any}_ras

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:23, Richard Henderson wrote: > > Add the aa64 predicate for detecting RAS support from id registers. > We already have the aa32 version from the M-profile work. > Add the 'any' predicate for testing both aa64 and aa32. > > Signed-off-by: Richard Henderson > --- > target/

[PATCH] migration/dirtyrate: Replace malloc with g_new

2022-04-11 Thread jianchunfu
Using macro g_new() to handling potential memory allocation failures in dirtyrate. Signed-off-by: jianchunfu --- migration/dirtyrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index aace12a787..0e59aacbb0 100644 --- a/m

Re: [PATCH] [PATCH RFC v4] Implements Backend Program conventions for vhost-user-scsi

2022-04-11 Thread Stefan Hajnoczi
On Wed, Apr 06, 2022 at 11:24:10AM -0500, Sakshi Kaushik wrote: > Signed-off-by: Sakshi Kaushik > --- > contrib/vhost-user-scsi/vhost-user-scsi.c | 78 +++ > 1 file changed, 52 insertions(+), 26 deletions(-) Thanks, I have applied this patch to my block-next branch! I made a

[RFC PATCH v6 04/23] hw/virtio: Replace g_memdup() by g_memdup2()

2022-04-11 Thread Eugenio Pérez
From: Philippe Mathieu-Daudé Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize t

[RFC PATCH v6 00/23] Net Control VQ support with asid in vDPA SVQ

2022-04-11 Thread Eugenio Pérez
Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. Shadow VirtQueue (SVQ) already makes possible migration of virtqueue states, effectively intercepting them so qemu can track what regions of me

[RFC PATCH v6 02/23] vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base

2022-04-11 Thread Eugenio Pérez
Fixes: 6d0b222666 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 9e5fe15d03..1f229ff4cb 100644 --- a/hw/virtio/v

[PATCH] tpm_crb: mark command buffer as dirty on request completion

2022-04-11 Thread Anthony PERARD via
From: Anthony PERARD At the moment, there doesn't seems to be any way to know that QEMU made modification to the command buffer. This is potentially an issue on Xen while migrating a guest, as modification to the buffer after the migration as started could be ignored and not transfered to the des

[RFC PATCH v6 01/23] vdpa: Add missing tracing to batch mapping functions

2022-04-11 Thread Eugenio Pérez
These functions were not traced properly. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 2 ++ hw/virtio/trace-events | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 8adf7c0b92..9e5fe15d03 100644 --- a/hw/virtio/vhost-vdpa.c

[RFC PATCH v6 10/23] vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs

2022-04-11 Thread Eugenio Pérez
To know the device features is also needed for CVQ SVQ. Extract from vhost_vdpa_get_max_queue_pairs so we can reuse it. Report errno in case of failure getting them while we're at it. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 30 -- 1 file changed, 20 inser

[RFC PATCH v6 06/23] vdpa: Add x-svq to NetdevVhostVDPAOptions

2022-04-11 Thread Eugenio Pérez
Finally offering the possibility to enable SVQ from the command line. Signed-off-by: Eugenio Pérez --- qapi/net.json| 9 - net/vhost-vdpa.c | 48 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/qapi/net.json b/qapi/net

[RFC PATCH v6 13/23] vhost: Add custom used buffer callback

2022-04-11 Thread Eugenio Pérez
The callback allows SVQ users to know the VirtQueue requests and responses. QEMU can use this to synchronize virtio device model state, allowing to migrate it with minimum changes to the migration code. In the case of networking, this will be used to inspect control virtqueue messages. Signed-off

[RFC PATCH v6 03/23] util: Return void on iova_tree_remove

2022-04-11 Thread Eugenio Pérez
It always returns IOVA_OK so nobody uses it. Signed-off-by: Eugenio Pérez --- include/qemu/iova-tree.h | 4 +--- util/iova-tree.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/qemu/iova-tree.h b/include/qemu/iova-tree.h index c938fb0793..16bbfdf5f8 1006

[RFC PATCH v6 17/23] vhost: Add vhost_svq_inject

2022-04-11 Thread Eugenio Pérez
This allows qemu to inject packets to the device without guest's notice. This will be use to inject net CVQ messages to restore status in the destination Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 5 + hw/virtio/vhost-shadow-virtqueue.c | 179 +++

[RFC PATCH v6 07/23] vhost: move descriptor translation to vhost_svq_vring_write_descs

2022-04-11 Thread Eugenio Pérez
It's done for both in and out descriptors so it's better placed here. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-

[RFC PATCH v6 05/23] vhost: Fix bad return of descriptors to SVQ

2022-04-11 Thread Eugenio Pérez
Only the first one of them were properly enqueued back. Fixes: 100890f7ca ("vhost: Shadow virtqueue buffers forwarding") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-shad

[RFC PATCH v6 20/23] vhost: Update kernel headers

2022-04-11 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- include/standard-headers/linux/vhost_types.h | 11 - linux-headers/linux/vhost.h | 25 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-he

[RFC PATCH v6 08/23] vdpa: Fix index calculus at vhost_vdpa_svqs_start

2022-04-11 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 1f229ff4cb..3f8fa66e8e 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -1018,7 +1018,7 @@ static bo

[RFC PATCH v6 23/23] vdpa: Add x-cvq-svq

2022-04-11 Thread Eugenio Pérez
This isolates shadow cvq in its own group. Signed-off-by: Eugenio Pérez --- qapi/net.json| 8 +++- net/vhost-vdpa.c | 98 ++-- 2 files changed, 100 insertions(+), 6 deletions(-) diff --git a/qapi/net.json b/qapi/net.json index 92848e4362..39c245e

[RFC PATCH v6 18/23] vdpa: add NetClientState->start() callback

2022-04-11 Thread Eugenio Pérez
It allows to inject custom code on device success start, right before release lock. Signed-off-by: Eugenio Pérez --- include/net/net.h | 2 ++ hw/net/vhost_net.c | 4 2 files changed, 6 insertions(+) diff --git a/include/net/net.h b/include/net/net.h index 523136c7ac..2fc3002ab4 100644 --

[RFC PATCH v6 09/23] virtio-net: Expose ctrl virtqueue logic

2022-04-11 Thread Eugenio Pérez
This allows external vhost-net devices to modify the state of the VirtIO device model once vhost-vdpa device has acknowledge the control commands. Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio-net.h | 3 ++ hw/net/virtio-net.c| 83 -- 2 fi

[RFC PATCH v6 22/23] vdpa: Add asid attribute to vdpa device

2022-04-11 Thread Eugenio Pérez
We can configure ASID per group, but we still use asid 0 for every vdpa device. Multiple asid support for cvq will be introduced in next patches Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost.h | 4 ++ hw/net/vhost_net.c| 5 ++ hw/virtio/vhost-vdpa.c| 97 +

[RFC PATCH] target/i386: avoid copying junk to extended ZMMReg fields

2022-04-11 Thread Alex Bennée
When change b7711471f5 was made to alias XMMReg to ZMMReg for the purposes of easing the handling of AVX512 registers we unwittingly broke the SSE helpers which construct a temporary value on the stack before copying them out. To avoid this lets encode REG_WIDTH based on shift and convert the point

[RFC PATCH v6 19/23] vdpa: Add vhost_vdpa_start_control_svq

2022-04-11 Thread Eugenio Pérez
This will send CVQ commands in the destination machine, seting up everything o there is no guest-visible change. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 63 1 file changed, 63 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vd

[RFC PATCH v6 11/23] virtio: Make virtqueue_alloc_element non-static

2022-04-11 Thread Eugenio Pérez
So SVQ can allocate elements using it Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio.h | 1 + hw/virtio/virtio.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b31c4507f5..1e85833897 100644 --

[PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator

2022-04-11 Thread Stefan Hajnoczi
The GLib documentation says "a NULL-terminated array of GOptionEntrys" so we'd better make sure there is a terminator that lets g_option_context_add_main_entries() know when the end of the array has been reached. Signed-off-by: Stefan Hajnoczi --- contrib/vhost-user-blk/vhost-user-blk.c | 3 ++-

[RFC PATCH v6 14/23] vdpa: control virtqueue support on shadow virtqueue

2022-04-11 Thread Eugenio Pérez
Introduce the control virtqueue support for vDPA shadow virtqueue. This is needed for advanced networking features like multiqueue. To demonstrate command handling, VIRTIO_NET_F_CTRL_MACADDR and VIRTIO_NET_CTRL_MQ are implemented. If vDPA device is started with SVQ support and virtio-net driver ch

[RFC PATCH v6 16/23] vdpa: Add map/unmap operation callback to SVQ

2022-04-11 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 21 +++-- hw/virtio/vhost-shadow-virtqueue.c | 8 +++- hw/virtio/vhost-vdpa.c | 20 +++- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost-shadow-vi

Re: [PATCH] target/ppc: Add two missing register callbacks on POWER10

2022-04-11 Thread Fabiano Rosas
Frederic Barrat writes: > This patch adds tcg accessors for 2 SPRs which were missing on P10: > > - the TBU40 register is used to write the upper 40 bits of the > timebase register. It is used by kvm to update the timebase when > entering/exiting the guest on P9 and above. The missing definition

[RFC PATCH v6 15/23] vhost: Add vhost_iova_tree_find

2022-04-11 Thread Eugenio Pérez
Just a simple wrapper so we can find DMAMap entries based on iova Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-iova-tree.h | 2 ++ hw/virtio/vhost-iova-tree.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/hw/virtio/vhost-iova-tree.h b/hw/virtio/vhost-iova-tree.h index

[RFC PATCH v6 12/23] vhost: Add SVQElement

2022-04-11 Thread Eugenio Pérez
This allows SVQ to add metadata to the different queue elements Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 8 -- hw/virtio/vhost-shadow-virtqueue.c | 42 -- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/hw/virtio/vhos

Re: [RFC PATCH] target/i386: avoid copying junk to extended ZMMReg fields

2022-04-11 Thread Peter Maydell
On Mon, 11 Apr 2022 at 15:56, Alex Bennée wrote: > > When change b7711471f5 was made to alias XMMReg to ZMMReg for the > purposes of easing the handling of AVX512 registers we unwittingly > broke the SSE helpers which construct a temporary value on the stack > before copying them out. To avoid thi

[RFC PATCH v6 21/23] vhost: Make possible to check for device exclusive vq group

2022-04-11 Thread Eugenio Pérez
CVQ needs to be in its own group, not shared with any data vq. Enable the checking of it here, before introducing address space id concepts. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost.h | 2 + hw/net/vhost_net.c| 4 +- hw/virtio/vhost-vdpa.c| 79 ++

Re: Procedures adding new CPUs in sbsa-ref

2022-04-11 Thread Alex Bennée
Itaru Kitayama writes: > Good point; however per the SBSA specification, DEN0029F, there's the > PE architecture requirement at > each level from 1 to 7, so now I am wondering whether supporting > cortex-a57 and a72 are good enough to > set up a fully SBSA level 7 compliant "board" in QMEU. No

Re: [PATCH v5 03/13] mm/shmem: Support memfile_notifier

2022-04-11 Thread Kirill A. Shutemov
On Thu, Mar 10, 2022 at 10:09:01PM +0800, Chao Peng wrote: > diff --git a/mm/shmem.c b/mm/shmem.c > index 9b31a7056009..7b43e274c9a2 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -903,6 +903,28 @@ static struct folio *shmem_get_partial_folio(struct > inode *inode, pgoff_t index) > return

Re: [PATCH v5 01/13] mm/memfd: Introduce MFD_INACCESSIBLE flag

2022-04-11 Thread Kirill A. Shutemov
On Thu, Mar 10, 2022 at 10:08:59PM +0800, Chao Peng wrote: > From: "Kirill A. Shutemov" > > Introduce a new memfd_create() flag indicating the content of the > created memfd is inaccessible from userspace through ordinary MMU > access (e.g., read/write/mmap). However, the file content can be > ac

Re: [PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-04-11 Thread Kirill A. Shutemov
On Fri, Apr 08, 2022 at 09:02:54PM +0800, Chao Peng wrote: > > I think the correct approach is to not do the locking automatically for > > SHM_F_INACCESSIBLE, > > and instead require userspace to do shmctl(.., SHM_LOCK, ...) if userspace > > knows the > > consumers don't support migrate/swap. Th

Re: [RFC] migration/dirtyrate: check malloc() return

2022-04-11 Thread Alex Bennée
Richard Henderson writes: > On 4/9/22 20:58, jianchunfu wrote: >> Handling potential memory allocation failures in dirtyrate. >> Signed-off-by: jianchunfu >> --- >> migration/dirtyrate.c | 8 >> 1 file changed, 8 insertions(+) >> diff --git a/migration/dirtyrate.c b/migration/dirty

Re: [PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-04-11 Thread Kirill A. Shutemov
On Thu, Apr 07, 2022 at 04:05:36PM +, Sean Christopherson wrote: > Hmm, shmem_writepage() already handles SHM_F_INACCESSIBLE by rejecting the > swap, so > maybe it's just the page migration path that needs to be updated? My early version prevented migration with -ENOTSUPP for address_space_op

RE: [PATCH v8 10/12] target/hexagon: import parser for idef-parser

2022-04-11 Thread Taylor Simpson
> -Original Message- > From: Anton Johansson > Sent: Wednesday, February 9, 2022 11:03 AM > To: qemu-devel@nongnu.org > Cc: a...@rev.ng; Taylor Simpson ; Brian Cain > ; Michael Lambert ; > bab...@rev.ng; ni...@rev.ng; richard.hender...@linaro.org > Subject: [PATCH v8 10/12] target/hexag

Re: [PATCH 03/16] target/arm: Update qemu-system-arm -cpu max to cortex-a57

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:11, Richard Henderson wrote: > > Instead of starting with cortex-a15 and adding v8 features to > a v7 cpu, begin with a v8 cpu stripped of its aarch64 features. > This fixes the long-standing to-do where we only enabled v8 > features for user-only. > > Signed-off-by: Richa

Re: [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator

2022-04-11 Thread Michael S. Tsirkin
On Mon, Apr 11, 2022 at 04:00:57PM +0100, Stefan Hajnoczi wrote: > The GLib documentation says "a NULL-terminated array of GOptionEntrys" > so we'd better make sure there is a terminator that lets > g_option_context_add_main_entries() know when the end of the array has > been reached. > > Signed-o

Re: [PATCH 11/16] target/arm: Add minimal RAS registers

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:14, Richard Henderson wrote: > > Add only the system registers required to implement zero error > records. This means we need to save state for ERRSELR, but all > values are out of range, so none of the indexed error record > registers need be implemented. > > Add the EL2

Re: [PATCH 12/16] target/arm: Enable SCR and HCR bits for RAS

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:11, Richard Henderson wrote: > > Enable writes to the TERR and TEA bits when RAS is enabled. > These bits are otherwise RES0. > > Signed-off-by: Richard Henderson > --- > target/arm/helper.c | 9 + > 1 file changed, 9 insertions(+) Reviewed-by: Peter Maydell

Re: [PATCH 13/16] target/arm: Implement virtual SError exceptions

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:11, Richard Henderson wrote: > > Virtual SError exceptions are raised by setting HCR_EL2.VSE, > and are routed to EL1 just like other virtual exceptions. > > Signed-off-by: Richard Henderson > --- > target/arm/cpu.h | 2 ++ > target/arm/internals.h | 8 >

Re: [PATCH 14/16] target/arm: Implement ESB instruction

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:18, Richard Henderson wrote: > > Check for and defer any pending virtual SError. > > Signed-off-by: Richard Henderson > --- > target/arm/helper.h| 1 + > target/arm/a32.decode | 16 +- > target/arm/t32.decode | 18 +++ > target/

Re: [PATCH V6 21/27] vfio-pci: cpr part 3 (intx)

2022-04-11 Thread Steven Sistare
On 3/29/2022 7:03 AM, Fam Zheng wrote: > On 2021-08-06 14:43, Steve Sistare wrote: >> Preserve vfio INTX state across cpr restart. Preserve VFIOINTx fields as >> follows: >> pin : Recover this from the vfio config in kernel space >> interrupt : Preserve its eventfd descriptor across exec. >>

Re: [PATCH 03/16] target/arm: Update qemu-system-arm -cpu max to cortex-a57

2022-04-11 Thread Richard Henderson
On 4/11/22 08:37, Peter Maydell wrote: +/* aarch64_a57_initfn, advertising none of the aarch64 features */ +cpu->dtb_compatible = "arm,cortex-a57"; +set_feature(&cpu->env, ARM_FEATURE_V8); +set_feature(&cpu->env, ARM_FEATURE_NEON); +set_feature(&cpu->env, ARM_FEATURE_GENERIC_T

Re: [PATCH] tpm_crb: mark command buffer as dirty on request completion

2022-04-11 Thread Stefan Berger
On 4/11/22 10:47, Anthony PERARD wrote: From: Anthony PERARD At the moment, there doesn't seems to be any way to know that QEMU made modification to the command buffer. This is potentially an issue on Xen while migrating a guest, as modification to the buffer after the migration as started c

Re: [PATCH v1] hw/ppc: change indentation to spaces from TABs

2022-04-11 Thread Daniel Henrique Barboza
On 4/11/22 04:23, Thomas Huth wrote: On 11/04/2022 08.57, Bin Meng wrote: On Mon, Apr 11, 2022 at 2:45 PM Thomas Huth wrote: On 08/04/2022 21.19, Daniel Henrique Barboza wrote: On 4/6/22 07:08, Bin Meng wrote: On Tue, Apr 5, 2022 at 10:36 PM Guo Zhi wrote: There are still some files

Re: [PATCH 15/16] target/arm: Enable FEAT_RAS for -cpu max

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:14, Richard Henderson wrote: > > Signed-off-by: Richard Henderson > --- > target/arm/cpu64.c | 1 + > target/arm/cpu_tcg.c | 1 + > 2 files changed, 2 insertions(+) Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH 13/16] target/arm: Implement virtual SError exceptions

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:11, Richard Henderson wrote: > > Virtual SError exceptions are raised by setting HCR_EL2.VSE, > and are routed to EL1 just like other virtual exceptions. > > Signed-off-by: Richard Henderson > @@ -10041,6 +10048,20 @@ static void arm_cpu_do_interrupt_aarch32(CPUState >

Re: [PATCH 16/16] target/arm: Enable FEAT_IESB for -cpu max

2022-04-11 Thread Peter Maydell
On Sat, 9 Apr 2022 at 01:23, Richard Henderson wrote: > > This feature is AArch64 only, and applies to physical SErrors, > which QEMU does not implement, thus the feature is a nop. > > Signed-off-by: Richard Henderson > --- > target/arm/cpu64.c | 1 + > 1 file changed, 1 insertion(+) > > diff --

Re: [PATCH 1/7] target/arm: Enable FEAT_CSV2 for -cpu max

2022-04-11 Thread Peter Maydell
On Sun, 10 Apr 2022 at 06:58, Richard Henderson wrote: > > This extension concerns branch speculation, which TCG does > not implement. Thus we can trivially enable this feature. > > Signed-off-by: Richard Henderson > --- > target/arm/cpu64.c | 1 + > target/arm/cpu_tcg.c | 1 + Reviewed-by:

Re: [PATCH 2/7] target/arm: Update ISAR fields for ARMv8.8

2022-04-11 Thread Peter Maydell
On Sun, 10 Apr 2022 at 06:58, Richard Henderson wrote: > > Update isar fields per ARM DDI0487 H.a. > > Signed-off-by: Richard Henderson > --- > target/arm/cpu.h | 23 +++ > 1 file changed, 23 insertions(+) > @@ -2067,7 +2087,9 @@ FIELD(ID_AA64DFR0, CTX_CMPS, 28, 4) > FIELD(

Re: [PATCH v1] hw/ppc: change indentation to spaces from TABs

2022-04-11 Thread Guo Zhi
Sure, I will send a v2 patch. Thanks, Guo - Original Message - From: "Daniel Henrique Barboza" To: "Thomas Huth" , "Bin Meng" Cc: "Guo Zhi" , "Cédric Le Goater" , "David Gibson" , "Greg Kurz" , "qemu-ppc" , "qemu-devel@nongnu.org Developers" , "Peter Maydell" , "open list:RISC-V"

Re: [RFC PATCH] target/i386: avoid copying junk to extended ZMMReg fields

2022-04-11 Thread Paolo Bonzini
On 4/11/22 17:18, Peter Maydell wrote: Looking a bit more closely, this won't work on big-endian hosts, because there we want to copy across the last 16 bytes of the struct, not the first 16. So I think we need some more macro magic: #if SHIFT == 0 #define COPY_REG(DEST, SRC) (DEST) = (SRC) #els

Re: [PATCH 4/7] target/arm: Enable FEAT_CSV3 for -cpu max

2022-04-11 Thread Peter Maydell
On Sun, 10 Apr 2022 at 07:07, Richard Henderson wrote: > > This extension concerns cache speculation, which TCG does > not implement. Thus we can trivially enable this feature. > > Signed-off-by: Richard Henderson > --- > target/arm/cpu64.c | 1 + > target/arm/cpu_tcg.c | 1 + > 2 files chang

[PATCH v2 0/2] Define NPCM7XX PWRON bit fields

2022-04-11 Thread Hao Wu
Currently, the PWRON STRAP values in NPCM7XX boards are magic numbers. Similar to the aspeed ones in hw/arm/aspeed.c, we define bit fields constants for them and use these fields instead of the magic numbers in the current implementation. The code should behave exactly the same as the existing one.

  1   2   >