Re: [PATCH v12] qapi: introduce 'query-x86-cpuid' QMP command.

2021-08-23 Thread Markus Armbruster
Eduardo Habkost writes: > On Mon, Aug 23, 2021 at 9:35 AM Markus Armbruster wrote: >> >> Eduardo Habkost writes: >> >> > On Wed, Aug 11, 2021 at 9:44 AM Thomas Huth wrote: >> >> >> >> On 11/08/2021 15.40, Eduardo Habkost wrote: >> >> > On Wed, Aug 11, 2021 at 2:10 AM Thomas Huth wrote: >> >>

Re: [PATCH v2 3/4] target/arm/cpu64: Replace kvm_supported with sve_vq_supported

2021-08-23 Thread Andrew Jones
On Tue, Aug 24, 2021 at 08:28:55AM +0200, Andrew Jones wrote: > On Mon, Aug 23, 2021 at 10:53:48AM -0700, Richard Henderson wrote: > > On 8/23/21 9:06 AM, Andrew Jones wrote: > > > Now that we have an ARMCPU member sve_vq_supported we no longer > > > need the local kvm_supported bitmap for KVM's su

Re: [PATCH 5/5] qmp: Added qemu-ebpf-rss-path command.

2021-08-23 Thread Markus Armbruster
Andrew Melnichenko writes: > Hi, > >> The helper may or may not be installed at the path compiled into QEMU. >> > Yes, so the helper will not be called - QEMU will try to initiate eBPF RSS > or use "in-qemu" RSS. My point is: the proposed command's mission is to help the management application r

Re: [PATCH v5 17/24] target/riscv: Fix hgeie, hgeip

2021-08-23 Thread Bin Meng
On Tue, Aug 24, 2021 at 4:08 AM Richard Henderson wrote: > > We failed to write into *val for these read functions; > replace them with read_zero. Only warn about unsupported > non-zero value when writing a non-zero value. > > Signed-off-by: Richard Henderson > --- > target/riscv/csr.c | 26 +++

Re: [PATCH v5 16/24] target/riscv: Fix rmw_sip, rmw_vsip, rmw_hsip vs write-only operation

2021-08-23 Thread Bin Meng
On Tue, Aug 24, 2021 at 4:02 AM Richard Henderson wrote: > > We distinguish write-only by passing ret_value as NULL. > > Signed-off-by: Richard Henderson > --- > target/riscv/csr.c | 23 +++ > 1 file changed, 15 insertions(+), 8 deletions(-) > Reviewed-by: Bin Meng

Re: hw/nvme: fix verification of select field in namespace attachment

2021-08-23 Thread Klaus Jensen
On Aug 23 16:33, Naveen wrote: > Fix is added to check for reserved value in select field for > namespace attachment > > Signed-off-by: Naveen Nagar > Signed-off-by: Klaus Jensen > cc: Minwoo Im > Looks like your MUA didnt pick up on the CC: tag, so: +CC Minwoo signature.asc Description:

[PATCH] MAINTAINERS: add fuzzing reviewer

2021-08-23 Thread Qiuhao Li
To keep me cc-ed when something changes. Suggested by Alexander. https://lists.gnu.org/archive/html/qemu-devel/2021-08/msg03631.html Signed-off-by: Qiuhao Li --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6b3697962c..3a979b1bc7 100644 --- a/M

Re: [PATCH v2 3/4] target/arm/cpu64: Replace kvm_supported with sve_vq_supported

2021-08-23 Thread Andrew Jones
On Mon, Aug 23, 2021 at 10:53:48AM -0700, Richard Henderson wrote: > On 8/23/21 9:06 AM, Andrew Jones wrote: > > Now that we have an ARMCPU member sve_vq_supported we no longer > > need the local kvm_supported bitmap for KVM's supported vector > > lengths. > > > > Signed-off-by: Andrew Jones > >

Re: [PATCH v2 4/4] target/arm/cpu64: Validate sve vector lengths are supported

2021-08-23 Thread Andrew Jones
On Mon, Aug 23, 2021 at 11:04:49AM -0700, Richard Henderson wrote: > On 8/23/21 9:06 AM, Andrew Jones wrote: > > Future CPU types may specify which vector lengths are supported. > > We can apply nearly the same logic to validate those lengths > > as we do for KVM's supported vector lengths. We merg

Re: Is QEMU's vmxnet3 still being used?

2021-08-23 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Wed, Aug 18, 2021 at 03:42:23PM +0200, Thomas Huth wrote: >> >> Hi all, >> >> I recently noticed that we have quite a bunch of tickets against the vmxnet3 >> device in our bug trackers, which indicate that this device could be used to >> crash QEMU in various wa

