RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-28 Thread Liu, Yi L
> From: Peter Xu > Sent: Monday, November 29, 2021 11:14 AM > > On Mon, Nov 29, 2021 at 10:28:42AM +0800, Jason Wang wrote: > > > > And in the future, it could be even more troublesome,e.g there's one > > day we found another bit that needs not to be checked. Maybe we should > > even remove all t

Re: [PATCH v8 06/10] target/ppc: enable PMU instruction count

2021-11-28 Thread David Gibson
On Thu, Nov 25, 2021 at 12:08:13PM -0300, Daniel Henrique Barboza wrote: > The PMU is already counting cycles by calculating time elapsed in > nanoseconds. Counting instructions is a different matter and requires > another approach. > > This patch adds the capability of counting completed instruct

Re: [PATCH v8 05/10] target/ppc: enable PMU counter overflow with cycle events

2021-11-28 Thread David Gibson
On Thu, Nov 25, 2021 at 12:08:12PM -0300, Daniel Henrique Barboza wrote: 65;6601;1c> The PowerISA v3.1 defines that if the proper bits are set (MMCR0_PMC1CE > for PMC1 and MMCR0_PMCjCE for the remaining PMCs), counter negative > conditions are enabled. This means that if the counter value overflow

Re: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-28 Thread Jason Wang
On Mon, Nov 29, 2021 at 11:14 AM Peter Xu wrote: > > On Mon, Nov 29, 2021 at 10:28:42AM +0800, Jason Wang wrote: > > > I think we can still have Jason's patch continued because the kernel > > > commit to > > > apply SNP bit is merged in v5.13, so we may need the qemu change to let it > > > still

[PATCH v10 46/77] target/riscv: rvv-1.0: single-width saturating add and subtract instructions

2021-11-28 Thread frank . chang
From: Frank Chang Sign-extend vsaddu.vi immediate value. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- 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

Re: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-28 Thread Peter Xu
On Mon, Nov 29, 2021 at 10:28:42AM +0800, Jason Wang wrote: > > I think we can still have Jason's patch continued because the kernel commit > > to > > apply SNP bit is merged in v5.13, so we may need the qemu change to let it > > still work with v5.13-v5.15+ guest kernels. We'll loose the resv bi

[PATCH v10 34/77] target/riscv: rvv-1.0: allow load element with sign-extended

2021-11-28 Thread frank . chang
From: Frank Chang For some vector instructions (e.g. vmv.s.x), the element is loaded with sign-extended. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 32 + 1 file changed, 22 inse

[PATCH v10 76/77] target/riscv: rvv-1.0: update opivv_vadc_check() comment

2021-11-28 Thread frank . chang
From: Frank Chang Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions is moved to Section 11.4 in RVV v1.0 spec. Update the comment, no functional changes. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 2 +- 1 file changed

[PATCH v10 74/77] target/riscv: rvv-1.0: add vector unit-stride mask load/store insns

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/helper.h | 2 ++ target/riscv/insn32.decode | 4 +++ target/riscv/insn_trans/trans_rvv.c.inc | 40 + target/riscv/vector_helper.c| 21 ++

[PATCH v10 13/77] target/riscv: rvv-1.0: add fractional LMUL

2021-11-28 Thread frank . chang
From: Frank Chang Introduce the concepts of fractional LMUL for RVV 1.0. In RVV 1.0, LMUL bits are contiguous in vtype register. Also rearrange rvv bits in TB_FLAGS to skip MSTATUS_VS (0x600) and MSTATUS_FS (0x6000) bits. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by:

[PATCH v10 70/77] target/riscv: rvv-1.0: floating-point reciprocal estimate instruction

2021-11-28 Thread frank . chang
From: Frank Chang Implement the floating-point reciprocal estimate to 7 bits instruction. Signed-off-by: Frank Chang --- target/riscv/helper.h | 4 + target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.c.inc | 1 + target/riscv/vector_helper

