[PATCH 1/6] host/i386: nothing looks at CPUINFO_SSE4

2024-05-31 Thread Paolo Bonzini
The only user was the SSE4.1 variant of buffer_is_zero, which has been removed; code to compute CPUINFO_SSE4 is dead. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 - util/cpuinfo-i386.c | 1 - 2 files changed, 2 deletions(-) diff --git a/host/include/i386

[PATCH 4/6] host/i386: assume presence of SSE2

2024-05-31 Thread Paolo Bonzini
QEMU now requires an x86-64-v2 host, which has SSE2. Use it freely in buffer_is_zero. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 - util/bufferiszero.c | 2 +- util/cpuinfo-i386.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-05-30 Thread Paolo Bonzini
On Thu, May 30, 2024 at 9:22 AM Philippe Mathieu-Daudé wrote: > > On 30/5/24 08:02, Paolo Bonzini wrote: > > On Wed, May 29, 2024 at 5:56 PM Philippe Mathieu-Daudé > > wrote: > >> It is pointless to build semihosting when TCG is not available. > > > > W

Re: [PATCH 2/5] qtest: use cpu interface in qtest_clock_warp

2024-05-29 Thread Paolo Bonzini
On Fri, May 17, 2024 at 12:21 AM Pierrick Bouvier wrote: > > From: Alex Bennée > > This generalises the qtest_clock_warp code to use the AccelOps > handlers for updating its own sense of time. This will make the next > patch which moves the warp code closer to pure code motion. > > From: Alex Ben

Re: [PATCH 1/5] sysemu: add set_virtual_time to accel ops

2024-05-29 Thread Paolo Bonzini
On Fri, May 17, 2024 at 12:21 AM Pierrick Bouvier wrote: > diff --git a/stubs/meson.build b/stubs/meson.build > index 3b9d42023cb..672213b7482 100644 > --- a/stubs/meson.build > +++ b/stubs/meson.build > @@ -3,6 +3,11 @@ > # below, so that it is clear who needs the stubbed functionality. > > stu

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-05-29 Thread Paolo Bonzini
On Wed, May 29, 2024 at 5:56 PM Philippe Mathieu-Daudé wrote: > It is pointless to build semihosting when TCG is not available. Why? I would have naively assumed that a suitable semihosting API could be implemented by KVM. The justification (and thus the commit message) needs to be different for

Re: [PATCH 0/3] semihosting: Restrict to TCG

2024-05-29 Thread Paolo Bonzini
On Wed, May 29, 2024 at 9:11 PM Alex Bennée wrote: > > Philippe Mathieu-Daudé writes: > > > It is pointless to build semihosting when TCG is not available. > > > > Philippe Mathieu-Daudé (3): > > target/mips: Restrict semihosting to TCG > > target/riscv: Restrict semihosting to TCG > > semi

Re: [PATCH] Issue #2294 | Machine microvm doesn't run under Xen accel for x86_64

2024-05-29 Thread Paolo Bonzini
On 5/28/24 12:23, Will Gyda wrote: Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64. Solution: microvm is now not build if only Xen is available. This does not fix the issue that microvm does not start with a Xen accelerator. I think it would be better to try an

Re: [PATCH 3/4] usb/ohci-pci: deprecate, don't build by default

2024-05-28 Thread Paolo Bonzini
On Tue, May 28, 2024 at 12:35 PM Thomas Huth wrote: > > diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig > > index 84bc7fbe36cd..c4a6ea5a687f 100644 > > --- a/hw/usb/Kconfig > > +++ b/hw/usb/Kconfig > > @@ -17,7 +17,6 @@ config USB_OHCI_SYSBUS > > > > config USB_OHCI_PCI > > bool > > -defa

[RFC PATCH v2 2/5] meson: move block.syms dependency out of libblock

2024-05-27 Thread Paolo Bonzini
dd the link_args and link_depends to the executables directly; fortunately there is just four of them. It is possible (and I will look into it) to add "link_depends" to declare_dependency(), but it probably will be a while before QEMU can use it. Signed-off-by: Paolo Bonzini --- meson.build