Re: Is QEMU's vmxnet3 still being used?

2021-08-23 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 19 Aug 2021 at 09:54, Daniel P. Berrangé wrote: >> We've especially not had "how many users >> are there" as a criteria for acceptance or removal of a device. > > ...not least because we have no accurate way to determine > the answer to that question! I'd like to

Re: [PATCH] hw/nvme: fix validation of ASQ and ACQ

2021-08-23 Thread Klaus Jensen
On Aug 23 19:47, Keith Busch wrote: > On Mon, Aug 23, 2021 at 02:20:18PM +0200, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Address 0x0 is a valid address. Fix the admin submission and completion > > queue address validation to not error out on this. > > Indeed, there are environments tha

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

2021-08-23 Thread Ani Sinha
On Mon, 23 Aug 2021, Michael S. Tsirkin wrote: > On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > > Bsel property of the pci bus indicates whether the bus supports acpi > > hotplug. > > We need to validate the presence of this property before performing any > > hotplug > > related

Re: [PATCH] vga: don't abort when adding a duplicate isa-vga device

2021-08-23 Thread Markus Armbruster
Thomas Huth writes: > On 14/08/2021 01.36, Jose R. Ziviani wrote: >> If users try to add an isa-vga device that was already registered, >> still in command line, qemu will crash: >> $ qemu-system-mips64el -M pica61 -device isa-vga >> RAMBlock "vga.vram" already registered, abort! >> Aborted (core

Re: [PATCH v7 05/15] machine: Improve the error reporting of smp parsing

2021-08-23 Thread wangyanan (Y)
On 2021/8/23 21:17, Philippe Mathieu-Daudé wrote: On 8/23/21 2:27 PM, Yanan Wang wrote: We have two requirements for a valid SMP configuration: the product of "sockets * cores * threads" must represent all the possible cpus, i.e., max_cpus, and then must include the initially present cpus, i.e

Re: [PATCH for-6.2 v5 5/5] hw/acpi/aml-build: Generate PPTT table

2021-08-23 Thread wangyanan (Y)
On 2021/8/24 7:52, Michael S. Tsirkin wrote: On Thu, Aug 05, 2021 at 08:39:21PM +0800, Yanan Wang wrote: From: Andrew Jones Add the Processor Properties Topology Table (PPTT) to expose CPU topology information defined by users to ACPI guests. Note, a DT-boot Linux guest with a non-flat CPU

Re: [PATCH for-6.2 v5 0/5] hw/arm/virt: Introduce cpu topology support

2021-08-23 Thread wangyanan (Y)
On 2021/8/24 7:53, Michael S. Tsirkin wrote: On Thu, Aug 05, 2021 at 08:39:16PM +0800, Yanan Wang wrote: Hi, This is a new version (v5) of the series [1] that I posted to introduce support for generating cpu topology descriptions to virt machine guest. Once the view of an accurate virtual cp

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

2021-08-23 Thread Jason Wang
On Tue, Aug 24, 2021 at 6:37 AM Peter Xu wrote: > > On Mon, Aug 23, 2021 at 06:05:07PM -0400, Michael S. Tsirkin wrote: > > On Mon, Aug 23, 2021 at 03:18:51PM -0400, Peter Xu wrote: > > > On Mon, Aug 23, 2021 at 02:49:12PM -0400, Eduardo Habkost wrote: > > > > On Wed, Aug 18, 2021 at 03:43:18PM -0

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

2021-08-23 Thread Jason Wang
On Tue, Aug 24, 2021 at 3:18 AM Peter Xu wrote: > > On Mon, Aug 23, 2021 at 02:49:12PM -0400, Eduardo Habkost wrote: > > On Wed, Aug 18, 2021 at 03:43:18PM -0400, Peter Xu wrote: > > > QEMU creates -device objects in order as specified by the user's cmdline. > > > However that ordering may not be

[PATCH v3 4/4] hw/arm/virt: Add PL330 DMA controller and connect with SMMU v3

2021-08-23 Thread Li, Chunming
From: LCM Add PL330 DMA controller to test SMMU v3 connection and function. The default SID for PL330 is 1 but we test other values, it works well. Signed-off-by: Chunming Li Signed-off-by: Renwei Liu --- hw/arm/virt.c | 92 ++- include/hw/arm/v

[PATCH v3 3/4] Update SMMU v3 creation to support non PCI/PCIe device connection

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

[PATCH v3 2/4] hw/arm/smmuv3: Update implementation of CFGI commands based on device SID

2021-08-23 Thread Li, Chunming
From: LCM "smmu_iommu_mr" function can't get MR according to SID for non PCI/PCIe devices. So we replace "smmuv3_flush_config" with "g_hash_table_foreach_remove" based on devices SID. Signed-off-by: Chunming Li Signed-off-by: Renwei Liu --- hw/arm/smmuv3.c | 35 ++---

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

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

Re: [PATCH] hw/nvme: fix validation of ASQ and ACQ

2021-08-23 Thread Keith Busch
On Mon, Aug 23, 2021 at 02:20:18PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Address 0x0 is a valid address. Fix the admin submission and completion > queue address validation to not error out on this. Indeed, there are environments that can use that address. It's a host error if the c

Re: [PATCH for-6.2 v5 0/5] hw/arm/virt: Introduce cpu topology support

2021-08-23 Thread Michael S. Tsirkin
On Thu, Aug 05, 2021 at 08:39:16PM +0800, Yanan Wang wrote: > Hi, > > This is a new version (v5) of the series [1] that I posted to introduce > support for generating cpu topology descriptions to virt machine guest. > > Once the view of an accurate virtual cpu topology is provided to guest, > wit

Re: [PATCH for-6.2 v5 5/5] hw/acpi/aml-build: Generate PPTT table

2021-08-23 Thread Michael S. Tsirkin
On Thu, Aug 05, 2021 at 08:39:21PM +0800, Yanan Wang wrote: > From: Andrew Jones > > Add the Processor Properties Topology Table (PPTT) to expose > CPU topology information defined by users to ACPI guests. > > Note, a DT-boot Linux guest with a non-flat CPU topology will > see socket and core ID

Re: [PATCH v2 1/1] virtio: failover: define the default device to use in case of error

2021-08-23 Thread Michael S. Tsirkin
On Mon, Aug 09, 2021 at 07:13:42PM +0200, Laurent Vivier wrote: > If the guest driver doesn't support the STANDBY feature, by default > we keep the virtio-net device and don't hotplug the VFIO device, > but in some cases, user can prefer to use the VFIO device rather > than the virtio-net one. We c

Re: [PATCH 0/3] gdbstub: add support for switchable endianness

2021-08-23 Thread Changbin Du
On Mon, Aug 23, 2021 at 04:30:05PM +0100, Peter Maydell wrote: > On Mon, 23 Aug 2021 at 16:21, Philippe Mathieu-Daudé > wrote: > > > > On 8/23/21 4:20 PM, Changbin Du wrote: > > > To resolve the issue to debug switchable targets, this serias introduces > > > basic infrastructure for gdbstub and e

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

2021-08-23 Thread Michael S. Tsirkin
On Sat, Aug 21, 2021 at 08:35:35PM +0530, Ani Sinha wrote: > Bsel property of the pci bus indicates whether the bus supports acpi hotplug. > We need to validate the presence of this property before performing any > hotplug > related callback operations. Currently validation of the existence of thi

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 05:56:23PM -0400, Eduardo Habkost wrote: > I don't have any other example, but I assume address assignment > based on ordering is a common pattern in device code. > > I would take a very close and careful look at the devices with > non-default vmsd priority. If you can pro

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 05:54:44PM -0400, Michael S. Tsirkin wrote: > > I can use a custom sort to replace qsort() to guarantee that. > You don't have to do that. Simply use the device position on the command > line for comparisons when priority is the same. Indeed. :) Thanks, -- Peter Xu

Re: [PATCH v4 01/14] target/riscv: Add x-zba, x-zbb, x-zbc and x-zbs properties

2021-08-23 Thread Alistair Francis
On Tue, Aug 24, 2021 at 4:12 AM Philipp Tomsich wrote: > > The bitmanipulation ISA extensions will be ratified as individual > small extension packages instead of a large B-extension. The first > new instructions through the door (these have completed public review) > are Zb[abcs]. > > This adds

Re: [PATCH 0/3] gdbstub: add support for switchable endianness

2021-08-23 Thread Changbin Du
On Mon, Aug 23, 2021 at 05:21:07PM +0200, Philippe Mathieu-Daudé wrote: > On 8/23/21 4:20 PM, Changbin Du wrote: > > To resolve the issue to debug switchable targets, this serias introduces > > basic infrastructure for gdbstub and enable support for ARM and RISC-V > > targets. > > > > For example,

[PATCH v6 0/5] python/aqmp: AQMP TUI

2021-08-23 Thread G S Niteesh Babu
Gitlab: https://gitlab.com/niteesh.gs/qemu/-/commits/aqmp-tui-prototype-v6 Based-on: <20210803182941.504537-1-js...@redhat.com> [v3,00/25] python: introduce Asynchronous QMP package CI: https://gitlab.com/niteesh.gs/qemu/-/pipelines/358117062 Updates since v5: 1) Moved all docstrings under init t

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

2021-08-23 Thread G S Niteesh Babu
Added AQMP TUI. Implements the follwing basic features: 1) Command transmission/reception. 2) Shows events asynchronously. 3) Shows server status in the bottom status bar. 4) Automatic retries on disconnects and error conditions. Also added type annotations and necessary pylint/mypy configuration

