[PATCH v2] target/ppc: Fix fallback to MFSS for MFFS* instructions on pre 3.0 ISAs

2023-05-05 Thread Richard Purdie
The following commits changed the code such that the fallback to MFSS for MFFSCRN, MFFSCRNI, MFFSCE and MFFSL on pre 3.0 ISAs was removed and became an illegal instruction: bf8adfd88b547680aa857c46098f3a1e94373160 - target/ppc: Move mffscrn[i] to decodetree 394c2e2fda70da722f20fb60412d6c0ca

[PULL v2 20/45] target/loongarch: Implement vmskltz/vmskgez/vmsknz

2023-05-05 Thread Song Gao
This patch includes: - VMSKLTZ.{B/H/W/D}; - VMSKGEZ.B; - VMSKNZ.B. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-21-gaos...@loongson.cn> --- target/loongarch/disas.c| 7 ++ target/loongarch/helper.h | 7 ++ t

[PULL v2 43/45] target/loongarch: Use {set/get}_gpr replace to cpu_fpr

2023-05-05 Thread Song Gao
Introduce set_fpr() and get_fpr() and remove cpu_fpr. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-44-gaos...@loongson.cn> --- .../loongarch/insn_trans/trans_farith.c.inc | 72 +++ target/loongarch/insn_trans/trans_fcmp.c.inc | 12

[PULL v2 08/45] target/loongarch: Implement vhaddw/vhsubw

2023-05-05 Thread Song Gao
This patch includes: - VHADDW.{H.B/W.H/D.W/Q.D/HU.BU/WU.HU/DU.WU/QU.DU}; - VHSUBW.{H.B/W.H/D.W/Q.D/HU.BU/WU.HU/DU.WU/QU.DU}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-9-gaos...@loongson.cn> --- target/loongarch/disas.c| 17 +++

[PULL v2 09/45] target/loongarch: Implement vaddw/vsubw