[PATCH v10 69/77] target/riscv: rvv-1.0: floating-point reciprocal square-root estimate instruction

2021-11-28 Thread frank . chang
From: Frank Chang Implement the floating-point reciprocal square-root estimate to 7 bits instruction. Signed-off-by: Frank Chang --- target/riscv/helper.h | 4 + target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.c.inc | 1 + target/riscv/v

[PATCH v10 68/77] target/riscv: gdb: support vector registers for rv64 & rv32

2021-11-28 Thread frank . chang
From: Hsiangkai Wang Signed-off-by: Hsiangkai Wang Signed-off-by: Greentime Hu Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/cpu.c | 2 + target/riscv/cpu.h | 1 + target/riscv/gdbstub.c | 184 + 3 files changed, 18

[PATCH v10 77/77] target/riscv: rvv-1.0: Add ELEN checks for widening and narrowing instructions

2021-11-28 Thread frank . chang
From: Frank Chang SEW has the limitation which cannot exceed ELEN. Widening instructions have a destination group with EEW = 2*SEW and narrowing instructions have a source operand with EEW = 2*SEW. Both of the instructions have the limitation of: 2*SEW <= ELEN. Signed-off-by: Frank Chang ---

[PATCH v10 67/77] target/riscv: rvv-1.0: trigger illegal instruction exception if frm is not valid

2021-11-28 Thread frank . chang
From: Frank Chang If the frm field contains an invalid rounding mode (101-111), attempting to execute any vector floating-point instruction, even those that do not depend on the rounding mode, will raise an illegal instruction exception. Call gen_set_rm() with DYN rounding mode to check and trig

[PATCH v10 73/77] target/riscv: rvv-1.0: add evl parameter to vext_ldst_us()

2021-11-28 Thread frank . chang
From: Frank Chang Add supports of Vector unit-stride mask load/store instructions (vlm.v, vsm.v), which has: evl (effective vector length) = ceil(env->vl / 8). The new instructions operate the same as unmasked byte loads and stores. Add evl parameter to reuse vext_ldst_us(). Signed-off-by:

[PATCH v10 66/77] target/riscv: rvv-1.0: implement vstart CSR