[PATCH v6 3/5] python: Add entry point for aqmp-tui

2021-08-23 Thread G S Niteesh Babu
Add an entry point for aqmp-tui. This will allow it to be run from the command line using "aqmp-tui localhost:1234" More options available in the TUI can be found using "aqmp-tui -h" Signed-off-by: G S Niteesh Babu --- python/setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/python/s

[PATCH v6 4/5] python: add optional pygments dependency

2021-08-23 Thread G S Niteesh Babu
Added pygments as optional dependency for AQMP TUI. This is required for the upcoming syntax highlighting feature in AQMP TUI. The dependency has also been added in the devel optional group. Added mypy 'ignore_missing_imports' for pygments since it does not have any type stubs. Signed-off-by: G S

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 06:05:07PM -0400, Michael S. Tsirkin wrote: > On Mon, Aug 23, 2021 at 03:18:51PM -0400, Peter Xu wrote: > > On Mon, Aug 23, 2021 at 02:49:12PM -0400, Eduardo Habkost wrote: > > > On Wed, Aug 18, 2021 at 03:43:18PM -0400, Peter Xu wrote: > > > > QEMU creates -device objects i

[PATCH v6 1/5] python: Add dependencies for AQMP TUI

2021-08-23 Thread G S Niteesh Babu
Added dependencies for the upcoming AQMP TUI under the optional 'tui' group. The same dependencies have also been added under the devel group since no work around has been found for optional groups to imply other optional groups. Signed-off-by: G S Niteesh Babu --- python/Pipfile.lock | 12

