Re: [PATCH] hw/nvme: fix number of PIDs for FDP RUH update

2024-05-06 Thread Klaus Jensen
On May 3 13:50, Vincent Fu wrote: > The number of PIDs is in the upper 16 bits of cdw10. So we need to > right-shift by 16 bits instead of only a single bit. > > Signed-off-by: Vincent Fu > --- > hw/nvme/ctrl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/nvme/ct

Re: [PATCH v11 19/21] i386: Add cache topology info in CPUCacheInfo

2024-05-06 Thread Zhao Liu
Hi Tejus, (Also +Paolo/Daniel) On Tue, Apr 30, 2024 at 06:14:52AM +, Tejus GK wrote: > Date: Tue, 30 Apr 2024 06:14:52 + > From: Tejus GK > Subject: Re: [PATCH v11 19/21] i386: Add cache topology info in CPUCacheInfo > > > > On 24 Apr 2024, at 9:19 PM, Zhao Liu wrote: > > @@ -2140,6

Re: [PATCH] include/exec/cpu-common.h: Rename PAGE_BITS macro to PAGE_RWX

2024-05-06 Thread Philippe Mathieu-Daudé
On 5/5/24 14:10, BALATON Zoltan wrote: This macro can be used to abbreviate PAGE_READ | PAGE_WRITE | PAGE_EXEC for which PAGE_RWX is a better name and renaming it also shows it is not related to TARGET_PAGE_BITS. Signed-off-by: BALATON Zoltan --- accel/tcg/user-exec.c | 2 +- bsd-user/m

Re: [PATCH] hw/arm/npcm7xx: remove setting of mp-affinity

2024-05-06 Thread Philippe Mathieu-Daudé
On 4/5/24 16:32, Richard Henderson wrote: On 5/4/24 07:17, Dorjoy Chowdhury wrote: The value of the mp-affinity property being set in npcm7xx_realize is always the same as the default value it would have when arm_cpu_realizefn is called if the property is not set here. So there is no need to set

Re: [PATCH 4/7] hw/usb/dev-network: Remove unused struct 'rndis_config_parameter'

2024-05-06 Thread Philippe Mathieu-Daudé
On 5/5/24 19:14, Dr. David Alan Gilbert wrote: As far as I can tell it was never used. Signed-off-by: Dr. David Alan Gilbert --- hw/usb/dev-network.c | 8 1 file changed, 8 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 5/7] hw/arm/bcm2836: Remove unusued struct 'BCM283XClass'

2024-05-06 Thread Philippe Mathieu-Daudé
On 5/5/24 19:14, Dr. David Alan Gilbert wrote: This struct has been unused since Commit f932093ae165 ("hw/arm/bcm2836: Split out common part of BCM283X classes") Rather than "splitting out", commit f932093ae165 duplicated BCM283XClass as BCM283XBaseClass and left it unmodified. Reviewed-by: Ph

Re: [PATCH 7/7] net/can: Remove unused struct 'CanBusState'

2024-05-06 Thread Philippe Mathieu-Daudé
On 5/5/24 19:14, Dr. David Alan Gilbert wrote: As far as I can tell this struct has never been used in this file (it is used in can_core.c). Signed-off-by: Dr. David Alan Gilbert --- net/can/can_host.c | 6 -- 1 file changed, 6 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PULL 00/46] Mostly build system and other cleanups patches for 2024-05-06

2024-05-06 Thread Paolo Bonzini
The following changes since commit 4977ce198d2390bff8c71ad5cb1a5f6aa24b56fb: Merge tag 'pull-tcg-20240501' of https://gitlab.com/rth7680/qemu into staging (2024-05-01 15:15:33 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fe

[PULL 02/46] Kconfig: kvm: allow building without any board

2024-05-06 Thread Paolo Bonzini
KVM code might have to call functions on the PCIDevice that is passed to kvm_arch_fixup_msi_route(). This fails in the case where --without-default-devices is used and no board is configured. While this is not really a useful configuration, and therefore setting up stubs for CONFIG_PCI is overkil