2021-11-28 Thread frank . chang
From: Frank Chang * Update and check vstart value for vector instructions. * Add whole register move instruction helper functions as we have to call helper function for case where vstart is not zero. * Remove probe_pages() calls in vector load/store instructions (except fault-only-first loads

[PATCH v10 72/77] target/riscv: rvv-1.0: add vsetivli instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 2 ++ target/riscv/insn_trans/trans_rvv.c.inc | 27 + 2 files changed, 29 insertions(+) diff --git a/target/riscv/insn32.decode b/target/riscv/insn

Re: [PATCH v10 04/77] target/riscv: rvv-1.0: set mstatus.SD bit if mstatus.VS is dirty

2021-11-28 Thread Alistair Francis
On Mon, Nov 29, 2021 at 1:07 PM wrote: > > From: Frank Chang > > Signed-off-by: Frank Chang > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/csr.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/target/riscv/csr.c b/target/riscv/csr.c >

[PATCH v10 44/77] target/riscv: rvv-1.0: narrowing integer right shift instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/helper.h | 24 +++--- target/riscv/insn32.decode | 12 +++ target/riscv/insn_trans/trans_rvv.c.inc | 42 - target/riscv/vector_helper.

[PATCH v10 02/77] target/riscv: Use FIELD_EX32() to extract wd field

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/vector_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 12c31aa4b4d..70f5898

[PATCH v10 63/77] target/riscv: add "set round to odd" rounding mode helper function

2021-11-28 Thread frank . chang
From: Frank Chang helper_set_rounding_mode() is responsible for SIGILL, and "round to odd" should be an interface private to translation, so add a new independent helper_set_rod_rounding_mode(). Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/fpu_helper.c | 5 + tar

[PATCH v10 64/77] target/riscv: rvv-1.0: narrowing floating-point/integer type-convert

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/helper.h | 22 - target/riscv/insn32.decode | 15 --- target/riscv/insn_trans/trans_rvv.c.inc | 59 + target/riscv/vector_helper.c

[PATCH v10 60/77] target/riscv: introduce floating-point rounding mode enum

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/fpu_helper.c | 12 ++-- target/riscv/insn_trans/trans_rvv.c.inc | 18 +- target/riscv/internals.h| 9 + 3 files changed, 24 insertions(+),

[PATCH v10 12/77] target/riscv: rvv-1.0: remove MLEN calculations

2021-11-28 Thread frank . chang
From: Frank Chang As in RVV 1.0 design, MLEN is hardcoded with value 1 (Section 4.5). Thus, remove all MLEN related calculations. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 35 +--- target/riscv/inter

[PATCH v10 01/77] target/riscv: drop vector 0.7.1 and add 1.0 support

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: Bin Meng --- target/riscv/cpu.c | 16 target/riscv/cpu.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/riscv/cpu.c b/target

[PATCH v10 59/77] target/riscv: rvv-1.0: floating-point min/max instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/vector_helper.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index aed230e1ad8..cc95b692558

[PATCH V2 2/2] virtio-balloon: correct used length

2021-11-28 Thread Jason Wang
Spec said: "and len the total of bytes written into the buffer." For inflateq, deflateq and statsq, we don't process in_sg so the used length should be zero. For free_page_vq, tough the pages could be changed by the device (in the destination), spec said: "Note: len is particularly useful for dr

[PATCH v10 15/77] target/riscv: rvv-1.0: update check functions

2021-11-28 Thread frank . chang
From: Frank Chang Update check functions with RVV 1.0 rules. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 715 +--- 1 file changed, 507 insertions(+), 208 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv

[PATCH v10 75/77] target/riscv: rvv-1.0: rename vmandnot.mm and vmornot.mm to vmandn.mm and vmorn.mm

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 4 ++-- target/riscv/insn32.decode | 4 ++-- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/vector_helper.c| 4 ++-- 4 files changed

[PATCH v10 52/77] target/riscv: rvv-1.0: narrowing fixed-point clip instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/helper.h | 24 ++-- target/riscv/insn32.decode | 12 +++--- target/riscv/insn_trans/trans_rvv.c.inc | 12 +++--- target/riscv/vector_helper.c| 52

[PATCH v10 71/77] target/riscv: rvv-1.0: rename r2_zimm to r2_zimm11

2021-11-28 Thread frank . chang
From: Frank Chang Rename r2_zimm to r2_zimm11 for the upcoming vsetivli instruction. vsetivli has 10-bits of zimm but vsetvli has 11-bits of zimm. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v10 53/77] target/riscv: rvv-1.0: single-width floating-point reduction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 12 +--- target/riscv/vector_helper.c| 12 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/target/riscv/insn_trans/trans_rv

[PATCH v10 51/77] target/riscv: rvv-1.0: floating-point slide instructions

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vfslide1up.vf * vfslide1down.vf Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 7 ++ target/riscv/insn32.decode | 2 + target/riscv/insn_trans/trans_rvv.c.inc | 16 ++

[PATCH V2 1/2] virtio-balloon: process all in sgs for free_page_vq

2021-11-28 Thread Jason Wang
We only process the first in sg which may lead to the bitmap of the pages belongs to following sgs were not cleared. This may result more pages to be migrated. Fixing this by process all in sgs for free_page_vq. Acked-by: David Hildenbrand Signed-off-by: Jason Wang --- Changes since V1: - fix ty

[PATCH v10 65/77] target/riscv: rvv-1.0: relax RV_VLEN_MAX to 1024-bits

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 2 +- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/vector_helper.c| 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target

[PATCH v10 50/77] target/riscv: rvv-1.0: slide instructions