[PATCH v6 5/5] python/aqmp-tui: Add syntax highlighting

2021-08-23 Thread G S Niteesh Babu
Add syntax highlighting for the incoming and outgoing QMP messages. This is achieved using the pygments module which was added in a previous commit. The current implementation is a really simple one which doesn't allow for any configuration. In future this has to be improved to allow for easier th

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

2021-08-23 Thread Alexander Bulekov
On 210823 1650, Peter Xu wrote: > On Mon, Aug 23, 2021 at 08:10:50PM +0100, Peter Maydell wrote: > > On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé > > wrote: > > > > > > This series aim to kill a recent class of bug, the infamous > > > "DMA reentrancy" issues found by Alexander while fuzzi

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

2021-08-23 Thread Michael S. Tsirkin
On Mon, Aug 23, 2021 at 03:18:51PM -0400, Peter Xu wrote: > On Mon, Aug 23, 2021 at 02:49:12PM -0400, Eduardo Habkost wrote: > > On Wed, Aug 18, 2021 at 03:43:18PM -0400, Peter Xu wrote: > > > QEMU creates -device objects in order as specified by the user's cmdline. > > > However that ordering may

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

2021-08-23 Thread Eduardo Habkost
On Mon, Aug 23, 2021 at 05:31:46PM -0400, Peter Xu wrote: > On Mon, Aug 23, 2021 at 05:07:03PM -0400, Eduardo Habkost wrote: > > To give just one example: > > > > $ (echo 'info pci';echo quit;) | qemu-system-x86_64 -device virtio-net-pci > > -device e1000e -monitor stdio | tail -n 20 > > Bus 0

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

2021-08-23 Thread Michael S. Tsirkin
On Mon, Aug 23, 2021 at 05:31:46PM -0400, Peter Xu wrote: > On Mon, Aug 23, 2021 at 05:07:03PM -0400, Eduardo Habkost wrote: > > To give just one example: > > > > $ (echo 'info pci';echo quit;) | qemu-system-x86_64 -device virtio-net-pci > > -device e1000e -monitor stdio | tail -n 20 > > Bus 0

Re: [PATCH V6 00/27] Live Update

2021-08-23 Thread Steven Sistare
Hi Zheng, testing aarch64 is on our todo list. We will run this case and try to reproduce the failure. Thanks for the report. - Steve On 8/21/2021 4:54 AM, Zheng Chuan wrote: > Hi, steve > > It seems the VM will stuck after cpr-load on AArch64 environment? > > My AArch64 environment and test

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 05:07:03PM -0400, Eduardo Habkost wrote: > To give just one example: > > $ (echo 'info pci';echo quit;) | qemu-system-x86_64 -device virtio-net-pci > -device e1000e -monitor stdio | tail -n 20 > Bus 0, device 4, function 0: > Ethernet controller: PCI device 1af4:1

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