[PULL 05/46] kvm: ppc: disable sPAPR code if CONFIG_PSERIES is disabled

2024-05-06 Thread Paolo Bonzini
target/ppc/kvm.c calls out to code in hw/ppc/spapr*.c; that code is not present and fails to link if CONFIG_PSERIES is not enabled. Adjust kvm.c to depend on CONFIG_PSERIES instead of TARGET_PPC64, and compile out anything that requires cap_papr, because only the pseries machine will call kvmppc_se

[PULL 01/46] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

2024-05-06 Thread Paolo Bonzini
From: Ruihan Li When emulated with QEMU, interrupts will never come in the following loop. However, if the NOP instruction is uncommented, interrupts will fire as normal. loop: cli call do_sti jmp loop do_sti: sti

[PULL 06/46] configs: list "implied" device groups in the default configs

2024-05-06 Thread Paolo Bonzini
Match the optional device groups to what is actually included in the config-devices.mak files. Signed-off-by: Paolo Bonzini --- configs/devices/arm-softmmu/default.mak | 2 ++ configs/devices/loongarch64-softmmu/default.mak | 3 +++ configs/devices/or1k-softmmu/default.mak| 4 +++

[PULL 04/46] gitlab-ci: adjust msys2-64bit to be able to run qtest

2024-05-06 Thread Paolo Bonzini
sparc-softmmu is able to run a subset of qtests when compiled --without-default-devices, so use it instead of x86_64-softmmu for the msys2 run. Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/windows.yml | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.d/windows.

[PULL 24/46] sparc: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with SPARC and SPARC64. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/sparc-softmmu/defa

[PULL 12/46] i386: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with i386. No changes to generated config-devices.mak files, other than adding CONFIG_I386 to the x86_64-softmmu target. Signed-off-by: Paolo

[PULL 39/46] monitor: remove MonitorDef from typedefs.h

2024-05-06 Thread Paolo Bonzini
MonitorDef is defined by hmp-target.h, and all users except one already include it; the reason why the stubs do not include it, is because hmp-target.h currently can only be used in files that are compiled per target. However, that is easily fixed. Because the benefit of having MonitorDef in type

[PULL 22/46] s390x: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with s390. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/s390x-softmmu/default.mak | 5 +

[PULL 14/46] m68k: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with m68k. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/m68k-softmmu/default.mak | 13 +

[PULL 30/46] build: do not build virtio-vga-gl if virgl/opengl not available

2024-05-06 Thread Paolo Bonzini
If virgl and opengl are not available, the build process creates a useless libvirtio-vga-gl module that does not have any device in it. Follow the example of virtio-vga-rutabaga and do not build the module at all in that case. Signed-off-by: Paolo Bonzini --- hw/display/meson.build | 14 +++

[PULL 33/46] numa: remove types from typedefs.h

2024-05-06 Thread Paolo Bonzini
Exactly nobody needs them there. Place the typedef in the header that defines the struct. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/qemu/typedefs.h | 2 -- include/sysemu/numa.h | 8 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/in

[PULL 37/46] lockable: remove QemuLockable from typedefs.h

