Re: [PULL 00/24] Build system and target/i386/translate.c cleanups for 2025-05-25

2024-05-25 Thread Richard Henderson
On 5/25/24 04:33, Paolo Bonzini wrote: The following changes since commit 70581940cabcc51b329652becddfbc6a261b1b83: Merge tag 'pull-tcg-20240523' ofhttps://gitlab.com/rth7680/qemu into staging (2024-05-23 09:47:40 -0700) are available in the Git repository at:

Re: [PATCH 0/6] target/riscv: Support Zabha extension

2024-05-25 Thread LIU Zhiwei
On 2024/5/24 19:44, Daniel Henrique Barboza wrote: Hi Zhiwei! On 5/23/24 09:40, LIU Zhiwei wrote: Zabha adds support AMO operations for byte and half word. If zacas has been implemented, zabha also adds support amocas.b and amocas.h. More details is on the specification here:

Re: [PATCH 1/4] target/riscv: Add zimop extension

2024-05-25 Thread LIU Zhiwei
Hi Daniel, On 2024/5/24 17:46, Daniel Henrique Barboza wrote: On 5/22/24 03:29, LIU Zhiwei wrote: Zimop extension defines an encoding space for 40 MOPs.The Zimop extension defines 32 MOP instructions named MOP.R.n, where n is an integer between 0 and 31, inclusive. The Zimop extension

Re: [PULL 17/20] target/arm: Do memory type alignment check when translation disabled

2024-05-25 Thread Bernhard Beschow
Am 25. Mai 2024 13:41:54 UTC schrieb Bernhard Beschow : > > >Am 5. März 2024 13:52:34 UTC schrieb Peter Maydell : >>From: Richard Henderson >> >>If translation is disabled, the default memory type is Device, which >>requires alignment checking. This is more optimally done early via >>the

Re: [PULL 17/20] target/arm: Do memory type alignment check when translation disabled

2024-05-25 Thread Bernhard Beschow
Am 5. März 2024 13:52:34 UTC schrieb Peter Maydell : >From: Richard Henderson > >If translation is disabled, the default memory type is Device, which >requires alignment checking. This is more optimally done early via >the MemOp given to the TCG memory operation. > >Reviewed-by: Philippe

[RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state

2024-05-25 Thread Nicholas Piggin
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via s390_cpu_set_psw and expects the interrupt to wake it. However when the

[RFC PATCH 3/3] tests/qtest/migration-test: Enable test_ignore_shared

2024-05-25 Thread Nicholas Piggin
This was said to be broken on aarch64, but if it works on others, let's try enable it. It's already starting to bitrot... Cc: Yury Kotov Cc: Dr. David Alan Gilbert Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 13 - 1 file changed, 8 insertions(+), 5

[RFC PATCH 0/3] Fix s390x flic migration and add some more qtests

2024-05-25 Thread Nicholas Piggin
I don't know s390x enough to know if this is the right fix, but I could debug the migration hangs this far at least (and the patch fixes the condition that would previously result in a hang on the qtest). Also we could enable the test_ignore_shared test that seems to work on s390x and ppc64 at

[RFC PATCH 2/3] tests/qtest/migration-test: enable on s390x

2024-05-25 Thread Nicholas Piggin
s390x is more stable now. Enable it. Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 12 1 file changed, 12 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 94d5057857..7987faaded 100644 ---

[PULL 24/24] migration: remove unnecessary zlib dependency

2024-05-25 Thread Paolo Bonzini
zlib code is only used by the emulators, not by the tests. Signed-off-by: Paolo Bonzini --- meson.build | 2 +- migration/dirtyrate.c | 1 - migration/qemu-file.c | 1 - migration/meson.build | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/meson.build

[PULL 13/24] target/i386: reg in gen_ldst_modrm is always OR_TMP0

2024-05-25 Thread Paolo Bonzini
Values other than OR_TMP0 were only ever used by MOV and MOVNTI opcodes. Now that these have been converted to the new decoder, remove the argument. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 33 - 1 file

[PULL 06/24] target/i386: cpu_load_eflags already sets cc_op

2024-05-25 Thread Paolo Bonzini
No need to set it again at the end of the translation block, cc_op_dirty can be set to false. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 37 - target/i386/tcg/emit.c.inc | 2 +- 2 files changed, 25

[PULL 21/24] meson: remove unnecessary dependency

2024-05-25 Thread Paolo Bonzini
The dbus_display1_dep is not really used since all occurrences also request gio independently. Just list the generated sources and drop dbus_display1_dep. Signed-off-by: Paolo Bonzini --- audio/meson.build | 4 ++-- tests/qtest/meson.build | 2 +- ui/meson.build | 5 ++--- 3

[PULL 04/24] target/i386: cleanup eob handling of RSM

2024-05-25 Thread Paolo Bonzini
gen_helper_rsm cannot generate an exception, and reloads the flags. So there's no need to spill cc_op and update cpu_eip, but on the other hand cc_op must be reset to CC_OP_EFLAGS before returning. It all works by chance, because by spilling cc_op before the call to the helper, it becomes

[PULL 10/24] target/i386: avoid calling gen_eob_inhibit_irq before tb_stop

2024-05-25 Thread Paolo Bonzini
sti only has one exit, so it does not need to generate the end-of-translation code inline. It can be deferred to tb_stop. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 - target/i386/tcg/emit.c.inc | 4 +--- 2 files changed, 1

[PULL 17/24] target/i386: introduce gen_lea_ss_ofs

2024-05-25 Thread Paolo Bonzini
Generalize gen_stack_A0() to include an initial add and to use an arbitrary destination. This is a common pattern and it is not a huge burden to add the extra arguments to the only caller of gen_stack_A0(). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini ---

[PULL 18/24] target/i386: clean up repeated string operations

2024-05-25 Thread Paolo Bonzini
Do not bother generating inline wrappers for gen_repz and gen_repz2; use s->prefix to separate REPZ from REPNZ in the case of SCAS and CMPS. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 22 -- target/i386/tcg/emit.c.inc | 22

[PULL 16/24] target/i386: use mo_stacksize more

2024-05-25 Thread Paolo Bonzini
Use mo_stacksize for all stack accesses, including when a 64-bit code segment is impossible and the code is therefore checking only for SS32(s). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 8 1 file changed, 4 insertions(+), 4

[PULL 01/24] configure: move -mcx16 flag out of CPU_CFLAGS

2024-05-25 Thread Paolo Bonzini
From: Artyom Kunakovsky The point of CPU_CFLAGS is really just to select the appropriate multilib, for example for library linking tests, and -mcx16 is not needed for that purpose. Furthermore, if -mcx16 is part of QEMU's choice of a basic x86_64 instruction set, it should be applied to

[PULL 14/24] target/i386: split gen_ldst_modrm for load and store

2024-05-25 Thread Paolo Bonzini
The is_store argument of gen_ldst_modrm has only ever been passed a constant. Just split the function in two. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 52 + 1 file changed, 29 insertions(+), 23

[PULL 20/24] meson: remove unnecessary reference to libm

2024-05-25 Thread Paolo Bonzini
libm is linked into all targets via libqemuutil, no need to specify it explicitly. Signed-off-by: Paolo Bonzini --- block/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/meson.build b/block/meson.build index e1f03fd773e..8993055c75e 100644 ---

[PULL 05/24] target/i386: remove unnecessary gen_update_cc_op before gen_eob*

2024-05-25 Thread Paolo Bonzini
This is already handled in gen_eob(). Before adding another DISAS_* case, remove the double calls. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/tcg/translate.c

[PULL 23/24] meson: do not query modules before they are processed

2024-05-25 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/meson.build b/block/meson.build index 8993055c75e..158dc3b89db 100644 --- a/block/meson.build +++ b/block/meson.build @@ -119,7 +119,7 @@ foreach m : [ module_ss =

[PULL 03/24] target/i386: no single-step exception after MOV or POP SS

2024-05-25 Thread Paolo Bonzini
Intel SDM 18.3.1.4 "If an occurrence of the MOV or POP instruction loads the SS register executes with EFLAGS.TF = 1, no single-step debug exception occurs following the MOV or POP instruction." Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- 1

[PULL 08/24] target/i386: document and group DISAS_* constants

2024-05-25 Thread Paolo Bonzini
Place DISAS_* constants that update cpu_eip first, and the "jump" ones last. Add comments explaining the differences and usage. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 25 ++--- 1 file changed, 22 insertions(+), 3

[PULL 22/24] tcg: include dependencies in static_library()

2024-05-25 Thread Paolo Bonzini
This ensures that for example libffi can be reached even if it is not in /usr/include. Signed-off-by: Paolo Bonzini --- tcg/meson.build | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/meson.build b/tcg/meson.build index 8251589fd4e..ffbe754d8b3 100644 ---

[PULL 11/24] target/i386: assert that gen_update_eip_cur and gen_update_eip_next are the same in tb_stop

2024-05-25 Thread Paolo Bonzini
This is an invariant now that there are no calls to gen_eob_inhibit_irq() outside tb_stop. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c

[PULL 12/24] target/i386: raze the gen_eob* jungle

2024-05-25 Thread Paolo Bonzini
Make gen_eob take the DISAS_* constant as an argument, so that it is not necessary to have wrappers around it. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 62 + 1 file changed, 15 insertions(+), 47

[PULL 15/24] target/i386: inline gen_add_A0_ds_seg

2024-05-25 Thread Paolo Bonzini
It is only used in MONITOR, where a direct call of gen_lea_v_seg is simpler, and in XLAT. Inline it in the latter. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 9 + target/i386/tcg/emit.c.inc | 2 +- 2 files changed, 2 insertions(+), 9

[PULL 19/24] target/i386: remove aflag argument of gen_lea_v_seg

2024-05-25 Thread Paolo Bonzini
It is always s->aflag. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 20 ++-- target/i386/tcg/emit.c.inc | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/target/i386/tcg/translate.c

[PULL 07/24] target/i386: set CC_OP in helpers if they want CC_OP_EFLAGS

2024-05-25 Thread Paolo Bonzini
Mark cc_op as clean and do not spill it at the end of the translation block. Technically this is a tiny bit less efficient, but: * it results in translations that are a tiny bit smaller * for most of these instructions, it is not unlikely that they are close to the end of the basic block, in

[PULL 09/24] target/i386: avoid calling gen_eob_syscall before tb_stop

2024-05-25 Thread Paolo Bonzini
syscall and sysret only have one exit, so they do not need to generate the end-of-translation code inline. It can be deferred to tb_stop. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 +++-- 1 file changed, 11 insertions(+), 2

[PULL 02/24] target/i386: disable jmp_opt if EFLAGS.RF is 1

2024-05-25 Thread Paolo Bonzini
If EFLAGS.RF is 1, special processing in gen_eob_worker() is needed and therefore goto_tb cannot be used. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- 1 file changed, 1

[PULL 00/24] Build system and target/i386/translate.c cleanups for 2025-05-25

2024-05-25 Thread Paolo Bonzini
The following changes since commit 70581940cabcc51b329652becddfbc6a261b1b83: Merge tag 'pull-tcg-20240523' of https://gitlab.com/rth7680/qemu into staging (2024-05-23 09:47:40 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to

Re: [PATCH] target/i386: always go through gen_eob*()

2024-05-25 Thread Paolo Bonzini
On Fri, May 24, 2024 at 6:51 PM Richard Henderson wrote: > > static void gen_set_hflag(DisasContext *s, uint32_t mask) > > @@ -2354,7 +2354,7 @@ static void gen_jmp_rel(DisasContext *s, MemOp ot, > > int diff, int tb_num) > > tcg_gen_movi_tl(cpu_eip, new_eip); > > } > >

Re: [PATCH 2/2] scsi-disk: Fix crash for VM configured with USB CDROM after live migration

2024-05-25 Thread Prasad Pandit
Hi, On Fri, 24 May 2024 at 16:23, Yong Huang wrote: > I'm not testing the latest QEMU version while theoretically it is > reproducible, I'll check it and give a conclusion. * Yes, that'll help. Thank you. > I'm not sure this usage is common but in our production environment, it is > used. *

Re: [PATCH v2 01/18] migration: Fix file migration with fdset

2024-05-25 Thread Prasad Pandit
On Fri, 24 May 2024 at 18:00, Fabiano Rosas wrote: > That's the point. If offset==0 we truncate all the way, if not, we truncate > to the offset. * Yes, I was wondering if the migration file has some data, but still 'offset' ends up being zero(0). If that's unlikely to happen, then we are good.