[PULL 12/27] s390x: select correct components for no-board build

2024-05-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Message-ID: <20240509170044.190795-5-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 4 ++-- target/s390x/Kconfig | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitla

[PULL 16/27] i386: correctly select code in hw/i386 that depends on other components

2024-05-12 Thread Paolo Bonzini
fw_cfg.c and vapic.c are currently included unconditionally but depend on other components. vapic.c depends on the local APIC, while fw_cfg.c includes a piece of AML builder code that depends on CONFIG_ACPI. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu Message-ID: <20240509170044.190

[PULL 22/27] meson: pick libfdt from common_ss when building target-specific files

2024-05-12 Thread Paolo Bonzini
Avoid having to list dependencies such as libfdt twice, both on common_ss and specific_ss. Instead, just take all the dependencies in common_ss and allow the target-specific libqemu-*.fa library to use them. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- meson.build

[PULL 09/27] s390x: move s390_cpu_addr2state to target/s390x/sigp.c

2024-05-12 Thread Paolo Bonzini
it to sigp.c for simplicity. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Message-ID: <20240509170044.190795-2-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/s390x/s390-virtio-ccw.c | 16 target/s390x/sigp.c| 17 + 2 files chang

[PULL 25/27] kconfig: express dependency of individual boards on libfdt

2024-05-12 Thread Paolo Bonzini
can express whether it needs FDT. It can then include the common code in the build via "select DEVICE_TREE", which will also as tell meson to link with libfdt. This allows building non-microvm x86 emulators without having libfdt available. Reviewed-by: Philippe Mathieu-Daudé

[PULL 18/27] hw/i386: split x86.c in multiple parts

2024-05-12 Thread Paolo Bonzini
Keep the basic X86MachineState definition in x86.c. Move out functions that are only needed by other files: x86-common.c for the pc and microvm machines, x86-cpu.c for those used by accelerator code. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu Message-ID: <20240509170044.190795-11-pb

[PULL 23/27] meson: move libfdt together with other dependencies

2024-05-12 Thread Paolo Bonzini
-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- meson.build | 79 ++--- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/meson.build b/meson.build index ab1f44b25c2..dd4a28f8f8f 100644 --- a/meson.build +++ b/meson.build

[PULL 07/27] configure: quote -D options that are passed through to meson

2024-05-12 Thread Paolo Bonzini
, a somewhat realistic failure case would be with -Dpkg_config_path and a pkg-config directory that contains spaces. Cc: qemu-sta...@nongnu.org Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index

[PULL 14/27] xen: initialize legacy backends from xen_bus_init()

2024-05-12 Thread Paolo Bonzini
everything is ready at the time the xen_backend_init() functions are called, remove the xen_be_init() function from all the boards and place it directly in xen_bus_init(). Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240509170044.190795-7-pbonz...@redhat.com> Sign

[PULL 17/27] i386: pc: remove unnecessary MachineClass overrides

2024-05-12 Thread Paolo Bonzini
There is no need to override these fields of MachineClass because they are already set to the right value in the superclass. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu Message-ID: <20240509170044.190795-10-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/i386/x86

[PULL 11/27] s390: move css_migration_enabled from machine to css.c

2024-05-12 Thread Paolo Bonzini
The CSS subsystem uses global variables, just face the truth and use a variable also for whether the CSS vmstate is in use; remove the indirection of fetching it from the machine type, which makes the TCG code depend unnecessarily on the virtio-ccw machine. Signed-off-by: Paolo Bonzini Message

[PULL 13/27] tests/qtest: s390x: fix operation in a build without any boards or devices

2024-05-12 Thread Paolo Bonzini
the memo; plus another one does not need a machine at all and can be run with -M none. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Message-ID: <20240509170044.190795-6-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- tests/qtest/drive_del-test.c | 7 ++- 1 file chan

[PULL 19/27] hw/i386: move rtc-reset-reinjection command out of hw/rtc

2024-05-12 Thread Paolo Bonzini
tracking of all created RTC devices. Move the implementation to hw/i386, so that 1) it is available even if no RTC device exist 2) the only RTC that exists is easily found in x86ms->rtc. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu Message-ID: <20240509170044.190795-12-pbonz...@redh

[PULL 04/27] target/i386: move prefetch and multi-byte UD/NOP to new decoder

