Re: [PATCH 19/23] target/arm: Mark up sysregs for HFGITR bits 48..63

2023-01-28 Thread Richard Henderson
On 1/27/23 07:55, Peter Maydell wrote: Mark up the sysreg definitions for the system instructions trapped by HFGITR bits 48..63. Some of these bits are for trapping instructions which are not in the system instruction encoding (i.e. which are not handled by the ARMCPRegInfo mechanism): * ERET,

Re: [PATCH 20/23] target/arm: Implement the HFGITR_EL2.ERET trap

2023-01-28 Thread Richard Henderson
On 1/27/23 07:55, Peter Maydell wrote: Implement the HFGITR_EL2.ERET fine-grained trap. This traps execution from AArch64 EL1 of ERET, ERETAA and ERETAB. The trap is reported with a syndrome value of 0x1a. The trap must take precedence over a possible pointer-authentication trap for ERETAA and

Re: [PATCH 21/23] target/arm: Implement the HFGITR_EL2.SVC_EL0 and SVC_EL1 traps

2023-01-28 Thread Richard Henderson
On 1/27/23 07:55, Peter Maydell wrote: Implement the HFGITR_EL2.SVC_EL0 and SVC_EL1 fine-grained traps. These trap execution of the SVC instruction from AArch32 and AArch64. (As usual, AArch32 can only trap from EL0, as fine grained traps are disabled with an AArch32 EL1.) Signed-off-by: Peter M

Re: [PATCH 22/23] target/arm: Implement MDCR_EL2.TDCC and MDCR_EL3.TDCC traps