[RFC PATCH v2 0/5] meson: Pass objects to declare_dependency()

2024-05-27 Thread Paolo Bonzini
move the .fa suffixes. This series can be evaluated independently from that. Paolo Akihiko Odaki (2): meson: Pass objects and dependencies to declare_dependency() Revert "meson: Propagate gnutls dependency" Paolo Bonzini (3): meson: move shared_module() calls where module

[RFC PATCH v2 3/5] meson: Pass objects and dependencies to declare_dependency()

2024-05-27 Thread Paolo Bonzini
pendencies can be added as well so that they are propagated, because object files on the linker command line are always deduplicated. This requires Meson 1.1.0 or later. Signed-off-by: Akihiko Odaki Message-ID: <20240524-objects-v1-1-07cbbe961...@daynix.com> Signed-off

[RFC PATCH v2 1/5] meson: move shared_module() calls where modules are already walked

2024-05-27 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 63866071445..92ddbd17c32 100644 --- a/meson.build +++ b/meson.build @@ -3562,21 +3562,28 @@ modinfo_files

[RFC PATCH v2 4/5] Revert "meson: Propagate gnutls dependency"

2024-05-27 Thread Paolo Bonzini
. Signed-off-by: Akihiko Odaki Message-ID: <20240524-objects-v1-2-07cbbe961...@daynix.com> Signed-off-by: Paolo Bonzini --- meson.build| 4 ++-- block/meson.build | 2 +- io/meson.build | 2 +- storage-daemon/meson.build | 2 +- ui/meson.build

[RFC PATCH v2 5/5] meson: Drop the .fa library suffix

2024-05-27 Thread Paolo Bonzini
ree-wide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki Message-ID: <20240524-xkb-v4-4-2de564e5c...@daynix.com> Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 5 - meson.build | 17 ++---

