[PATCH v3 13/15] KVM: Handle page fault for private memory

2021-12-21 Thread Chao Peng
When a page fault from the secondary page table while the guest is running happens in a memslot with KVM_MEM_PRIVATE, we need go different paths for private access and shared access. - For private access, KVM checks if the page is already allocated in the memory backend, if yes KVM establish

[PATCH v3 03/15] mm/memfd: Introduce MEMFD_OPS

2021-12-21 Thread Chao Peng
From: "Kirill A. Shutemov" The patch introduces new MEMFD_OPS facility around file created by memfd_create() to allow a third kernel component to make use of memory bookmarked in a memfd and gets notifier when the memory in the file is allocated/invalidated. It will be used for KVM to use memfd f

[PATCH v3 06/15] KVM: Refactor hva based memory invalidation code

2021-12-21 Thread Chao Peng
The purpose of this patch is for fd-based memslot to reuse the same mmu_notifier based guest memory invalidation code for private pages. No functional changes except renaming 'hva' to more neutral 'useraddr' so that it can also cover 'offset' in a fd that private pages live in. Signed-off-by: Yu

[PATCH v3 00/15] KVM: mm: fd-based approach for supporting KVM guest private memory

2021-12-21 Thread Chao Peng
This is the third version of this series which try to implement the fd-based KVM guest private memory. In general this patch series introduce fd-based memslot which provide guest memory through a memfd file descriptor fd[offset,size] instead of hva/size. The fd then can be created from a supported

[PATCH v3 10/15] KVM: Add kvm_map_gfn_range

2021-12-21 Thread Chao Peng
This new function establishes the mapping in KVM page tables for a given gfn range. It can be used in the memory fallocate callback for memfd based memory to establish the mapping for KVM secondary MMU when the pages are allocated in the memory backend. Signed-off-by: Yu Zhang Signed-off-by: Chao

[PATCH v3 05/15] KVM: Implement fd-based memory using MEMFD_OPS interfaces

2021-12-21 Thread Chao Peng
This patch adds the new memfd facility in KVM using MEMFD_OPS to provide guest memory from a file descriptor created in user space with memfd_create() instead of traditional userspace hva. It mainly provides two kind of functions: - Pair/unpair a fd-based memslot to a memory backend that owns the

[PATCH v3 07/15] KVM: Special handling for fd-based memory invalidation

2021-12-21 Thread Chao Peng
For fd-based guest memory, the memory backend (e.g. the fd provider) should notify KVM to unmap/invalidate the privated memory from KVM second MMU when userspace punches hole on the fd (e.g. when userspace converts private memory to shared memory). To support fd-based memory invalidation, existing

[PATCH v3 08/15] KVM: Split out common memory invalidation code

2021-12-21 Thread Chao Peng
When fd-based memory is enabled, there will be two types of memory invalidation: - memory invalidation from native MMU through mmu_notifier callback for hva-based memory, and, - memory invalidation from memfd through memfd_notifier callback for fd-based memory. Some code can be shared

[PATCH v3 15/15] KVM: Register/unregister private memory slot to memfd

2021-12-21 Thread Chao Peng
Expose KVM_MEM_PRIVATE flag and register/unregister private memory slot to memfd when userspace sets the flag. KVM_MEM_PRIVATE is disallowed by default but architecture code can turn it on by implementing kvm_arch_private_memory_supported(). Signed-off-by: Yu Zhang Signed-off-by: Chao Peng ---

[PATCH v3 09/15] KVM: Implement fd-based memory invalidation

2021-12-21 Thread Chao Peng
KVM gets notified when userspace punches a hole in a fd which is used for guest memory. KVM should invalidate the mapping in the second MMU page tables. This is the same logic as MMU notifier invalidation except the fd related information is carried around to indicate the memory range. KVM hence ca

[PATCH v3 12/15] KVM: Add KVM_EXIT_MEMORY_ERROR exit

2021-12-21 Thread Chao Peng
This new exit allows user space to handle memory-related errors. Currently it supports two types (KVM_EXIT_MEM_MAP_SHARED/PRIVATE) of errors which are used for shared memory <-> private memory conversion in memory encryption usage. After private memory is enabled, there are two places in KVM that