2023-05-05 Thread Song Gao
This patch includes: - VADDW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - VSUBW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - VADDW{EV/OD}.{H.BU.B/W.HU.H/D.WU.W/Q.DU.D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-10-gaos...@loongson.cn> --- target/loongarch/disas.c

[PULL v2 21/45] target/loongarch: Implement LSX logic instructions

2023-05-05 Thread Song Gao
This patch includes: - V{AND/OR/XOR/NOR/ANDN/ORN}.V; - V{AND/OR/XOR/NOR}I.B. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-22-gaos...@loongson.cn> --- target/loongarch/disas.c| 12 + target/loongarch/helper.h

[PULL v2 14/45] target/loongarch: Implement vmul/vmuh/vmulw{ev/od}

2023-05-05 Thread Song Gao
This patch includes: - VMUL.{B/H/W/D}; - VMUH.{B/H/W/D}[U]; - VMULW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - VMULW{EV/OD}.{H.BU.B/W.HU.H/D.WU.W/Q.DU.D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-15-gaos...@loongson.cn> --- target/loongarch/disas.c

[PULL v2 36/45] target/loongarch: Implement vfcmp

2023-05-05 Thread Song Gao
This patch includes: - VFCMP.cond.{S/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-37-gaos...@loongson.cn> --- target/loongarch/disas.c| 94 + target/loongarch/helper.h | 5 ++ target/loo

[PULL v2 10/45] target/loongarch: Implement vavg/vavgr

2023-05-05 Thread Song Gao
This patch includes: - VAVG.{B/H/W/D}[U]; - VAVGR.{B/H/W/D}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-11-gaos...@loongson.cn> --- target/loongarch/disas.c| 17 ++ target/loongarch/helper.h | 18 ++ targ

[PULL v2 34/45] target/loongarch: Implement LSX fpu fcvt instructions

2023-05-05 Thread Song Gao
This patch includes: - VFCVT{L/H}.{S.H/D.S}; - VFCVT.{H.S/S.D}; - VFRINT[{RNE/RZ/RP/RM}].{S/D}; - VFTINT[{RNE/RZ/RP/RM}].{W.S/L.D}; - VFTINT[RZ].{WU.S/LU.D}; - VFTINT[{RNE/RZ/RP/RM}].W.D; - VFTINT[{RNE/RZ/RP/RM}]{L/H}.L.S; - VFFINT.{S.W/D.L}[U]; - VFFINT.S.L, VFFINT{L/H}.D.W. Reviewed-by: Richard

[PULL v2 25/45] target/loongarch: Implement vsrln vsran

2023-05-05 Thread Song Gao
This patch includes: - VSRLN.{B.H/H.W/W.D}; - VSRAN.{B.H/H.W/W.D}; - VSRLNI.{B.H/H.W/W.D/D.Q}; - VSRANI.{B.H/H.W/W.D/D.Q}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-26-gaos...@loongson.cn> --- target/loongarch/disas.c| 16 +++

[PULL v2 31/45] target/loongarch: Implement vbitclr vbitset vbitrev

2023-05-05 Thread Song Gao
This patch includes: - VBITCLR[I].{B/H/W/D}; - VBITSET[I].{B/H/W/D}; - VBITREV[I].{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-32-gaos...@loongson.cn> --- target/loongarch/disas.c| 25 ++ target/loongarch/helper.h

[PULL v2 44/45] target/loongarch: CPUCFG support LSX

2023-05-05 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-45-gaos...@loongson.cn> --- target/loongarch/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 55d7f9255e..c0afc21b2f 100644 --- a/target/loong

[PULL v2 41/45] target/loongarch: Implement vld vst

2023-05-05 Thread Song Gao
This patch includes: - VLD[X], VST[X]; - VLDREPL.{B/H/W/D}; - VSTELM.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-42-gaos...@loongson.cn> --- target/loongarch/disas.c| 34 + target/loongarch/insn_trans/trans_lsx.c

[PULL v2 22/45] target/loongarch: Implement vsll vsrl vsra vrotr

2023-05-05 Thread Song Gao
This patch includes: - VSLL[I].{B/H/W/D}; - VSRL[I].{B/H/W/D}; - VSRA[I].{B/H/W/D}; - VROTR[I].{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-23-gaos...@loongson.cn> --- target/loongarch/disas.c| 36 +

[PULL v2 38/45] target/loongarch: Implement vinsgr2vr vpickve2gr vreplgr2vr

2023-05-05 Thread Song Gao
This patch includes: - VINSGR2VR.{B/H/W/D}; - VPICKVE2GR.{B/H/W/D}[U]; - VREPLGR2VR.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-39-gaos...@loongson.cn> --- target/loongarch/disas.c| 33 ++ target/loongarch/insn_t

[PULL v2 03/45] target/loongarch: Add CHECK_SXE maccro for check LSX enable

2023-05-05 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-4-gaos...@loongson.cn> --- target/loongarch/cpu.c | 2 ++ target/loongarch/cpu.h | 2 ++ target/loongarch/insn_trans/trans_lsx.c.inc | 11 +++ 3 files ch

[PULL v2 18/45] target/loongarch: Implement vexth

2023-05-05 Thread Song Gao
This patch includes: - VEXTH.{H.B/W.H/D.W/Q.D}; - VEXTH.{HU.BU/WU.HU/DU.WU/QU.DU}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-19-gaos...@loongson.cn> --- target/loongarch/disas.c| 9 ++ target/loongarch/helper.h

[PULL v2 29/45] target/loongarch: Implement vclo vclz

2023-05-05 Thread Song Gao
This patch includes: - VCLO.{B/H/W/D}; - VCLZ.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-30-gaos...@loongson.cn> --- target/loongarch/disas.c| 9 ++ target/loongarch/helper.h | 9 ++ targe

[PULL v2 45/45] hw/intc: don't use target_ulong for LoongArch ipi

2023-05-05 Thread Song Gao
From: Alex Bennée The calling function is already working with hwaddr and uint64_t so lets avoid bringing target_ulong in if we don't need to. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Song Gao Message-Id: <20230404132711.2563638-1-alex.ben...@linaro.org> Sig

[PULL v2 40/45] target/loongarch: Implement vilvl vilvh vextrins vshuf

2023-05-05 Thread Song Gao
This patch includes: - VILV{L/H}.{B/H/W/D}; - VSHUF.{B/H/W/D}; - VSHUF4I.{B/H/W/D}; - VPERMI.W; - VEXTRINS.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-41-gaos...@loongson.cn> --- target/loongarch/disas.c| 25 ta

[PULL v2 37/45] target/loongarch: Implement vbitsel vset

2023-05-05 Thread Song Gao
This patch includes: - VBITSEL.V; - VBITSELI.B; - VSET{EQZ/NEZ}.V; - VSETANYEQZ.{B/H/W/D}; - VSETALLNEZ.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-38-gaos...@loongson.cn> --- target/loongarch/disas.c| 20 ++ targ

[PULL v2 27/45] target/loongarch: Implement vssrln vssran

2023-05-05 Thread Song Gao
This patch includes: - VSSRLN.{B.H/H.W/W.D}; - VSSRAN.{B.H/H.W/W.D}; - VSSRLN.{BU.H/HU.W/WU.D}; - VSSRAN.{BU.H/HU.W/WU.D}; - VSSRLNI.{B.H/H.W/W.D/D.Q}; - VSSRANI.{B.H/H.W/W.D/D.Q}; - VSSRLNI.{BU.H/HU.W/WU.D/DU.Q}; - VSSRANI.{BU.H/HU.W/WU.D/DU.Q}. Reviewed-by: Richard Henderson Signed-off-by: Song

[PULL v2 13/45] target/loongarch: Implement vmax/vmin

2023-05-05 Thread Song Gao
This patch includes: - VMAX[I].{B/H/W/D}[U]; - VMIN[I].{B/H/W/D}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-14-gaos...@loongson.cn> --- target/loongarch/disas.c| 33 target/loongarch/helper.h | 18 +

[PULL v2 07/45] target/loongarch: Implement vsadd/vssub

2023-05-05 Thread Song Gao
This patch includes: - VSADD.{B/H/W/D}[U]; - VSSUB.{B/H/W/D}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-8-gaos...@loongson.cn> --- target/loongarch/disas.c| 17 + target/loongarch/insn_trans/trans_lsx.c.inc

[PULL v2 15/45] target/loongarch: Implement vmadd/vmsub/vmaddw{ev/od}

2023-05-05 Thread Song Gao
This patch includes: - VMADD.{B/H/W/D}; - VMSUB.{B/H/W/D}; - VMADDW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - VMADDW{EV/OD}.{H.BU.B/W.HU.H/D.WU.W/Q.DU.D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-16-gaos...@loongson.cn> --- target/loongarch/disas.c

[PULL v2 02/45] target/loongarch: meson.build support build LSX

2023-05-05 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-3-gaos...@loongson.cn> --- target/loongarch/insn_trans/trans_lsx.c.inc | 5 + target/loongarch/lsx_helper.c | 6 ++ target/loongarch/meson.build| 1 + target/loongarch

[PULL v2 23/45] target/loongarch: Implement vsllwil vextl

2023-05-05 Thread Song Gao
This patch includes: - VSLLWIL.{H.B/W.H/D.W}; - VSLLWIL.{HU.BU/WU.HU/DU.WU}; - VEXTL.Q.D, VEXTL.QU.DU. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-24-gaos...@loongson.cn> --- target/loongarch/disas.c| 9 + target/loongarch/

[PULL v2 39/45] target/loongarch: Implement vreplve vpack vpick

2023-05-05 Thread Song Gao
This patch includes: - VREPLVE[I].{B/H/W/D}; - VBSLL.V, VBSRL.V; - VPACK{EV/OD}.{B/H/W/D}; - VPICK{EV/OD}.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-40-gaos...@loongson.cn> --- target/loongarch/disas.c| 35 + ta

[PULL v2 11/45] target/loongarch: Implement vabsd

2023-05-05 Thread Song Gao
This patch includes: - VABSD.{B/H/W/D}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-12-gaos...@loongson.cn> --- target/loongarch/disas.c| 9 ++ target/loongarch/helper.h | 9 ++ target/loongarch/insn_trans

[PULL v2 30/45] target/loongarch: Implement vpcnt

2023-05-05 Thread Song Gao
This patch includes: - VPCNT.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-31-gaos...@loongson.cn> --- target/loongarch/disas.c| 5 + target/loongarch/helper.h | 5 + target/loongarch/insn_tr

[PULL v2 33/45] target/loongarch: Implement LSX fpu arith instructions

2023-05-05 Thread Song Gao
This patch includes: - VF{ADD/SUB/MUL/DIV}.{S/D}; - VF{MADD/MSUB/NMADD/NMSUB}.{S/D}; - VF{MAX/MIN}.{S/D}; - VF{MAXA/MINA}.{S/D}; - VFLOGB.{S/D}; - VFCLASS.{S/D}; - VF{SQRT/RECIP/RSQRT}.{S/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-34-gaos...@lo

[PULL v2 01/45] target/loongarch: Add LSX data type VReg

2023-05-05 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-2-gaos...@loongson.cn> --- linux-user/loongarch64/signal.c | 4 +- target/loongarch/cpu.c | 2 +- target/loongarch/cpu.h | 21 - target/loongarch/gdbstub.c | 4 +- target/

[PULL v2 17/45] target/loongarch: Implement vsat

2023-05-05 Thread Song Gao
This patch includes: - VSAT.{B/H/W/D}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-18-gaos...@loongson.cn> --- target/loongarch/disas.c| 9 ++ target/loongarch/helper.h | 9 ++ target/loongarch/insn_tran

[PULL v2 19/45] target/loongarch: Implement vsigncov

2023-05-05 Thread Song Gao
This patch includes: - VSIGNCOV.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-20-gaos...@loongson.cn> --- target/loongarch/disas.c| 5 ++ target/loongarch/helper.h | 5 ++ target/loongarch/insn_trans

[PULL v2 16/45] target/loongarch: Implement vdiv/vmod

2023-05-05 Thread Song Gao
This patch includes: - VDIV.{B/H/W/D}[U]; - VMOD.{B/H/W/D}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-17-gaos...@loongson.cn> --- target/loongarch/disas.c| 17 ++ target/loongarch/helper.h | 17 +++

[PULL v2 42/45] target/loongarch: Implement vldi

2023-05-05 Thread Song Gao
This patch includes: - VLDI. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-43-gaos...@loongson.cn> --- target/loongarch/disas.c| 7 + target/loongarch/insn_trans/trans_lsx.c.inc | 137 target/loongarch/insns

[PULL v2 24/45] target/loongarch: Implement vsrlr vsrar

2023-05-05 Thread Song Gao
This patch includes: - VSRLR[I].{B/H/W/D}; - VSRAR[I].{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-25-gaos...@loongson.cn> --- target/loongarch/disas.c| 18 target/loongarch/helper.h | 18

[PULL v2 32/45] target/loongarch: Implement vfrstp

2023-05-05 Thread Song Gao
This patch includes: - VFRSTP[I].{B/H}. Acked-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-33-gaos...@loongson.cn> --- target/loongarch/disas.c| 5 +++ target/loongarch/helper.h | 5 +++ target/loongarch/insn_trans/tra

[PULL v2 05/45] target/loongarch: Implement vaddi/vsubi

2023-05-05 Thread Song Gao
This patch includes: - VADDI.{B/H/W/D}U; - VSUBI.{B/H/W/D}U. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-6-gaos...@loongson.cn> --- target/loongarch/disas.c| 14 target/loongarch/insn_trans/trans_lsx.c.inc | 37

[PULL v2 35/45] target/loongarch: Implement vseq vsle vslt

2023-05-05 Thread Song Gao
This patch includes: - VSEQ[I].{B/H/W/D}; - VSLE[I].{B/H/W/D}[U]; - VSLT[I].{B/H/W/D/}[U]. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-36-gaos...@loongson.cn> --- target/loongarch/disas.c| 43 + target/loongarch/helper.h

[PULL v2 04/45] target/loongarch: Implement vadd/vsub

2023-05-05 Thread Song Gao
This patch includes: - VADD.{B/H/W/D/Q}; - VSUB.{B/H/W/D/Q}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-5-gaos...@loongson.cn> --- target/loongarch/disas.c| 23 +++ target/loongarch/insn_trans/trans_lsx.c.inc | 69 +

[PULL v2 26/45] target/loongarch: Implement vsrlrn vsrarn

2023-05-05 Thread Song Gao
This patch includes: - VSRLRN.{B.H/H.W/W.D}; - VSRARN.{B.H/H.W/W.D}; - VSRLRNI.{B.H/H.W/W.D/D.Q}; - VSRARNI.{B.H/H.W/W.D/D.Q}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-27-gaos...@loongson.cn> --- target/loongarch/disas.c| 16

[PULL v2 00/45] loongarch-to-apply queue

2023-05-05 Thread Song Gao
The following changes since commit eb5c3932a383ba1ef3a911232c644f2e053ef66c: Merge tag 'pw-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-05-05 19:18:05 +0100) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20230

[PULL v2 06/45] target/loongarch: Implement vneg

2023-05-05 Thread Song Gao
This patch includes; - VNEG.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-7-gaos...@loongson.cn> --- target/loongarch/disas.c| 10 ++ target/loongarch/insn_trans/trans_lsx.c.inc | 20 target

[PULL v2 28/45] target/loongarch: Implement vssrlrn vssrarn

2023-05-05 Thread Song Gao
This patch includes: - VSSRLRN.{B.H/H.W/W.D}; - VSSRARN.{B.H/H.W/W.D}; - VSSRLRN.{BU.H/HU.W/WU.D}; - VSSRARN.{BU.H/HU.W/WU.D}; - VSSRLRNI.{B.H/H.W/W.D/D.Q}; - VSSRARNI.{B.H/H.W/W.D/D.Q}; - VSSRLRNI.{BU.H/HU.W/WU.D/DU.Q}; - VSSRARNI.{BU.H/HU.W/WU.D/DU.Q}. Reviewed-by: Richard Henderson Signed-off-

[PULL v2 12/45] target/loongarch: Implement vadda

2023-05-05 Thread Song Gao
This patch includes: - VADDA.{B/H/W/D}. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20230504122810.4094787-13-gaos...@loongson.cn> --- target/loongarch/disas.c| 5 ++ target/loongarch/helper.h | 5 ++ target/loongarch/insn_trans/tr

[PATCH RFC v3 1/9] linux-headers: Add KVM headers for loongarch

2023-05-05 Thread Tianrui Zhao
This patch is only a placeholder now, which is used to show some kvm structures and macros for reviewers. And it will be replaced by using update-linux-headers.sh when the linux loongarch kvm patches are accepted. Signed-off-by: Tianrui Zhao --- linux-headers/asm-loongarch/kvm.h | 99 +++

[PATCH RFC v3 4/9] target/loongarch: Implement kvm get/set registers

2023-05-05 Thread Tianrui Zhao
Implement kvm_arch_get/set_registers interfaces, many regs can be get/set in the function, such as core regs, csr regs, fpu regs, mp state, etc. Signed-off-by: Tianrui Zhao Reviewed-by: Richard Henderson --- meson.build | 1 + target/loongarch/cpu.c| 3 + target/lo

[PATCH RFC v3 8/9] target/loongarch: Implement set vcpu intr for kvm

2023-05-05 Thread Tianrui Zhao
Implement loongarch kvm set vcpu interrupt interface, when a irq is set in vcpu, we use the KVM_INTERRUPT ioctl to set intr into kvm. Signed-off-by: Tianrui Zhao --- target/loongarch/cpu.c | 18 +- target/loongarch/kvm-stub.c | 11 +++ target/loongarch/kvm.

[PATCH RFC v3 9/9] target/loongarch: Add loongarch kvm into meson build

2023-05-05 Thread Tianrui Zhao
Add kvm.c and kvm-stub.c into meson.build to compile it when kvm is configed. Meanwhile in meson.build, we set the kvm_targets to loongarch64-softmmu when the cpu is loongarch. Signed-off-by: Tianrui Zhao Reviewed-by: Richard Henderson --- meson.build | 2 ++ target/loongarch/m

Re: [PATCH] virtio-net: not enable vq reset feature unconditionally

2023-05-05 Thread Xuan Zhuo
On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?= wrote: > The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables > unconditionally vq reset feature as long as the device is emulated. > This makes impossible to actually disable the feature, and it causes > migrat

[PATCH RFC v3 7/9] target/loongarch: Implement kvm_arch_handle_exit

2023-05-05 Thread Tianrui Zhao
Implement kvm_arch_handle_exit for loongarch. In this function, the KVM_EXIT_LOONGARCH_IOCSR is handled, we read or write the iocsr address space by the addr, length and is_write argument in kvm_run. Signed-off-by: Tianrui Zhao Reviewed-by: Richard Henderson --- target/loongarch/kvm.c|

[PATCH RFC v3 0/9] Add loongarch kvm accel support

2023-05-05 Thread Tianrui Zhao
This series add loongarch kvm support, mainly implement some interfaces used by kvm such as kvm_arch_get/set_regs, kvm_arch_handle_exit, kvm_loongarch_set_interrupt, etc. Currently, we are able to boot LoongArch KVM Linux Guests. In loongarch VM, mmio devices and iocsr devices are emulated in user

[PATCH RFC v3 3/9] target/loongarch: Supplement vcpu env initial when vcpu reset

2023-05-05 Thread Tianrui Zhao
Supplement vcpu env initial when vcpu reset, including init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index. The two regs will be used in kvm_get/set_csr_ioctl. Signed-off-by: Tianrui Zhao --- target/loongarch/cpu.c | 2 ++ target/loongarch/cpu.h | 1 + 2 files changed, 3 insertions(+) diff --git a/ta

[PATCH RFC v3 5/9] target/loongarch: Implement kvm_arch_init function

2023-05-05 Thread Tianrui Zhao
Implement the kvm_arch_init of loongarch, in the function, the KVM_CAP_MP_STATE cap is checked by kvm ioctl. Signed-off-by: Tianrui Zhao Reviewed-by: Richard Henderson --- target/loongarch/kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/loongarch/kvm.c b/target/loongarch/kvm.c

[PATCH RFC v3 6/9] target/loongarch: Implement kvm_arch_init_vcpu

2023-05-05 Thread Tianrui Zhao
Implement kvm_arch_init_vcpu interface for loongarch, in this function, we register VM change state handler. And when VM state changes to running, the counter value should be put into kvm to keep consistent with kvm, and when state change to stop, counter value should be refreshed from kvm. Signed

[PATCH RFC v3 2/9] target/loongarch: Define some kvm_arch interfaces

2023-05-05 Thread Tianrui Zhao
Define some functions in target/loongarch/kvm.c, such as kvm_arch_put_registers, kvm_arch_get_registers and kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c. Now the most functions has no content and they will be implemented in the next patches. Signed-off-by: Tianrui Zhao Reviewed-by

Re: [PATCH v4 36/57] tcg/loongarch64: Assert the host supports unaligned accesses

2023-05-05 Thread Song Gao
Hi, 在 2023/5/5 下午9:24, WANG Xuerui 写道: Hi, On 2023/5/3 15:06, Richard Henderson wrote: This should be true of all server class loongarch64. And desktop-class (i.e. all Loongson-3 series). Signed-off-by: Richard Henderson ---   tcg/loongarch64/tcg-target.c.inc | 6 ++   1 file changed, 6

Re: [PULL 00/45] loongarch-to-apply queue

2023-05-05 Thread Song Gao
ble in the Git repository at:    https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20230505 for you to fetch changes up to 9dd207d409cc2eb08fe52965b9d1fd4a12a82bd5:    hw/intc: don't use target_ulong for LoongArch ipi (2023-05-05

Re: [PATCH 0/1] Updated: Ensure PV ring is drained on disconenct

2023-05-05 Thread Stefano Stabellini
On Thu, 20 Apr 2023, Mark Syms wrote: > Updated patch to address intermittent SIGSEGV on domain disconnect/shutdown. > > Mark Syms (1): > Ensure the PV ring is drained on disconnect > > hw/block/dataplane/xen-block.c | 31 +-- > 1 file changed, 25 insertions(+), 6 d

Re: [PATCH] 9pfs/xen: Fix segfault on shutdown

2023-05-05 Thread Stefano Stabellini
On Tue, 2 May 2023, Jason Andryuk wrote: > xen_9pfs_free can't use gnttabdev since it is already closed and NULL-ed > out when free is called. Do the teardown in _disconnect(). This > matches the setup done in _connect(). > > trace-events are also added for the XenDevOps functions. > > Signed-o

[PATCH v2] vfio/pci: Static Resizable BAR capability

2023-05-05 Thread Alex Williamson
The PCI Resizable BAR (ReBAR) capability is currently hidden from the VM because the protocol for interacting with the capability does not support a mechanism for the device to reject an advertised supported BAR size. However, when assigned to a VM, the act of resizing the BAR requires adjustment

Question: PCIe P2P Guidance

2023-05-05 Thread Thomas Barrett
Hi, I have been struggling for a few months now with achieving full bandwidth PCIe P2P in a qemu virtual machine. I am working with a number of PCIe endpoints (NVIDIA A100 GPUs and Mellanox ConnectX 7 Infiniband NICs) behind a PCIe switch. In all configurations I have tried, P2P traffic gets route

Re: [PATCH v3 0/3] ACPI: i386: bump MADT to revision 5

2023-05-05 Thread Eric DeVolder
Thoughts? eric On 4/21/23 16:48, Eric DeVolder wrote: The following Linux kernel change broke CPU hotplug for MADT revision less than 5. e2869bd7af60 ("x86/acpi/boot: Do not register processors that cannot be onlined for x2APIC") Discussion on this topic can be located here: https://lor

[PULL 19/42] tcg/i386: Rationalize args to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
Interpret the variable argument placement in the caller. Pass data_type instead of is64 -- there are several places where we already convert back from bool to type. Clean things up by using type throughout. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-

[PULL 30/42] tcg/mips: Rationalize args to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
Interpret the variable argument placement in the caller. There are several places where we already convert back from bool to type. Clean things up by using type throughout. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 186

[PULL 41/42] tcg: Introduce arg_slot_stk_ofs

2023-05-05 Thread Richard Henderson
Unify all computation of argument stack offset in one function. This requires that we adjust ref_slot to be in the same units, by adding max_reg_slots during init_call_layout. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 29 +

[PULL 27/42] tcg/arm: Introduce HostAddress

2023-05-05 Thread Richard Henderson
Collect the parts of the host address, and condition, into a struct. Merge tcg_out_qemu_*_{index,direct} and use it. Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 248 ++- 1 file changed, 115 insertions(+), 133 deletions(-) diff --git a/tcg/

[PULL 17/42] target/sparc: Use cpu_ld*_code_mmu

2023-05-05 Thread Richard Henderson
This passes on the memop as given as argument to helper_ld_asi to the ultimate load primitive. Reviewed-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/ldst_helper.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/sparc/ldst_helper.c

[PULL 11/42] target/alpha: Use MO_ALIGN for system UNALIGN()

2023-05-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 9d25e21164..ffbac1c114 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -72,7 +72,7 @@

[PULL 40/42] tcg: Replace REG_P with arg_loc_reg_p

2023-05-05 Thread Richard Henderson
An inline function is safer than a macro, and REG_P was rather too generic. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 4 tcg/tcg.c | 16 +--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tcg/tcg-in

[PULL 26/42] tcg/arm: Rationalize args to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
Interpret the variable argument placement in the caller. Pass data_type instead of is_64. We need to set this in TCGLabelQemuLdst, so plumb this all the way through from tcg_out_op. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 113

[PULL 12/42] target/alpha: Use MO_ALIGN where required

2023-05-05 Thread Richard Henderson
Mark all memory operations that are not already marked with UNALIGN. Signed-off-by: Richard Henderson --- target/alpha/translate.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index

[PULL 22/42] tcg/i386: Drop r0+r1 local variables from tcg_out_tlb_load

2023-05-05 Thread Richard Henderson
Use TCG_REG_L[01] constants directly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc i

[PULL 42/42] tcg: Widen helper_*_st[bw]_mmu val arguments

2023-05-05 Thread Richard Henderson
While the old type was correct in the ideal sense, some ABIs require the argument to be zero-extended. Using uint32_t for all such values is a decent compromise. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-ldst.h | 10 +++--- accel/tcg/cputlb.c

[PULL 14/42] target/hppa: Use MO_ALIGN for system UNALIGN()

2023-05-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6a3154ebc6..59e4688bfa 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -271,7 +271,7 @@ ty

[PULL 34/42] tcg/riscv: Rationalize args to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
Interpret the variable argument placement in the caller. Pass data_type instead of is64 -- there are several places where we already convert back from bool to type. Clean things up by using type throughout. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by:

[PULL 23/42] tcg/i386: Introduce tcg_out_testi

2023-05-05 Thread Richard Henderson
Split out a helper for choosing testb vs testl. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target

[PULL 02/42] target/avr: Finish conversion to tcg_gen_qemu_{ld,st}_*

2023-05-05 Thread Richard Henderson
Convert away from the old interface with the implicit MemOp argument. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20230502135741.1158035-2-richard.hender...@linaro.org> --- target/avr/translate.c | 16 1 file changed, 8 insertions(+), 8 deletions(

[PULL 06/42] target/mips: Finish conversion to tcg_gen_qemu_{ld, st}_*

2023-05-05 Thread Richard Henderson
Convert away from the old interface with the implicit MemOp argument. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20230502135741.1158035-6-richard.hender...@linaro.org> --- target/mips/tcg/translate.c | 8 target/mips/tcg/nanomips_translate.c

[PULL 28/42] tcg/loongarch64: Rationalize args to tcg_out_qemu_{ld, st}

2023-05-05 Thread Richard Henderson
Interpret the variable argument placement in the caller. Shift some code around slightly to share more between softmmu and user-only. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 100 +-- 1 file changed,

[PULL 25/42] tcg/aarch64: Introduce HostAddress

2023-05-05 Thread Richard Henderson
Collect the 3 potential parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 86 +--- 1 file changed, 59 insertions(+), 27 del

[PULL 32/42] tcg/ppc: Introduce HostAddress

2023-05-05 Thread Richard Henderson
Collect the parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st} to use it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 90 +--- 1 file changed, 47 insertions(+), 43 deletions(-) diff --g

[PULL 13/42] target/alpha: Remove TARGET_ALIGNED_ONLY

2023-05-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- configs/targets/alpha-linux-user.mak | 1 - configs/targets/alpha-softmmu.mak| 1 - 2 files changed, 2 deletions(-) diff --git a/configs/targets/alpha-linux-user.mak b/configs/targets/alpha-linux-user.mak index 7e62fd796a..f7d3fb4afa 100644 --- a/configs

[PULL 21/42] tcg/i386: Introduce HostAddress

2023-05-05 Thread Richard Henderson
Collect the 4 potential parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Reorg guest_base handling to use it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 165 +- 1 f

[PULL 03/42] target/cris: Finish conversion to tcg_gen_qemu_{ld, st}_*

2023-05-05 Thread Richard Henderson
Convert away from the old interface with the implicit MemOp argument. In this case we can fold the calls using the size bits of MemOp. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20230502135741.1158035-3-richard.hender...@linaro.org> --- target/cris/translate_v10

[PULL 31/42] tcg/ppc: Rationalize args to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
Interpret the variable argument placement in the caller. Pass data_type instead of is64 -- there are several places where we already convert back from bool to type. Clean things up by using type throughout. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by:

[PULL 01/42] softfloat: Fix the incorrect computation in float32_exp2

2023-05-05 Thread Richard Henderson
From: Shivaprasad G Bhat The float32_exp2 function is computing wrong exponent of 2. For example, with the following set of values {0.1, 2.0, 2.0, -1.0}, the expected output would be {1.071773, 4.00, 4.00, 0.50}. Instead, the function is computing {1.119102, 3.382044, 3.382044, -0.19

[PULL 39/42] tcg: Move TCGLabelQemuLdst to tcg.c

2023-05-05 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 13 + tcg/tcg-ldst.c.inc | 14 -- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index cfd3262a4a..6f5daaee5f 100644 --- a/tcg/tcg.c +++ b

[PULL 35/42] tcg/s390x: Pass TCGType to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
We need to set this in TCGLabelQemuLdst, so plumb this all the way through from tcg_out_op. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tcg/s390x/t

[PULL 36/42] tcg/s390x: Introduce HostAddress

2023-05-05 Thread Richard Henderson
Collect the 3 potential parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 109 - 1 file changed, 60 insertions(+), 49 del

[PULL 38/42] tcg/sparc64: Pass TCGType to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
We need to set this in TCGLabelQemuLdst, so plumb this all the way through from tcg_out_op. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.in

[PULL 24/42] tcg/aarch64: Rationalize args to tcg_out_qemu_{ld,st}

2023-05-05 Thread Richard Henderson
Rename the 'ext' parameter 'data_type' to make the use clearer; pass it to tcg_out_qemu_st as well to even out the interfaces. Rename the 'otype' local 'addr_type' to make the use clearer. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 36

[PULL 29/42] tcg/loongarch64: Introduce HostAddress

2023-05-05 Thread Richard Henderson
Collect the 2 parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 55 +--- 1 file changed, 30 insertions(+), 25 deletions(-)

[PULL 00/42] tcg patch queue

2023-05-05 Thread Richard Henderson
The following changes since commit a9fe9e191b4305b88c356a1ed9ac3baf89eb18aa: Merge tag 'pull-riscv-to-apply-20230505-1' of https://github.com/alistair23/qemu into staging (2023-05-05 09:25:13 +0100) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tag

[PULL 04/42] target/Hexagon: Finish conversion to tcg_gen_qemu_{ld, st}_*

2023-05-05 Thread Richard Henderson
Convert away from the old interface with the implicit MemOp argument. Importantly, this removes some incorrect casts generated by idef-parser's gen_load(). Signed-off-by: Richard Henderson Tested-by: Taylor Simpson Reviewed-by: Taylor Simpson Reviewed-by: Anton Johansson Message-Id: <20230502

[PULL 20/42] tcg/i386: Generalize multi-part load overlap test

2023-05-05 Thread Richard Henderson
Test for both base and index; use datahi as a temporary, overwritten by the final load. Always perform the loads in ascending order, so that any (user-only) fault sees the correct address. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 31 +++ 1 fil

[PULL 08/42] target/sparc: Finish conversion to tcg_gen_qemu_{ld, st}_*

2023-05-05 Thread Richard Henderson
Convert away from the old interface with the implicit MemOp argument. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20230502135741.1158035-8-richard.hender...@linaro.org> --- target/sparc/translate.c | 43 ++-- 1 file changed, 28

[PULL 18/42] target/sparc: Remove TARGET_ALIGNED_ONLY

2023-05-05 Thread Richard Henderson
Reviewed-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- configs/targets/sparc-linux-user.mak | 1 - configs/targets/sparc-softmmu.mak | 1 - configs/targets/sparc32plus-linux-user.mak | 1 - configs/targets/sparc64-linux-user.mak | 1 - configs/targets/sparc64-softm

  1   2   3   4   >