2021-08-23 Thread Eduardo Habkost
On Mon, Aug 23, 2021 at 03:18:51PM -0400, Peter Xu wrote: > On Mon, Aug 23, 2021 at 02:49:12PM -0400, Eduardo Habkost wrote: > > On Wed, Aug 18, 2021 at 03:43:18PM -0400, Peter Xu wrote: > > > QEMU creates -device objects in order as specified by the user's cmdline. > > > However that ordering may

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

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

[PATCH v5 24/24] target/riscv: Use {get,dest}_gpr for RVV

2021-08-23 Thread Richard Henderson
Remove gen_get_gpr, as the function becomes unused. Signed-off-by: Richard Henderson --- target/riscv/translate.c| 13 ++--- target/riscv/insn_trans/trans_rvv.c.inc | 74 +++-- 2 files changed, 26 insertions(+), 61 deletions(-) diff --git a/target/riscv/trans

[PATCH v5 22/24] target/riscv: Use {get,dest}_gpr for RVD

2021-08-23 Thread Richard Henderson
Reviewed-by: Bin Meng Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvd.c.inc | 125 1 file changed, 60 insertions(+), 65 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvd.c.inc b/target/riscv/insn_trans/trans_rvd.c.inc index 11b9b3f90b..

[PATCH v5 18/24] target/riscv: Reorg csr instructions

2021-08-23 Thread Richard Henderson
Introduce csrr and csrw helpers, for read-only and write-only insns. Note that we do not properly implement this in riscv_csrrw, in that we cannot distinguish true read-only (rs1 == 0) from any other zero write_mask another source register -- this should still raise an exception for read-only regi

[PATCH v5 20/24] target/riscv: Use gen_shift_imm_fn for slli_uw

2021-08-23 Thread Richard Henderson
Always use tcg_gen_deposit_z_tl; the special case for shamt >= 32 is handled there. Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvb.c.inc | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/tar

[PATCH v5 19/24] target/riscv: Use {get,dest}_gpr for RVA

2021-08-23 Thread Richard Henderson
Reviewed-by: Bin Meng Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rva.c.inc | 47 ++--- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/target/riscv/insn_trans/trans_rva.c.inc b/target/riscv/insn_trans/trans_rva.c.inc index 3cc3c3b073..

[PATCH v5 17/24] target/riscv: Fix hgeie, hgeip

2021-08-23 Thread Richard Henderson
We failed to write into *val for these read functions; replace them with read_zero. Only warn about unsupported non-zero value when writing a non-zero value. Signed-off-by: Richard Henderson --- target/riscv/csr.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-)

[PATCH v5 13/24] target/riscv: Use extracts for sraiw and srliw

2021-08-23 Thread Richard Henderson
These operations can be done in one instruction on some hosts. Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvi.c.inc | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans

[PATCH v5 23/24] target/riscv: Tidy trans_rvh.c.inc

2021-08-23 Thread Richard Henderson
Exit early if check_access fails. Split out do_hlv, do_hsv, do_hlvx subroutines. Use dest_gpr, get_gpr in the new subroutines. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvh.c.inc | 266

[PATCH v5 09/24] target/riscv: Move gen_* helpers for RVM

2021-08-23 Thread Richard Henderson
Move these helpers near their use by the trans_* functions within insn_trans/trans_rvm.c.inc. Reviewed-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c| 127 ta

[PATCH v5 21/24] target/riscv: Use {get,dest}_gpr for RVF

2021-08-23 Thread Richard Henderson
Reviewed-by: Bin Meng Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvf.c.inc | 146 1 file changed, 70 insertions(+), 76 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvf.c.inc b/target/riscv/insn_trans/trans_rvf.c.inc index fb9f7f9c00..

[PATCH v5 14/24] target/riscv: Use get_gpr in branches

2021-08-23 Thread Richard Henderson
Narrow the scope of t0 in trans_jalr. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvi.c.inc | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/target/riscv/insn_trans/trans_r

[PATCH v5 10/24] target/riscv: Move gen_* helpers for RVB

2021-08-23 Thread Richard Henderson
Move these helpers near their use by the trans_* functions within insn_trans/trans_rvb.c.inc. Reviewed-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c| 233 --- tar

[PATCH v5 11/24] target/riscv: Add DisasExtend to gen_unary

