RE: [PATCH V5 1/3] net/filter: Optimize transfer protocol for filter-mirror/redirector

2021-11-01 Thread Zhang, Chen
> -Original Message- > From: Jason Wang > Sent: Monday, November 1, 2021 11:46 AM > To: Zhang, Chen > Cc: qemu-dev ; Markus Armbruster > ; Li Zhijian > Subject: Re: [PATCH V5 1/3] net/filter: Optimize transfer protocol for filter- > mirror/redirector > > On Fri, Oct 29, 2021 at 4:08 P

[PATCH v3 2/5] monitor: Support 'info numa' command

2021-11-01 Thread Yang Zhong
Add the MEMORY_DEVICE_INFO_KIND_SGX_EPC case for SGX numa info with 'info numa' command in the monitor. Signed-off-by: Yang Zhong --- hw/core/numa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/core/numa.c b/hw/core/numa.c index 510d096a88..1aa05dcf42 100644 --- a/hw/core/numa.c

[PATCH v3 0/5] SGX NUMA support plus vepc reset

2021-11-01 Thread Yang Zhong
The basic SGX patches were merged into Qemu release, the left NUMA function for SGX should be enabled. The patch1 implemented the SGX NUMA ACPI to enable NUMA in the SGX guest. Since Libvirt need detailed host SGX EPC sections info to decide how to allocate EPC sections for SGX NUMA guest, the SGXE

[PATCH v3 1/5] numa: Enable numa for SGX EPC sections