2024-05-12 Thread Paolo Bonzini
Henderson Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 1 + target/i386/tcg/translate.c | 30 -- target/i386/tcg/decode-new.c.inc | 24 +--- target/i386/tcg/emit.c.inc | 5 + 4 files changed

Re: [PATCH 03/13] s390: move css_migration_enabled from machine to css.c

2024-05-10 Thread Paolo Bonzini
On Fri, May 10, 2024 at 7:38 AM Thomas Huth wrote: > I think this is wrong: By adding this to ccw_machine_2_9_class_options the > variable now always gets set to false, even for newer machines, since the > *class_options functions are part of the "class_init" which is always done. > You have to

[PATCH 13/13] tests/qtest: arm: fix operation in a build without any boards or devices

2024-05-09 Thread Paolo Bonzini
ARM/aarch64 are easy to fix because they already have to pass a machine type by hand. Just guard the tests with a check that the machine actually exists. Signed-off-by: Paolo Bonzini --- tests/qtest/arm-cpu-features.c | 4 tests/qtest/migration-test.c | 6 ++ tests/qtest/numa-test.c

[PATCH 01/13] s390x: move s390_cpu_addr2state to target/s390x/sigp.c

2024-05-09 Thread Paolo Bonzini
it to sigp.c for simplicity. Signed-off-by: Paolo Bonzini --- hw/s390x/s390-virtio-ccw.c | 16 target/s390x/sigp.c| 17 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index

[PATCH 08/13] i386: correctly select code in hw/i386 that depends on other components

2024-05-09 Thread Paolo Bonzini
fw_cfg.c and vapic.c are currently included unconditionally but depend on other components. vapic.c depends on the local APIC, while fw_cfg.c includes a piece of AML builder code that depends on CONFIG_ACPI. Signed-off-by: Paolo Bonzini --- hw/i386/fw_cfg.c| 2 ++ hw/i386/meson.build | 2

[PATCH 12/13] i386: select correct components for no-board build

2024-05-09 Thread Paolo Bonzini
but the APIC is. Signed-off-by: Paolo Bonzini --- hw/intc/ioapic-stub.c | 29 + .gitlab-ci.d/buildtest.yml | 2 +- hw/intc/meson.build| 2 +- target/i386/Kconfig| 1 + 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 hw/intc

[PATCH 07/13] xen: register legacy backends via xen_backend_init

2024-05-09 Thread Paolo Bonzini
for the backend_register callback, whose only purpose is to avoid registering nonfunctional backends. Signed-off-by: Paolo Bonzini --- include/hw/xen/xen-legacy-backend.h | 14 ++ include/hw/xen/xen_pvdev.h | 1 - hw/9pfs/xen-9p-backend.c| 8 +++- hw/display

[PATCH 02/13] s390_flic: add migration-enabled property

2024-05-09 Thread Paolo Bonzini
Instead of mucking with css_migration_enabled(), add a property specific to the FLIC device, similar to what is done for TYPE_S390_STATTRIB. Signed-off-by: Paolo Bonzini --- include/hw/s390x/s390_flic.h | 1 + hw/intc/s390_flic.c | 6 +- hw/s390x/s390-virtio-ccw.c | 1 + 3 files

[PATCH 03/13] s390: move css_migration_enabled from machine to css.c

2024-05-09 Thread Paolo Bonzini
The CSS subsystem uses global variables, just face the truth and use a variable also for whether the CSS vmstate is in use; remove the indirection of fetching it from the machine type, which makes the TCG code depend unnecessarily on the virtio-ccw machine. Signed-off-by: Paolo Bonzini

[PATCH 06/13] xen: initialize legacy backends from xen_bus_init()

2024-05-09 Thread Paolo Bonzini
everything is ready at the time the xen_backend_init() functions are called, remove the xen_be_init() function from all the boards and place it directly in xen_bus_init(). Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 1 - hw/xen/xen-bus.c | 4 hw/xen/xen-hvm-common.c

[PATCH 00/13] fix --without-default-devices build and (mostly) tests

2024-05-09 Thread Paolo Bonzini
on vanilla upstream configs is the more pressing problem, though. Patches 6 and 7 were tested with the Avocado Xen-on-KVM tests. Paolo Paolo Bonzini (13): s390x: move s390_cpu_addr2state to target/s390x/sigp.c s390_flic: add migration-enabled property s390: move css_migration_enabled fr