2021-08-23 Thread Richard Henderson
Use ctx->w for ctpopw, which is the only one that can re-use the generic algorithm for the narrow operation. Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c| 14 ++ target/riscv/insn_trans/trans_rvb.c.inc | 24 +

[PATCH v5 16/24] target/riscv: Fix rmw_sip, rmw_vsip, rmw_hsip vs write-only operation

2021-08-23 Thread Richard Henderson
We distinguish write-only by passing ret_value as NULL. Signed-off-by: Richard Henderson --- target/riscv/csr.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 9a4ed18ac5..d900f96dc1 100644 --- a/target/ri

[PATCH v5 06/24] target/riscv: Add DisasExtend to gen_arith*

2021-08-23 Thread Richard Henderson
Most arithmetic does not require extending the inputs. Exceptions include division, comparison and minmax. Begin using ctx->w, which allows elimination of gen_addw, gen_subw, gen_mulw. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/transl

[PATCH v5 15/24] target/riscv: Use {get, dest}_gpr for integer load/store

2021-08-23 Thread Richard Henderson
Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvi.c.inc | 36 + 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/tra

[PATCH v5 08/24] target/riscv: Use gen_arith for mulh and mulhu

2021-08-23 Thread Richard Henderson
Split out gen_mulh and gen_mulhu and use the common helper. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvm.c.inc | 40 +++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/target/ri

[PATCH v5 12/24] target/riscv: Use DisasExtend in shift operations

2021-08-23 Thread Richard Henderson
These operations are greatly simplified by ctx->w, which allows us to fold gen_shiftw into gen_shift. Split gen_shifti into gen_shift_imm_{fn,tl} like we do for gen_arith_imm_{fn,tl}. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/transla

[PATCH v5 07/24] target/riscv: Remove gen_arith_div*

2021-08-23 Thread Richard Henderson
Use ctx->w and the enhanced gen_arith function. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c| 42 - target/riscv/insn_trans/trans_rvm.c.inc | 16 +- 2 files changed, 8 insertion

[PATCH v5 04/24] target/riscv: Add DisasContext to gen_get_gpr, gen_set_gpr

2021-08-23 Thread Richard Henderson
We will require the context to handle RV64 word operations. Reviewed-by: Alistair Francis Reviewed-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/riscv/translate.c| 58 - target/riscv/insn_trans/trans_rva.c.

[PATCH v5 02/24] tests/tcg/riscv64: Add test for division

2021-08-23 Thread Richard Henderson
Tested-by: Bin Meng Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- tests/tcg/riscv64/test-div.c | 58 +++ tests/tcg/riscv64/Makefile.target | 5 +++ 2 files changed, 63 insertions(+) create mode 100644 tests/tcg/riscv

[PATCH v5 03/24] target/riscv: Clean up division helpers

2021-08-23 Thread Richard Henderson
Utilize the condition in the movcond more; this allows some of the setcond that were feeding into movcond to be removed. Do not write into source1 and source2. Re-name "condN" to "tempN" and use the temporaries for more than holding conditions. Tested-by: Bin Meng Reviewed-by: Bin Meng Reviewed

[PATCH v5 05/24] target/riscv: Introduce DisasExtend and new helpers

2021-08-23 Thread Richard Henderson
Introduce get_gpr, dest_gpr, temp_new -- new helpers that do not force tcg globals into temps, returning a constant 0 for $zero as source and a new temp for $zero as destination. Introduce ctx->w for simplifying word operations, such as addw. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis

[PATCH v5 01/24] target/riscv: Use tcg_constant_*

2021-08-23 Thread Richard Henderson
Replace uses of tcg_const_* with the allocate and free close together. Reviewed-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c| 36 -- target/riscv/insn_trans/trans_rvf.c.

[PATCH v5 00/24] target/riscv: Use tcg_constant_*

2021-08-23 Thread Richard Henderson
Replace use of tcg_const_*, which makes a copy into a temp which must be freed, with direct use of the constant. Reorg handling of $zero, with different accessors for source and destination. Reorg handling of csrs, passing the actual write_mask instead of a regno. Use more helpers for RVH expans

Re: [PATCH v4 15/21] target/riscv: Reorg csr instructions

2021-08-23 Thread Richard Henderson
On 8/22/21 9:54 PM, Bin Meng wrote: On Sat, Aug 21, 2021 at 1:43 AM Richard Henderson wrote: Introduce csrr and csrw helpers, for read-only and write-only insns. Note that we do not properly implement this in riscv_csrrw, in that we cannot distinguish true read-only (rs1 == 0) from any other

Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation

2021-08-23 Thread Gautam Bhat
On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell wrote: > > On Sun, 22 Aug 2021 at 15:37, Gautam Bhat wrote: > > > > Hi, > > > > I am to implement a very simple microcontroller for my understanding > > of Qemu development. This microcontroller runs its code from > > programmable flash which is bit-