2024-05-06 Thread Paolo Bonzini
Using QemuLockable almost always requires going through QEMU_MAKE_LOCKABLE(). Therefore, there is little point in having the typedef always present. Move it to lockable.h, with only a small adjustment to coroutine.h (which has a tricky co-dependency with lockable.h due to defining CoMutex *and* us

[PULL 20/46] riscv: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with RISC-V. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/riscv32-softmmu/default.mak |

[PULL 32/46] qdev-core: remove DeviceListener from typedefs.h

2024-05-06 Thread Paolo Bonzini
It is needed in very few places, which already depend on other parts of qdev-core.h files. The benefit of having it in typedefs.h is small. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/hw/qdev-core.h | 1 + include/qemu/typedefs.h | 1 - 2 files changed, 1 inse

[PULL 31/46] fw_cfg: remove useless declarations from typedefs.h

2024-05-06 Thread Paolo Bonzini
Only FWCfgState is used as part of APIs such as acpi_ghes_add_fw_cfg. Everything else need not be in typedefs.h. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/hw/nvram/fw_cfg.h | 2 ++ include/qemu/typedefs.h | 3 --- 2 files changed, 2 insertions(+), 3 deletion

[PULL 36/46] intc: remove PICCommonState from typedefs.h

2024-05-06 Thread Paolo Bonzini
Move it to the existing "PIC related things" header, hw/intc/i8259.h. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/hw/intc/i8259.h | 2 ++ include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/intc/i8259.h b/inclu

[PULL 27/46] docs: document new convention for Kconfig board symbols

2024-05-06 Thread Paolo Bonzini
Boards have been switched to use "default y" and are now listed in default-configs/*.mak only for convenience. Document this change and the new possibilities that it allows. Signed-off-by: Paolo Bonzini --- docs/devel/kconfig.rst | 14 -- 1 file changed, 12 insertions(+), 2 deletion

[PULL 25/46] tricore: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with TriCore. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/tricore-softmmu/default.mak

[PULL 29/46] bitmap: Use g_try_new0/g_new0/g_renew

2024-05-06 Thread Paolo Bonzini
Avoids an explicit use of sizeof(). The GLib allocation macros ensure that the multiplication by the size of the element uses the right type and does not overflow. While at it, change bitmap_new() to use g_new0 directly. Its current impl of calling bitmap_try_new() followed by a plain abort() ha

[PULL 38/46] migration: remove PostcopyDiscardState from typedefs.h

2024-05-06 Thread Paolo Bonzini
It is defined and referred to exclusively from a .c file. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/qemu/typedefs.h | 1 - migration/postcopy-ram.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu

[PULL 34/46] net: remove AnnounceTimer from typedefs.h

2024-05-06 Thread Paolo Bonzini
Exactly nobody needs it there. Place the typedef in the header that defines the struct. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/net/announce.h | 4 ++-- include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/n

[PULL 03/46] tests/qtest: skip m48t59-test if the machine is absent

2024-05-06 Thread Paolo Bonzini
Together with the series at https://patchew.org/QEMU/20240423131612.28362-1-pbonz...@redhat.com/, this allows adding sparc-softmmu to the target list of the build-without-defaults CI job. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- tests/qtest/m48t59-test.c | 11 ++-

[PULL 28/46] target/i386: Introduce SapphireRapids-v3 to add missing features

2024-05-06 Thread Paolo Bonzini
From: Lei Wang Add the missing features(ss, tsc-adjust, cldemote, movdiri, movdir64b) in the SapphireRapids-v3 CPU model. Signed-off-by: Lei Wang Message-ID: <20240424072912.43188-1-lei4.w...@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 11 +++ 1 file changed, 11 in

[PULL 16/46] meson: make target endianneess available to Kconfig

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. MIPS boards may only be available for big-endian or only for little-endian emulators, add a symbol so that this can be described with a "depends on" clau

[PULL 07/46] alpha: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Start with Alpha. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/alpha-softmmu/default.mak | 5 ++-

[PULL 19/46] ppc: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with PowerPC/POWER. No changes to generated config-devices.mak files, other than adding CONFIG_PPC to the ppc64-softmmu target. Signed-off-by:

[PULL 18/46] openrisc: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with OpenRISC. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/or1k-softmmu/default.mak |

[PULL 46/46] qga/commands-posix: fix typo in qmp_guest_set_user_password

2024-05-06 Thread Paolo Bonzini
qga/commands-posix.c does not compile on FreeBSD due to a confusion between "chpasswdata" (wrong) and "chpasswddata" (used in the #else branch). Fixes: 0e5b75a390 ("qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper") Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini

[PULL 42/46] tcg: remove CPU* types from typedefs.h

2024-05-06 Thread Paolo Bonzini
hw/core/cpu.h is already using struct forward declarations in some cases to avoid inclusions, and otherwise CPUAddressSpace and CPUJumpCache are only used together with their definition. CPUTLBEntryFull is always used when their definition is available. Remove all three from typedefs.h. Signed-o

[PULL 15/46] microblaze: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with Microblaze. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/microblaze-softmmu/defaul

[PULL 40/46] qapi/machine: remove types from typedefs.h

2024-05-06 Thread Paolo Bonzini
They are needed in very few places, which already depends on other generated QAPI files. The benefit of having these types in typedefs.h is small. Signed-off-by: Paolo Bonzini --- include/hw/core/cpu.h | 1 + include/qemu/typedefs.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) di

[PULL 44/46] kvm: move target-dependent interrupt routing out of kvm-all.c

2024-05-06 Thread Paolo Bonzini
Let hw/hyperv/hyperv.c and hw/intc/s390_flic.c handle (respectively) SynIC and adapter routes, removing the code from target-independent files. This also removes the only occurrence of AdapterInfo outside s390 code, so remove that from typedefs.h. Signed-off-by: Paolo Bonzini --- include/hw/s39

[PULL 17/46] mips: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with MIPS. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/mips-softmmu/common.mak |

[PULL 11/46] hppa: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with PARISC. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/hppa-softmmu/default.mak | 5

[PULL 21/46] rx: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with RX. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/rx-softmmu/default.mak | 3 ++- .

[PULL 23/46] sh4: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with SH. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/sh4-softmmu/default.mak | 7 +++--

[PULL 26/46] xtensa: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with Xtensa. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/xtensa-softmmu/default.mak |

[PULL 45/46] migration: do not include coroutine_int.h

2024-05-06 Thread Paolo Bonzini
Migration code needs no private fields of the coroutine backend. Include the "regular" coroutine.h header. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- migration/migration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.h b/migration/

[PULL 13/46] loongarch: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with Loongarch. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/loongarch64-softmmu/defaul

[PULL 43/46] pci: remove some types from typedefs.h

2024-05-06 Thread Paolo Bonzini
For types that are embedded in structs defined by pci.h, the definition is pretty much required to be available. Remove them from typedefs.h. Signed-off-by: Paolo Bonzini --- include/hw/pci/pcie.h | 3 +++ include/hw/pci/pcie_aer.h | 38 ++--- include/hw

[PULL 08/46] arm: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
For ARM targets, boards that require TCG are already using "default y". Switch ARM_VIRT to the same selection mechanism. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/arm-softmmu/default.mak | 3 ++- .gitlab-ci.d/buildtest.yml | 1

[PULL 41/46] display: remove GraphicHwOps from typedefs.h

2024-05-06 Thread Paolo Bonzini
Basically all uses of GraphicHwOps are defining an instance of it, which requires the full definition of the struct. It is pointless to have it in typedefs.h. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/display/vga_int.h| 1 + include/qemu/typedefs.h | 1 - 2 f

[PULL 35/46] qemu-option: remove QemuOpt from typedefs.h

2024-05-06 Thread Paolo Bonzini
QemuOpt is basically an internal data structure. It has no business being defined except if you need functions from include/qemu/option.h. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- include/qemu/option.h | 2 ++ include/qemu/typedefs.h | 1 - 2 files changed, 2 inse

[PULL 10/46] cris: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with CRIS. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/cris-softmmu/default.mak | 5 ++

[PULL 09/46] avr: switch boards to "default y"

2024-05-06 Thread Paolo Bonzini
Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with AVR. No changes to generated config-devices.mak file. Signed-off-by: Paolo Bonzini --- configs/devices/avr-softmmu/default.mak | 5 ++--

[PATCH] hw/nvme: fix mo field in io mgnt send

2024-05-06 Thread Klaus Jensen
t mo = (cdw10 & 0xff); +uint8_t mo = cdw10 & 0xf; switch (mo) { case NVME_IOMS_MO_NOP: --- base-commit: 84b0eb1826f690aa8d51984644318ee6c810f5bf change-id: 20240506-fix-ioms-mo-97098c6c5396 Best regards, -- Klaus Jensen

[PATCH v2 00/25] target/i386: convert 1-byte opcodes to new decoder

2024-05-06 Thread Paolo Bonzini
This series includes changes to the x86 TCG decoder that switch the 1-byte opcodes to the table-driven decoder (except for x87). A few easy 2-byte opcodes are also converted (BSWAP, SETcc, CMOVcc, MOVZX/MOVSX and those that are extensions of 1-byte opcodes like PUSH/POP FS/GS, LFS/LGS/LSS). After

[PATCH v2 04/25] target/i386: cc_op is not dynamic in gen_jcc1

2024-05-06 Thread Paolo Bonzini
Resetting cc_op to CC_OP_DYNAMIC should be done at control flow junctions, which is not the case here. This translation block is ending and the only effect of calling set_cc_op() would be a discard of s->cc_srcT. This discard is useless (it's a temporary, not a global) and in fact prevents gen_pre

[PATCH v2 01/25] target/i386: use TSTEQ/TSTNE to test low bits

2024-05-06 Thread Paolo Bonzini
When testing the sign bit or equality to zero of a partial register, it is useful to use a single TSTEQ or TSTNE operation. It can also be used to test the parity flag, using bit 0 of the population count. Do not do this for target_ulong-sized values however; the optimizer would produce a compari

[PATCH v2 03/25] target/i386: remove mask from CCPrepare

2024-05-06 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(-

[PATCH v2 12/25] target/i386: move 00-5F opcodes to new decoder

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

[PATCH v2 02/25] target/i386: use TSTEQ/TSTNE to check flags

2024-05-06 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/tran

[PATCH v2 11/25] target/i386: reintroduce debugging mechanism

2024-05-06 Thread Paolo Bonzini
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 e36ed4dcc10..705e8f3ef49 100644 --- a/targ

[PATCH v2 10/25] target/i386: cleanup *gen_eob*

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

[PATCH v2 24/25] target/i386: split legacy decoder into a separate function

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

[PATCH v2 14/25] target/i386: allow instructions with more than one immediate

2024-05-06 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: Paolo Bon

[PATCH v2 16/25] target/i386: generalize gen_movl_seg_T0

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

[PATCH v2 07/25] target/i386: extend cc_* when using them to compute flags

2024-05-06 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. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 44 +++

[PATCH v2 25/25] target/i386: remove duplicate prefix decoding

2024-05-06 Thread Paolo Bonzini
Now that a bulk of opcodes go through the new decoder, it is sensible to do some cleanup. Go immediately through disas_insn_new and only jump back after parsing the prefixes. disas_insn() now only contains the three sigsetjmp cases, and they are more easily managed if they are inlined into i386_t

[PATCH v2 23/25] target/i386: decode x87 instructions in a separate function

2024-05-06 Thread Paolo Bonzini
These are unlikely to be converted to the table-based decoding soon (perhaps there could be generic ESC decoding in decode-new.c.inc for the Mod/RM byte, but not operand decoding), so keep them separate from the remaining legacy-decoded instructions. Acked-by: Richard Henderson Signed-off-by: Pao

[PATCH v2 22/25] target/i386: remove now-converted opcodes from old decoder

2024-05-06 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/shift_helper

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

2024-05-06 Thread Paolo Bonzini
gen_update_cc_op must be called before control flow splits. Doing it in gen_jmp_rel{,_csize} may hide bugs, instead assert that cc_op is clean---even if that means a few more calls to gen_update_cc_op(). With this new invariant, setting cc_op to CC_OP_DYNAMIC is unnecessary since the caller shoul

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

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

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

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

[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/translate.

[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 05/25] target/i386: cleanup cc_op changes for REP/REPZ/REPNZ

2024-05-06 Thread Paolo Bonzini
gen_update_cc_op must be called before control flow splits. Do it where the jump on ECX!=0 is translated. On the other hand, remove the call before gen_jcc1, which takes care of it already, and explain why REPZ/REPNZ need not use CC_OP_DYNAMIC---the translation block ends before any control-flow-

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

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

2024-05-06 Thread Paolo Bonzini
The shift instructions are rewritten instead of reusing code from the old decoder. Rotates use CC_OP_ADCOX more extensively and generally rely more on the optimizer, so that the code generators are shared between the immediate-count and variable-count cases. In particular, this makes gen_RCL and

[PATCH v3] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-05-06 Thread Daniil Tatianin
This can be used to force-synchronize the time in guest after a long stop-cont pause, which can be useful for serverless-type workload. Also add a comment to highlight the fact that this (and one other QMP command) only works for the MC146818 RTC controller. Signed-off-by: Daniil Tatianin --- C

[PATCH 0/3] Cleanup VFIOIOMMUClass callback return with bool

2024-05-06 Thread Zhenzhong Duan
Hi This is a cleanup series to change VFIOIOMMUClass callbacks to return bool when the error is passed through errp parameter. See discussion at https://lists.gnu.org/archive/html/qemu-devel/2024-04/msg04782.html It looks many functions in VFIO sub-system need same change, so this can be a very

[PATCH 2/3] vfio: Make VFIOIOMMUClass::setup() return bool

2024-05-06 Thread Zhenzhong Duan
This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-container-base.h | 2 +- hw/vfio/container.c | 10 +- hw/vfio/spapr.c

[PATCH 3/3] vfio: Make VFIOIOMMUClass::add_window() and its wrapper return bool

2024-05-06 Thread Zhenzhong Duan
Make VFIOIOMMUClass::add_window() and its wrapper function vfio_container_add_section_window() return bool. This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-container-

[PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-06 Thread Zhenzhong Duan
Make VFIOIOMMUClass::attach_device() and its wrapper function vfio_attach_device() return bool. This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 4

[PATCH v2 2/6] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions

2024-05-06 Thread Zhao Liu
These 2 MSRs have been already defined in kvm_para.h (standard-headers/ asm-x86/kvm_para.h). Remove QEMU local definitions to avoid duplication. Reviewed-by: Xiaoyao Li Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/i386/kvm/kvm.c

[PATCH v2 0/6] target/i386: Misc cleanup on KVM PV defs and outdated comments

2024-05-06 Thread Zhao Liu
Hi, This is my v2 cleanup series. Compared with v1 [1], only tags (R/b, S/b) updates, and a typo fix, no code change. This series picks cleanup from my previous kvmclock [2] (as other renaming attempts were temporarily put on hold). In addition, this series also include the cleanup on a historic

[PATCH v2 6/6] target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type()

2024-05-06 Thread Zhao Liu
Update the comment to match the X86ConfidentialGuestClass implementation. Reported-by: Xiaoyao Li Signed-off-by: Zhao Liu Reviewed-by: Pankaj Gupta --- target/i386/confidential-guest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/confidential-guest.h b/target

[PATCH v2 3/6] target/i386/kvm: Only save/load kvmclock MSRs when kvmclock enabled

2024-05-06 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME and MSR_KVM_WALL_CLOCK are attached with the (old) kvmclock feature (KVM_FEATURE_CLOCKSOURCE). So, just save/load them only when kvmclock (KVM_FEATURE_CLOCKSOURCE) is enabled. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 12 1 file changed, 8 insertions(+

[PATCH v2 1/6] target/i386/kvm: Add feature bit definitions for KVM CPUID

2024-05-06 Thread Zhao Liu
Add feature definitions for KVM_CPUID_FEATURES in CPUID ( CPUID[4000_0001].EAX and CPUID[4000_0001].EDX), to get rid of lots of offset calculations. Signed-off-by: Zhao Liu --- v2: Fixed a typo. v1: Changed the prefix from CPUID_FEAT_KVM_* to CPUID_KVM_*. (Xiaoyao) --- hw/i386/kvm/clock.c | 5

[PATCH v2 5/6] target/i386/kvm: Drop workaround for KVM_X86_DISABLE_EXITS_HTL typo

2024-05-06 Thread Zhao Liu
The KVM_X86_DISABLE_EXITS_HTL typo has been fixed in commit 77d361b13c19 ("linux-headers: Update to kernel mainline commit b357bf602"). Drop the related workaround. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 4 1 file changed, 4 deletions(-) diff --git a/target/i386/kvm/kvm.c b/t

[PATCH v2 4/6] target/i386/kvm: Save/load MSRs of kvmclock2 (KVM_FEATURE_CLOCKSOURCE2)

2024-05-06 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME_NEW and MSR_KVM_WALL_CLOCK_NEW are bound to kvmclock2 (KVM_FEATURE_CLOCKSOURCE2). Add the save/load support for these 2 MSRs just like kvmclock MSRs. Signed-off-by: Zhao Liu --- target/i386/cpu.h | 2 ++ target/i386/kvm/kvm.c | 16 2 files changed, 18 i

Re: [PATCH v2] MAINTAINERS: Update my email address

2024-05-06 Thread Philippe Mathieu-Daudé
On 5/5/24 09:23, Bin Meng wrote: From: Bin Meng The old Wind River email address (bin.m...@windriver.com) is no longer available due to an internal infrastructure change within the company. While a new email address (bin.meng...@windriver.com) has been assigned to me, I am unable to find a way

[PATCH v6 2/7] migration/multifd: put IOV initialization into compression method

2024-05-06 Thread Yuan Liu
Different compression methods may require different numbers of IOVs. Based on streaming compression of zlib and zstd, all pages will be compressed to a data block, so two IOVs are needed for packet header and compressed data block. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou --- migration/m

[PATCH v6 3/7] configure: add --enable-qpl build option

2024-05-06 Thread Yuan Liu
add --enable-qpl and --disable-qpl options to enable and disable the QPL compression method for multifd migration. The Query Processing Library (QPL) is an open-source library that supports data compression and decompression features. It is based on the deflate compression algorithm and use Intel

[PATCH v6 4/7] migration/multifd: add qpl compression method

2024-05-06 Thread Yuan Liu
add the Query Processing Library (QPL) compression method Introduce the qpl as a new multifd migration compression method, it can use In-Memory Analytics Accelerator(IAA) to accelerate compression and decompression, which can not only reduce network bandwidth requirement but also reduce host compr

[PATCH v6 6/7] migration/multifd: implement qpl compression and decompression

2024-05-06 Thread Yuan Liu
each qpl job is used to (de)compress a normal page and it can be processed independently by the IAA hardware. All qpl jobs are submitted to the hardware at once, and wait for all jobs completion. If hardware path(IAA) is not available, use software for compression and decompression. Signed-off-by:

[PATCH v6 7/7] tests/migration-test: add qpl compression test

2024-05-06 Thread Yuan Liu
add qpl to compression method test for multifd migration the qpl compression supports software path and hardware path(IAA device), and the hardware path is used first by default. If the hardware path is unavailable, it will automatically fallback to the software path for testing. Signed-off-by: Y

[PATCH v6 5/7] migration/multifd: implement initialization of qpl compression

2024-05-06 Thread Yuan Liu
the qpl initialization includes memory allocation for compressed data and the qpl job initialization. the qpl job initialization will check if the In-Memory Analytics Accelerator(IAA) device is available and use the IAA device first. If the platform does not have IAA device or the IAA device is no

  1   2   3   4   >