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

2021-12-12 Thread Michael S. Tsirkin
On Sat, Dec 11, 2021 at 03:00:27AM +, Longpeng (Mike, Cloud Infrastructure Service Product Dept.) wrote: > > > > -Original Message- > > From: Stefan Hajnoczi [mailto:stefa...@redhat.com] > > Sent: Thursday, December 9, 2021 5:17 PM > > To: Longpeng (Mike, Cloud Infrastructure Service

Re: [PATCH 5/8] standard-headers: Add virtio_video.h

2021-12-12 Thread Michael S. Tsirkin
On Fri, Dec 10, 2021 at 01:09:46PM +, Peter Griffin wrote: > Hi Michael, > > On Fri, 10 Dec 2021, Michael S. Tsirkin wrote: > > > On Thu, Dec 09, 2021 at 02:55:58PM +, Peter Griffin wrote: > > > Signed-off-by: Peter Griffin > > > --- > > > include/standard-headers/linux/virtio_video.h |

Re: [PATCH v10 06/10] ACPI ERST: build the ACPI ERST table

2021-12-12 Thread Ani Sinha
. On Thu, Dec 9, 2021 at 11:28 PM Eric DeVolder wrote: > > This builds the ACPI ERST table to inform OSPM how to communicate > with the acpi-erst device. This patch starts in the middle of pci device code addition, between erst_reg_ops and erst_post_load. I do not like this :( > > Signed-off-by

Re: [PATCH 01/26] hw/intc: clean-up error reporting for failed ITS cmd

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: From: Alex Bennée While trying to debug a GIC ITS failure I saw some guest errors that had poor formatting as well as leaving me confused as to what failed. As most of the checks aren't possible without a valid dte split that check apart and then check

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The checks in the ITS on the rdbase values in guest commands are off-by-one: they permit the guest to pass us a value equal to s->gicv3->num_cpu, but the valid values are 0...num_cpu-1. This meant the guest could cause us to index off the end of the s->

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: We currently define a bitmask for the GITS_CTLR ENABLED bit in two ways: as ITS_CTLR_ENABLED, and via the FIELD() macro as R_GITS_CTLR_ENABLED_MASK. Consistently use the FIELD macro version everywhere and remove the redundant ITS_CTLR_ENABLED define. Si

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The TableDesc struct defines properties of the in-guest-memory tables which the guest tells us about by writing to the GITS_BASER registers. This struct currently has a union 'maxids', but all the fields of the union have the same type (uint32_t) and do

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: In extract_table_params() we process each GITS_BASER register. If the register's Valid bit is not set, this means there is no in-guest-memory table and so we should not try to interpret the other fields in the register. This was incorrectly coded as a

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The extract_table_params() decodes the fields in the GITS_BASER registers into TableDesc structs. Since the fields are the same for all the GITS_BASER registers, there is currently a lot of code duplication within the switch (type) statement. Refactor

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: We set the TableDesc entry_sz field from the appropriate GITS_BASER.ENTRYSIZE field. That ID register field specifies the number of bytes per table entry minus one. However when we use td->entry_sz we assume it to be the number of bytes per table entry

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The GITS_TYPE_PHYSICAL define is the value we set the GITS_TYPER.Physical field to -- this is 1 to indicate that we support physical LPIs. (Support for virtual LPIs is the GITS_TYPER.Virtual field.) We also use this define as the *value* that we write i

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The MAPI command takes arguments DeviceID, EventID, ICID, and is defined to be equivalent to MAPTI DeviceID, EventID, EventID, ICID. (That is, where MAPTI takes an explicit pINTID, MAPI uses the EventID as the pINTID.) We didn't quite get this right. I

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Currently the ITS code that reads and writes DTEs uses open-coded shift-and-mask to assemble the various fields into the 64-bit DTE word. The names of the macros used for mask and shift values are also somewhat inconsistent, and don't follow our usual c

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The DTE.SIZE field is 5 bits, which means that DTE.SIZE + 1 might in theory be 32. When calculating 1 << (DTE.SIZE + 1) use 1ULL to ensure that we don't do this arithmetic at 32 bits and shift the 1 off the end in this case. Signed-off-by: Peter Maydell

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The comment says that in our CTE format the RDBase field is 36 bits; in fact for us it is only 16 bits, because we use the RDBase format where it specifies a 16-bit CPU number. The code already uses RDBASE_PROCNUM_LENGTH (16) as the field width, so fix t

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Use FIELD macros to handle CTEs, rather than ad-hoc mask-and-shift. Signed-off-by: Peter Maydell --- hw/intc/gicv3_internal.h | 3 ++- hw/intc/arm_gicv3_its.c | 7 --- 2 files changed, 6 insertions(+), 4 deletions(-) Reviewed-by: Richard Hen

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

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

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: if (dte_valid) { -max_eventid = 1UL << (FIELD_EX64(dte, DTE, SIZE) + 1); +max_eventid = 1ULL << (FIELD_EX64(dte, DTE, SIZE) + 1); Without changing the type of max_eventid, I think it'd be easiest to fix the off-by-one bug by n

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

2021-12-12 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > We currently define a bitmask for the GITS_CTLR ENABLED bit in > two ways: as ITS_CTLR_ENABLED, and via the FIELD() macro as > R_GITS_CTLR_ENABLED_MASK. Consistently use the FIELD macro version > everywhere and remove the redundant ITS_CTLR_ENABLED define.

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

2021-12-12 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > The extract_table_params() decodes the fields in the GITS_BASER > registers into TableDesc structs. Since the fields are the same for > all the GITS_BASER registers, there is currently a lot of code > duplication within the switch (type) statement. Refact

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

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

Re: [PATCH 19/26] hw/intc/arm_gicv3_its: Don't use data if reading command failed

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: In process_cmdq(), we read 64 bits of the command packet, which contain the command identifier, which we then switch() on to dispatch to an appropriate sub-function. However, if address_space_ldq_le() reports a memory transaction failure, we still read

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

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: When an ITS detects an error in a command, it has an implementation-defined (CONSTRAINED UNPREDICTABLE) choice of whether to ignore the command, proceeding to the next one in the queue, or to stall the ITS command queue, processing nothing further. The

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

2021-12-12 Thread Philippe Mathieu-Daudé
On 12/11/21 20:11, Peter Maydell wrote: > Currently the ITS code that reads and writes DTEs uses open-coded > shift-and-mask to assemble the various fields into the 64-bit DTE > word. The names of the macros used for mask and shift values are > also somewhat inconsistent, and don't follow our usua

Re: [PATCH 21/26] hw/intc/arm_gicv3_its: Fix return codes in process_its_cmd()

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Fix process_its_cmd() to consistently return CMD_STALL for memory errors and CMD_CONTINUE for parameter errors, as we claim in the comments that we do. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson r~

Re: [PATCH 22/26] hw/intc/arm_gicv3_its: Refactor process_its_cmd() to reduce nesting

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Refactor process_its_cmd() so that it consistently uses the structure do thing; if (error condition) { return early; } do next thing; rather than doing some of the work nested inside if (not error) code blocks. Signed-off-by: Peter M

Re: [PATCH 23/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapti()

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Fix process_mapti() to consistently return CMD_STALL for memory errors and CMD_CONTINUE for parameter errors, as we claim in the comments that we do. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 28 +--- 1 file c

Re: [PATCH 24/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapc()

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Fix process_mapc() to consistently return CMD_STALL for memory errors and CMD_CONTINUE for parameter errors, as we claim in the comments that we do. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 8 +++- 1 file changed, 3 insertions(+

Re: [PATCH 25/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapd()

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: Fix process_mapd() to consistently return CMD_STALL for memory errors and CMD_CONTINUE for parameter errors, as we claim in the comments that we do. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 10 -- 1 file changed, 4 insertion

Re: [PATCH 26/26] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code

2021-12-12 Thread Richard Henderson
On 12/11/21 11:11 AM, Peter Maydell wrote: The ITS has several tables which all share a similar format, described by the TableDesc struct: the guest may configure them to be a single-level table or a two-level table. Currently we open-code the process of finding the table entry in all the functio

Re: [PATCH v10 06/10] ACPI ERST: build the ACPI ERST table

2021-12-12 Thread Michael S. Tsirkin
On Thu, Dec 09, 2021 at 12:57:31PM -0500, Eric DeVolder wrote: > This builds the ACPI ERST table to inform OSPM how to communicate > with the acpi-erst device. > > Signed-off-by: Eric DeVolder > --- > hw/acpi/erst.c | 241 > + > 1 file cha

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

2021-12-12 Thread Jason Wang
On Sun, Dec 12, 2021 at 5:30 PM Michael S. Tsirkin wrote: > > On Sat, Dec 11, 2021 at 03:00:27AM +, Longpeng (Mike, Cloud > Infrastructure Service Product Dept.) wrote: > > > > > > > -Original Message- > > > From: Stefan Hajnoczi [mailto:stefa...@redhat.com] > > > Sent: Thursday, Dece

Re: [RFC PATCH v3 00/27] Add LoongArch softmmu support.

2021-12-12 Thread yangxiaojuan
Ping! Please help review the V3 patch, thank you! On 12/04/2021 08:06 PM, Xiaojuan Yang wrote: > This series patch add softmmu support for LoongArch. > Base on the linux-user emulation support V13 patch. > * > https://patchew.org/QEMU/1638610165-15036-1-git-send-email-gaos...@loongson.cn/ > Th

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

2021-12-12 Thread Jason Wang
On Sat, Dec 11, 2021 at 1:23 PM Longpeng (Mike, Cloud Infrastructure Service Product Dept.) wrote: > > > > > -Original Message- > > From: Jason Wang [mailto:jasow...@redhat.com] > > Sent: Wednesday, December 8, 2021 2:27 PM > > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.

Re: [PATCH v2 03/12] target/riscv: Implement function kvm_arch_init_vcpu

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Get isa info from kvm while kvm init. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > target/riscv/kvm.c | 32

Re: [PATCH v2 04/12] target/riscv: Implement kvm_arch_get_registers

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > target/riscv/k

Re: [PATCH v2 05/12] target/riscv: Implement kvm_arch_put_registers

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > target/riscv/kvm.

Re: [PATCH v2 06/12] target/riscv: Support start kernel directly by KVM

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Get kernel and fdt start address in virt.c, and pass them to KVM > when cpu reset. In addition, add kvm_riscv.h to place riscv specific > interface. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis

Re: [PATCH v2 07/12] target/riscv: Support setting external interrupt by KVM

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > When KVM is enabled, set the S-mode external interrupt through > kvm_riscv_set_irq function. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis > --- > target/riscv/cpu.c | 6 +- > target

Re: [PATCH v2 08/12] target/riscv: Handle KVM_EXIT_RISCV_SBI exit

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Use char-fe to handle console sbi call, which implement early > console io while apply 'earlycon=sbi' into kernel parameters. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li Looks good to me. Reviewed-by: Anup Patel Regards,

Re: [PATCH v2 12/12] target/riscv: Support virtual time context synchronization

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:38 PM Yifei Jiang wrote: > > Add virtual time context description to vmstate_kvmtimer. After cpu being > loaded, virtual time context is updated to KVM. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > --- > target/riscv/machine.c | 37

Re: [PATCH v2 11/12] target/riscv: Implement virtual time adjusting with vm state changing

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:38 PM Yifei Jiang wrote: > > We hope that virtual time adjusts with vm state changing. When a vm > is stopped, guest virtual time should stop counting and kvm_timer > should be stopped. When the vm is resumed, guest virtual time should > continue to count and kvm_timer sh

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

2021-12-12 Thread Ani Sinha
All work related to VIOT tables are being done by Jean. Adding him as the maintainer for acpi VIOT table code in qemu. Signed-off-by: Ani Sinha --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7543eb4d59..f9580f2fe2 100644 --- a/MAINTAINE

Re: [PATCH v2 10/12] target/riscv: Add kvm_riscv_get/put_regs_timer

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Add kvm_riscv_get/put_regs_timer to synchronize virtual time context > from KVM. > > To set register of RISCV_TIMER_REG(state) will occur a error from KVM > on kvm_timer_state == 0. It's better to adapt in KVM, but it doesn't matter > that ada

Re: [PATCH v8 2/7] net/vmnet: add vmnet backends to qapi/net

2021-12-12 Thread Markus Armbruster
Vladislav Yaroshchuk writes: > Create separate netdevs for each vmnet operating mode: > - vmnet-host > - vmnet-shared > - vmnet-bridged > > Signed-off-by: Vladislav Yaroshchuk QAPI schema Acked-by: Markus Armbruster

[PATCH] meson: be strict for boolean options

2021-12-12 Thread Антон Кочков
This patch allows to proceed further to be able to build with Muon buildsystem https://sr.ht/~lattis/muon/ There are still few bugs remain, but they are on the Muon side: https://todo.sr.ht/~lattis/muon/21 Best regards, Anton Kochkov. >From fa80e0c17b14b8f5067d13ad7bc63e0d2cbb94ce Mon Sep 17 00

Re: [PATCH v2] Move the libssh setup from configure to meson.build

2021-12-12 Thread Thomas Huth
On 10/12/2021 14.05, Philippe Mathieu-Daudé wrote: On 12/9/21 16:22, Richard W.M. Jones wrote: On Thu, Dec 09, 2021 at 04:08:24PM +0100, Thomas Huth wrote: On 09/12/2021 15.55, Richard W.M. Jones wrote: On Thu, Dec 09, 2021 at 03:48:01PM +0100, Thomas Huth wrote: It's easier to do this in mes