Re: [PATCH V6 19/27] vfio-pci: cpr part 1 (fd and dma)

2021-08-23 Thread Steven Sistare
On 8/10/2021 1:06 PM, Alex Williamson wrote: > On Fri, 6 Aug 2021 14:43:53 -0700 > Steve Sistare wrote: > >> Enable vfio-pci devices to be saved and restored across an exec restart >> of qemu. >> >> At vfio creation time, save the value of vfio container, group, and device >> descriptors in cpr

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

2021-08-23 Thread David Hildenbrand
On 23.08.21 12:34, Philippe Mathieu-Daudé wrote: On 8/23/21 12:24 PM, David Hildenbrand wrote: On 23.08.21 12:12, Philippe Mathieu-Daudé wrote: On 8/23/21 11:29 AM, David Hildenbrand wrote: On 23.08.21 11:23, Peter Maydell wrote: On Mon, 23 Aug 2021 at 09:40, David Hildenbrand wrote: Not op

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 02:49:12PM -0400, Eduardo Habkost wrote: > On Wed, Aug 18, 2021 at 03:43:18PM -0400, Peter Xu wrote: > > QEMU creates -device objects in order as specified by the user's cmdline. > > However that ordering may not be the ideal order. For example, some > > platform > > devic

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

2021-08-23 Thread Peter Maydell
On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé wrote: > > This series aim to kill a recent class of bug, the infamous > "DMA reentrancy" issues found by Alexander while fuzzing. > > Introduce the 'bus_perm' field in MemTxAttrs, defining 3 bits: > > - MEMTXPERM_UNSPECIFIED (current default, u

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

2021-08-23 Thread David Hildenbrand
On 23.08.21 18:41, Philippe Mathieu-Daudé wrote: Check bus permission in flatview_access_allowed() before running any bus transaction. There is not change for the default case (MEMTXPERM_UNSPECIFIED). s/not/no/ The MEMTXPERM_UNRESTRICTED case works as an allow list. Devices using it won't b

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

2021-08-23 Thread Peter Maydell
On Mon, 23 Aug 2021 at 17:42, Philippe Mathieu-Daudé wrote: > > We are going to introduce more MemTxResult bits, so it is > safer to check for !MEMTX_OK rather than MEMTX_ERROR. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell but note that these MEMTX_* aren't from the mem

Re: [RFC PATCH v2 3/5] exec/memattrs: Introduce MemTxAttrs::bus_perm field

2021-08-23 Thread David Hildenbrand
On 23.08.21 20:41, Peter Xu wrote: On Mon, Aug 23, 2021 at 06:41:55PM +0200, Philippe Mathieu-Daudé wrote: +/* Permission to restrict bus memory accesses. See MemTxAttrs::bus_perm */ +enum { +MEMTXPERM_UNSPECIFIED = 0, +MEMTXPERM_UNRESTRICTED = 1, +MEMTXPERM_RAM_DEVICE= 2, +};

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

2021-08-23 Thread David Hildenbrand
On 23.08.21 20:43, Peter Xu wrote: On Mon, Aug 23, 2021 at 06:41:56PM +0200, Philippe Mathieu-Daudé wrote: Introduce flatview_access_allowed() to check bus permission before running any bus transaction. For now this is a simple stub. Signed-off-by: Philippe Mathieu-Daudé Shall we squash this

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

2021-08-23 Thread David Hildenbrand
On 23.08.21 18:41, Philippe Mathieu-Daudé wrote: We are going to introduce more MemTxResult bits, so it is safer to check for !MEMTX_OK rather than MEMTX_ERROR. Signed-off-by: Philippe Mathieu-Daudé --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

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

2021-08-23 Thread John Snow
On Mon, Aug 23, 2021 at 12:31 PM G S Niteesh Babu wrote: > Added AQMP TUI. > > Implements the follwing basic features: > 1) Command transmission/reception. > 2) Shows events asynchronously. > 3) Shows server status in the bottom status bar. > 4) Automatic retries on disconnects and error conditio

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

2021-08-23 Thread David Hildenbrand
On 23.08.21 18:41, Philippe Mathieu-Daudé wrote: Remove unuseful local 'result' variables. Signed-off-by: Philippe Mathieu-Daudé --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 06:41:54PM +0200, Philippe Mathieu-Daudé wrote: > We are going to introduce more MemTxResult bits, so it is > safer to check for !MEMTX_OK rather than MEMTX_ERROR. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu -- Peter Xu

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