2021-11-28 Thread frank . chang
From: Frank Chang * Remove clear function from helper functions as the tail elements are unchanged in RVV 1.0. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/vector_helper.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/

[PATCH v10 48/77] target/riscv: rvv-1.0: floating-point compare instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/vector_helper.c | 9 - 1 file changed, 9 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 277a5e4120a..71d7b1e8796 100644 --- a/target/riscv/vector_h

[PATCH v10 58/77] target/riscv: rvv-1.0: remove integer extract instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 1 - target/riscv/insn_trans/trans_rvv.c.inc | 23 --- 2 files changed, 24 deletions(-) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.

[PATCH v10 62/77] target/riscv: rvv-1.0: widening floating-point/integer type-convert

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vfwcvt.rtz.xu.f.v * vfwcvt.rtz.x.f.v Also adjust GEN_OPFV_WIDEN_TRANS() to accept multiple floating-point rounding modes. Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/helper.h | 2 + target/risc

[PATCH v10 45/77] target/riscv: rvv-1.0: widening integer multiply-add instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index a3f1101cd63..7548b71efdb 100644 --- a/target/riscv/

[PATCH v10 47/77] target/riscv: rvv-1.0: integer comparison instructions

2021-11-28 Thread frank . chang
From: Frank Chang * Sign-extend vmselu.vi and vmsgtu.vi immediate values. * Remove "set tail elements to zeros" as tail elements can be unchanged for either VTA to have undisturbed or agnostic setting. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/tra

[PATCH v10 57/77] target/riscv: rvv-1.0: remove vmford.vv and vmford.vf

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/helper.h | 6 -- target/riscv/insn32.decode | 2 -- target/riscv/insn_trans/trans_rvv.c.inc | 2 -- target/riscv/vector_helper.c| 7 --- 4 files chang

[PATCH v10 61/77] target/riscv: rvv-1.0: floating-point/integer type-convert instructions

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vfcvt.rtz.xu.f.v * vfcvt.rtz.x.f.v Also adjust GEN_OPFV_TRANS() to accept multiple floating-point rounding modes. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 11 ++-- target/riscv/

[PATCH v10 41/77] target/riscv: rvv-1.0: single-width averaging add and subtract instructions

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vaaddu.vv * vaaddu.vx * vasubu.vv * vasubu.vx Remove the following instructions: * vadd.vi Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/helper.h | 16 ++ target/riscv/insn32.decode

[PATCH v10 43/77] target/riscv: rvv-1.0: integer add-with-carry/subtract-with-borrow

2021-11-28 Thread frank . chang
From: Frank Chang * Only do carry-in or borrow-in if is masked (vm=0). * Remove clear function from helper functions as the tail elements are unchanged in RVV 1.0. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 20 ++--

[PATCH v10 55/77] target/riscv: rvv-1.0: single-width scaling shift instructions

2021-11-28 Thread frank . chang
From: Frank Chang log(SEW) truncate vssra.vi immediate value. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/i

[PATCH v10 56/77] target/riscv: rvv-1.0: remove widening saturating scaled multiply-add

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/helper.h | 22 --- target/riscv/insn32.decode | 7 - target/riscv/insn_trans/trans_rvv.c.inc | 9 -- target/riscv/vector_helper.c| 205 --

[PATCH v10 39/77] target/riscv: rvv-1.0: whole register move instructions

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vmv1r.v * vmv2r.v * vmv4r.v * vmv8r.v Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/insn32.decode | 4 target/riscv/insn_trans/trans_rvv.c.inc | 25 + 2 files changed, 29 i

[PATCH v10 38/77] target/riscv: rvv-1.0: floating-point scalar move instructions

2021-11-28 Thread frank . chang
From: Frank Chang NaN-boxed the scalar floating-point register based on RVV 1.0's rules. Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/insn32.decode | 4 +-- target/riscv/insn_trans/trans_rvv.c.inc | 38 - target/riscv/internals.h