[PATCH v3 14/15] KVM: Use kvm_userspace_memory_region_ext

2021-12-21 Thread Chao Peng
Use the new extended memslot structure kvm_userspace_memory_region_ext which includes two additional fd/ofs fields comparing to the current kvm_userspace_memory_region. The fields fd/ofs will be copied from userspace only when KVM_MEM_PRIVATE is set. Internal the KVM we change all existing kvm_use

[PATCH v3 11/15] KVM: Implement fd-based memory fallocation

2021-12-21 Thread Chao Peng
KVM gets notified through memfd_notifier when user space allocate space via fallocate() on the fd which is used for guest memory. KVM can set up the mapping in the secondary MMU page tables at this time. This patch adds function in KVM to map pfn to gfn when the page is allocated in the memory back

Re: [PATCH] vl: Add -set options to device opts dict when using JSON syntax for -device

2021-12-21 Thread Markus Armbruster
Paolo Bonzini writes: > On 12/21/21 13:58, Markus Armbruster wrote: >>> Is this a regression? I suspect commit 5dacda5167 "vl: Enable JSON >>> syntax for -device" (v6.2.0). >> >> Obviously not a regression: everything that used to work still works. > > FWIW I think -set should be deprecated. I

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

2021-12-21 Thread Sean Christopherson
On Tue, Dec 21, 2021, Chao Peng wrote: > This is the third version of this series which try to implement the > fd-based KVM guest private memory. ... > Test > > This code has been tested with latest TDX code patches hosted at > (https://github.com/intel/tdx/tree/kvm-upstream) with minimal TD

Re: [PATCH] docker: include bison in debian-tricore-cross

2021-12-21 Thread Richard Henderson
On 12/21/21 3:16 AM, Paolo Bonzini wrote: Binutils sometimes fail to build if bison is not installed: /bin/sh ./ylwrap `test -f arparse.y || echo ./`arparse.y y.tab.c arparse.c y.tab.h arparse.h y.output arparse.output -- -d ./ylwrap: 109: ./ylwrap: -d: not found (the correct invocation

Re: [PATCH RFC] MAINTAINERS: split out s390x sections

2021-12-21 Thread Cornelia Huck
On Tue, Dec 21 2021, Thomas Huth wrote: > On 20/12/2021 12.54, Cornelia Huck wrote: >> Split out some more specialized devices etc., so that we can build >> smarter lists of people to be put on cc: in the future. >> >> Signed-off-by: Cornelia Huck >> --- >> >> As discussed offlist. Some notes:

Re: QOM

2021-12-21 Thread abhijeet inamdar
Hi, How did we decide the NUM_IRQ_LINES 64 for stellaris? BR. Abhijeet. On Tue, 21 Dec, 2021, 13:22 abhijeet inamdar, wrote: > As we have almost 80 irq lines and 40-45 NVIC_irq's. > > Where can I define them? > > BR. > Abhijeet. > > On Tue, 21 Dec, 2021, 13:18 abhijeet inamdar, < > abhijee

[PATCH 0/3] build: some cleanups for common-user/ infrastructure

2021-12-21 Thread Paolo Bonzini
A belated review of the patches that introduced common-user/. Limiting the interface that it expects from bsd-user/ and linux-user/ to an include/ subdirectory, and simplifying the mesonry that builds the new directory. Paolo Bonzini (3): meson: reuse common_user_inc when building files specific

[PATCH 1/3] meson: reuse common_user_inc when building files specific to user-mode emulators

2021-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f45ecf31bd..b0af02b805 100644 --- a/meson.build +++ b/meson.build @@ -2897,6 +2897,7 @@ foreach target : target_dirs else abi = config_target['T

[PATCH 3/3] meson: cleanup common-user/ build

2021-12-21 Thread Paolo Bonzini
Do not go through a static_library, which is only necessary in order to reuse some source files between emulators and tests. Instead just place common files for all user-mode emulators in common_ss, similar to what is already done for softmmu_ss in full system emulators. The only disadvantage is

[PATCH 2/3] user: move common-user includes to a subdirectory of {bsd, linux}-user/

2021-12-21 Thread Paolo Bonzini
Avoid polluting the compilation of common-user/ with local include files; making an include file available to common-user/ should be a deliberate decision in order to keep a clear interface that can be used by both bsd-user/ and linux-user/. Signed-off-by: Paolo Bonzini --- bsd-user/{ => include

Re: [PATCH] pci: Skip power-off reset when pending unplug

2021-12-21 Thread Alex Williamson
On Mon, 20 Dec 2021 18:03:56 -0500 "Michael S. Tsirkin" wrote: > On Mon, Dec 20, 2021 at 11:26:59AM -0700, Alex Williamson wrote: > > The below referenced commit introduced a change where devices under a > > root port slot are reset in response to removing power to the slot. > > This improves emu

Re: [PATCH] acpi: validate hotplug selector on access

2021-12-21 Thread Ani Sinha
On Tue, 21 Dec 2021, Michael S. Tsirkin wrote: > When bus is looked up on a pci write, we didn't > validate that the lookup succeeded. > Fuzzers thus can trigger QEMU crash by dereferencing the NULL > bus pointer. Good fix. Nice catch. > > Fixes: b32bd763a1 ("pci: introduce acpi-index propert

[PULL 01/31] elf: Add machine type value for LoongArch

2021-12-21 Thread Richard Henderson
From: WANG Xuerui This is already officially allocated as recorded in GNU binutils repo [1], and the description is updated in [2]. Add to enable further work. [1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4cf2ad720078a9f490dd5b5bc8893a926479196e [2]: https://sourceware.org/gi

[PULL 07/31] tcg/loongarch64: Implement necessary relocation operations

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-8-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 66 1 file changed, 66

[PULL 00/31] tcg/loongarch64: New tcg backend

2021-12-21 Thread Richard Henderson
The following changes since commit 2bf40d0841b942e7ba12953d515e62a436f0af84: Merge tag 'pull-user-20211220' of https://gitlab.com/rth7680/qemu into staging (2021-12-20 13:20:07 -0800) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-loong-202

[PULL 02/31] MAINTAINERS: Add tcg/loongarch64 entry with myself as maintainer

2021-12-21 Thread Richard Henderson
From: WANG Xuerui I ported the initial code, so I should maintain it of course. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-3-...@xen0n.name> Signed-off-by: Richard Henderson --- MAINTAINERS | 5 + 1 fi

[PULL 04/31] tcg/loongarch64: Add generated instruction opcodes and encoding helpers

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson Message-Id: <20211221054105.178795-5-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 979 1 file changed, 979 i

[PULL 05/31] tcg/loongarch64: Add register names, allocation order and input/output sets

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-6-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 118 +++ 1 file changed, 118 insertions(+) create mode 100644 t

[PULL 03/31] tcg/loongarch64: Add the tcg-target.h file

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Support for all optional TCG ops are initially marked disabled; the bits are to be set in individual commits later. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-4-...@xen0n.name> Signed-off-b

[PULL 06/31] tcg/loongarch64: Define the operand constraints

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-7-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-str.h | 28 +++ tcg/loongarch64/tcg-target.c.in

[PULL 09/31] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-10-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 137 +++ 1 file changed, 1

[PULL 13/31] tcg/loongarch64: Implement deposit/extract ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-14-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.h | 8 ++

[PULL 14/31] tcg/loongarch64: Implement bswap{16,32,64} ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-15-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.h | 10 +- tcg/loongarch64/tcg-target.c.inc | 32 +

[PULL 17/31] tcg/loongarch64: Implement add/sub ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui The neg_i{32,64} ops is fully expressible with sub, so omitted for simplicity. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-18-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loong

[PULL 18/31] tcg/loongarch64: Implement mul/mulsh/muluh/div/divu/rem/remu ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-19-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.h | 16 ++

[PULL 19/31] tcg/loongarch64: Implement br/brcond ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-20-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 53 ++

[PULL 12/31] tcg/loongarch64: Implement not/and/or/xor/nor/andc/orc ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-13-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target.h | 16 ++

[PULL 15/31] tcg/loongarch64: Implement clz/ctz ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-16-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.h | 8 +++--- tcg/loongarch64/tcg-target.c.in

[PULL 22/31] tcg/loongarch64: Implement simple load/store ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-23-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 131

[PULL 16/31] tcg/loongarch64: Implement shl/shr/sar/rotl/rotr ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-17-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.h | 4 +-

[PULL 10/31] tcg/loongarch64: Implement goto_ptr

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-11-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 17 + tcg/loongarch64/tcg-target.c

[PULL 26/31] tcg/loongarch64: Implement tcg_target_init

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-27-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tcg/loongarc

[PULL 20/31] tcg/loongarch64: Implement setcond ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-21-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 69 2 files c

[PULL 11/31] tcg/loongarch64: Implement sign-/zero-extension ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-12-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.h | 24 ++

[PULL 21/31] tcg/loongarch64: Implement tcg_out_call

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-22-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 34 1 file changed, 34 insertions(+) diff --git a/tcg/loo

[PULL 27/31] tcg/loongarch64: Register the JIT

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-28-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 44 1 file changed, 44 insertions(+) diff --git a/tcg/loo

[PULL 08/31] tcg/loongarch64: Implement the memory barrier op

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-9-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 32 1 file changed, 32

[PULL 25/31] tcg/loongarch64: Implement exit_tb/goto_tb

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-26-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tcg/loongarch64/tcg-

[PULL 23/31] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-24-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target.c.inc | 353 +++ 2 files

[PULL 30/31] configure, meson.build: Mark support for loongarch64 hosts

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Example output of `uname -a` on an initial Gentoo LA64 port, running the upstream submission version of Linux (with some very minor patches not influencing output here): > Linux 5.14.0-10342-g37a00851b145 #5 SMP PREEMPT Tue Aug 10 > 12:56:24 PM CST 2021 loongarch64 GNU/Linux

[PULL 24/31] tcg/loongarch64: Implement tcg_target_qemu_prologue

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-25-...@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 68 1 file changed, 68 insertions(+) diff --git a/tcg/loo

[PULL 28/31] common-user: Add safe syscall handling for loongarch64 hosts

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-29-...@xen0n.name> Signed-off-by: Richard Henderson --- .../host/loongarch64/safe-syscall.inc.S | 90 +++ 1 file changed, 90 insertions(+) create mode 100644 c

[PULL 29/31] linux-user: Implement CPU-specific signal handler for loongarch64 hosts

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-30-...@xen0n.name> Signed-off-by: Richard Henderson --- linux-user/host/loongarch64/host-signal.h | 87 +++ 1 file changed, 8

[PULL 31/31] tests/docker: Add gentoo-loongarch64-cross image and run cross builds in GitLab

2021-12-21 Thread Richard Henderson
From: WANG Xuerui Normally this would be based on qemu/debian10 or qemu/ubuntu2004, but after a week-long struggle, I still cannot build stage2 gcc with the known-good LoongArch toolchain sources, so I chose the least-resistance path with Gentoo as base image. As this image is not expected to be

Re: [PATCH v11 00/31] LoongArch64 port of QEMU TCG

2021-12-21 Thread Richard Henderson
On 12/20/21 9:40 PM, WANG Xuerui wrote: Hi all, This is a port of QEMU TCG to the brand-new CPU architecture LoongArch, introduced by Loongson with their 3A5000 chips. Everything is tested on real 3A5000 board (system emulation, linux-user, make check) and GitLab (CI jobs), and rebased to lates

[PATCH] target/riscv: make H-extension non-experimental

2021-12-21 Thread Vineet Gupta
H-ext v1.0 was ratified recently as part of Privileged Spec 1.12. So move it out of experimental. [1] https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions Signed-off-by: Vineet Gupta --- target/riscv/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targe

Re: [PATCH] vl: Add -set options to device opts dict when using JSON syntax for -device

2021-12-21 Thread Damien Hedde
On 12/21/21 16:40, Markus Armbruster wrote: Paolo Bonzini writes: On 12/21/21 13:58, Markus Armbruster wrote: Is this a regression? I suspect commit 5dacda5167 "vl: Enable JSON syntax for -device" (v6.2.0). Obviously not a regression: everything that used to work still works. FWIW I t

Re: [PATCH] vl: Add -set options to device opts dict when using JSON syntax for -device

2021-12-21 Thread Damien Hedde
On 12/21/21 16:40, Markus Armbruster wrote: Paolo Bonzini writes: On 12/21/21 13:58, Markus Armbruster wrote: Is this a regression? I suspect commit 5dacda5167 "vl: Enable JSON syntax for -device" (v6.2.0). Obviously not a regression: everything that used to work still works. FWIW I t

RE: [PATCH v7 09/13] target/hexagon: import lexer for idef-parser

2021-12-21 Thread Taylor Simpson
> -Original Message- > From: Anton Johansson > Sent: Friday, December 17, 2021 2:01 AM > To: qemu-devel@nongnu.org > Cc: a...@rev.ng; Taylor Simpson ; Brian Cain > ; bab...@rev.ng; ni...@rev.ng; > richard.hender...@linaro.org > Subject: [PATCH v7 09/13] target/hexagon: import lexer for i

RE: [PATCH v7 05/13] target/hexagon: introduce new helper functions

2021-12-21 Thread Taylor Simpson
> -Original Message- > From: Anton Johansson > Sent: Friday, December 17, 2021 2:01 AM > To: qemu-devel@nongnu.org > Cc: a...@rev.ng; Taylor Simpson ; Brian Cain > ; bab...@rev.ng; ni...@rev.ng; > richard.hender...@linaro.org > Subject: [PATCH v7 05/13] target/hexagon: introduce new help

Re: [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF

2021-12-21 Thread Alex Williamson
On Tue, 14 Dec 2021 13:45:34 +0800 Cai Huoqing wrote: > No support MSI-X in BAIDU KUNLUN Virtual Function devices, > so add a quirk to avoid setuping VFIO MSI-X > > Signed-off-by: Cai Huoqing > --- > hw/vfio/pci.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/vfio/pci.c b

Re: [PULL v2 00/36] ui: D-Bus display backend

2021-12-21 Thread Richard Henderson
On 12/20/21 10:58 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The following changes since commit 2bf40d0841b942e7ba12953d515e62a436f0af84: Merge tag 'pull-user-20211220' of https://gitlab.com/rth7680/qemu into staging (2021-12-20 13:20:07 -0800) are available in the Git

Re: [PATCH] tests/qtest/virtio-net-failover: Use g_random_int() instead of g_test_rand_int()

2021-12-21 Thread Richard Henderson
On 12/21/21 2:32 AM, Thomas Huth wrote: Using g_file_open_tmp is certainly better ... but the tests are currently written in a way where they require the file name of the temporary file - so switching to g_file_open_tmp() (which only provides a file handle) certainly would need some rewrite here

[PATCH 2/3] scripts/qapi-gen.py: add --add-trace-points option

2021-12-21 Thread Vladimir Sementsov-Ogievskiy
Add and option to generate trace points. We should generate both trace points and trace-events files for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/gen.py | 13 ++--- scripts/qapi/main.py | 10 +++--- 2 files changed, 17 inserti

[PATCH 3/3] meson: generate trace points for qmp commands

2021-12-21 Thread Vladimir Sementsov-Ogievskiy
I need help with this thing. Now it works like this: make -j9 ninja: error: '/work/src/qemu/up/up-trace-qmp-commands/build/qapi/qapi-commands-authz.trace-events', needed by 'trace/trace-events-all', missing and no known rule to make it make[1]: *** [Makefile:162: run-ninja] Error 1 make[1]: Leav

[PATCH RFC 0/3] trace qmp commands

2021-12-21 Thread Vladimir Sementsov-Ogievskiy
Hi all! This series aims to add trace points for each qmp command with help of qapi code generator. That's a replacement for my "[PATCH 0/5] trace: inroduce qmp: trace namespace" Supersedes: <20210923195451.714796-1-vsement...@virtuozzo.com> There are some problems, so that's an RFC. 1. Main p

[PATCH 1/3] scripts/qapi/commands: gen_commands(): add add_trace_points argument

2021-12-21 Thread Vladimir Sementsov-Ogievskiy
Add possibility to generate trace points for each qmp command. We should generate both trace points and trace-events file, for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/commands.py | 84 ++-- 1 file chan

Re: [PATCH 2/3] user: move common-user includes to a subdirectory of {bsd,linux}-user/

2021-12-21 Thread Richard Henderson
On 12/21/21 8:32 AM, Paolo Bonzini wrote: Avoid polluting the compilation of common-user/ with local include files; making an include file available to common-user/ should be a deliberate decision in order to keep a clear interface that can be used by both bsd-user/ and linux-user/. The reason

Re: [PATCH 2/3] user: move common-user includes to a subdirectory of {bsd,linux}-user/

2021-12-21 Thread Richard Henderson
On 12/21/21 11:56 AM, Richard Henderson wrote: On 12/21/21 8:32 AM, Paolo Bonzini wrote: Avoid polluting the compilation of common-user/ with local include files; making an include file available to common-user/ should be a deliberate decision in order to keep a clear interface that can be used

Re: [PATCH 3/3] meson: cleanup common-user/ build

2021-12-21 Thread Richard Henderson
On 12/21/21 8:33 AM, Paolo Bonzini wrote: Do not go through a static_library, which is only necessary in order to reuse some source files between emulators and tests. That's not true, is it. Anyway, you're moving the file to a different static_library. I though I had tried this myself, but I

Re: [PATCH 2/3] user: move common-user includes to a subdirectory of {bsd,linux}-user/

2021-12-21 Thread Richard Henderson
On 12/21/21 8:32 AM, Paolo Bonzini wrote: Avoid polluting the compilation of common-user/ with local include files; making an include file available to common-user/ should be a deliberate decision in order to keep a clear interface that can be used by both bsd-user/ and linux-user/. Signed-off-b

Re: [PATCH 1/3] meson: reuse common_user_inc when building files specific to user-mode emulators

2021-12-21 Thread Richard Henderson
On 12/21/21 8:32 AM, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 1/8] configure: simplify creation of plugin symbol list

2021-12-21 Thread Richard Henderson
On 12/21/21 3:05 AM, Paolo Bonzini wrote: --dynamic-list is present on all supported ELF (not Windows or Darwin) platforms, since it dates back to 2006; -exported_symbols_list is likewise present on all supported versions of macOS. Do not bother doing a functional test in configure. Remove the

Re: [PATCH 2/8] configure: do not set bsd_user/linux_user early

2021-12-21 Thread Richard Henderson
On 12/21/21 3:05 AM, Paolo Bonzini wrote: Similar to other optional features, leave the variables empty and compute the actual value later. Use the existence of include or source directories to detect whether an OS or CPU supports respectively bsd-user and linux-user. For now, BSD user-mode emu

Re: [PATCH 3/8] configure, makefile: remove traces of really old files

2021-12-21 Thread Richard Henderson
On 12/21/21 3:05 AM, Paolo Bonzini wrote: These files have been removed for more than year in the best case, or for more than ten years for some really old TCG files. Remove any traces of it. Signed-off-by: Paolo Bonzini --- Makefile | 11 --- configure | 9 - 2 files chang

[PATCH v2 00/30] tcg/loongarch64: New tcg backend

2021-12-21 Thread Richard Henderson
ng (2021-12-21 08:00:26 -0800) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-loong-20211221-2 for you to fetch changes up to dfcf900ba67040ea9aa839aa38b33b4c091721d8: configure, meson

Re: powernv gitlab ci regression

2021-12-21 Thread Daniel Henrique Barboza
On 12/21/21 06:44, Daniel Henrique Barboza wrote: On 12/21/21 05:20, Cédric Le Goater wrote: On 12/21/21 03:37, Daniel Henrique Barboza wrote: Hey, On 12/20/21 18:35, Richard Henderson wrote: Hi guys, Somewhere within Merge tag 'pull-ppc-20211217' of https://github.com/legoater/qemu i

Re: [PATCH 7/8] configure, meson: move config-poison.h to meson

2021-12-21 Thread Richard Henderson
On 12/21/21 3:05 AM, Paolo Bonzini wrote: +genh += custom_target('config-poison.h', + input: [target_configs_h], + output: 'config-poison.h', + capture: true, + command: [find_program('scripts/make-config-poison.s

Re: [PATCH] target/riscv: make H-extension non-experimental

2021-12-21 Thread Alistair Francis
On Wed, Dec 22, 2021 at 3:22 AM Vineet Gupta wrote: > > H-ext v1.0 was ratified recently as part of Privileged Spec 1.12. > So move it out of experimental. > > [1] https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions > > Signed-off-by: Vineet Gupta Thanks for the patch! There is alr

Re: powernv gitlab ci regression

2021-12-21 Thread Cédric Le Goater
Just rewrote the fore-mentioned patch using TCG ops. Here's some numbers running the tests on my local machine: - using current master:  (1/1) tests/avocado/boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8: PASS (71.00 s)  (1/1) tests/avocado/boot_linux_console.py:BootLinuxConsole.te

Re: [PATCH v2 00/30] tcg/loongarch64: New tcg backend

2021-12-21 Thread Richard Henderson
tps://gitlab.com/marcandre.lureau/qemu into staging (2021-12-21 08:00:26 -0800) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-loong-20211221-2 for you to fetch changes up to dfcf900ba67040ea9aa839aa38b33b4c091721d8: configure, meson

Re: [PATCH 1/4] dma: Let st*_dma() take MemTxAttrs argument

2021-12-21 Thread Richard Henderson
On 12/18/21 6:51 AM, Philippe Mathieu-Daudé wrote: Let devices specify transaction attributes when calling st*_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 3 ++- include/hw/ppc/spapr_vio.h | 12 +++

Re: [PATCH 2/4] dma: Let ld*_dma() take MemTxAttrs argument

2021-12-21 Thread Richard Henderson
On 12/18/21 6:51 AM, Philippe Mathieu-Daudé wrote: Let devices specify transaction attributes when calling ld*_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 3 ++- include/hw/ppc/spapr_vio.h | 3 ++-

Re: [PATCH 3/4] dma: Let st*_dma() propagate MemTxResult

2021-12-21 Thread Richard Henderson
On 12/18/21 6:51 AM, Philippe Mathieu-Daudé wrote: dma_memory_write() returns a MemTxResult type. Do not discard it, return it to the caller. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/dma.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) Reviewed-

Re: [PATCH 1/5] hw/scsi/megasas: Use uint32_t for reply queue head/tail values

2021-12-21 Thread Richard Henderson
On 12/18/21 7:10 AM, Philippe Mathieu-Daudé wrote: While the reply queue values fit in 16-bit, they are accessed as 32-bit: 661:s->reply_queue_head = ldl_le_pci_dma(pcid, s->producer_pa); 662:s->reply_queue_head %= MEGASAS_MAX_FRAMES; 663:s->reply_queue_tail = ldl_le_pci_dma

Re: [PATCH 4/4] dma: Let ld*_dma() propagate MemTxResult

2021-12-21 Thread Richard Henderson
On 12/18/21 6:51 AM, Philippe Mathieu-Daudé wrote: dma_memory_read() returns a MemTxResult type. Do not discard it, return it to the caller. Update the few callers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 6 -- include/hw/ppc/spapr_vio.h | 6 +- incl

Re: [PATCH 2/5] dma: Let st*_pci_dma() take MemTxAttrs argument

2021-12-21 Thread Richard Henderson
On 12/18/21 7:10 AM, Philippe Mathieu-Daudé wrote: Let devices specify transaction attributes when calling st*_pci_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 11 ++- hw/audio/intel-hda.c | 10 +++

Re: [PATCH 3/5] dma: Let ld*_pci_dma() take MemTxAttrs argument

2021-12-21 Thread Richard Henderson
On 12/18/21 7:10 AM, Philippe Mathieu-Daudé wrote: Let devices specify transaction attributes when calling ld*_pci_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 6 +++--- hw/audio/intel-hda.c | 2 +- hw/

Re: [PATCH 4/5] dma: Let st*_pci_dma() propagate MemTxResult

2021-12-21 Thread Richard Henderson
On 12/18/21 7:10 AM, Philippe Mathieu-Daudé wrote: st*_dma() returns a MemTxResult type. Do not discard it, return it to the caller. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Richard Henderson

Re: [PATCH 5/5] dma: Let ld*_pci_dma() propagate MemTxResult

2021-12-21 Thread Richard Henderson
On 12/18/21 7:10 AM, Philippe Mathieu-Daudé wrote: ld*_dma() returns a MemTxResult type. Do not discard it, return it to the caller. Update the few callers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 17 - hw/audio/intel-hda.c | 2 +- hw/net/eepro100.

Re: [PATCH 1/3] linux-user: netlink: update IFLA entries

2021-12-21 Thread Richard Henderson
On 12/19/21 7:45 AM, Laurent Vivier wrote: Add IFLA_PHYS_PORT_ID, IFLA_PARENT_DEV_NAME, IFLA_PARENT_DEV_BUS_NAME # QEMU_LOG=unimp ip a Unknown host QEMU_IFLA type: 56 Unknown host QEMU_IFLA type: 57 Unknown host QEMU_IFLA type: 34 Signed-off-by: Laurent Vivier --- linux-user/fd-t

Re: [PATCH 2/3] linux-user: netlink: Add IFLA_VFINFO_LIST

2021-12-21 Thread Richard Henderson
On 12/19/21 7:45 AM, Laurent Vivier wrote: # QEMU_LOG=unimp ip a Unknown host QEMU_IFLA type: 22 Signed-off-by: Laurent Vivier --- linux-user/fd-trans.c | 174 ++ 1 file changed, 174 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH 3/3] linux-user: netlink: update IFLA_BRPORT entries

2021-12-21 Thread Richard Henderson
On 12/19/21 7:45 AM, Laurent Vivier wrote: add IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT and IFLA_BRPORT_MCAST_EHT_HOSTS_CNT # QEMU_LOG=unimp ip a Unknown QEMU_IFLA_BRPORT type 37 Unknown QEMU_IFLA_BRPORT type 38 Signed-off-by: Laurent Vivier --- linux-user/fd-trans.c | 4 1 file chang

Re: [RFC v2 01/12] target/ppc: powerpc_excp: Set alternate SRRs directly

2021-12-21 Thread Richard Henderson
On 12/20/21 10:18 AM, Fabiano Rosas wrote: There are currently only two interrupts that use alternate SRRs, so let them write to them directly during the setup code. No functional change intented. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 23 --- 1 file

Re: [PATCH] pci: Skip power-off reset when pending unplug

2021-12-21 Thread Michael S. Tsirkin
On Tue, Dec 21, 2021 at 09:36:56AM -0700, Alex Williamson wrote: > On Mon, 20 Dec 2021 18:03:56 -0500 > "Michael S. Tsirkin" wrote: > > > On Mon, Dec 20, 2021 at 11:26:59AM -0700, Alex Williamson wrote: > > > The below referenced commit introduced a change where devices under a > > > root port sl

[PATCH v2 0/3] UI fixups

2021-12-21 Thread Alexander Orzechowski
Some UI fixups including one revert. I have some things that I want to have a discussion about. Fullscreen mode will always distort the virtual console. Is this behavior we really want? If we get rid of this, we can combine scale_x and scale_y into a single variable and simplify things a little bi

[PATCH v2 3/3] ui: Fix gtk/gl when the scaled virtual console does not fit the window

2021-12-21 Thread Alexander Orzechowski
gtk/gl was incorrectly always rendering as if the 'Zoom to Fit' was always checked even if it wasn't. This is now using logic closer to what is being used for the existing cairo code paths. Signed-off-by: Alexander Orzechowski --- ui/gtk-gl-area.c | 34 +- 1 file

[PATCH v2 1/3] ui: Use allocated size instead of window size

2021-12-21 Thread Alexander Orzechowski
In these cases, we only care about the size of the virtual console itself. Previously, these calculations were made using the size of the entire window, which would include the size of the virtual console plus all the ui elements around it. Signed-off-by: Alexander Orzechowski Reviewed-by: Marc-A

<    1   2   3   >