2021-08-23 Thread Eduardo Habkost
On Wed, Aug 18, 2021 at 03:43:18PM -0400, Peter Xu wrote: > QEMU creates -device objects in order as specified by the user's cmdline. > However that ordering may not be the ideal order. For example, some platform > devices (vIOMMUs) may want to be created earlier than most of the rest > devices (e

[PATCH v5 14/14] disas/riscv: Add Zb[abcs] instructions

2021-08-23 Thread Philipp Tomsich
With the addition of Zb[abcs], we also need to add disassembler support for these new instructions. Signed-off-by: Philipp Tomsich --- (no changes since v2) Changes in v2: - Fix missing ';' from last-minute whitespace cleanups. disas/riscv.c | 157

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 06:41:57PM +0200, Philippe Mathieu-Daudé wrote: > @@ -2772,7 +2772,22 @@ static inline bool > flatview_access_allowed(MemoryRegion *mr, MemTxAttrs attrs, > hwaddr addr, hwaddr len, > Mem

[PATCH v5 09/14] target/riscv: Add orc.b instruction for Zbb, removing gorc/gorci

2021-08-23 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain gorc/gorci. Instead, a orc.b instruction (equivalent to the orc.b pseudo-instruction built on gorci from pre-0.93 draft-B) is available, mainly targeting string-processing workloads. This commit adds the new orc.b instruction and removed gorc/gorci. Sign

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 06:41:53PM +0200, Philippe Mathieu-Daudé wrote: > Remove unuseful local 'result' variables. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu -- Peter Xu

[PATCH v5 08/14] target/riscv: Reassign instructions to the Zbb-extension

2021-08-23 Thread Philipp Tomsich
This reassigns the instructions that are part of Zbb into it, with the notable exceptions of the instructions (rev8, zext.w and orc.b) that changed due to gorci, grevi and pack not being part of Zb[abcs]. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) C

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

2021-08-23 Thread Peter Xu
On Mon, Aug 23, 2021 at 06:41:56PM +0200, Philippe Mathieu-Daudé wrote: > Introduce flatview_access_allowed() to check bus permission > before running any bus transaction. For now this is a simple > stub. > > Signed-off-by: Philippe Mathieu-Daudé Shall we squash this patch into the next one? It

[PATCH v5 11/14] target/riscv: Add rev8 instruction, removing grev/grevi

2021-08-23 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain grev/grevi. Instead, a rev8 instruction (equivalent to the rev8 pseudo-instruction built on grevi from pre-0.93 draft-B) is available. This commit adds the new rev8 instruction and removes grev/grevi. Note that there is no W-form of this instruction (bot

[PATCH v5 12/14] target/riscv: Add zext.h instructions to Zbb, removing pack/packu/packh

2021-08-23 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain pack/packu/packh. However, a zext.h instruction is provided (built on pack/packh from pre-0.93 draft-B) is available. This commit adds zext.h and removes the pack* instructions. Note that the encodings for zext.h are different between RV32 and RV64, which

[PATCH v5 07/14] target/riscv: Add instructions of the Zbc-extension

2021-08-23 Thread Philipp Tomsich
The following instructions are part of Zbc: - clmul - clmulh - clmulr Note that these instructions were already defined in the pre-0.93 and the 0.93 draft-B proposals, but had not been omitted in the earlier addition of draft-B to QEmu. Signed-off-by: Philipp Tomsich --- Changes in v5: - Int

[PATCH v5 02/14] target/riscv: Reassign instructions to the Zba-extension

2021-08-23 Thread Philipp Tomsich
The following instructions are part of Zba: - add.uw (RV64 only) - sh[123]add (RV32 and RV64) - sh[123]add.uw (RV64-only) - slli.uw (RV64-only) Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in v3: - The changes to the Zba instructions (i.e.

[PATCH v5 13/14] target/riscv: Remove RVB (replaced by Zb[abcs]

2021-08-23 Thread Philipp Tomsich
With everything classified as Zb[abcs] and pre-0.93 draft-B instructions that are not part of Zb[abcs] removed, we can remove the remaining support code for RVB. Note that RVB has been retired for good and misa.B will neither mean 'some' or 'all of' Zb*: https://lists.riscv.org/g/tech-bitmanip/m

[PATCH v5 06/14] target/riscv: Reassign instructions to the Zbs-extension

2021-08-23 Thread Philipp Tomsich
The following instructions are part of Zbs: - b{set,clr,ext,inv} - b{set,clr,ext,inv}i Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in v3: - The changes to the Zbs instructions (i.e. the REQUIRE_ZBS macro) and its use for qualifying the Zb

  1   2   3   4   >