[PATCH 05/13] tests/qtest: s390x: fix operation in a build without any boards or devices

2024-05-09 Thread Paolo Bonzini
the memo; plus another one does not need a machine at all and can be run with -M none. Signed-off-by: Paolo Bonzini --- tests/qtest/drive_del-test.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index

[PATCH 11/13] hw/i386: move rtc-reset-reinjection command out of hw/rtc

2024-05-09 Thread Paolo Bonzini
tracking of all created RTC devices. Move the implementation to hw/i386, so that 1) it is available even if no RTC device exist 2) the only RTC that exists is easily found in x86ms->rtc. Signed-off-by: Paolo Bonzini --- include/hw/rtc/mc146818rtc.h | 2 +- hw/i386/monitor.c|

[PATCH 10/13] hw/i386: split x86.c in multiple parts

2024-05-09 Thread Paolo Bonzini
Keep the basic X86MachineState definition in x86.c. Move out functions that are only needed by other files: x86-common.c for the pc and microvm machines, x86-cpu.c for those used by accelerator code. Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h |6 +- hw/i386/x86-common.c | 1007

[PATCH 09/13] i386: pc: remove unnecessary MachineClass overrides

2024-05-09 Thread Paolo Bonzini
There is no need to override these fields of MachineClass because they are already set to the right value in the superclass. Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h | 4 hw/i386/pc.c | 3 --- hw/i386/x86.c | 6 +++--- 3 files changed, 3 insertions(+), 10

[PATCH 04/13] s390x: select correct components for no-board build

2024-05-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 4 ++-- target/s390x/Kconfig | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 13afd0df1f0..f8502905203 100644 --- a/.gitlab-ci.d/buildtest.yml

[PATCH] target/i386: add feature dependency for XSAVE

2024-05-09 Thread Paolo Bonzini
The XSAVEOPT, XSAVEC, XGETBV1, XSAVES features make no sense if you cannot enable XSAVE in the first place. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f2ea6899e39..6f5ff71c6ee 100644

[PATCH] target/i386: fix feature dependency for WAITPKG

2024-05-09 Thread Paolo Bonzini
The VMX feature bit depends on general availability of WAITPKG, not the other way round. Fixes: 33cc88261c3 ("target/i386: add support for VMX_SECONDARY_EXEC_ENABLE_USER_WAIT_PAUSE", 2023-08-28) Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 ++

[PATCH] target/i386: move prefetch and multi-byte UD/NOP to new decoder

2024-05-09 Thread Paolo Bonzini
These are trivial to add, and moving them to the new decoder fixes some corner cases: raising #UD instead of an instruction fetch page fault for the undefined opcodes, and incorrectly rejecting 0F 18 prefetches with register operands (which are treated as reserved NOPs). Signed-off-by: Paolo

[PATCH] target/i386: fix operand size for DATA16 REX.W POPCNT

2024-05-09 Thread Paolo Bonzini
); } which prints 5//5 on real hardware and 5// on QEMU. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/target/i386/tcg/translate.c b/t

[PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt

2024-05-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-i386.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index 864c4e620d5..ce3bf74b5a8 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386

[PATCH] target/i386: rdpkru/wrpkru are no-prefix instructions

2024-05-09 Thread Paolo Bonzini
Reject 0x66/0xf3/0xf2 in front of them. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 5366dc32dd3..3da4fdf64cc

Re: [PATCH v2 6/6] hw/i386/pc_sysfw: Alias rather than copy isa-bios region

2024-05-08 Thread Paolo Bonzini
On Tue, Apr 30, 2024 at 5:39 PM Philippe Mathieu-Daudé wrote: > I'm still not convinced we need a migration back compat for this... It's absolutely needed, memory_region_init_ram(isa_bios, NULL, "isa-bios", isa_bios_size, _fatal); will register a RAM region for

[PATCH] target/i386: remove PCOMMIT from TCG, deprecate property

2024-05-08 Thread Paolo Bonzini
s versions, and deprecate the property just in case someone is using it as "pcommit=off". Signed-off-by: Paolo Bonzini --- docs/about/deprecated.rst | 8 target/i386/cpu.h | 2 -- target/i386/cpu.c | 2 +- target/i386/tcg/translate.c | 12 +---

Re: Hermetic virtio-vsock in QEMU

2024-05-08 Thread Paolo Bonzini
On Wed, May 8, 2024 at 2:51 PM Daniel P. Berrangé wrote: > Designwise, a native VSOCK backend in QEMU really should implement the > same approach defined by firecracker, so that we have interoperability > with systemd, firecracker and cloud-hypervisor. See > >

Re: Hermetic virtio-vsock in QEMU

2024-05-08 Thread Paolo Bonzini
On 5/8/24 11:38, Stefano Garzarella wrote: On Wed, May 08, 2024 at 01:13:09PM GMT, Marc-André Lureau wrote: Hi On Wed, May 8, 2024 at 11:50 AM Stefano Garzarella wrote: Hi Roman, On Tue, May 07, 2024 at 11:20:50PM GMT, Roman Kiryanov wrote: >Hi Stefano, > >On Tue, May 7, 2024 at 1:10 AM

[PATCH] virtio-blk: remove SCSI passthrough functionality

2024-05-08 Thread Paolo Bonzini
-by: Paolo Bonzini --- docs/about/deprecated.rst | 10 -- docs/about/removed-features.rst | 8 ++ hw/block/virtio-blk.c | 166 +++- hw/core/machine.c | 2 - 4 files changed, 19 insertions(+), 167 deletions(-) diff --git a/docs/about

[PATCH 5/6] hw/xtensa: require libfdt

2024-05-08 Thread Paolo Bonzini
All other boards require libfdt if it can be used (including for example i386/x86_64), so change the "imply" to "select" and always allow -dtb in qemu-system-xtensa. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/xtensa/xtfpga.c | 9 - hw

[PATCH 6/6] configs: disable emulators that require it if libfdt is not found

2024-05-08 Thread Paolo Bonzini
mentioned explicitly in --target-list, in which case the build will fail. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- configs/targets/aarch64-softmmu.mak | 1 + configs/targets/arm-softmmu.mak | 1 + configs/targets/i386-softmmu.mak | 1 - confi

[PATCH 3/6] kconfig: allow compiling out QEMU device tree code per target

2024-05-08 Thread Paolo Bonzini
Introduce a new Kconfig symbol, CONFIG_DEVICE_TREE, that specifies whether to include the common device tree code in system/device_tree.c and to link to libfdt. For now, include it unconditionally if libfdt is available. Signed-off-by: Paolo Bonzini --- meson.build | 1

[PATCH 2/6] meson: move libfdt together with other dependencies

2024-05-08 Thread Paolo Bonzini
-off-by: Paolo Bonzini --- meson.build | 79 ++--- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/meson.build b/meson.build index 7ca0ba4987f..2e7e2b15406 100644 --- a/meson.build +++ b/meson.build @@ -1858,6 +1858,34 @@ if numa.found

[PATCH 4/6] kconfig: express dependency of individual boards on libfdt

2024-05-08 Thread Paolo Bonzini
can express whether it needs FDT. It can then include the common code in the build via "select DEVICE_TREE", which will also as tell meson to link with libfdt. This allows building non-microvm x86 emulators without having libfdt available. Reviewed-by: Philippe Mathieu-Daudé

[PATCH 1/6] meson: pick libfdt from common_ss when building target-specific files

2024-05-08 Thread Paolo Bonzini
Avoid having to list dependencies such as libfdt twice, both on common_ss and specific_ss. Instead, just take all the dependencies in common_ss and allow the target-specific libqemu-*.fa library to use them. Signed-off-by: Paolo Bonzini --- meson.build | 14 +++--- hw/arm

[PATCH v2 0/6] kconfig: express dependency of individual boards on libfdt

2024-05-08 Thread Paolo Bonzini
the --without-default-features mode", 2022-02-21) - patch 6 does not - split patch 3 in two parts - fix compilation errors due to missing qmp_dumpdtb/hmp_dumpdtb - make MIPS_BOSTON depend on FDT Paolo Bonzini (6): meson: pick libfdt from common_ss when building target-specific fil

[PATCH] loongarch64: move memory map to boot.c

2024-05-07 Thread Paolo Bonzini
Ensure that it can be used even if virt.c is not included in the build, as is the case for --without-default-devices. Signed-off-by: Paolo Bonzini --- include/hw/loongarch/boot.h | 10 ++ include/hw/loongarch/virt.h | 10 -- hw/loongarch/boot.c | 3 +++ hw/loongarch

[PATCH] sh4: select correct components for no-board build

2024-05-07 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 5 +++-- hw/sh4/meson.build | 2 +- target/sh4/Kconfig | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index bab61945643..13afd0df1f0

Re: [PATCH] configure: quote -D options that are passed to meson

2024-05-07 Thread Paolo Bonzini
On Tue, May 7, 2024 at 1:58 PM Peter Maydell wrote: > > On Tue, 7 May 2024 at 11:50, Paolo Bonzini wrote: > > > > Ensure that they go through unmodified, instead of removing one layer > > of quoting. > > Do you have an example of what goes wrong that we could > m

[PULL 07/26] target/i386: pull cc_op update to callers of gen_jmp_rel{, _csize}

2024-05-07 Thread Paolo Bonzini
should have done it. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 466fee38c0e..024da6d88eb 100644 --- a/target

[PULL 02/26] target/i386: use TSTEQ/TSTNE to test low bits

2024-05-07 Thread Paolo Bonzini
a comparison against zero anyway, and it avoids shifts by 64 which are undefined behavior. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 28 target/i386/tcg/emit.c.inc | 5 ++--- 2 files changed, 22 insertions(+), 11

[PULL 23/26] target/i386: remove now-converted opcodes from old decoder

2024-05-07 Thread Paolo Bonzini
Send all converted opcodes to disas_insn_new() directly from the big decoding switch statement; once more, the debugging/bisecting logic disappears. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/helper.h| 11 - target/i386/tcg

[PULL 25/26] target/i386: split legacy decoder into a separate function

2024-05-07 Thread Paolo Bonzini
Split the bits that have some duplication with disas_insn_new, from those that should be the main topic of the conversion. This is the first step towards removing duplicate decoding of prefixes between disas_insn and disas_insn_new. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini

[PULL 13/26] target/i386: move 00-5F opcodes to new decoder

2024-05-07 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- target/i386/tcg/decode-new.c.inc | 120 ++ target/i386/tcg/emit.c.inc | 202 +++ 3 files changed, 323 insertions(+), 1 deletion(-) diff

[PULL 14/26] target/i386: extract gen_far_call/jmp, reordering temporaries

2024-05-07 Thread Paolo Bonzini
Extract the code into new functions, and swap T0/T1 so that T0 corresponds to the first immediate in the instruction stream. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 93 + 1 file changed, 53 insertions

[PULL 03/26] target/i386: use TSTEQ/TSTNE to check flags

2024-05-07 Thread Paolo Bonzini
The new conditions obviously come in handy when testing individual bits of EFLAGS, and they make it possible to remove the .mask field of CCPrepare. Lowering to shift+and is done by the optimizer if necessary. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg

[PULL 26/26] target/i386: remove duplicate prefix decoding

2024-05-07 Thread Paolo Bonzini
into i386_tr_translate_insn. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 259 +++ target/i386/tcg/decode-new.c.inc | 63 ++-- 2 files changed, 103 insertions(+), 219 deletions(-) diff --git a/target/i386/tcg

[PULL 12/26] target/i386: reintroduce debugging mechanism

2024-05-07 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 27 +++ target/i386/tcg/decode-new.c.inc | 3 +++ 2 files changed, 30 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index

[PULL 06/26] target/i386: cleanup cc_op changes for REP/REPZ/REPNZ

2024-05-07 Thread Paolo Bonzini
-dependent cc_op could be observed. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 3f1d2858fc9..466fee38c0e 100644 --- a/target/i386

[PULL 22/26] target/i386: port extensions of one-byte opcodes to new decoder

2024-05-07 Thread Paolo Bonzini
A few two-byte opcodes are simple extensions of existing one-byte opcodes; they are easy to decode and need no change to emit.c.inc. Port them to the new decoder. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 target/i386/tcg/decode

[PULL 24/26] target/i386: decode x87 instructions in a separate function

2024-05-07 Thread Paolo Bonzini
-by: Paolo Bonzini --- target/i386/tcg/translate.c | 1120 ++- 1 file changed, 566 insertions(+), 554 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index f4e5843d5f5..973bf07ef27 100644 --- a/target/i386/tcg/translate.c +++ b/target

[PULL 15/26] target/i386: allow instructions with more than one immediate

2024-05-07 Thread Paolo Bonzini
While keeping decode->immediate for convenience and for 4-operand instructions, store the immediate in X86DecodedOp as well. This enables instructions with more than one immediate such as ENTER. It can also be used for far calls and jumps. Reviewed-by: Richard Henderson Signed-off-by: Pa

[PULL 05/26] target/i386: cc_op is not dynamic in gen_jcc1

2024-05-07 Thread Paolo Bonzini
nts gen_prepare_cc from returning s->cc_srcT. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 9aecd415b38..3f1d2858fc9

[PULL 21/26] target/i386: move BSWAP to new decoder

2024-05-07 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 +++- target/i386/tcg/decode-new.c.inc | 9 + target/i386/tcg/emit.c.inc | 11 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/target/i386/tcg

[PULL 17/26] target/i386: generalize gen_movl_seg_T0

2024-05-07 Thread Paolo Bonzini
In the new decoder it is sometimes easier to put the segment in T1 instead of T0, usually because another operand was loaded by common code in T0. Genrealize gen_movl_seg_T0 to allow using any source. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c

[PULL 11/26] target/i386: cleanup *gen_eob*

2024-05-07 Thread Paolo Bonzini
Create a new wrapper for syscall/sysret, and do not go through multiple layers of wrappers. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/target/i386

[PULL 19/26] target/i386: merge and enlarge a few ranges for call to disas_insn_new

2024-05-07 Thread Paolo Bonzini
Since new opcodes are not going to be added in translate.c, round the case labels that call to disas_insn_new(), including whole sets of eight opcodes when possible. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 5 ++--- 1 file changed, 2

[PULL 04/26] target/i386: remove mask from CCPrepare

2024-05-07 Thread Paolo Bonzini
With the introduction of TSTEQ and TSTNE the .mask field is always -1, so remove all the now-unnecessary code. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 81 + 1 file changed, 27 insertions(+), 54 deletions

[PULL 08/26] target/i386: extend cc_* when using them to compute flags

2024-05-07 Thread Paolo Bonzini
Instead of using s->tmp0 or s->tmp4 as the result, just extend the cc_* registers in place. It is harmless and, if multiple setcc instructions are used, the optimizer will be able to remove the redundant ones. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i3

[PULL 09/26] target/i386: do not use s->T0 and s->T1 as scratch registers for CCPrepare

2024-05-07 Thread Paolo Bonzini
Instead of using s->T0 or s->T1, create a scratch register when computing the C, NC, L or LE conditions. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/

[PULL 10/26] target/i386: clarify the "reg" argument of functions returning CCPrepare

2024-05-07 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index dae9553fcaa..8e0289ca414 100644 --- a/target/i386/tcg

[PULL 18/26] target/i386: move C0-FF opcodes to new decoder (except for x87)

2024-05-07 Thread Paolo Bonzini
carry shr cc_dst, cc_src2, length - 1 and cc_dst, cc_dst, 1 // compute overflow xor cc_src2, cc_src2, T0 extract cc_src2, cc_src2, length - 1, 1 32-bit MUL and IMUL are also slightly more efficient on 64-bit hosts. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini

[PULL 20/26] target/i386: move remaining conditional operations to new decoder

2024-05-07 Thread Paolo Bonzini
Move long-displacement Jcc, SETcc and CMOVcc to the new decoder. While filling in the tables makes the code seem longer, the new emitters are all just one line of code. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 1 + target/i386/tcg

[PULL 16/26] target/i386: move 60-BF opcodes to new decoder

2024-05-07 Thread Paolo Bonzini
Compared to the old decoder, the main differences in translation are for the little-used ARPL instruction. IMUL is adjusted a bit to share more code to produce flags, but is otherwise very similar. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h

[PULL 00/26] target/i386 changes for 2024-05-07

2024-05-07 Thread Paolo Bonzini
Babu Moger (1): target/i386: Fix CPUID encoding of Fn801E_ECX Paolo Bonzini (25): target/i386: use TSTEQ/TSTNE to test low bits target/i386: use TSTEQ/TSTNE to check flags target/i386: remove mask from CCPrepare target

[PULL 01/26] target/i386: Fix CPUID encoding of Fn8000001E_ECX

2024-05-07 Thread Paolo Bonzini
D_8000_001E for AMD") Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 Reviewed-by: Zhao Liu Signed-off-by: Babu Moger Message-ID: <0ee4b0a8293188a53970a2b0e4f4ef713425055e.1714757834.git.babu.mo...@amd.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 6 ++ hw/i386/pc

[PATCH] configure: quote -D options that are passed to meson

2024-05-07 Thread Paolo Bonzini
Ensure that they go through unmodified, instead of removing one layer of quoting. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index bd85377a6ae..10fbe10ad9c 100755 --- a/configure

Re: [PATCH 2/4] kconfig: express dependency of individual boards on libfdt

2024-05-07 Thread Paolo Bonzini
On Tue, May 7, 2024 at 9:48 AM Philippe Mathieu-Daudé wrote: > > On 7/5/24 09:19, Paolo Bonzini wrote: > > Now that boards are enabled by default and the "CONFIG_FOO=y" > > entries are gone from configs/devices/, there cannot be any more > > a conflicts betwe

[PATCH 4/4] configs: disable emulators that require it if libfdt is not found

2024-05-07 Thread Paolo Bonzini
in --target-list, those emulators will be skipped if libfdt is not present. Signed-off-by: Paolo Bonzini --- configs/targets/aarch64-softmmu.mak | 1 + configs/targets/arm-softmmu.mak | 1 + configs/targets/i386-softmmu.mak | 1 - configs/targets/loongarch64-softmmu.mak | 1

[PATCH 2/4] kconfig: express dependency of individual boards on libfdt

2024-05-07 Thread Paolo Bonzini
libfdt available. Signed-off-by: Paolo Bonzini --- meson.build | 1 + Kconfig.host | 3 +++ hw/arm/Kconfig| 5 + hw/arm/meson.build| 2 +- hw/core/Kconfig | 9 - hw/core/meson.build | 2 +- hw/i386/Kconfig

[PATCH 3/4] hw/xtensa: require libfdt

2024-05-07 Thread Paolo Bonzini
All other boards require libfdt if it can be used (including for example i386/x86_64), so change the "imply" to "select" and always allow -dtb in qemu-system-xtensa. Signed-off-by: Paolo Bonzini --- hw/xtensa/xtfpga.c | 9 - hw/xtensa/Kconfig | 4 ++-- 2 files c

[PATCH 0/4] express dependency of individual boards on libfdt

2024-05-07 Thread Paolo Bonzini
re libfdt altogether. In a normal build without --target-list or --enable-libfdt, these binaries will be disabled with a message printed by meson. Paolo Paolo Bonzini (4): meson: remove system/internal distinction for libfdt kconfig: express dependency of individual boards on libfdt hw/xtensa: requ

[PATCH 1/4] meson: remove system/internal distinction for libfdt

2024-05-07 Thread Paolo Bonzini
Treat libfdt like slirp and the other dependencies that use --enable-download; remove the ability to force usage of the subproject. Signed-off-by: Paolo Bonzini --- meson.build | 69 +++ meson_options.txt | 6 +-- scripts/meson

Re: [PATCH v2 05/25] target/i386: cleanup cc_op changes for REP/REPZ/REPNZ

2024-05-06 Thread Paolo Bonzini
On Mon, May 6, 2024 at 6:08 PM Richard Henderson wrote: > > -gen_update_cc_op(s); > > l2 = gen_jz_ecx_string(s); > > +/* > > + * Only one iteration is done at a time, so there is > > + * no control flow junction here and cc_op is never dynamic. > > + */ > > fn(s,

Re: [PATCH 0/3] Make it possible to compile the x86 binaries without FDC

2024-05-06 Thread Paolo Bonzini
On Thu, Apr 25, 2024 at 8:43 PM Thomas Huth wrote: > OTOH, it seems > to work fine, and the FDC is only disabled when it is not available > in the binary, so I hope this patch is fine, too. We do the same for parallel so i think it should be fine---definitely for -nodefaults, and I'd say in

Re: [PATCH v2] qemu-options: Deprecate "-runas" and introduce "-run-with user=..." instead

2024-05-06 Thread Paolo Bonzini
On Mon, May 6, 2024 at 1:21 PM Thomas Huth wrote: > > The old "-runas" option has the disadvantage that it is not visible > in the QAPI schema, so it is not available via the normal introspection > mechanisms. We've recently introduced the "-run-with" option for exactly > this purpose, which is

Call for Presentations: KVM Forum 2024

2024-05-06 Thread Paolo Bonzini
### KVM Forum 2024 September 22-23, 2024 Brno, Czech Republic https://kvm-forum.qemu.org/ ### KVM Forum is an annual event that presents a rare opportunity for developers and users to discuss the state of Linux virtualization technology and plan

[qemu-web PATCH] blog: KVM Forum 2024 CFP

2024-05-06 Thread Paolo Bonzini
Add a new post linking to the KVM Forum 2024 Call for Presentations. Thanks to Stefan Hajnoczi for providing a draft of this post! Cc: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- _posts/2024-05-06-kvm-forum-cfp.md | 36 ++ 1 file changed, 36 insertions

[PATCH v2 17/25] target/i386: move C0-FF opcodes to new decoder (except for x87)

2024-05-06 Thread Paolo Bonzini
carry shr cc_dst, cc_src2, length - 1 and cc_dst, cc_dst, 1 // compute overflow xor cc_src2, cc_src2, T0 extract cc_src2, cc_src2, length - 1, 1 32-bit MUL and IMUL are also slightly more efficient on 64-bit hosts. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode

[PATCH v2 15/25] target/i386: move 60-BF opcodes to new decoder

2024-05-06 Thread Paolo Bonzini
Compared to the old decoder, the main differences in translation are for the little-used ARPL instruction. IMUL is adjusted a bit to share more code to produce flags, but is otherwise very similar. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 3 + target/i386/tcg

[PATCH v2 05/25] target/i386: cleanup cc_op changes for REP/REPZ/REPNZ

2024-05-06 Thread Paolo Bonzini
-dependent cc_op could be observed. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 3f1d2858fc9..6b766f5dd3f 100644 --- a/target/i386/tcg

[PATCH v2 21/25] target/i386: port extensions of one-byte opcodes to new decoder

2024-05-06 Thread Paolo Bonzini
A few two-byte opcodes are simple extensions of existing one-byte opcodes; they are easy to decode and need no change to emit.c.inc. Port them to the new decoder. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 1 + target/i386/tcg

[PATCH v2 09/25] target/i386: clarify the "reg" argument of functions returning CCPrepare

2024-05-06 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 2cd7868d596..7efd12cbe7e 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg

[PATCH v2 19/25] target/i386: move remaining conditional operations to new decoder

2024-05-06 Thread Paolo Bonzini
Move long-displacement Jcc, SETcc and CMOVcc to the new decoder. While filling in the tables makes the code seem longer, the new emitters are all just one line of code. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 1 + target/i386/tcg

[PATCH v2 20/25] target/i386: move BSWAP to new decoder

2024-05-06 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 +++- target/i386/tcg/decode-new.c.inc | 9 + target/i386/tcg/emit.c.inc | 11 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/target/i386/tcg

[PATCH v2 13/25] target/i386: extract gen_far_call/jmp, reordering temporaries

2024-05-06 Thread Paolo Bonzini
Extract the code into new functions, and swap T0/T1 so that T0 corresponds to the first immediate in the instruction stream. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 93 + 1 file changed, 53 insertions

[PATCH v2 18/25] target/i386: merge and enlarge a few ranges for call to disas_insn_new

2024-05-06 Thread Paolo Bonzini
Since new opcodes are not going to be added in translate.c, round the case labels that call to disas_insn_new(), including whole sets of eight opcodes when possible. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 5 ++--- 1 file changed, 2

[PATCH v2 06/25] target/i386: pull cc_op update to callers of gen_jmp_rel{, _csize}

2024-05-06 Thread Paolo Bonzini
should have done it. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 6b766f5dd3f..17bf85da0ce 100644 --- a/target/i386/tcg/translate.c +++ b/target

[PATCH v2 08/25] target/i386: do not use s->T0 and s->T1 as scratch registers for CCPrepare

2024-05-06 Thread Paolo Bonzini
Instead of using s->T0 or s->T1, create a scratch register when computing the C, NC, L or LE conditions. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/target/i386/tcg/translate.c b/targe

<    1   2   3   4   5   6   7   8   9   10   >