[PATCH v10 40/77] target/riscv: rvv-1.0: integer extension instructions

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vzext.vf2 * vzext.vf4 * vzext.vf8 * vsext.vf2 * vsext.vf4 * vsext.vf8 Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/helper.h | 14 + target/riscv/insn32.decode | 8 +++ target

[PATCH v10 54/77] target/riscv: rvv-1.0: widening floating-point reduction instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 998247d71

[PATCH v10 36/77] target/riscv: rvv-1.0: integer scalar move instructions

2021-11-28 Thread frank . chang
From: Frank Chang * Remove "vmv.s.x: dothing if rs1 == 0" constraint. * Add vmv.x.s instruction. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Acked-by: Alistair Francis --- target/riscv/insn32.decode | 3 +- target/riscv/insn_trans/trans_rvv.c.inc | 43

[PATCH v10 37/77] target/riscv: rvv-1.0: floating-point move instruction

2021-11-28 Thread frank . chang
From: Frank Chang NaN-boxed the scalar floating-point register based on RVV 1.0's rules. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn

[PATCH v10 31/77] target/riscv: rvv-1.0: set-X-first mask bit instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 6 +++--- target/riscv/insn_trans/trans_rvv.c.inc | 5 - target/riscv/vector_helper.c| 4 3 files changed, 7 insertions(

[PATCH v10 49/77] target/riscv: rvv-1.0: mask-register logical instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 3 ++- target/riscv/vector_helper.c| 4 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/ri

[PATCH v10 33/77] target/riscv: rvv-1.0: element index instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 3ac5162aeb7..ab274dcde12 1

[PATCH v10 30/77] target/riscv: rvv-1.0: find-first-set mask bit instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/helper.h | 2 +- target/riscv/insn32.decode | 2 +- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/vector_helper.c

[PATCH v10 32/77] target/riscv: rvv-1.0: iota instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 2 +- target/riscv/insn_trans/trans_rvv.c.inc | 10 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/target/riscv/i

[PATCH v10 42/77] target/riscv: rvv-1.0: single-width bit shift instructions

2021-11-28 Thread frank . chang
From: Frank Chang Truncate vsll.vi, vsrl.vi, vsra.vi's immediate values to lg2(SEW) bits. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/riscv/insn_trans/tra

[PATCH v10 29/77] target/riscv: rvv-1.0: count population in mask instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/helper.h | 2 +- target/riscv/insn32.decode | 2 +- target/riscv/insn_trans/trans_rvv.c.inc | 7 --- target/riscv/vector_helper.c

[PATCH v10 25/77] target/riscv: rvv-1.0: update vext_max_elems() for load/store insns

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 32 ++-- target/riscv/vector_helper.c| 99 ++--- 2 files changed, 80 insertions(+), 51 deletions(-) diff --git a/target/riscv/insn_trans

[PATCH v10 26/77] target/riscv: rvv-1.0: take fractional LMUL into vector max elements calculation

2021-11-28 Thread frank . chang
From: Frank Chang Update vext_get_vlmax() and MAXSZ() to take fractional LMUL into calculation for RVV 1.0. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 27 - target/riscv/cpu_hel

[PATCH v10 35/77] target/riscv: rvv-1.0: register gather instructions

2021-11-28 Thread frank . chang
From: Frank Chang * Add vrgatherei16.vv instruction. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 4 target/riscv/insn32.decode | 1 + target/riscv/insn_trans/trans_rvv.c.inc | 27 ++--- target/r

[PATCH v10 21/77] target/riscv: rvv-1.0: index load and store instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 67 +++ target/riscv/insn32.decode | 21 +++-- target/riscv/insn_trans/trans_rvv.c.inc | 110 +--- target/riscv/vector_helper.

[PATCH v10 24/77] target/riscv: rvv-1.0: load/store whole register instructions

2021-11-28 Thread frank . chang
From: Frank Chang Add the following instructions: * vlre.v * vsr.v Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 21 target/riscv/insn32.decode | 22 target/riscv/insn_trans/trans_rvv.c.inc | 68 +

[PATCH v10 28/77] target/riscv: rvv-1.0: floating-point classify instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 92a0e6fe51e..f61eaf7c6ba 1

[PATCH v10 27/77] target/riscv: rvv-1.0: floating-point square-root instruction

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 7d8441d1f21..92a0e6fe51e 1

[PATCH v10 18/77] target/riscv: rvv-1.0: remove amo operations instructions

2021-11-28 Thread frank . chang
From: Frank Chang Vector AMOs are removed from standard vector extensions. Will be added later as separate Zvamo extension, but will need a different encoding from earlier proposal. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 27

[PATCH v10 23/77] target/riscv: rvv-1.0: fault-only-first unit stride load

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/helper.h | 26 ++--- target/riscv/insn32.decode | 14 ++--- target/riscv/insn_trans/trans_rvv.c.inc | 33 +++ target/riscv/vect

[PATCH v10 08/77] target/riscv: rvv-1.0: remove rvv related codes from fcsr registers

2021-11-28 Thread frank . chang
From: Frank Chang * Remove VXRM and VXSAT fields from FCSR register as they are only presented in VCSR register. * Remove RVV loose check in fs() predicate function. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/csr.c | 13

[PATCH v10 20/77] target/riscv: rvv-1.0: stride load and store instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/helper.h | 129 ++-- target/riscv/insn32.decode | 43 ++- target/riscv/insn_trans/trans_rvv.c.inc | 376 target/riscv/vector_helper.c

[PATCH v10 22/77] target/riscv: rvv-1.0: fix address index overflow bug of indexed load/store insns

2021-11-28 Thread frank . chang
From: Frank Chang Replace ETYPE from signed int to unsigned int to prevent index overflow issue, which would lead to wrong index address. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/vector_helper.c | 8 1 file changed, 4 i

[PATCH v10 17/77] target/riscv: rvv:1.0: add translation-time nan-box helper function

2021-11-28 Thread frank . chang
From: Frank Chang * Add fp16 nan-box check generator function, if a 16-bit input is not properly nanboxed, then the input is replaced with the default qnan. * Add do_nanbox() helper function to utilize gen_check_nanbox_X() to generate the NaN-boxed floating-point values based on SEW setting.

[PATCH v10 09/77] target/riscv: rvv-1.0: add vcsr register

2021-11-28 Thread frank . chang
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu_bits.h | 7 +++ target/riscv/csr.c | 17 + 2 files changed, 24 insertions(+) diff --git a/target/riscv/cpu_bits.h

[PATCH v10 19/77] target/riscv: rvv-1.0: configure instructions

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 62 +++-- target/riscv/vector_helper.c| 14 +- 2 files changed, 40 insertions(+), 36 deletions(-) diff -

[PATCH v10 11/77] target/riscv: rvv-1.0: check MSTATUS_VS when accessing vector csr registers

2021-11-28 Thread frank . chang
From: Frank Chang If VS field is off, accessing vector csr registers should raise an illegal-instruction exception. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/csr.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/r

[PATCH v10 16/77] target/riscv: introduce more imm value modes in translator functions

2021-11-28 Thread frank . chang
From: Frank Chang Immediate value in translator function is extended not only zero-extended and sign-extended but with more modes to be applicable with multiple formats of vector instructions. * IMM_ZX: Zero-extended * IMM_SX: Sign-extended * IMM_TRUNC_SEW: Truncate to log(SEW)

[PATCH v10 06/77] target/riscv: rvv-1.0: introduce writable misa.v field

2021-11-28 Thread frank . chang
From: Frank Chang Implementations may have a writable misa.v field. Analogous to the way in which the floating-point unit is handled, the mstatus.vs field may exist even if misa.v is clear. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/ris

[PATCH v10 10/77] target/riscv: rvv-1.0: add vlenb register

2021-11-28 Thread frank . chang
From: Greentime Hu Signed-off-by: Greentime Hu Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu_bits.h | 1 + target/riscv/csr.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/target/riscv/cpu_bits.h b/target/riscv

[PATCH v10 05/77] target/riscv: rvv-1.0: add sstatus VS field

2021-11-28 Thread frank . chang
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu_bits.h | 1 + target/riscv/csr.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu_bits.h b/target

[PATCH v10 04/77] target/riscv: rvv-1.0: set mstatus.SD bit if mstatus.VS is dirty

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/csr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 9b5bd5d7b49..bb500afdeb5 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -502,6 +502,

[PATCH v10 07/77] target/riscv: rvv-1.0: add translation-time vector context status

2021-11-28 Thread frank . chang
From: Frank Chang Signed-off-by: LIU Zhiwei Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 5 +- target/riscv/cpu_helper.c | 3 + target/riscv/insn_trans/trans_rvv.c.inc | 75 ++

[PATCH v10 03/77] target/riscv: rvv-1.0: add mstatus VS field

2021-11-28 Thread frank . chang
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.h| 2 ++ target/riscv/cpu_bits.h | 1 + target/riscv/cpu_helper.c | 20 +++- target/riscv/csr.c| 12

[PATCH v10 00/77] support vector extension v1.0

2021-11-28 Thread frank . chang
From: Frank Chang This patchset implements the vector extension v1.0 for RISC-V on QEMU. RVV v1.0 spec is now fronzen for public review: https://github.com/riscv/riscv-v-spec/releases/tag/v1.0 The port is available here: https://github.com/sifive/qemu/tree/rvv-1.0-upstream-v10 RVV v1.0 can be

Re: [PATCH 2/2] virtio-balloon: correct used length

2021-11-28 Thread Jason Wang
On Fri, Nov 26, 2021 at 3:37 PM Michael S. Tsirkin wrote: > > On Fri, Nov 26, 2021 at 10:45:43AM +0800, Jason Wang wrote: > > On Fri, Nov 26, 2021 at 12:14 AM Michael S. Tsirkin wrote: > > > > > > On Thu, Nov 25, 2021 at 10:20:46AM +0800, Jason Wang wrote: > > > > Spec said: > > > > > > > > "and

Re: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-28 Thread Jason Wang
On Mon, Nov 29, 2021 at 9:19 AM Peter Xu wrote: > > On Sun, Nov 28, 2021 at 07:06:18AM +, Liu, Yi L wrote: > > > From: Peter Xu > > > Sent: Thursday, November 25, 2021 2:14 PM > > > > > > On Thu, Nov 25, 2021 at 05:49:38AM +, Liu, Yi L wrote: > > > > > From: Peter Xu > > > > > Sent: Thur

Re: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-28 Thread Peter Xu
On Sun, Nov 28, 2021 at 07:06:18AM +, Liu, Yi L wrote: > > From: Peter Xu > > Sent: Thursday, November 25, 2021 2:14 PM > > > > On Thu, Nov 25, 2021 at 05:49:38AM +, Liu, Yi L wrote: > > > > From: Peter Xu > > > > Sent: Thursday, November 25, 2021 12:31 PM > > > > > > > > On Thu, Nov 25,

Re: [PATCH 1/3] ppc/pnv: Tune the POWER9 PCIe Host bridge model

2021-11-28 Thread Michael S. Tsirkin
On Fri, Nov 26, 2021 at 06:08:30PM +0100, Cédric Le Goater wrote: > [ Adding Alfredo the thread ] > > On 11/26/21 10:09, Cédric Le Goater wrote: > > On 11/16/21 18:01, Frederic Barrat wrote: > > > The PHB v4 found on POWER9 doesn't request any LSI, so let's clear the > > > Interrupt Pin register i

Re: [PATCH 00/10] vhost: stick to -errno error return convention

2021-11-28 Thread Michael S. Tsirkin
On Thu, Nov 11, 2021 at 06:33:44PM +0300, Roman Kagan wrote: > Error propagation between the generic vhost code and the specific backends is > not quite consistent: some places follow "return -1 and set errno" convention, > while others assume "return negated errno". Furthermore, not enough care i

Re: [PATCH for-6.2? 1/2] hw/intc/arm_gicv3: Add new gicv3_intid_is_special() function

2021-11-28 Thread Alex Bennée
Peter Maydell writes: > The GICv3/v4 pseudocode has a function IsSpecial() which returns true > if passed a "special" interrupt ID number (anything between 1020 and > 1023 inclusive). We open-code this condition in a couple of places, > so abstract it out into a new function gicv3_intid_is_spe

[PATCH] Fix STM32F2XX USART data register readout

2021-11-28 Thread Olivier Hériveaux
Fix issue where the data register may be overwritten by next character reception before being read and returned. Signed-off-by: Olivier Hériveaux --- hw/char/stm32f2xx_usart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usar

[PATCH v6 13/18] target/riscv: support for 128-bit arithmetic instructions

2021-11-28 Thread Frédéric Pétrot
Addition of 128-bit adds and subs in their various sizes, "set if less than"s and branches. Refactored the code to have a comparison function used for both stls and branches. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas --- target/riscv/insn32.decode | 3 + target

[PATCH v6 14/18] target/riscv: support for 128-bit M extension

2021-11-28 Thread Frédéric Pétrot
Mult are generated inline (using a cool trick pointed out by Richard), but for div and rem, given the complexity of the implementation of these instructions, we call helpers to produce their behavior. From an implementation standpoint, the helpers return the low part of the results, while the high

[PATCH v6 11/18] target/riscv: support for 128-bit U-type instructions

2021-11-28 Thread Frédéric Pétrot
Adding the 128-bit version of lui and auipc, and introducing to that end a "set register with immediat" function to handle extension on 128 bits. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translat

[PATCH v6 16/18] target/riscv: helper functions to wrap calls to 128-bit csr insns

2021-11-28 Thread Frédéric Pétrot
Given the side effects they have, the csr instructions are realized as helpers. We extend this existing infrastructure for 128-bit sized csr. We return 128-bit values using the same approach as for div/rem. Theses helpers all call a unique function that is currently a fallback on the 64-bit version

[PATCH v6 10/18] target/riscv: support for 128-bit bitwise instructions

2021-11-28 Thread Frédéric Pétrot
The 128-bit bitwise instructions do not need any function prototype change as the functions can be applied independently on the lower and upper part of the registers. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis ---

[PATCH v6 18/18] target/riscv: actual functions to realize crs 128-bit insns

2021-11-28 Thread Frédéric Pétrot
The csrs are accessed through function pointers: we add 128-bit read operations in the table for three csrs (writes fallback to the 64-bit version as the upper 64-bit information is handled elsewhere): - misa, as mxl is needed for proper operation, - mstatus and sstatus, to return sd In addition, w

[PATCH v6 17/18] target/riscv: modification of the trans_csrxx for 128-bit support

2021-11-28 Thread Frédéric Pétrot
As opposed to the gen_arith and gen_shift generation helpers, the csr insns do not have a common prototype, so the choice to generate 32/64 or 128-bit helper calls is done in the trans_csrxx functions. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas Reviewed-by: Richard Henderson -

[PATCH v6 04/18] target/riscv: additional macros to check instruction support

2021-11-28 Thread Frédéric Pétrot
Given that the 128-bit version of the riscv spec adds new instructions, and that some instructions that were previously only available in 64-bit mode are now available for both 64-bit and 128-bit, we added new macros to check for the processor mode during translation. Although RV128 is a superset o

  1   2   >