[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 b

[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
s non-dirty and gen_eob will not overwrite the CC_OP_EFLAGS value that is placed there by the helper. But let's clean it up. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/targe

[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 --- target/i386/tcg

[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 |

[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
gned-off-by: Paolo Bonzini --- configure | 7 ++- meson.build | 7 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 38ee2577013..4d01a42ba65 100755 --- a/configure +++ b/configure @@ -512,10 +512,7 @@ case "$cpu" in cpu="x86

[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 deletions

[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 --- a/block

[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 b/target/i386/tcg

[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

[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 insert

[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 --- a/tcg

[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 deletions

[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 b/target/i386/

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

2024-05-25 Thread Paolo Bonzini
which case cc_op would not be overwritten * anyway the cost is probably dwarfed by that of computing flags. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 8 target/i386/tcg/fpu_helper.c | 2 ++ target/i386/tcg/int_helper.c | 13

[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 insertion

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

2024-05-25 Thread Paolo Bonzini
c cleanups Artyom Kunakovsky (1): configure: move -mcx16 flag out of CPU_CFLAGS Paolo Bonzini (23): target/i386: disable jmp_opt if EFLAGS.RF is 1 target/i386: no single-step exception after MOV or POP SS target/i386: cleanup eob handling of RSM t

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); > > } > >

[PATCH 2/5] meson: remove unnecessary dependency

2024-05-24 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

[PATCH 1/5] meson: remove unnecessary reference to libm

2024-05-24 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 --- a/block

[PATCH 4/5] meson: do not query modules before they are processed

2024-05-24 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

[PATCH 5/5] migration: remove unnecessary zlib dependency

2024-05-24 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 b

[PATCH 3/5] tcg: include dependencies in static_library()

2024-05-24 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 --- a/tcg

[PATCH 0/5] meson: small cleanups

2024-05-24 Thread Paolo Bonzini
All found while looking at Akihiko's issues with declare_dependency( objects: ...). https://patchew.org/QEMU/20240524-objects-v1-0-07cbbe961...@daynix.com/ Paolo Bonzini (5): meson: remove unnecessary reference to libm meson: remove unnecessary dependency tcg: include dependenci

Re: [RFC PATCH 1/4] target/riscv/kvm: add software breakpoints support

2024-05-24 Thread Paolo Bonzini
On Tue, Apr 16, 2024 at 11:23 AM Daniel Henrique Barboza wrote: > > +int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint > > *bp, > > + vaddr len) > > +{ > > +if (len != 4 && len != 2) { > > +return -EINVAL; > > +} > > I wonder

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

2024-05-24 Thread Paolo Bonzini
Using DISAS_NORETURN does not process any of HF_INHIBIT_IRQ_MASK, HF_RF_MASK or HF_TF_MASK. Never use it, instead there is DISAS_EOB_ONLY. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 18 -- target/i386/tcg/emit.c.inc | 4 ++-- 2

[PATCH] target/i386: disable jmp_opt if EFLAGS.RF is 1

2024-05-24 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 Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [PATCH 03/16] target/i386: document and group DISAS_* constants

2024-05-24 Thread Paolo Bonzini
On Fri, May 24, 2024 at 5:13 PM Richard Henderson wrote: > > On 5/24/24 08:04, Paolo Bonzini wrote: > > ... and nope, it's the other way round - DISAS_NORETURN is a bug > > waiting to happen for x86 translation because it doesn't process any > > of HF_INHIBIT_

Re: [PATCH 03/16] target/i386: document and group DISAS_* constants

2024-05-24 Thread Paolo Bonzini
On Fri, May 24, 2024 at 5:02 PM Paolo Bonzini wrote: > > On Fri, May 24, 2024 at 4:23 PM Richard Henderson > wrote: > > > > On 5/24/24 01:10, Paolo Bonzini wrote: > > > Place DISAS_* constants that update cpu_eip first, and > > > the "jump" on

Re: [PATCH 03/16] target/i386: document and group DISAS_* constants

2024-05-24 Thread Paolo Bonzini
On Fri, May 24, 2024 at 4:23 PM Richard Henderson wrote: > > On 5/24/24 01:10, Paolo Bonzini wrote: > > Place DISAS_* constants that update cpu_eip first, and > > the "jump" ones last. Add comments explaining the differences > > and usage. &g

Re: [PATCH RFC 0/2] meson: Pass objects to declare_dependency()

2024-05-24 Thread Paolo Bonzini
On Fri, May 24, 2024 at 10:00 AM Akihiko Odaki wrote: > > Based-on: <20240524-xkb-v4-0-2de564e5c...@daynix.com> > ("[PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1") > > This is changes suggested by Paolo Bonzini at: > https://lore.kernel.org/all/C

[PATCH 13/16] target/i386: clean up repeated string operations

2024-05-24 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. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 22 -- target/i386/tcg/emit.c.inc | 22 +- 2 fi

[PATCH 16/16] target/i386: set CC_OP in helpers if they want CC_OP_EFLAGS

2024-05-24 Thread Paolo Bonzini
which case the spilling of cc_op would be there anyway * even in other cases, the cost is probably dwarfed by that of computing flags. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 8 target/i386/tcg/fpu_helper.c | 2 ++ target/i386/tcg/int_helper.c | 13

[PATCH 07/16] target/i386: raze the gen_eob* jungle

2024-05-24 Thread Paolo Bonzini
Make gen_eob take the DISAS_* constant as an argument, so that it is not necessary to have wrappers around it. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 60 + 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/target/i386/tcg

[PATCH 10/16] target/i386: inline gen_add_A0_ds_seg

2024-05-24 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. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 9 + target/i386/tcg/emit.c.inc | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a

[PATCH 04/16] target/i386: avoid calling gen_eob_syscall before tb_stop

2024-05-24 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. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/target/i386

[PATCH 02/16] target/i386: cleanup eob handling of RSM

2024-05-24 Thread Paolo Bonzini
s non-dirty and gen_eob will not overwrite the CC_OP_EFLAGS value that is placed there by the helper. But let's clean it up. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/targe

[PATCH 08/16] target/i386: reg in gen_ldst_modrm is always OR_TMP0

2024-05-24 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. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 33 - 1 file changed, 12 insertions(+), 21

[PATCH 09/16] target/i386: split gen_ldst_modrm for load and store

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

[PATCH 12/16] target/i386: introduce gen_lea_ss_ofs

2024-05-24 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(). Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 51

[PATCH 11/16] target/i386: use mo_stacksize more

2024-05-24 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). Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386

[PATCH 05/16] target/i386: avoid calling gen_eob_inhibit_irq before tb_stop

2024-05-24 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. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 - target/i386/tcg/emit.c.inc | 4 +--- 2 files changed, 1 insertion(+), 16 deletions

[PATCH 03/16] target/i386: document and group DISAS_* constants

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

[PATCH 14/16] target/i386: remove aflag argument of gen_lea_v_seg

2024-05-24 Thread Paolo Bonzini
It is always s->aflag. 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 b/target/i386/tcg/translate.c index 18d8c0de

[PATCH 15/16] target/i386: cpu_load_eflags already sets cc_op

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

[PATCH 00/16] target/i386/tcg: translation cleanups

2024-05-24 Thread Paolo Bonzini
Some cleanups in translate.c, which I could make now that the it's smaller and it's easier to understand how the various utility functions are used. 1-7: cleanups for gen_eob 8-14: inlining and removing macros 15-16: cleanups for cc_op vs. helpers Paolo Paolo Bonzini (16): t

[PATCH 06/16] target/i386: assert that gen_update_eip_cur and gen_update_eip_next are the same in tb_stop

2024-05-24 Thread Paolo Bonzini
This is an invariant, since these cases of tb_stop() should only be reached through the "instruction decoding completed" path of i386_tr_translate_insn(). Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targe

[PATCH 01/16] target/i386: remove unnecessary gen_update_cc_op before gen_eob*

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

Re: [PATCH v2] meson.build: add -mcx16 flag for x86_64 host

2024-05-24 Thread Paolo Bonzini
mail.com> [rewrite commit message, remove from configure. - Paolo] Signed-off-by: Paolo Bonzini diff --git a/configure b/configure index 38ee2577013..4d01a42ba65 100755 --- a/configure +++ b/configure @@ -512,10 +512,7 @@ case "$cpu" in cpu="x86_64" host_arch=x86_64

[PULL 16/23] i386: Support module_id in X86CPUTopoIDs

2024-05-23 Thread Paolo Bonzini
ed-off-by: Zhuocheng Ding Co-developed-by: Zhuocheng Ding Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-16-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- include/hw/i386/topology.h | 17 + hw/i386/x86-common.c | 27 ++

[PULL 17/23] i386/cpu: Introduce module-id to X86CPU

2024-05-23 Thread Paolo Bonzini
-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-17-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 1 + hw/i386/x86-common.c | 33 + target/i386/cpu.c| 2 ++ 3 files changed, 28 insertions(+), 8 del

[PULL 15/23] i386: Expose module level in CPUID[0x1F]

2024-05-23 Thread Paolo Bonzini
1 modules. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-15-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- include/hw/i386/topology.h | 6 -- target/i386/cpu.h | 1 + hw/i386/x86-common.c | 2 +- t

[PULL 19/23] hw/i386/pc: Support smp.modules for x86 PC machine

2024-05-23 Thread Paolo Bonzini
bu Moger Message-ID: <20240424154929.1487382-19-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc.c| 1 + qemu-options.hx | 18 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6126bfdd2a7..7b638da7aaa

[PULL 14/23] i386: Support modules_per_die in X86CPUTopoInfo

2024-05-23 Thread Paolo Bonzini
Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-14-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- include/hw/i386/topology.h | 22 +++ hw/i386/x86.c | 9 +++- target/i386/cpu.c

[PULL 07/23] i386/cpu: Use APIC ID info to encode cache topo in CPUID[4]

2024-05-23 Thread Paolo Bonzini
d-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-7-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 50 +-- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git

[PULL 20/23] i386: Add cache topology info in CPUCacheInfo

2024-05-23 Thread Paolo Bonzini
CPUCacheInfo.share_level. Signed-off-by: Zhao Liu Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Message-ID: <20240424154929.1487382-20-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 7 +++ target/i386/cpu.

[PULL 13/23] i386: Introduce module level cpu topology to CPUX86State

2024-05-23 Thread Paolo Bonzini
Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-13-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 3 +++ hw/i386/x86-common.c | 5 + target/i386/cpu.c| 1 + 3 files chang

[PULL 05/23] target/i386: add control bits support for LAM

2024-05-23 Thread Paolo Bonzini
uo Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu Message-ID: <20240112060042.19925-3-binbin...@linux.intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 7 ++- target/i386/helper.c | 4 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.

[PULL 21/23] i386/cpu: Use CPUCacheInfo.share_level to encode CPUID[4]

2024-05-23 Thread Paolo Bonzini
, wrap the encoding of CPUID[4].EAX[bits 31:26] into a helper to make the code cleaner. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Message-ID: <20240424154929.1487382-21-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.

[PULL 18/23] tests: Add test case of APIC ID for module level parsing

2024-05-23 Thread Paolo Bonzini
S. Tsirkin Message-ID: <20240424154929.1487382-18-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- tests/unit/test-x86-topo.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/unit/test-x86-topo.c b/tests/unit/test-x86-topo.c index f21b8a5d

[PULL 23/23] target-i386: hyper-v: Correct kvm_hv_handle_exit return value

2024-05-23 Thread Paolo Bonzini
: 267e071bd6d6 (“hyperv: make overlay pages for SynIC”) Suggested-by: Chao Gao Signed-off-by: Dongsheng Zhang Message-ID: <20240521200114.11588-1-dongsheng.x.zh...@intel.com> Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/kvm/hyperv.c | 2 +- 1 file changed, 1 inse

[PULL 01/23] target/i386: generate simpler code for ROL/ROR with immediate count

2024-05-23 Thread Paolo Bonzini
. gen_RCL and gen_RCR use a conditional branch to skip the computation if count is zero, so they can pass false unconditionally to gen_rot_overflow. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson Message-ID: <20240522123914.608516-1-pbonz...@redhat.com> Signed-off-by: Paolo Bonz

[PULL 08/23] i386/cpu: Use APIC ID info get NumSharingCache for CPUID[0x8000001D].EAX[bits 25:14]

2024-05-23 Thread Paolo Bonzini
APM, vol.3, appendix.E.4.15 Function 8000_001Dh--Cache Topology Information Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Reviewed-by: Babu Moger Tested-by: Babu Moger Reviewed-by: Xiaoyao Li Message-ID: <20240424154929.1487382-8-zhao1....@intel.com> Signed-off-by: Paolo Bo

[PULL 22/23] i386/cpu: Use CPUCacheInfo.share_level to encode CPUID[0x8000001D].EAX[bits 25:14]

2024-05-23 Thread Paolo Bonzini
level to be encoded into CPUID[0x801D].EAX[bits 25:14]. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Babu Moger Message-ID: <20240424154929.1487382-22-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 10 +- 1 file c

[PULL 03/23] hw/i386/pc_sysfw: Alias rather than copy isa-bios region

2024-05-23 Thread Paolo Bonzini
uot;system.flash0" memory region only appears standalone when "isa-bios" is an alias. Signed-off-by: Bernhard Beschow Message-ID: <20240508175507.22270-7-shen...@gmail.com> Signed-off-by: Paolo Bonzini --- include/hw/i386/pc.h | 1 + hw/i386/pc.c | 1 + hw/i386/pc_piix.c

[PULL 11/23] i386: Split topology types of CPUID[0x1F] from the definitions of CPUID[0xB]

2024-05-23 Thread Paolo Bonzini
lippe Mathieu-Daudé Tested-by: Babu Moger Message-ID: <20240424154929.1487382-11-zhao1@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 13 + target/i386/cpu.c | 14 +++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/target/i386/cpu

[PULL 12/23] i386/cpu: Decouple CPUID[0x1F] subleaf with specific topology level

2024-05-23 Thread Paolo Bonzini
CPUID[0x1F] subleaf with specific topology level. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Xiaoyao Li Message-ID: <20240424154929.1487382-12-zhao1....@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 135 +++

[PULL 10/23] i386/cpu: Introduce bitmap to cache available CPU topology levels

2024-05-23 Thread Paolo Bonzini
ology details. This is also in preparation for the follow-up to decouple CPUID[0x1F] subleaf with specific topology level. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Xiaoyao Li Message-ID: <20240424154929.1487382-10-zhao1@intel.com> Signed-of

[PULL 09/23] i386/cpu: Consolidate the use of topo_info in cpu_x86_cpuid()

2024-05-23 Thread Paolo Bonzini
ested-by: Robert Hoo Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Reviewed-by: Xiaoyao Li Reviewed-by: Philippe Mathieu-Daudé Tested-by: Babu Moger Message-ID: <20240424154929.1487382-9-zhao1....@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 31 ++---

[PULL 00/23] i386 changes for 2024-05-23

2024-05-23 Thread Paolo Bonzini
turn value Bernhard Beschow (1): hw/i386/pc_sysfw: Alias rather than copy isa-bios region Binbin Wu (1): target/i386: add control bits support for LAM Paolo Bonzini (2): target/i386: generate simpler code for ROL/ROR with immediate count target/i386: clean up AAM/AAD

[PULL 06/23] i386/cpu: Fix i/d-cache topology to core level for Intel CPU

2024-05-23 Thread Paolo Bonzini
lt;20240424154929.1487382-6-zhao1@intel.com> [Add compat property. - Paolo] Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 1 + target/i386/cpu.c | 6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4a2d6f5a97f..6126bfdd2a7 100644 --- a/hw/i

[PULL 04/23] target/i386: add support for LAM in CPUID enumeration

2024-05-23 Thread Paolo Bonzini
y: Xiaoyao Li Reviewed-by: Zhao Liu Message-ID: <20240112060042.19925-2-binbin...@linux.intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 ++ target/i386/cpu.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h i

[PULL 02/23] target/i386: clean up AAM/AAD

2024-05-23 Thread Paolo Bonzini
t;regs[R_EAX] that generic load/writeback code already does. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson Message-ID: <20240522123912.608497-1-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/helper.h | 4 ++-- target/i386/tcg/int_helpe

Re: [PATCH] meson.build: add -mcx16 flag

2024-05-23 Thread Paolo Bonzini
On 5/22/24 21:30, Artyom Kunakovsky wrote: fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command Signed-off-by: Artyom Kunakovsky --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build

Re: [PATCH v3 3/3] meson: Drop the .fa library prefix

2024-05-22 Thread Paolo Bonzini
On Wed, May 22, 2024 at 3:45 PM Paolo Bonzini wrote: > > On Wed, May 22, 2024 at 12:49 PM Akihiko Odaki > wrote: > > The non-standard .fa library prefix breaks the link source > > de-duplication done by Meson so drop it. > > Can you show the difference in the command

Re: [PATCH v3 3/3] meson: Drop the .fa library prefix

2024-05-22 Thread Paolo Bonzini
On Wed, May 22, 2024 at 12:49 PM Akihiko Odaki wrote: > The non-standard .fa library prefix breaks the link source > de-duplication done by Meson so drop it. Can you show the difference in the command lines? One possibility to force de-duplication of objects is to change "link_whole: foo" to "ob

[PATCH] target/i386: generate simpler code for ROL/ROR with immediate count

2024-05-22 Thread Paolo Bonzini
. gen_RCL and gen_RCR use a conditional branch to skip the computation if count is zero, so they can pass false unconditionally to gen_rot_overflow. Signed-off-by: Paolo Bonzini --- target/i386/tcg/emit.c.inc | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) di

<    7   8   9   10   11   12   13   14   15   16   >