2021-11-01 Thread Yang Zhong
The basic SGX did not enable numa for SGX EPC sections, which result in all EPC sections located in numa node 0. This patch enable SGX numa function in the guest and the EPC section can work with RAM as one numa node. The Guest kernel related log: [0.009981] ACPI: SRAT: Node 0 PXM 0 [mem 0x180

[PATCH v3 3/5] numa: Support SGX numa in the monitor and Libvirt interfaces

2021-11-01 Thread Yang Zhong
Add the SGXEPCSection list into SGXInfo to show the multiple SGX EPC sections detailed info, not the total size like before. This patch can enable numa support for 'info sgx' command and QMP interfaces. The new interfaces show each EPC section info in one numa node. Libvirt can use QMP interface to

[PATCH v3 4/5] doc: Add the SGX numa description

2021-11-01 Thread Yang Zhong
Add the SGX numa reference command and how to check if SGX numa is support or not with multiple EPC sections. Signed-off-by: Yang Zhong --- docs/system/i386/sgx.rst | 31 +++ 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/system/i386/sgx.rst b/doc

[PATCH v3 5/5] sgx: Reset the vEPC regions during VM reboot

2021-11-01 Thread Yang Zhong
For bare-metal SGX on real hardware, the hardware provides guarantees SGX state at reboot. For instance, all pages start out uninitialized. The vepc driver provides a similar guarantee today for freshly-opened vepc instances, but guests such as Windows expect all pages to be in uninitialized state

Re: [PATCH v4 07/22] target/riscv: Add defines for AIA CSRs

2021-11-01 Thread Anup Patel
On Mon, Nov 1, 2021 at 12:26 PM Alistair Francis wrote: > > On Tue, Oct 26, 2021 at 5:01 PM Anup Patel wrote: > > > > The RISC-V AIA specification extends RISC-V local interrupts and > > introduces new CSRs. This patch adds defines for the new AIA CSRs. > > > > Signed-off-by: Anup Patel > > What

Re: [PATCH v3 2/4] qemu-img: make --block-size optional for compare --stat

2021-11-01 Thread Vladimir Sementsov-Ogievskiy
29.10.2021 23:32, Eric Blake wrote: On Thu, Oct 28, 2021 at 12:24:39PM +0200, Vladimir Sementsov-Ogievskiy wrote: Let's detect block-size automatically if not specified by user: If both files define cluster-size, use minimum to be more precise. If both files don't specify cluster-size, use

[PATCH v2 2/7] Fixed qemu crash when guest power off in COLO mode

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" This patch fixes the following: qemu-system-x86_64: invalid runstate transition: 'shutdown' -> 'running' Aborted (core dumped) The gdb bt as following: 0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 1 0x7faa3d613859 in __GI_abort () at abort.c:79 2

[PATCH v2 1/7] Some minor optimizations for COLO

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" Signed-off-by: Lei Rao Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 2 +- net/colo-compare.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 79fa1f6619..616dc00af7 100644 --- a/migration/colo.c ++

[PATCH v2 0/7] Fixed some bugs and optimized some codes for COLO

2021-11-01 Thread Rao, Lei
Changes since v1: --Move the s->rp_state.from_dst_file = NULL behind qemu_close(). The series of patches include: Fixed some bugs of qemu crash and segment fault. Optimized the function of fill_connection_key. Remove some unnecessary code to improve COLO. Rao, Lei

[PATCH v2 4/7] colo: fixed 'Segmentation fault' when the simplex mode PVM poweroff

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" The GDB statck is as follows: Program terminated with signal SIGSEGV, Segmentation fault. 0 object_class_dynamic_cast (class=0x55c8f5d2bf50, typename=0x55c8f2f7379e "qio-channel") at qom/object.c:832 if (type->class->interfaces && [Current thread is 1 (Thread 0x7f756e9

[PATCH v2 5/7] Removed the qemu_fclose() in colo_process_incoming_thread

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" After the live migration, the related fd will be cleanup in migration_incoming_state_destroy(). So, the qemu_close() in colo_process_incoming_thread is not necessary. Signed-off-by: Lei Rao --- migration/colo.c | 5 - 1 file changed, 5 deletions(-) diff --git a/migration/

[PATCH v2 3/7] Fixed SVM hang when do failover before PVM crash

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" This patch fixed as follows: Thread 1 (Thread 0x7f34ee738d80 (LWP 11212)): #0 __pthread_clockjoin_ex (threadid=139847152957184, thread_return=0x7f30b1febf30, clockid=, abstime=, block=) at pthread_join_common.c:145 #1 0x563401998e36 in qemu_thread_join (thread=0

[PATCH v2 6/7] Changed the last-mode to none of first start COLO

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" When we first stated the COLO, the last-mode is as follows: { "execute": "query-colo-status" } {"return": {"last-mode": "primary", "mode": "primary", "reason": "none"}} The last-mode is unreasonable. After the patch, will be changed to the following: { "execute": "query-colo-sta

[PATCH v2 7/7] Optimized the function of fill_connection_key.

2021-11-01 Thread Rao, Lei
From: "Rao, Lei" Remove some unnecessary code to improve the performance of the filter-rewriter module. Signed-off-by: Lei Rao Reviewed-by: Zhang Chen --- net/colo-compare.c| 2 +- net/colo.c| 31 --- net/colo.h| 6 +++--- net/filter-r

Re: [RFC PATCH v5 01/26] util: Make some iova_tree parameters const

2021-11-01 Thread Eugenio Perez Martin
On Sun, Oct 31, 2021 at 7:59 PM Juan Quintela wrote: > > Eugenio Pérez wrote: > > As qemu guidelines: > > Unless a pointer is used to modify the pointed-to storage, give it the > > "const" attribute. > > > > In the particular case of iova_tree_find it allows to enforce what is > > requested by it

Re: [PATCH v3 3/4] qemu-img: add --shallow option for qemu-img compare

2021-11-01 Thread Vladimir Sementsov-Ogievskiy
29.10.2021 23:44, Eric Blake wrote: On Thu, Oct 28, 2021 at 12:24:40PM +0200, Vladimir Sementsov-Ogievskiy wrote: Allow compare only top images of backing chains. This is useful to Allow the comparison of only the top image of backing chains. compare images with same backing file or to compa

[PULL 0/6] Trivial branch for 6.2 patches

2021-11-01 Thread Laurent Vivier
ch-for-6.2-pull-request for you to fetch changes up to c3f93230df9ad1d3260f03655faa8f9f23c90a52: hw/input/lasips2: QOM'ify the Lasi PS/2 (2021-10-31 21:05:40 +0100) Trivial patches branch pull r

[PULL 1/6] monitor: Trim some trailing space from human-readable output

2021-11-01 Thread Laurent Vivier
From: Markus Armbruster I noticed -cpu help printing enough trailing spaces to make the output at least 84 characters wide. Looks ugly unless the terminal is wider. Ugly or not, trailing spaces are stupid. The culprit is this line in x86_cpu_list_entry(): qemu_printf("x86 %-20s %-58s\n",

[PULL 5/6] hw/input/lasips2: Move LASIPS2State declaration to 'hw/input/lasips2.h'

2021-11-01 Thread Laurent Vivier
From: Philippe Mathieu-Daudé We want to use the OBJECT_DECLARE_SIMPLE_TYPE() macro to QOM'ify this device in the next commit. To make its review simpler, as a first step move the LASIPS2State and LASIPS2Port declarations to 'hw/input/lasips2.h' Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

[PULL 3/6] MAINTAINERS: Split HPPA TCG vs HPPA machines/hardware

2021-11-01 Thread Laurent Vivier
From: Philippe Mathieu-Daudé Hardware emulated models don't belong to the TCG MAINTAINERS section. Move them to the 'HP-PARISC Machines' section. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Helge Deller Message-Id: <20211004083835.3802961-1-f4...@amsat.or

[PULL 2/6] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()

2021-11-01 Thread Laurent Vivier
From: Yanan Wang The expected output string from cpu_slot_to_string() ought to be like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add the missing ", " before "die-id". This affects the readability of the error message. Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp

[PULL 6/6] hw/input/lasips2: QOM'ify the Lasi PS/2

2021-11-01 Thread Laurent Vivier
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Message-Id: <20210920064048.2729397-4-f4...@amsat.org> Signed-off-by: Laurent Vivier --- hw/hppa/lasi.c | 10 +- hw/input/lasips2.c | 38 ---

[PULL 4/6] hw/input/lasips2: Fix typos in function names

2021-11-01 Thread Laurent Vivier
From: Philippe Mathieu-Daudé Artist is another device, this one is the Lasi PS/2. Rename the functions accordingly. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Message-Id: <20210920064048.2729397-2-f4...@amsat.org> Signed-off-by: Laurent Vivier --- hw/input/lasips2.c | 8

[PATCH v6 1/2] vhost-user: remove VirtQ notifier restore

2021-11-01 Thread Xueming Li
When vhost-user vdpa client suspend, backend may close all resources, VQ notifier mmap address become invalid, restore MR which contains the invalid address is wrong. vdpa client will set VQ notifier after reconnect. This patch removes VQ notifier restore and related flags to avoid reusing invalid

[PATCH v6 0/2] Improve vhost-user VQ notifier unmap

2021-11-01 Thread Xueming Li
When vDPA applicaiton in client mode shutdown, unmapped VQ notifier might being accessed by vCPU thread under high tx traffic, it will crash VM in rare conditon. This patch try to fix it with better RCU sychronization of new flatview. v2: no RCU draining on vCPU thread v3: minor fix on coding styl

[PATCH v6 2/2] vhost-user: fix VirtQ notifier cleanup

2021-11-01 Thread Xueming Li
When vhost-user device cleanup is executed and un-mmaps notifier address, VM cpu thread writing the notifier fails by accessing invalid address error. To avoid this concurrent issue, call RCU and wait for a memory flatview update, then un-mmap notifiers in callback. Fixes: 44866521bd6e ("vhost-us

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-01 Thread Igor Mammedov
On Thu, 28 Oct 2021 22:32:09 +1100 Gavin Shan wrote: > On 10/28/21 2:40 AM, Igor Mammedov wrote: > > On Wed, 27 Oct 2021 13:29:58 +0800 > > Gavin Shan wrote: > > > >> The empty NUMA nodes, where no memory resides, aren't exposed > >> through ACPI SRAT table. It's not user preferred behaviour

Re: [PATCH 00/31] passage: Define a standard for firmware data flow

2021-11-01 Thread François Ozog
Hi Simon, this seems a great endeavor. I'd like to better understand the scope of it. Is it to be used as part of what could become a U-Boot entry ABI scheme? By that I mean giving some fixed aspects to U-Boot entry while letting boards to have flexibility (say for instance that the first 5 archi

Re: [PATCH] vhost: Fix last queue index of devices with no cvq

2021-11-01 Thread Eugenio Perez Martin
On Mon, Nov 1, 2021 at 4:34 AM Jason Wang wrote: > > On Fri, Oct 29, 2021 at 10:16 PM Eugenio Pérez wrote: > > > > The -1 assumes that all devices with no cvq have an spare vq allocated > > for them, but with no offer of VIRTIO_NET_F_CTRL_VQ. This may not be the > > case, and the device may have

Re: [PATCH v4 01/22] target/riscv: Fix trap cause for RV32 HS-mode CSR access from RV64 HS-mode

2021-11-01 Thread Bin Meng
On Tue, Oct 26, 2021 at 2:43 PM Anup Patel wrote: > > We should be returning illegal instruction trap when RV64 HS-mode tries > to access RV32 HS-mode CSR. > > Fixes: d6f20dacea51 ("target/riscv: Fix 32-bit HS mode access permissions") > Signed-off-by: Anup Patel > Reviewed-by: Alistair Francis

Re: [PATCH] vhost: Fix last queue index of devices with no cvq

2021-11-01 Thread Eugenio Perez Martin
On Sun, Oct 31, 2021 at 10:47 PM Michael S. Tsirkin wrote: > > On Fri, Oct 29, 2021 at 04:16:08PM +0200, Eugenio Pérez wrote: > > The -1 assumes that all devices with no cvq have an spare vq allocated > > for them, but with no offer of VIRTIO_NET_F_CTRL_VQ. This may not be the > > case, and the de

Re: [RFC PATCH v5 00/26] vDPA shadow virtqueue

2021-11-01 Thread Eugenio Perez Martin
On Fri, Oct 29, 2021 at 8:41 PM Eugenio Pérez wrote: > > This series enable shadow virtqueue (SVQ) for vhost-vdpa devices. This > is intended as a new method of tracking the memory the devices touch > during a migration process: Instead of relay on vhost device's dirty > logging capability, SVQ in

Re: [PATCH] vhost: Fix last queue index of devices with no cvq

2021-11-01 Thread Michael S. Tsirkin
On Mon, Nov 01, 2021 at 10:03:19AM +0100, Eugenio Perez Martin wrote: > On Sun, Oct 31, 2021 at 10:47 PM Michael S. Tsirkin wrote: > > > > On Fri, Oct 29, 2021 at 04:16:08PM +0200, Eugenio Pérez wrote: > > > The -1 assumes that all devices with no cvq have an spare vq allocated > > > for them, but

Re: [PATCH v2] failover: specify an alternate MAC address

2021-11-01 Thread Michael S. Tsirkin
On Wed, Oct 27, 2021 at 11:59:45AM +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

[PATCH v8 01/29] target/loongarch: Add README

2021-11-01 Thread Song Gao
This patch gives an introduction to the LoongArch target. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- MAINTAINERS | 5 target/loongarch/README | 76 + 2 files changed, 81 insertions(+)

[PATCH v8 00/29] Add LoongArch linux-user emulation support

2021-11-01 Thread Song Gao
Hi all, This series only support linux-user emulation. More about LoongArch at: https://github.com/loongson/ The latest kernel: * https://github.com/loongson/linux/tree/loongarch-next Patches need review: * 0002-target-loongarch-Add-core-definition.patch * 0016-target-loongarch-Add-disasse

[PATCH v8 10/29] target/loongarch: Add floating point arithmetic instruction translation

2021-11-01 Thread Song Gao
This includes: - F{ADD/SUB/MUL/DIV}.{S/D} - F{MADD/MSUB/NMADD/NMSUB}.{S/D} - F{MAX/MIN}.{S/D} - F{MAXA/MINA}.{S/D} - F{ABS/NEG}.{S/D} - F{SQRT/RECIP/RSQRT}.{S/D} - F{SCALEB/LOGB/COPYSIGN}.{S/D} - FCLASS.{S/D} Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --

[PATCH v8 04/29] target/loongarch: Add fixed point arithmetic instruction translation

2021-11-01 Thread Song Gao
This includes: - ADD.{W/D}, SUB.{W/D} - ADDI.{W/D}, ADDU16ID - ALSL.{W[U]/D} - LU12I.W, LU32I.D LU52I.D - SLT[U], SLT[U]I - PCADDI, PCADDU12I, PCADDU18I, PCALAU12I - AND, OR, NOR, XOR, ANDN, ORN - MUL.{W/D}, MULH.{W[U]/D[U]} - MULW.D.W[U] - DIV.{W[U]/D[U]}, MOD.{W[U]/D[U]} - ANDI, ORI, XORI Review

[PATCH v8 03/29] target/loongarch: Add main translation routines

2021-11-01 Thread Song Gao
This patch adds main translation routines and basic functions for translation. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/helper.h| 9 +++ target/loongarch/op_helper.c | 22 ++ target/loongarch/translate.c | 160 +

[PATCH v8 02/29] target/loongarch: Add core definition

2021-11-01 Thread Song Gao
This patch adds target state header, target definitions and initialization routines. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/cpu-param.h | 19 +++ target/loongarch/cpu.c | 352 +++ t

[PATCH v8 06/29] target/loongarch: Add fixed point bit instruction translation

2021-11-01 Thread Song Gao
This includes: - EXT.W.{B/H} - CL{O/Z}.{W/D}, CT{O/Z}.{W/D} - BYTEPICK.{W/D} - REVB.{2H/4H/2W/D} - REVH.{2W/D} - BITREV.{4B/8B}, BITREV.{W/D} - BSTRINS.{W/D}, BSTRPICK.{W/D} - MASKEQZ, MASKNEZ Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loonga

[PATCH v8 13/29] target/loongarch: Add floating point move instruction translation

2021-11-01 Thread Song Gao
This includes: - FMOV.{S/D} - FSEL - MOVGR2FR.{W/D}, MOVGR2FRH.W - MOVFR2GR.{S/D}, MOVFRH2GR.S - MOVGR2FCSR, MOVFCSR2GR - MOVFR2CF, MOVCF2FR - MOVGR2CF, MOVCF2GR Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/fpu_helper.c|

[PATCH v8 07/29] target/loongarch: Add fixed point load/store instruction translation

2021-11-01 Thread Song Gao
This includes: - LD.{B[U]/H[U]/W[U]/D}, ST.{B/H/W/D} - LDX.{B[U]/H[U]/W[U]/D}, STX.{B/H/W/D} - LDPTR.{W/D}, STPTR.{W/D} - PRELD - LD{GT/LE}.{B/H/W/D}, ST{GT/LE}.{B/H/W/D} - DBAR, IBAR Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/helpe

[PATCH v8 08/29] target/loongarch: Add fixed point atomic instruction translation

2021-11-01 Thread Song Gao
This includes: - LL.{W/D}, SC.{W/D} - AM{SWAP/ADD/AND/OR/XOR/MAX/MIN}[_DB].{W/D} - AM{MAX/MIN}[_DB].{WU/DU} Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/insn_trans/trans_atomic.c | 133 + target/loongarch/i

[PATCH v8 11/29] target/loongarch: Add floating point comparison instruction translation

2021-11-01 Thread Song Gao
This includes: - FCMP.cond.{S/D} Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/fpu_helper.c| 60 target/loongarch/helper.h| 9 + target/loongarch/insn_trans/trans_fcmp.c

[PATCH v8 12/29] target/loongarch: Add floating point conversion instruction translation

2021-11-01 Thread Song Gao
This includes: - FCVT.S.D, FCVT.D.S - FFINT.{S/D}.{W/L}, FTINT.{W/L}.{S/D} - FTINT{RM/RP/RZ/RNE}.{W/L}.{S/D} - FRINT.{S/D} Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/fpu_helper.c| 393 +++ tar

[PATCH v8 19/29] linux-user: Add LoongArch signal support

2021-11-01 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- accel/tcg/user-exec.c | 15 +++ linux-user/loongarch64/signal.c| 163 + linux-user/loongarch64/target_signal.h | 30 ++ 3 files changed, 208 insertions(+) create mode 100644 l

[PATCH v8 22/29] linux-user: Add LoongArch cpu_loop support

2021-11-01 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- configure | 5 ++ linux-user/loongarch64/cpu_loop.c | 98 + linux-user/loongarch64/target_cpu.h | 35 + 3 files changed, 138 insertions(+) create mode 100644 lin

[PATCH v8 05/29] target/loongarch: Add fixed point shift instruction translation

2021-11-01 Thread Song Gao
This includes: - SLL.W, SRL.W, SRA.W, ROTR.W - SLLI.W, SRLI.W, SRAI.W, ROTRI.W - SLL.D, SRL.D, SRA.D, ROTR.D - SLLI.D, SRLI.D, SRAI.D, ROTRI.D Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/insn_trans/trans_shift.c | 131 +++

[PATCH v8 20/29] linux-user: Add LoongArch elf support

2021-11-01 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- include/elf.h | 2 ++ linux-user/elfload.c| 58 + linux-user/loongarch64/target_elf.h | 14 + 3 files changed, 74 insertions(+) create mode 100644 linux-us

[PATCH v8 26/29] target/loongarch: 'make check-tcg' support

2021-11-01 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- tests/tcg/configure.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 1f985cc..d8f677d 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure

[PATCH v8 09/29] target/loongarch: Add fixed point extra instruction translation

2021-11-01 Thread Song Gao
This includes: - CRC[C].W.{B/H/W/D}.W - SYSCALL - BREAK - ASRT{LE/GT}.D - RDTIME{L/H}.W, RDTIME.D - CPUCFG Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/helper.h | 4 ++ target/loongarch/insn_trans/trans_extra.c | 87 +

[PATCH v8 17/29] linux-user: Add LoongArch generic header files

2021-11-01 Thread Song Gao
This includes: - sockbits.h - target_errno_defs.h - target_fcntl.h - termbits.h Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/loongarch64/sockbits.h | 1 + linux-user/loongarch64/target_errno_defs.h | 7 +++ linux-user/loongarch64/target_fcntl.h | 12 ++

[PATCH v8 28/29] accel/tcg/user-exec: Implement CPU-specific signal handler for loongarch64 hosts

2021-11-01 Thread Song Gao
Base-on: <20210925173032.2434906-30-...@xen0n.name> Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- accel/tcg/user-exec.c | 64 --- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.

[PATCH v8 24/29] default-configs: Add loongarch linux-user support

2021-11-01 Thread Song Gao
This patch adds loongarch64 linux-user default configs file. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- configs/targets/loongarch64-linux-user.mak | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 configs/targets/loongarch64-linux-user.ma

[PATCH v8 29/29] linux-user: Add safe syscall handling for loongarch64 hosts

2021-11-01 Thread Song Gao
Base-on: <20210925173032.2434906-29-...@xen0n.name> Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/host/loongarch64/hostdep.h | 23 linux-user/host/loongarch64/safe-syscall.inc.S | 80 ++ 2 files changed, 103 insertions(+) create mo

[PATCH v8 14/29] target/loongarch: Add floating point load/store instruction translation

2021-11-01 Thread Song Gao
This includes: - FLD.{S/D}, FST.{S/D} - FLDX.{S/D}, FSTX.{S/D} - FLD{GT/LE}.{S/D}, FST{GT/LE}.{S/D} Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/insn_trans/trans_fmemory.c | 187 target/loongarch/insns.dec

[PATCH 03/13] target/riscv: Ignore the pc bits above XLEN

2021-11-01 Thread LIU Zhiwei
The read from PC for translation is in cpu_get_tb_cpu_state, before translation. Signed-off-by: LIU Zhiwei --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 7d0aee6769..eb425d74d2 100644 -

[PATCH v8 23/29] linux-user: Add host dependency for LoongArch 64-bit

2021-11-01 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/host/loongarch64/hostdep.h | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 linux-user/host/loongarch64/hostdep.h diff --git a/linux-user/host/loongarch64/hostdep.h b/linux-user/host/loongarch64/hostdep.h

[PATCH v8 18/29] linux-user: Add LoongArch specific structures

2021-11-01 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/loongarch64/target_structs.h | 49 + 1 file changed, 49 insertions(+) create mode 100644 linux-user/loongarch64/target_structs.h diff --git a/linux-user/loongarch64/target_structs.h b/linux-use

Re: [PATCH v3 02/12] vfio-user: build library

2021-11-01 Thread Stefan Hajnoczi
On Fri, Oct 29, 2021 at 02:17:43PM +, Jag Raman wrote: > Hi Stefan, > > > On Oct 27, 2021, at 11:17 AM, Stefan Hajnoczi wrote: > > > > On Mon, Oct 11, 2021 at 01:31:07AM -0400, Jagannathan Raman wrote: > >> diff --git a/hw/remote/Kconfig b/hw/remote/Kconfig > >> index 08c16e235f..f9e512d44a

[PATCH 01/13] target/riscv: Sign extend pc for different ol

2021-11-01 Thread LIU Zhiwei
When pc is written, it is sign-extended to fill the widest supported XLEN. Signed-off-by: LIU Zhiwei --- target/riscv/translate.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 1d57bc97b5..7d7

[PATCH 10/13] target/riscv: Adjust scalar reg in vector with ol

2021-11-01 Thread LIU Zhiwei
When sew <= 32bits, not need to extend scalar reg. When sew > 32bits, if xlen is less that sew, we should sign extend the scalar register, except explicitly specified by the spec. Signed-off-by: LIU Zhiwei --- target/riscv/insn_trans/trans_rvv.c.inc | 5 +++-- target/riscv/vector_helper.c

[PATCH v8 16/29] target/loongarch: Add disassembler

2021-11-01 Thread Song Gao
This patch adds support for disassembling via option '-d in_asm'. Acked-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- include/disas/dis-asm.h | 2 + meson.build | 1 + target/loongarch/disas.c | 919

[PATCH v8 27/29] scripts: add loongarch64 binfmt config

2021-11-01 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- scripts/qemu-binfmt-conf.sh | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 7de996d..da6a937 100755 --- a/scripts/qemu

[PATCH 00/13] Support UXL filed in xstatus.

2021-11-01 Thread LIU Zhiwei
In this patch set, we process the pc reigsters writes, gdb reads and writes, and address calculation under different UXLEN settings. LIU Zhiwei (13): target/riscv: Sign extend pc for different ol target/riscv: Extend pc for runtime pc write target/riscv: Ignore the pc bits above XLEN targe

[PATCH 09/13] target/riscv: Adjust vector address with ol

2021-11-01 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei --- target/riscv/insn_trans/trans_rvv.c.inc | 8 target/riscv/internals.h| 1 + target/riscv/vector_helper.c| 54 + 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/target/riscv/insn_trans/trans_r

[PATCH v8 15/29] target/loongarch: Add branch instruction translation

2021-11-01 Thread Song Gao
This includes: - BEQ, BNE, BLT[U], BGE[U] - BEQZ, BNEZ - B - BL - JIRL - BCEQZ, BCNEZ Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/insn_trans/trans_branch.c | 85 ++ target/loongarch/insns.decode

[PATCH 05/13] target/riscv: Calculate address according to ol

2021-11-01 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei --- target/riscv/insn_trans/trans_rvd.c.inc | 20 ++-- target/riscv/insn_trans/trans_rvf.c.inc | 21 - target/riscv/insn_trans/trans_rvi.c.inc | 21 ++--- 3 files changed, 24 insertions(+), 38 deletions(-) diff --git a

[PATCH 06/13] target/riscv: Adjust vsetvl according to ol

2021-11-01 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei --- target/riscv/cpu.h | 2 ++ target/riscv/helper.h | 2 +- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/vector_helper.c| 19 +++ 4 files changed, 20 insertions(+), 7 deletions(-) d

[PATCH v8 21/29] linux-user: Add LoongArch syscall support

2021-11-01 Thread Song Gao
We should disable '__BITS_PER_LONG' at [1] before run gensyscalls.sh [1] arch/loongarch/include/uapi/asm/bitsperlong.h Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/loongarch64/syscall_nr.h | 312 linux-user/loongarch64/target_syscall

[PATCH v8 25/29] target/loongarch: Add target build suport

2021-11-01 Thread Song Gao
This patch adds build loongarch-linux-user target support. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- meson.build | 2 +- target/loongarch/meson.build | 19 +++ target/meson.build | 1 + 3 files changed,

[PATCH 08/13] target/riscv: Fix check range for first fault only

2021-11-01 Thread LIU Zhiwei
Only check the range that has passed the address translation. Signed-off-by: LIU Zhiwei --- target/riscv/vector_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 09e76229bc..535420ee66 100644 --- a/t

[PATCH 02/13] target/riscv: Extend pc for runtime pc write

2021-11-01 Thread LIU Zhiwei
In some cases, we must restore the guest PC to the address of the start of the TB, such as when the instruction counter hit zero. So extend pc register according to current xlen for these cases. Signed-off-by: LIU Zhiwei --- target/riscv/cpu.c| 20 +--- target/riscv/cpu.h

[PATCH 04/13] target/riscv: Use gdb xml according to max mxlen

2021-11-01 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei --- target/riscv/gdbstub.c | 73 +++--- 1 file changed, 54 insertions(+), 19 deletions(-) diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 23429179e2..15abbbdb54 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv

[PATCH 13/13] target/riscv: Enable uxl field write

2021-11-01 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei --- target/riscv/csr.c | 6 -- target/riscv/insn_trans/trans_rvi.c.inc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 9f41954894..471c10acf6 100644 --- a/target/riscv/csr.c +++

[PATCH 11/13] target/riscv: Switch context in exception return

2021-11-01 Thread LIU Zhiwei
After excpetion return, we should give a xlen view of context in new priveledge, including the general registers, pc, and CSRs. Signed-off-by: LIU Zhiwei --- target/riscv/helper.h | 1 + .../riscv/insn_trans/trans_privileged.c.inc | 2 ++ target/riscv/op_helper.c

[PATCH 12/13] target/riscv: Don't save pc when exception return

2021-11-01 Thread LIU Zhiwei
As pc will be written by the xepc in exception return, just ignore pc in translation. Signed-off-by: LIU Zhiwei --- target/riscv/helper.h | 4 ++-- target/riscv/insn_trans/trans_privileged.c.inc | 7 ++- target/riscv/op_helper.c | 4 ++-- 3 file

[PATCH 07/13] target/riscv: Ajdust vector atomic check with ol

2021-11-01 Thread LIU Zhiwei
Signed-off-by: LIU Zhiwei --- target/riscv/insn_trans/trans_rvv.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 01da065710..ed042f7bb9 100644 --- a/target/riscv/insn_trans/trans_rvv.

[PATCH 3/3] sev/i386: Perform padding calculations at compile-time

2021-11-01 Thread Dov Murik
In sev_add_kernel_loader_hashes, the sizes of structs are known at compile-time, so calculate needed padding at compile-time. No functional change intended. Signed-off-by: Dov Murik --- target/i386/sev.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff

[PATCH 0/3] SEV: fixes for -kernel launch with incompatible OVMF

2021-11-01 Thread Dov Murik
Tom Lendacky and Brijesh Singh reported two issues with launching SEV guests with the -kernel QEMU option when an old [1] or wrongly configured [2] OVMF images are used. The fixes in patches 1 and 2 allow such guests to boot by skipping the kernel/initrd/cmdline hashes addition to the initial gues

Re: [PATCH v2] hw: Add a 'Sensor devices' qdev category

2021-11-01 Thread Philippe Mathieu-Daudé
ping? On 10/27/21 07:06, Philippe Mathieu-Daudé wrote: > Sensors models are listed in the 'Misc devices' category. > Move them to their own category. > > Reviewed-by: Cédric Le Goater > Reviewed-by: Hao Wu > Signed-off-by: Philippe Mathieu-Daudé > --- > v2: Only include hw/sensor/, removed AER

[PATCH 1/3] sev/i386: Allow launching with -kernel if no OVMF hashes table found

2021-11-01 Thread Dov Murik
Commit cff03145ed3c ("sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot", 2021-09-30) introduced measured direct boot with -kernel, using an OVMF-designated hashes table which QEMU fills. However, if OVMF doesn't designate such an area, QEMU would completely abort the VM lau

gitlab-ci: clang-user job failed with run-tcg-tests-sh4-linux-user

2021-11-01 Thread Philippe Mathieu-Daudé
Build failed running the 'clang-user' job: TESTlinux-test on sh4 ../linux-user/syscall.c:10373:34: runtime error: member access within misaligned address 0x0048af34 for type 'struct linux_dirent64', which requires 8 byte alignment 0x0048af34: note: pointer points here 00 00 00 00 0

Re: [PATCH v4 1/2] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-11-01 Thread Dov Murik
On 28/10/2021 11:41, Dov Murik wrote: > > > On 27/10/2021 22:43, Brijesh Singh wrote: >> Hi Dov, >> >> Sorry for coming a bit late on it but I am seeing another issue with >> this patch. The hash build logic looks for a SEV_HASH_TABLE_RV_GUID in >> the GUID list. If found, it uses the base add

[PATCH 2/3] sev/i386: Warn if using -kernel with invalid OVMF hashes table area

2021-11-01 Thread Dov Murik
Commit cff03145ed3c ("sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot", 2021-09-30) introduced measured direct boot with -kernel, using an OVMF-designated hashes table which QEMU fills. However, no checks are performed on the validity of the hashes area designated by OVMF.

Re: [PATCH 01/13] target/riscv: Sign extend pc for different ol

2021-11-01 Thread Richard Henderson
On 11/1/21 6:01 AM, LIU Zhiwei wrote: +static void gen_set_pc(DisasContext *ctx, target_ulong dest) +{ +TCGv t = tcg_constant_tl(dest); +switch (get_ol(ctx)) { +case MXL_RV32: +tcg_gen_ext32s_tl(cpu_pc, t); Don't compute with tcg to do what you can in C. Dest is constant. A

Re: [PATCH v2] .mailmap: Fix more contributor entries

2021-11-01 Thread Philippe Mathieu-Daudé
Can this patch go via the Trivial tree? On 10/27/21 06:32, Philippe Mathieu-Daudé wrote: > These authors have some incorrect author email field. > > Acked-by: Pan Nengyuan > Reviewed-by: Alex Chen > Reviewed-by: Hyman Huang > Reviewed-by: Haibin Zhang > Signed-off-by: Philippe Mathieu-Daudé

Re: [PULL 28/30] Hexagon HVX (tests/tcg/hexagon) hvx_misc test

2021-11-01 Thread Philippe Mathieu-Daudé
On 10/31/21 17:43, Taylor Simpson wrote: > Tests for > packet semantics > vector loads (aligned and unaligned) > vector stores (aligned and unaligned) > vector masked stores > vector new value store > maximum HVX temps in a packet > vector operations > > Acked-by: Richa

Re: [PATCH 02/13] target/riscv: Extend pc for runtime pc write

2021-11-01 Thread Richard Henderson
On 11/1/21 6:01 AM, LIU Zhiwei wrote: In some cases, we must restore the guest PC to the address of the start of the TB, such as when the instruction counter hit zero. So extend pc register according to current xlen for these cases. Signed-off-by: LIU Zhiwei --- target/riscv/cpu.c| 20

Re: [PATCH v3 03/12] vfio-user: define vfio-user-server object

2021-11-01 Thread Stefan Hajnoczi
On Fri, Oct 29, 2021 at 02:42:49PM +, Jag Raman wrote: > > On Oct 27, 2021, at 11:40 AM, Stefan Hajnoczi wrote: > > On Mon, Oct 11, 2021 at 01:31:08AM -0400, Jagannathan Raman wrote: > >> diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c > >> new file mode 100644 > >> index 00

Re: [PATCH v3 04/12] vfio-user: instantiate vfio-user context

2021-11-01 Thread Stefan Hajnoczi
On Fri, Oct 29, 2021 at 02:59:02PM +, Jag Raman wrote: > > > > On Oct 27, 2021, at 11:59 AM, Stefan Hajnoczi wrote: > > > > On Mon, Oct 11, 2021 at 01:31:09AM -0400, Jagannathan Raman wrote: > >> @@ -94,9 +101,31 @@ static void vfu_object_set_device(Object *obj, const > >> char *str, Error

Re: [PATCH v3 05/12] vfio-user: find and init PCI device

2021-11-01 Thread Stefan Hajnoczi
On Fri, Oct 29, 2021 at 03:58:28PM +, Jag Raman wrote: > > > > On Oct 27, 2021, at 12:05 PM, Stefan Hajnoczi wrote: > > > > On Mon, Oct 11, 2021 at 01:31:10AM -0400, Jagannathan Raman wrote: > >> Find the PCI device with specified id. Initialize the device context > >> with the QEMU PCI dev

Re: [PATCH 03/13] target/riscv: Ignore the pc bits above XLEN

2021-11-01 Thread Richard Henderson
On 11/1/21 6:01 AM, LIU Zhiwei wrote: The read from PC for translation is in cpu_get_tb_cpu_state, before translation. Signed-off-by: LIU Zhiwei --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson Could perhaps be sorted to pa

Re: [PATCH 04/13] target/riscv: Use gdb xml according to max mxlen

2021-11-01 Thread Richard Henderson
On 11/1/21 6:01 AM, LIU Zhiwei wrote: +switch (env->misa_mxl_max) { +case MXL_RV32: +tmp = (uint32_t)ldl_p(mem_buf); Signed int32_t. Otherwise, Reviewed-by: Richard Henderson r~

Re: [PATCH v4 2/2] tests/unit: Add an unit test for smp parsing

2021-11-01 Thread Philippe Mathieu-Daudé
On 10/31/21 13:02, wangyanan (Y) wrote: > Hi Philippe, > > I saw that there are some cross-build failures and a clang complain > about this patch in your triggered CI pipeline. I believe the minor > diff below will resolve them. If you are going to resend v2 of the > "qdev-hotplug" patches, I woul

Re: [PATCH v8 28/29] accel/tcg/user-exec: Implement CPU-specific signal handler for loongarch64 hosts

2021-11-01 Thread WANG Xuerui
Hi, On 2021/11/1 17:51, Song Gao wrote: > Base-on: <20210925173032.2434906-30-...@xen0n.name> > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > --- > accel/tcg/user-exec.c | 64 > --- > 1 file changed, 61 insertions(+), 3 deletions(-) W

  1   2   3   4   5   >