2023-01-28 Thread Richard Henderson
On 1/27/23 07:55, Peter Maydell wrote: FEAT_FGT also implements an extra trap bit in the MDCR_EL2 and MDCR_EL3 registers: bit TDCC enables trapping of use of the Debug Comms Channel registers OSDTRRX_EL1, OSDTRTX_EL1, MDCCSR_EL0, MDCCINT_EL0, DBGDTR_EL0, DBGDTRRX_EL0 and DBGDTRTX_EL0 (and their A

Re: [PATCH 23/23] target/arm: Enable FEAT_FGT on '-cpu max'

2023-01-28 Thread Richard Henderson
On 1/27/23 07:55, Peter Maydell wrote: Update the ID registers for TCG's '-cpu max' to report the presence of FEAT_FGT Fine-Grained Traps support. Signed-off-by: Peter Maydell --- docs/system/arm/emulation.rst | 1 + target/arm/cpu64.c| 1 + 2 files changed, 2 insertions(+) Rev

[PATCH] linux-user: move target_flat.h to target subdirs

2023-01-28 Thread Mike Frysinger
This makes target_flat.h behave like every other target_xxx.h header. It also makes it actually work -- while the current header says adding a header to the target subdir overrides the common one, it doesn't. This is for two reasons: * meson.build adds -Ilinux-user before -Ilinux-user/$arch * the c

Re: [PATCH v4 1/3] hw/riscv/boot.c: calculate fdt size after fdt_pack()

2023-01-28 Thread Bin Meng
Hi Daniel, On Thu, Jan 26, 2023 at 9:53 PM Daniel Henrique Barboza wrote: > > fdt_pack() can change the fdt size, meaning that fdt_totalsize() can > contain a now deprecated (bigger) value. The commit message is a bit confusing. The original code in this patch does not call fdt_pack(). So not s

Re: [PATCH 0/3] Misc sm501 clean ups

2023-01-28 Thread BALATON Zoltan
On Mon, 23 Jan 2023, Philippe Mathieu-Daudé wrote: On 21/1/23 21:35, BALATON Zoltan wrote: Some small trivial clean ups I've found while looking at this file. BALATON Zoltan (3): hw/display/sm501: Remove parenthesis around consant macro definitions hw/display/sm501: Remove unneeded casts

[PATCH v1 1/2] virtio: struct VirtQueue introduce reset

2023-01-28 Thread Xuan Zhuo
In the current design, we stop the device from operating on the vring during per-queue reset by resetting the structure VirtQueue. But before the reset operation, when recycling some resources, we should stop referencing new vring resources. For example, when recycling virtio-net's asynchronous se

[PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-28 Thread Xuan Zhuo
Check whether it is per-queue reset state in virtio_net_flush_tx(). Before per-queue reset, we need to recover async tx resources. At this time, virtio_net_flush_tx() is called, but we should not try to send new packets, so virtio_net_flush_tx() should check the current per-queue reset state. Fix

[PATCH v1 0/2] virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed

2023-01-28 Thread Xuan Zhuo
In the current design, we stop the device from operating on the vring during per-queue reset by resetting the structure VirtQueue. But before the reset operation, when recycling some resources, we should stop referencing new vring resources. This bug is caused by this reason. https://gitlab.

[PATCH v4 03/12] cryptodev: Introduce cryptodev alg type in QAPI

2023-01-28 Thread zhenwei pi
Introduce cryptodev alg type in cryptodev.json, then apply this to related codes, and drop 'enum CryptoDevBackendAlgType'. There are two options: 1, { 'enum': 'QCryptodevBackendAlgType', 'prefix': 'CRYPTODEV_BACKEND_ALG', 'data': ['sym', 'asym']} Then we can keep 'CRYPTODEV_BACKEND_ALG_SYM' an

[PATCH v4 00/12] Refactor cryptodev

2023-01-28 Thread zhenwei pi
v4 -> v5: - suggested by MST, use 'PRIu32' instead of '%u' to print a uint32_t value - correct *QCryptodevBackendClient* and *QCryptodevInfo* in qapi/cryptodev.json v3 -> v4: - a small change in '0005-cryptodev-Introduce-query-cryptodev-QMP-command.patch': use 'uint32' instead of 'int' to descr

[PATCH v4 08/12] cryptodev: Use CryptoDevBackendOpInfo for operation

2023-01-28 Thread zhenwei pi
Move queue_index, CryptoDevCompletionFunc and opaque into struct CryptoDevBackendOpInfo, then cryptodev_backend_crypto_operation() needs an argument CryptoDevBackendOpInfo *op_info only. And remove VirtIOCryptoReq from cryptodev. It's also possible to hide VirtIOCryptoReq into virtio-crypto.c in th

[PATCH v4 01/12] cryptodev: Introduce cryptodev.json

2023-01-28 Thread zhenwei pi
Introduce QCryptodevBackendType in cryptodev.json, also apply this to related codes. Then we can drop 'enum CryptoDevBackendOptionsType'. Note that `CRYPTODEV_BACKEND_TYPE_NONE` is *NOT* used by anywhere, so drop it(no 'none' enum in QCryptodevBackendType). Reviewed-by: Daniel P. Berrangé Signed

[PATCH v4 05/12] cryptodev: Introduce 'query-cryptodev' QMP command

2023-01-28 Thread zhenwei pi
Now we have a QMP command to query crypto devices: virsh qemu-monitor-command vm '{"execute": "query-cryptodev"}' | jq { "return": [ { "service": [ "akcipher", "mac", "hash", "cipher" ], "id": "cryptodev1", "client": [ {

[PATCH v4 07/12] hmp: add cryptodev info command

2023-01-28 Thread zhenwei pi
Example of this command: # virsh qemu-monitor-command vm --hmp info cryptodev cryptodev1: service=[akcipher|mac|hash|cipher] queue 0: type=builtin cryptodev0: service=[akcipher] queue 0: type=lkcf Signed-off-by: zhenwei pi --- hmp-commands-info.hx | 14 ++ include/monitor/h

[PATCH v4 09/12] cryptodev: Account statistics

2023-01-28 Thread zhenwei pi
Account OPS/BPS for crypto device, this will be used for 'query-stats' QEMU monitor command and QoS in the next step. Note that a crypto device may support symmetric mode, asymmetric mode, both symmetric and asymmetric mode. So we use two structure to describe the statistics of a crypto device. S

[PATCH v4 02/12] cryptodev: Remove 'name' & 'model' fields

2023-01-28 Thread zhenwei pi
We have already used qapi to generate crypto device types, this allows to convert type to a string 'model', so the 'model' field is not needed. And the 'name' field is not used by any backend driver, drop it. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cryptodev-buil

[PATCH v4 10/12] cryptodev: support QoS

2023-01-28 Thread zhenwei pi
Add 'throttle-bps' and 'throttle-ops' limitation to set QoS. The two arguments work with both QEMU command line and QMP command. Example of QEMU command line: -object cryptodev-backend-builtin,id=cryptodev1,throttle-bps=1600,\ throttle-ops=100 Example of QMP command: virsh qemu-monitor-command bu

[PATCH v4 06/12] cryptodev-builtin: Detect akcipher capability

2023-01-28 Thread zhenwei pi
Rather than exposing akcipher service/RSA algorithm to virtio crypto device unconditionally, detect akcipher capability from akcipher crypto framework. This avoids unsuccessful requests. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 18

[PATCH v4 04/12] cryptodev: Introduce server type in QAPI

2023-01-28 Thread zhenwei pi
Introduce cryptodev service type in cryptodev.json, then apply this to related codes. Now we can remove VIRTIO_CRYPTO_SERVICE_xxx dependence from QEMU cryptodev. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c| 8 backends/cryptodev-lkcf.

[PATCH v4 11/12] cryptodev: Support query-stats QMP command

2023-01-28 Thread zhenwei pi
Now we can use "query-stats" QMP command to query statistics of crypto devices. (Originally this was designed to show statistics by '{"execute": "query-cryptodev"}'. Daniel Berrangé suggested that querying configuration info by "query-cryptodev", and querying runtime performance info by "query-stat

[PATCH v4 12/12] MAINTAINERS: add myself as the maintainer for cryptodev

2023-01-28 Thread zhenwei pi
I developed the akcipher service, QoS setting, QMP/HMP commands and statistics accounting for crypto device. Making myself as the maintainer for QEMU's cryptodev. Cc: Gonglei Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS

Re: [PATCH] pci: add enforce_slot_reserved_mask_manual property

2023-01-28 Thread Chuck Zmudzinski
On 1/28/2023 4:58 PM, Mark Cave-Ayland wrote: > On 28/01/2023 03:39, Chuck Zmudzinski wrote: > > > On 1/27/2023 8:28 AM, Michael S. Tsirkin wrote: > >> On Sun, Jan 15, 2023 at 07:49:51PM -0500, Chuck Zmudzinski wrote: > >>> The current reserved slot check in do_pci_register_device(), added with > >

Re: [PATCH v4 1/3] hw/riscv/boot.c: calculate fdt size after fdt_pack()

2023-01-28 Thread Bin Meng
On Sun, Jan 29, 2023 at 10:20 AM Bin Meng wrote: > > Hi Daniel, > > On Thu, Jan 26, 2023 at 9:53 PM Daniel Henrique Barboza > wrote: > > > > fdt_pack() can change the fdt size, meaning that fdt_totalsize() can > > contain a now deprecated (bigger) value. > > The commit message is a bit confusing.

Re: [PATCH v4] net: stream: add a new option to automatically reconnect

2023-01-28 Thread Jason Wang
On Thu, Jan 19, 2023 at 6:16 PM Laurent Vivier wrote: > > In stream mode, if the server shuts down there is currently > no way to reconnect the client to a new server without removing > the NIC device and the netdev backend (or to reboot). > > This patch introduces a reconnect option that specifie

Re: [PATCH v7] tests/qtest: netdev: test stream and dgram backends

2023-01-28 Thread Jason Wang
On Thu, Jan 26, 2023 at 8:48 PM Thomas Huth wrote: > > On 18/01/2023 13.04, Laurent Vivier wrote: > > Signed-off-by: Laurent Vivier > > Acked-by: Michael S. Tsirkin > > Acked-by: Thomas Huth > > --- > > > > Notes: > > v7: > >- disable test_dgram_mcast() on windows > >- disa

Re: [PATCH v4 2/3] hw/riscv: split fdt address calculation from fdt load

2023-01-28 Thread Bin Meng
On Thu, Jan 26, 2023 at 9:53 PM Daniel Henrique Barboza wrote: > > A common trend in other archs is to calculate the fdt address, which is > usually straightforward, and then calling a function that loads the > fdt/dtb by using that address. > > riscv_load_fdt() is doing a bit too much in comparis

Re: [PATCH 0/3] Fix UNMAP notifier for intel-iommu

2023-01-28 Thread Jason Wang
On Fri, Jan 27, 2023 at 9:17 PM Michael S. Tsirkin wrote: > > On Mon, Jan 16, 2023 at 03:06:44PM +0800, Jason Wang wrote: > > On Mon, Jan 16, 2023 at 7:30 AM Viktor Prutyanov wrote: > > > > > > On Tue, Nov 29, 2022 at 11:10 AM Jason Wang wrote: > > > > > > > > Hi All: > > > > > > > > According t

Re: [PATCH] vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag check

2023-01-28 Thread Jason Wang
On Mon, Jan 23, 2023 at 10:39 PM Michael S. Tsirkin wrote: > > On Tue, Jan 17, 2023 at 11:53:08AM +0100, Eugenio Pérez wrote: > > VHOST_BACKEND_F_IOTLB_ASID is the feature bit, not the bitmask. Since > > the device under test also provided VHOST_BACKEND_F_IOTLB_MSG_V2 and > > VHOST_BACKEND_F_IOTLB

Re: [PATCH v4 3/3] hw/riscv: change riscv_compute_fdt_addr() semantics

2023-01-28 Thread Bin Meng
On Thu, Jan 26, 2023 at 9:54 PM Daniel Henrique Barboza wrote: > > As it is now, riscv_compute_fdt_addr() is receiving a dram_base, a > mem_size (which is defaulted to MachineState::ram_size in all boards) > and the FDT pointer. And it makes a very important assumption: the DRAM > interval dram_ba

Re: [PATCH] linux-user: move target_flat.h to target subdirs

2023-01-28 Thread Richard Henderson
On 1/28/23 14:46, Mike Frysinger wrote: This makes target_flat.h behave like every other target_xxx.h header. It also makes it actually work -- while the current header says adding a header to the target subdir overrides the common one, it doesn't. This is for two reasons: * meson.build adds -Ili

Re: [PATCH v8 1/5] riscv: Pass Object to register_cpu_props instead of DeviceState

2023-01-28 Thread Bin Meng
On Thu, Jan 26, 2023 at 12:21 AM Alexandre Ghiti wrote: > > One can extract the DeviceState pointer from the Object pointer, so pass > the Object for future commits to access other fields of Object. > > No functional changes intended. > > Signed-off-by: Alexandre Ghiti > Reviewed-by: Alistair Fra

Re: [PATCH v8 2/5] riscv: Change type of valid_vm_1_10_[32|64] to bool

2023-01-28 Thread Bin Meng
On Thu, Jan 26, 2023 at 12:22 AM Alexandre Ghiti wrote: > > This array is actually used as a boolean so swap its current char type > to a boolean and at the same time, change the type of validate_vm to > bool since it returns valid_vm_1_10_[32|64]. > > Suggested-by: Andrew Jones > Signed-off-by:

Re: [PATCH 2/9] igb: handle PF/VF reset properly

2023-01-28 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Use PFRSTD to reset RSTI bit for VFs, and raise VFLRE interrupt when VF is reset. Signed-off-by: Sriram Yagnaraman --- hw/net/e1000x_regs.h | 1 + hw/net/igb_core.c| 33 + hw/net/trace-events | 2 ++ 3 fil

Re: [PATCH 2/9] igb: handle PF/VF reset properly

2023-01-28 Thread Akihiko Odaki
On 2023/01/29 14:58, Akihiko Odaki wrote: On 2023/01/28 22:46, Sriram Yagnaraman wrote: Use PFRSTD to reset RSTI bit for VFs, and raise VFLRE interrupt when VF is reset. Signed-off-by: Sriram Yagnaraman ---   hw/net/e1000x_regs.h |  1 +   hw/net/igb_core.c    | 33 +

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-28 Thread Jason Wang
On Sun, Jan 29, 2023 at 10:52 AM Xuan Zhuo wrote: > > Check whether it is per-queue reset state in virtio_net_flush_tx(). > > Before per-queue reset, we need to recover async tx resources. At this > time, virtio_net_flush_tx() is called, but we should not try to send > new packets, so virtio_net_f

Re: [PATCH 4/9] igb: check oversized packets for VMDq

2023-01-28 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 74 ++- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 6bca5459b9..1eb7ba168f 100644

Re: [PATCH v1 1/2] virtio: struct VirtQueue introduce reset

2023-01-28 Thread Michael S. Tsirkin
subject seems wrong. On Sun, Jan 29, 2023 at 10:51:49AM +0800, Xuan Zhuo wrote: > In the current design, we stop the device from operating on the vring > during per-queue reset by resetting the structure VirtQueue. > > But before the reset operation, when recycling some resources, we should > s

Re: [PATCH 5/9] igb: respect E1000_VMOLR_RSSE

2023-01-28 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: RSS for VFs is only enabled if VMOLR[n].RSSE is set. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 1eb7ba

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-28 Thread Michael S. Tsirkin
On Sun, Jan 29, 2023 at 10:51:50AM +0800, Xuan Zhuo wrote: > Check whether it is per-queue reset state in virtio_net_flush_tx(). > > Before per-queue reset, we need to recover async tx resources. At this > time, virtio_net_flush_tx() is called, but we should not try to send > new packets, so virti

Re: [PATCH v1 1/2] virtio: struct VirtQueue introduce reset

2023-01-28 Thread Xuan Zhuo
On Sun, 29 Jan 2023 02:12:36 -0500, "Michael S. Tsirkin" wrote: > > subject seems wrong. Will fix. > > On Sun, Jan 29, 2023 at 10:51:49AM +0800, Xuan Zhuo wrote: > > In the current design, we stop the device from operating on the vring > > during per-queue reset by resetting the structure Vir

Re: [PATCH v1 0/2] virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed

2023-01-28 Thread Michael S. Tsirkin
On Sun, Jan 29, 2023 at 10:51:48AM +0800, Xuan Zhuo wrote: > In the current design, we stop the device from operating on the vring > during per-queue reset by resetting the structure VirtQueue. > > But before the reset operation, when recycling some resources, we should > stop referencing new vrin

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-28 Thread Xuan Zhuo
On Sun, 29 Jan 2023 02:25:43 -0500, "Michael S. Tsirkin" wrote: > On Sun, Jan 29, 2023 at 10:51:50AM +0800, Xuan Zhuo wrote: > > Check whether it is per-queue reset state in virtio_net_flush_tx(). > > > > Before per-queue reset, we need to recover async tx resources. At this > > time, virtio_net_

Re: [PATCH v1 1/2] virtio: struct VirtQueue introduce reset

2023-01-28 Thread Michael S. Tsirkin
On Sun, Jan 29, 2023 at 03:15:16PM +0800, Xuan Zhuo wrote: > On Sun, 29 Jan 2023 02:12:36 -0500, "Michael S. Tsirkin" > wrote: > > > > subject seems wrong. > > > Will fix. > > > > > > On Sun, Jan 29, 2023 at 10:51:49AM +0800, Xuan Zhuo wrote: > > > In the current design, we stop the device fr

Re: [PATCH v1 1/2] virtio: struct VirtQueue introduce reset

2023-01-28 Thread Xuan Zhuo
On Sun, 29 Jan 2023 02:37:22 -0500, "Michael S. Tsirkin" wrote: > On Sun, Jan 29, 2023 at 03:15:16PM +0800, Xuan Zhuo wrote: > > On Sun, 29 Jan 2023 02:12:36 -0500, "Michael S. Tsirkin" > > wrote: > > > > > > subject seems wrong. > > > > > > Will fix. > > > > > > > > > > On Sun, Jan 29, 2023 at

Re: [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset

2023-01-28 Thread Xuan Zhuo
On Sun, 29 Jan 2023 14:23:21 +0800, Jason Wang wrote: > On Sun, Jan 29, 2023 at 10:52 AM Xuan Zhuo wrote: > > > > Check whether it is per-queue reset state in virtio_net_flush_tx(). > > > > Before per-queue reset, we need to recover async tx resources. At this > > time, virtio_net_flush_tx() is c

<    1   2