OSDN Git Service

qmiga/qemu.git
9 months agoigb: add IPv6 extended headers traffic detection
Tomasz Dzieciol [Mon, 29 May 2023 14:01:51 +0000 (16:01 +0200)]
igb: add IPv6 extended headers traffic detection

Signed-off-by: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agoigb: RX payload guest writting refactoring
Tomasz Dzieciol [Mon, 29 May 2023 14:01:50 +0000 (16:01 +0200)]
igb: RX payload guest writting refactoring

Refactoring is done in preparation for support of multiple advanced
descriptors RX modes, especially packet-split modes.

Signed-off-by: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agoigb: RX descriptors guest writting refactoring
Tomasz Dzieciol [Mon, 29 May 2023 14:01:49 +0000 (16:01 +0200)]
igb: RX descriptors guest writting refactoring

Refactoring is done in preparation for support of multiple advanced
descriptors RX modes, especially packet-split modes.

Signed-off-by: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agoigb: rename E1000E_RingInfo_st
Tomasz Dzieciol [Mon, 29 May 2023 14:01:48 +0000 (16:01 +0200)]
igb: rename E1000E_RingInfo_st

Rename E1000E_RingInfo_st and E1000E_RingInfo according to qemu typdefs guide.

Signed-off-by: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agoigb: remove TCP ACK detection
Tomasz Dzieciol [Mon, 29 May 2023 14:01:47 +0000 (16:01 +0200)]
igb: remove TCP ACK detection

TCP ACK detection is no longer present in igb.

Signed-off-by: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agovirtio-net: Add support for USO features
Yuri Benditovich [Mon, 31 Jul 2023 22:31:48 +0000 (01:31 +0300)]
virtio-net: Add support for USO features

USO features of virtio-net device depend on kernel ability
to support them, for backward compatibility by default the
features are disabled on 8.0 and earlier.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Andrew Melnychecnko <andrew@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agovirtio-net: Add USO flags to vhost support.
Andrew Melnychenko [Mon, 31 Jul 2023 22:31:47 +0000 (01:31 +0300)]
virtio-net: Add USO flags to vhost support.

New features are subject to check with vhost-user and vdpa.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agotap: Add check for USO features
Yuri Benditovich [Mon, 31 Jul 2023 22:31:46 +0000 (01:31 +0300)]
tap: Add check for USO features

Tap indicates support for USO features according to
capabilities of current kernel module.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Andrew Melnychecnko <andrew@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agotap: Add USO support to tap device.
Andrew Melnychenko [Mon, 31 Jul 2023 22:31:45 +0000 (01:31 +0300)]
tap: Add USO support to tap device.

Passing additional parameters (USOv4 and USOv6 offloads) when
setting TAP offloads

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
9 months agotcg: Map code_gen_buffer with PROT_BTI
Richard Henderson [Wed, 16 Aug 2023 00:53:42 +0000 (17:53 -0700)]
tcg: Map code_gen_buffer with PROT_BTI

For linux aarch64 host supporting BTI, map the buffer
to require BTI instructions at branch landing pads.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/aarch64: Emit BTI insns at jump landing pads
Richard Henderson [Wed, 16 Aug 2023 02:31:38 +0000 (19:31 -0700)]
tcg/aarch64: Emit BTI insns at jump landing pads

The prologue is entered via "call"; the epilogue, each tb,
and each goto_tb continuation point are all reached via "jump".

As tcg_out_goto_long is only used by tcg_out_exit_tb, merge
the two functions.  Change the indirect register used to
TCG_REG_TMP1, aka X17, so that the BTI condition created
is "jump" instead of "jump or call".

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoutil/cpuinfo-aarch64: Add CPUINFO_BTI
Richard Henderson [Wed, 16 Aug 2023 00:33:56 +0000 (17:33 -0700)]
util/cpuinfo-aarch64: Add CPUINFO_BTI

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg: Add tcg_out_tb_start backend hook
Richard Henderson [Tue, 15 Aug 2023 16:34:59 +0000 (16:34 +0000)]
tcg: Add tcg_out_tb_start backend hook

This hook may emit code at the beginning of the TB.

Suggested-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agofpu: Handle m68k extended precision denormals properly
Richard Henderson [Mon, 21 Aug 2023 00:28:33 +0000 (17:28 -0700)]
fpu: Handle m68k extended precision denormals properly

Motorola treats denormals with explicit integer bit set as
having unbiased exponent 0, unlike Intel which treats it as
having unbiased exponent 1 (more like all other IEEE formats
that have no explicit integer bit).

Add a flag on FloatFmt to differentiate the behaviour.

Reported-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agofpu: Add conversions between bfloat16 and [u]int8
LIU Zhiwei [Wed, 31 May 2023 06:54:57 +0000 (14:54 +0800)]
fpu: Add conversions between bfloat16 and [u]int8

We missed these functions when upstreaming the bfloat16 support.

Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-Id: <20230531065458.2082-1-zhiwei_liu@linux.alibaba.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Introduce do_st16_mmio_leN
Richard Henderson [Mon, 28 Aug 2023 03:09:58 +0000 (20:09 -0700)]
accel/tcg: Introduce do_st16_mmio_leN

Split out int_st_mmio_leN, to be used by both do_st_mmio_leN
and do_st16_mmio_leN.  Move the locks down into the two
functions, since each one now covers all accesses to once page.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Introduce do_ld16_mmio_beN
Richard Henderson [Mon, 28 Aug 2023 02:54:54 +0000 (19:54 -0700)]
accel/tcg: Introduce do_ld16_mmio_beN

Split out int_ld_mmio_beN, to be used by both do_ld_mmio_beN
and do_ld16_mmio_beN.  Move the locks down into the two
functions, since each one now covers all accesses to once page.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Merge io_writex into do_st_mmio_leN
Richard Henderson [Sun, 27 Aug 2023 18:25:25 +0000 (11:25 -0700)]
accel/tcg: Merge io_writex into do_st_mmio_leN

Avoid multiple calls to io_prepare for unaligned acceses.
One call to do_st_mmio_leN will never cross pages.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Merge io_readx into do_ld_mmio_beN
Richard Henderson [Sun, 27 Aug 2023 16:50:41 +0000 (09:50 -0700)]
accel/tcg: Merge io_readx into do_ld_mmio_beN

Avoid multiple calls to io_prepare for unaligned acceses.
One call to do_ld_mmio_beN will never cross pages.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Replace direct use of io_readx/io_writex in do_{ld,st}_1
Richard Henderson [Sun, 27 Aug 2023 16:49:13 +0000 (09:49 -0700)]
accel/tcg: Replace direct use of io_readx/io_writex in do_{ld,st}_1

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Merge cpu_transaction_failed into io_failed
Richard Henderson [Sun, 27 Aug 2023 15:54:50 +0000 (08:54 -0700)]
accel/tcg: Merge cpu_transaction_failed into io_failed

Push computation down into the if statements to the point
the data is used.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoplugin: Simplify struct qemu_plugin_hwaddr
Richard Henderson [Mon, 28 Aug 2023 01:58:15 +0000 (18:58 -0700)]
plugin: Simplify struct qemu_plugin_hwaddr

Rather than saving MemoryRegionSection and offset,
save phys_addr and MemoryRegion.  This matches up
much closer with the plugin api.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Use CPUTLBEntryFull.phys_addr in io_failed
Richard Henderson [Mon, 28 Aug 2023 01:22:41 +0000 (18:22 -0700)]
accel/tcg: Use CPUTLBEntryFull.phys_addr in io_failed

Since the introduction of CPUTLBEntryFull, we can recover
the full cpu address space physical address without having
to examine the MemoryRegionSection.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Split out io_prepare and io_failed
Richard Henderson [Mon, 28 Aug 2023 00:31:27 +0000 (17:31 -0700)]
accel/tcg: Split out io_prepare and io_failed

These are common code from io_readx and io_writex.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Simplify tlb_plugin_lookup
Richard Henderson [Mon, 28 Aug 2023 00:28:16 +0000 (17:28 -0700)]
accel/tcg: Simplify tlb_plugin_lookup

Now that we defer address space update and tlb_flush until
the next async_run_on_cpu, the plugin run at the end of the
instruction no longer has to contend with a flushed tlb.
Therefore, delete SavedIOTLB entirely.

Properly return false from tlb_plugin_lookup when we do
not have a tlb match.

Fixes a bug in which SavedIOTLB had stale data, because
there were multiple i/o accesses within a single insn.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/arm: Use tcg_gen_gvec_cmpi for compare vs 0
Richard Henderson [Thu, 31 Aug 2023 03:09:04 +0000 (20:09 -0700)]
target/arm: Use tcg_gen_gvec_cmpi for compare vs 0

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20230831030904.1194667-3-richard.henderson@linaro.org>

9 months agotcg: Add gvec compare with immediate and scalar operand
Richard Henderson [Thu, 31 Aug 2023 03:09:03 +0000 (20:09 -0700)]
tcg: Add gvec compare with immediate and scalar operand

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20230831030904.1194667-2-richard.henderson@linaro.org>

9 months agotcg/loongarch64: Implement 128-bit load & store
Jiajie Chen [Fri, 8 Sep 2023 02:21:23 +0000 (10:21 +0800)]
tcg/loongarch64: Implement 128-bit load & store

If LSX is available, use LSX instructions to implement 128-bit load &
store when MO_128 is required, otherwise use two 64-bit loads & stores.

Signed-off-by: Jiajie Chen <c@jia.je>
Message-Id: <20230908022302.180442-17-c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/hppa: Extract diagnose immediate value
Helge Deller [Wed, 13 Sep 2023 08:44:02 +0000 (10:44 +0200)]
target/hppa: Extract diagnose immediate value

Extract the immediate value given by the diagnose CPU instruction.
This is needed to distinguish the various diagnose calls.

Signed-off-by: Helge Deller <deller@gmx.de>
9 months agotarget/hppa: Add BTLB support to hppa TLB functions
Helge Deller [Wed, 13 Sep 2023 08:55:59 +0000 (10:55 +0200)]
target/hppa: Add BTLB support to hppa TLB functions

Change the TLB code to store the Block-TLBs at the beginning
of the TLB table. New 4k TLB entries which are added later
shall not overwrite any of the BTLB entries.

Make sure that when the TLB is cleared by the OS via the ptlbe
instruction, the Block-TLBs will not be dropped.

Signed-off-by: Helge Deller <deller@gmx.de>
9 months agotarget/hppa: Report and clear BTLBs via fw_cfg at startup
Helge Deller [Wed, 13 Sep 2023 08:40:12 +0000 (10:40 +0200)]
target/hppa: Report and clear BTLBs via fw_cfg at startup

Report the new number of TLB entries (without BTLBs) to the
guest and drop reporting of BTLB entries which weren't used at all.

Clear all BTLB and TLB entries at machine reset.

Signed-off-by: Helge Deller <deller@gmx.de>
9 months agohost/include/aarch64: Implement clmul.h
Richard Henderson [Wed, 12 Jul 2023 18:21:19 +0000 (18:21 +0000)]
host/include/aarch64: Implement clmul.h

Detect PMULL in cpuinfo; implement the accel hook.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agohost/include/i386: Implement clmul.h
Richard Henderson [Tue, 11 Jul 2023 20:39:10 +0000 (21:39 +0100)]
host/include/i386: Implement clmul.h

Detect PCLMUL in cpuinfo; implement the accel hook.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/ppc: Use clmul_64
Richard Henderson [Tue, 11 Jul 2023 09:41:28 +0000 (10:41 +0100)]
target/ppc: Use clmul_64

Use generic routine for 64-bit carry-less multiply.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/s390x: Use clmul_64
Richard Henderson [Tue, 11 Jul 2023 09:19:45 +0000 (10:19 +0100)]
target/s390x: Use clmul_64

Use the generic routine for 64-bit carry-less multiply.
Remove our local version of galois_multiply64.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/i386: Use clmul_64
Richard Henderson [Mon, 21 Aug 2023 15:24:07 +0000 (08:24 -0700)]
target/i386: Use clmul_64

Use generic routine for 64-bit carry-less multiply.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/arm: Use clmul_64
Richard Henderson [Tue, 11 Jul 2023 09:13:45 +0000 (10:13 +0100)]
target/arm: Use clmul_64

Use generic routine for 64-bit carry-less multiply.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agocrypto: Add generic 64-bit carry-less multiply routine
Richard Henderson [Tue, 11 Jul 2023 09:10:47 +0000 (10:10 +0100)]
crypto: Add generic 64-bit carry-less multiply routine

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/ppc: Use clmul_32* routines
Richard Henderson [Tue, 11 Jul 2023 09:01:57 +0000 (10:01 +0100)]
target/ppc: Use clmul_32* routines

Use generic routines for 32-bit carry-less multiply.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/s390x: Use clmul_32* routines
Richard Henderson [Tue, 11 Jul 2023 08:58:46 +0000 (09:58 +0100)]
target/s390x: Use clmul_32* routines

Use generic routines for 32-bit carry-less multiply.
Remove our local version of galois_multiply32.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/arm: Use clmul_32* routines
Richard Henderson [Tue, 11 Jul 2023 08:56:41 +0000 (09:56 +0100)]
target/arm: Use clmul_32* routines

Use generic routines for 32-bit carry-less multiply.
Remove our local version of pmull_d.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agocrypto: Add generic 32-bit carry-less multiply routines
Richard Henderson [Tue, 11 Jul 2023 08:54:06 +0000 (09:54 +0100)]
crypto: Add generic 32-bit carry-less multiply routines

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/ppc: Use clmul_16* routines
Richard Henderson [Tue, 11 Jul 2023 08:38:28 +0000 (09:38 +0100)]
target/ppc: Use clmul_16* routines

Use generic routines for 16-bit carry-less multiply.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/s390x: Use clmul_16* routines
Richard Henderson [Tue, 11 Jul 2023 08:35:30 +0000 (09:35 +0100)]
target/s390x: Use clmul_16* routines

Use generic routines for 16-bit carry-less multiply.
Remove our local version of galois_multiply16.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/arm: Use clmul_16* routines
Richard Henderson [Tue, 11 Jul 2023 08:26:24 +0000 (09:26 +0100)]
target/arm: Use clmul_16* routines

Use generic routines for 16-bit carry-less multiply.
Remove our local version of pmull_w.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agocrypto: Add generic 16-bit carry-less multiply routines
Richard Henderson [Tue, 11 Jul 2023 08:14:58 +0000 (09:14 +0100)]
crypto: Add generic 16-bit carry-less multiply routines

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/ppc: Use clmul_8* routines
Richard Henderson [Tue, 11 Jul 2023 07:00:21 +0000 (08:00 +0100)]
target/ppc: Use clmul_8* routines

Use generic routines for 8-bit carry-less multiply.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/s390x: Use clmul_8* routines
Richard Henderson [Mon, 10 Jul 2023 15:26:49 +0000 (16:26 +0100)]
target/s390x: Use clmul_8* routines

Use generic routines for 8-bit carry-less multiply.
Remove our local version of galois_multiply8.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotarget/arm: Use clmul_8* routines
Richard Henderson [Mon, 10 Jul 2023 15:07:57 +0000 (16:07 +0100)]
target/arm: Use clmul_8* routines

Use generic routines for 8-bit carry-less multiply.
Remove our local version of pmull_h.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agocrypto: Add generic 8-bit carry-less multiply routines
Richard Henderson [Mon, 10 Jul 2023 14:38:28 +0000 (15:38 +0100)]
crypto: Add generic 8-bit carry-less multiply routines

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower rotli_vec to vrotri
Jiajie Chen [Fri, 8 Sep 2023 02:21:22 +0000 (10:21 +0800)]
tcg/loongarch64: Lower rotli_vec to vrotri

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-16-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower rotv_vec ops to LSX
Jiajie Chen [Fri, 8 Sep 2023 02:21:21 +0000 (10:21 +0800)]
tcg/loongarch64: Lower rotv_vec ops to LSX

Lower the following ops:

- rotrv_vec
- rotlv_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-15-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower vector shift integer ops
Jiajie Chen [Fri, 8 Sep 2023 02:21:20 +0000 (10:21 +0800)]
tcg/loongarch64: Lower vector shift integer ops

Lower the following ops:

- shli_vec
- shrv_vec
- sarv_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-14-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower bitsel_vec to vbitsel
Jiajie Chen [Fri, 8 Sep 2023 02:21:19 +0000 (10:21 +0800)]
tcg/loongarch64: Lower bitsel_vec to vbitsel

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-13-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower vector shift vector ops
Jiajie Chen [Fri, 8 Sep 2023 02:21:18 +0000 (10:21 +0800)]
tcg/loongarch64: Lower vector shift vector ops

Lower the following ops:

- shlv_vec
- shrv_vec
- sarv_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-12-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower vector saturated ops
Jiajie Chen [Fri, 8 Sep 2023 02:21:17 +0000 (10:21 +0800)]
tcg/loongarch64: Lower vector saturated ops

Lower the following ops:

- ssadd_vec
- usadd_vec
- sssub_vec
- ussub_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-11-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower vector min max ops
Jiajie Chen [Fri, 8 Sep 2023 02:21:16 +0000 (10:21 +0800)]
tcg/loongarch64: Lower vector min max ops

Lower the following ops:

- smin_vec
- smax_vec
- umin_vec
- umax_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-10-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower mul_vec to vmul
Jiajie Chen [Fri, 8 Sep 2023 02:21:15 +0000 (10:21 +0800)]
tcg/loongarch64: Lower mul_vec to vmul

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-9-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower neg_vec to vneg
Jiajie Chen [Fri, 8 Sep 2023 02:21:14 +0000 (10:21 +0800)]
tcg/loongarch64: Lower neg_vec to vneg

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-8-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower vector bitwise operations
Jiajie Chen [Fri, 8 Sep 2023 02:21:13 +0000 (10:21 +0800)]
tcg/loongarch64: Lower vector bitwise operations

Lower the following ops:

- and_vec
- andc_vec
- or_vec
- orc_vec
- xor_vec
- nor_vec
- not_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-7-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower add/sub_vec to vadd/vsub
Jiajie Chen [Fri, 8 Sep 2023 02:21:12 +0000 (10:21 +0800)]
tcg/loongarch64: Lower add/sub_vec to vadd/vsub

Lower the following ops:

- add_vec
- sub_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-6-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt
Jiajie Chen [Fri, 8 Sep 2023 02:21:11 +0000 (10:21 +0800)]
tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-5-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg: pass vece to tcg_target_const_match()
Jiajie Chen [Fri, 8 Sep 2023 02:21:10 +0000 (10:21 +0800)]
tcg: pass vece to tcg_target_const_match()

Pass vece to tcg_target_const_match() to allow correct interpretation of
const args of vector ops.

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908022302.180442-4-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Lower basic tcg vec ops to LSX
Jiajie Chen [Fri, 8 Sep 2023 02:21:09 +0000 (10:21 +0800)]
tcg/loongarch64: Lower basic tcg vec ops to LSX

LSX support on host cpu is detected via hwcap.

Lower the following ops to LSX:

- dup_vec
- dupi_vec
- dupm_vec
- ld_vec
- st_vec

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-3-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agotcg/loongarch64: Import LSX instructions
Jiajie Chen [Fri, 8 Sep 2023 02:21:08 +0000 (10:21 +0800)]
tcg/loongarch64: Import LSX instructions

Add opcodes and encoder functions for LSX.

Generated from
https://github.com/jiegec/loongarch-opcodes/tree/qemu-lsx.

Signed-off-by: Jiajie Chen <c@jia.je>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230908022302.180442-2-c@jia.je>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agothunk: Delete checks for old host definitions
Akihiko Odaki [Tue, 8 Aug 2023 15:23:10 +0000 (00:23 +0900)]
thunk: Delete checks for old host definitions

Alpha, IA-64, and PA-RISC hosts are no longer supported.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230808152314.102036-1-akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agosoftmmu: Delete checks for old host definitions
Akihiko Odaki [Sat, 9 Sep 2023 21:40:25 +0000 (14:40 -0700)]
softmmu: Delete checks for old host definitions

PA-RISC host support is already removed with commit
b1cef6d02f ("Drop remaining bits of ia64 host support").

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230810225922.21600-1-akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoutil: Delete checks for old host definitions
Akihiko Odaki [Sat, 9 Sep 2023 21:37:24 +0000 (14:37 -0700)]
util: Delete checks for old host definitions

IA-64 and PA-RISC host support is already removed with commit
b1cef6d02f ("Drop remaining bits of ia64 host support").

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230810225922.21600-1-akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: Fix the comment for CPUTLBEntryFull
LIU Zhiwei [Fri, 1 Sep 2023 06:01:18 +0000 (14:01 +0800)]
accel/tcg: Fix the comment for CPUTLBEntryFull

When memory region is ram, the lower TARGET_PAGE_BITS is not the
physical section number. Instead, its value is always 0.

Add comment and assert to make it clear.

Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-Id: <20230901060118.379-1-zhiwei_liu@linux.alibaba.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoaccel/tcg: mttcg remove false-negative halted assertion
Nicholas Piggin [Tue, 29 Aug 2023 01:06:58 +0000 (11:06 +1000)]
accel/tcg: mttcg remove false-negative halted assertion

mttcg asserts that an execution ending with EXCP_HALTED must have
cpu->halted. However between the event or instruction that sets
cpu->halted and requests exit and the assertion here, an
asynchronous event could clear cpu->halted.

This leads to crashes running AIX on ppc/pseries because it uses
H_CEDE/H_PROD hcalls, where H_CEDE sets self->halted = 1 and
H_PROD sets other cpu->halted = 0 and kicks it.

H_PROD could be turned into an interrupt to wake, but several other
places in ppc, sparc, and semihosting follow what looks like a similar
pattern setting halted = 0 directly. So remove this assertion.

Reported-by: Ivan Warren <ivan@vmfacility.fr>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20230829010658.8252-1-npiggin@gmail.com>
[rth: Keep the case label and adjust the comment.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9 months agoMerge tag 'pull-tpm-2023-09-12-3' of https://github.com/stefanberger/qemu-tpm into...
Stefan Hajnoczi [Wed, 13 Sep 2023 17:41:57 +0000 (13:41 -0400)]
Merge tag 'pull-tpm-2023-09-12-3' of https://github.com/stefanberger/qemu-tpm into staging

Merge tpm 2023/09/12 v3

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEuBi5yt+QicLVzsZrda1lgCoLQhEFAmUBrwgACgkQda1lgCoL
# QhG9PQgA5drE1s0dYGkAIZimOsRKvduMV/kqeTmqnhGSUBM9jnYLWssnuG7/nDAi
# IXTqoKOzw27TGZKNiKuCO7PvlKCeirPEk7KmHk2JrxjC/QjtExMZLF700eLemP9/
# RBKwHerT8mLAkVuIGFvFgU9nQRrg/YX6kSvOFBJEl4XBn4w/vyY7gp3QbJgqcl36
# jrL7qJXrxQnT0BRRy+NlmmG3WswIY6xZpURdYKWMAINeNSH2DW2JxiDov2+fUVWH
# jp7SKBzCsXvD/RjRz1WWRpsrz3EtC7LiaLiB685XZsMcavb1zy0Pj7pchjr6NkwF
# 2gTWFPr/YG/eYoodtix2r2ElG4hyJQ==
# =WBnS
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 13 Sep 2023 08:46:00 EDT
# gpg:                using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* tag 'pull-tpm-2023-09-12-3' of https://github.com/stefanberger/qemu-tpm:
  tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9 months agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Stefan Hajnoczi [Wed, 13 Sep 2023 17:41:27 +0000 (13:41 -0400)]
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* target/i386: fix non-optimized compilation on clang
* fix detection of Solaris/IllumOS

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmUBj8cUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroOP7QgApdNqHKH4zNbBRPk/cxYDZEd0maPl
# nolD0eBts5ZWDYnQk/fFzHflzh/b5F119xv9H3fB86i/D2JNUMdqFR8QmQr9ZwEW
# izjXe8CdWto4dsW2RQbxGihThjMGu5BTZucqKSvLiZcyTQhPhwZ917Jo9YM5k072
# /1ECrCZYmCr2RECyNG6/zRrph8hustz5O0QEL65YhqK8ztttr+7E33m3CJ1fGEDy
# nbXu/WKrUxG20ohQJJ7Slpt9XTBGQXlfUO5gSg3nxkS9xqOjc15sCh+yit4gvS8f
# IDi8xD2JTWP05xQppSv33plEvmi+KrCY8d965isRsVbzPh5qB2osBoAa/A==
# =bOr3
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 13 Sep 2023 06:32:39 EDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()
  target/i386: Drop accel_uses_host_cpuid before x86_cpu_get_supported_cpuid
  target/i386: Check kvm_hyperv_expand_features() return value
  meson: Fix targetos match for illumos and Solaris.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9 months agoMerge tag 'nvme-next-pull-request' of https://gitlab.com/birkelund/qemu into staging
Stefan Hajnoczi [Wed, 13 Sep 2023 17:41:09 +0000 (13:41 -0400)]
Merge tag 'nvme-next-pull-request' of https://gitlab.com/birkelund/qemu into staging

hw/nvme updates

Two fixes for dynamic array allocation.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmUAc8AACgkQTeGvMW1P
# DelwhQgAxD7imw85V89Dz58LgrFoq5XZz2cq6Q5BsudyZd8FW5r7lOn9c1i0Yu2x
# iiP93FX0b5LPQ9/8/liz3oHu1HZ7+hX+VeDZSQ1/bugfXM/eDSPA7lf7GG1np312
# 9lKRs8o+T4Di7v93kdiEi6G3b0jQSmZ722aMa54isk58hy1mcUTnGxvPZpVZutTP
# lYhwuElQIsnnKXB0jaRlpcDkpXdHJ1wwziaYLM7pus+tElMiSkFP05j2pX9iigKu
# 7g+Hs+DaqrOzdoF/6uu72IKygq3/5H8iou1No/7OICWbFti5Qhhra0OKQE6nrlKd
# 51fnWA6VjpO5g9+diwRRYbjEiOrkqQ==
# =wn4B
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Sep 2023 10:20:48 EDT
# gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg:                 aka "Klaus Jensen <k.jensen@samsung.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
#      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9

* tag 'nvme-next-pull-request' of https://gitlab.com/birkelund/qemu:
  hw/nvme: Avoid dynamic stack allocation
  hw/nvme: Use #define to avoid variable length array

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9 months agotpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR
Marc-André Lureau [Mon, 11 Sep 2023 13:25:51 +0000 (17:25 +0400)]
tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

Replace select() with poll() to fix a crash when QEMU has a large number
of FDs. Also use RETRY_ON_EINTR to avoid unnecessary errors due to EINTR.

Cc: qemu-stable@nongnu.org
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133
Fixes: 56a3c24ffc ("tpm: Probe for connected TPM 1.2 or TPM 2")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
9 months agoMerge tag 'pull-request-2023-09-12' of https://gitlab.com/thuth/qemu into staging
Stefan Hajnoczi [Wed, 13 Sep 2023 11:52:43 +0000 (07:52 -0400)]
Merge tag 'pull-request-2023-09-12' of https://gitlab.com/thuth/qemu into staging

* Enable AP (crypto adapter) instructions for s390x PV-guests
* Allow NVME for s390x machines
* Update Linux headers to v6.6-rc1

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmUATY8RHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbVjBhAAlfXhQuxFdSRkPLyPgSuAInGTZfsW7A56
# 6vunyzP3ZyY5G0WtbgKZ5ovDIfjzlNYvkxWmQ4m4PWEY2JaBKOqeS9+lFkdZmGD9
# Sj1u+EereQS5MsJ31Vg2LHDKv5QbtNbVOq4KIm30qpzj1OfhfZzzqU0tGnaDlz/T
# PW2bSQl4cGHExcYpprWx02cXsMnodWwGV2FTgtc9D42YyE1q5IDX8phjFFzUHfcQ
# p3cjM0S2M8KOGJ5+0w2/0C4DEKgLH0OuA/JY3W+f94O+jdqoYUJpom4m6FywIKrr
# 38c7UqQESh7r/te1UkgvxfVCbTlptsS21xQNbsa+TS/apP6IMU7VJI3N14Qshtba
# cqcP54aGC+9v5FRz7E5njCJWJQv9JWInrKYTEEtSTFCguGCQO2owulba70MNrQc8
# hQkBXOzqnqYVxdktcHkbnq6QZoKLfsGAxfarQPPJySNUyGgoaM0JFlzp3z0hjAHY
# aGRZdN4kU+hF7/0RQygYDN4AzTQhn3EMZ6q6o81xVeKzfbziA3fCLXX5J1bd+rO8
# 3LKPrmOuk3dadRVlVTyFrtlG9SEMRen8dh12oru28ebW2WTeYm71zQf7SCPGzaKE
# hJMtlN7B9ogGxDpLJvTDLHbKNbwyIcW00GjyWiUwBg88ACg63tulD2kpUxBs2PwF
# bVk/lIWMqL0=
# =zeRZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Sep 2023 07:37:51 EDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2023-09-12' of https://gitlab.com/thuth/qemu:
  tests/qtest/pflash: Clean up local variable shadowing
  kconfig: Add NVME to s390x machines
  target/s390x: AP-passthrough for PV guests
  target/s390x/kvm: Refactor AP functionalities
  linux-headers: Update to Linux v6.6-rc1
  s390x: do a subsystem reset before the unprotect on reboot
  s390x/ap: fix missing subsystem reset registration

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9 months agoMerge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging
Stefan Hajnoczi [Wed, 13 Sep 2023 11:52:27 +0000 (07:52 -0400)]
Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging

UI patch queue

- vhost-user-gpu: support dmabuf modifiers
- fix VNC crash when there are no active_console
- cleanups and refactoring in ui/vc code

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmUAQX4cHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5Y4jD/4/whR7a1KZqHytl6sc
# cCQ0Xn0gpcPM8rn3tWItp2vAOlGmx8ACfAyXYa5QzO7pBOU/xoMJt8a99geNRXFu
# nN33UJ0NRAWW6V0/cF5AVe9clckzs1Vq4VX2ITP+VAG+c+kt4E3fgFn9o8nwnBrd
# zuiqYz4pO9yBVO/av/FZQcBY8s9/M8jrdraDNNhsY2O2k2zLTxt1xxNG5qeVvPUw
# 2RZyc/EOG7RzW8eUA55BW/NU8Olg5u7dxsB0jfYnWBQxknOy5c+wF9MTGJSKmdGk
# HmgfMns6intUdfHmmJuDpP1Tiy1sVK1lkrsMeeQ67M84lYZsrSI+kIG5+YbWN8vx
# mMB/qwDmNMVMnGiBN5/ktvAJwcilYBUqen0KFrEHBghTpGhqAVoBNCC1MT/9w/bO
# c3/E1viuCi8OamPixVu9LeqQsxuP2jK5qxjfyDYH87HdnljSY6wFbVzD/2zz5YNv
# 43JtEbP9bv1yyRRd+JTpD54vCK0IZK7MBR8MbJqfknpbEw1FSPofRQxCSe9BlSJ/
# nYamatH9I9i92kGg5eD573X+UcLX9eOPBw8gVNKxuttwSIW1cwjGKi12B9MiFMg7
# Z6jP3gvpe9DrYef+4Wojo1PAioyweZVG5IFtWIqXRZjPwAoIzzVgBcEtcq4qeZwX
# BAliXWeUcRGsbLorT3COx2DjBw==
# =Xsr0
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Sep 2023 06:46:22 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
  ui: add precondition for dpy_get_ui_info()
  ui: fix crash when there are no active_console
  virtio-gpu/win32: set the destroy function on load
  ui/console: move DisplaySurface to its own header
  ui/vc: split off the VC part from console.c
  ui/vc: preliminary QemuTextConsole changes before split
  ui/console: remove redundant format field
  ui/vc: rename kbd_put to qemu_text_console functions
  ui/vc: remove kbd_put_keysym() and update function calls
  vmmouse: use explicit code
  vmmouse: replace DPRINTF with tracing
  vhost-user-gpu: support dmabuf modifiers
  contrib/vhost-user-gpu: add support for sending dmabuf modifiers
  docs: vhost-user-gpu: add protocol changes for dmabuf modifiers

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9 months agotarget/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()
Philippe Mathieu-Daudé [Wed, 13 Sep 2023 09:30:05 +0000 (11:30 +0200)]
target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()

x86_cpu_get_supported_cpuid() is generic and handles the different
accelerators. Use it instead of kvm_arch_get_supported_cpuid().

That fixes a link failure introduced by commit 3adce820cf
("target/i386: Remove unused KVM stubs") when QEMU is configured
as:

  $ ./configure --cc=clang \
    --target-list=x86_64-linux-user,x86_64-softmmu \
    --enable-debug

We were getting:

  [71/71] Linking target qemu-x86_64
  FAILED: qemu-x86_64
  /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
  cpu.c:(.text+0x1374): undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
  cpu.c:(.text+0x81c2): undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: cpu.c:(.text+0x81da): undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: cpu.c:(.text+0x81f2): undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: cpu.c:(.text+0x820a): undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:cpu.c:(.text+0x8225): more undefined references to `kvm_arch_get_supported_cpuid' follow
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

For the record, this is because '--enable-debug' disables
optimizations (CFLAGS=-O0).

While at this (un)optimization level GCC eliminate the
following dead code (CPP output of mentioned build):

 static void x86_cpu_get_supported_cpuid(uint32_t func, uint32_t index,
                                         uint32_t *eax, uint32_t *ebx,
                                         uint32_t *ecx, uint32_t *edx)
 {
     if ((0)) {
         *eax = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_EAX);
         *ebx = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_EBX);
         *ecx = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_ECX);
         *edx = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_EDX);
     } else if (0) {
         *eax = 0;
         *ebx = 0;
         *ecx = 0;
         *edx = 0;
     } else {
         *eax = 0;
         *ebx = 0;
         *ecx = 0;
         *edx = 0;
     }

Clang does not (see commit 2140cfa51d "i386: Fix build by
providing stub kvm_arch_get_supported_cpuid()").

Cc: qemu-stable@nongnu.org
Fixes: 3adce820cf ("target/i386: Remove unused KVM stubs")
Reported-by: Kevin Wolf <kwolf@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230913093009.83520-4-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 months agotarget/i386: Drop accel_uses_host_cpuid before x86_cpu_get_supported_cpuid
Philippe Mathieu-Daudé [Wed, 13 Sep 2023 09:30:04 +0000 (11:30 +0200)]
target/i386: Drop accel_uses_host_cpuid before x86_cpu_get_supported_cpuid

x86_cpu_get_supported_cpuid() already checks for KVM/HVF
accelerators, so it is not needed to manually check it via
a call to accel_uses_host_cpuid() before calling it.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230913093009.83520-3-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 months agotarget/i386: Check kvm_hyperv_expand_features() return value
Philippe Mathieu-Daudé [Wed, 13 Sep 2023 09:30:03 +0000 (11:30 +0200)]
target/i386: Check kvm_hyperv_expand_features() return value

In case more code is added after the kvm_hyperv_expand_features()
call, check its return value (since it can fail).

Fixes: 071ce4b03b ("i386: expand Hyper-V features during CPU feature expansion time")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230913093009.83520-2-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 months agotarget/hppa: Allow up to 16 BTLB entries
Helge Deller [Wed, 13 Sep 2023 08:37:41 +0000 (10:37 +0200)]
target/hppa: Allow up to 16 BTLB entries

Reserve 16 out of the 256 TLB entries for Block-TLBs.

Signed-off-by: Helge Deller <deller@gmx.de>
9 months agotarget/hppa: Update to SeaBIOS-hppa version 9
Helge Deller [Wed, 13 Sep 2023 09:32:27 +0000 (11:32 +0200)]
target/hppa: Update to SeaBIOS-hppa version 9

Enhancements:
- Support for Block-TLB (BTLB) on 32-bit CPUs

Signed-off-by: Helge Deller <deller@gmx.de>
9 months agomeson: Fix targetos match for illumos and Solaris.
Jonathan Perkin [Fri, 8 Sep 2023 17:45:42 +0000 (18:45 +0100)]
meson: Fix targetos match for illumos and Solaris.

qemu 8.1.0 breaks on illumos platforms due to _XOPEN_SOURCE and others no longer being set correctly, leading to breakage such as:

  https://us-central.manta.mnx.io/pkgsrc/public/reports/trunk/tools/20230908.1404/qemu-8.1.0/build.log

This is a result of meson conversion which incorrectly matches against 'solaris' instead of 'sunos' for uname.

First time submitting a patch here, hope I did it correctly.  Thanks.

Signed-off-by: Jonathan Perkin <jonathan@perkin.org.uk>
Message-ID: <ZPtdxtum9UVPy58J@perkin.org.uk>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 months agohw/nvme: Avoid dynamic stack allocation
Peter Maydell [Fri, 11 Aug 2023 17:47:51 +0000 (18:47 +0100)]
hw/nvme: Avoid dynamic stack allocation

Instead of using a variable-length array in nvme_map_prp(),
allocate on the stack with a g_autofree pointer.

The codebase has very few VLAs, and if we can get rid of them all we
can make the compiler error on new additions.  This is a defensive
measure against security bugs where an on-stack dynamic allocation
isn't correctly size-checked (e.g.  CVE-2021-3527).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
9 months agohw/nvme: Use #define to avoid variable length array
Philippe Mathieu-Daudé [Fri, 11 Aug 2023 17:47:50 +0000 (18:47 +0100)]
hw/nvme: Use #define to avoid variable length array

In nvme_map_sgl() we create an array segment[] whose size is the
'const int SEG_CHUNK_SIZE'.  Since this is C, rather than C++, a
"const int foo" is not a true constant, it's merely a variable with a
constant value, and so semantically segment[] is a variable-length
array.  Switch SEG_CHUNK_SIZE to a #define so that we can make the
segment[] array truly fixed-size, in the sense that it doesn't
trigger the -Wvla warning.

The codebase has very few VLAs, and if we can get rid of them all we
can make the compiler error on new additions.  This is a defensive
measure against security bugs where an on-stack dynamic allocation
isn't correctly size-checked (e.g.  CVE-2021-3527).

[PMM: rebased (function has moved file), expand commit message
 based on discussion from previous version of patch]

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
9 months agotests/qtest/pflash: Clean up local variable shadowing
Philippe Mathieu-Daudé [Mon, 4 Sep 2023 16:28:24 +0000 (18:28 +0200)]
tests/qtest/pflash: Clean up local variable shadowing

Fix:

  tests/qtest/pflash-cfi02-test.c: In function ‘test_geometry’:
  tests/qtest/pflash-cfi02-test.c:409:22: warning: declaration of ‘byte_addr’ shadows a previous local [-Wshadow=compatible-local]
    409 |             uint64_t byte_addr = (uint64_t)i * c->sector_len[region];
        |                      ^~~~~~~~~
  tests/qtest/pflash-cfi02-test.c:342:14: note: shadowed declaration is here
    342 |     uint64_t byte_addr = 0;
        |              ^~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904162824.85385-4-philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agokconfig: Add NVME to s390x machines
Cédric Le Goater [Mon, 28 Aug 2023 15:01:48 +0000 (17:01 +0200)]
kconfig: Add NVME to s390x machines

We recently had issues with nvme devices on big endian platforms.
Include their compilation on s390x to ease tests.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20230828150148.120031-1-clg@kaod.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agotarget/s390x: AP-passthrough for PV guests
Steffen Eiden [Wed, 23 Aug 2023 14:22:19 +0000 (16:22 +0200)]
target/s390x: AP-passthrough for PV guests

Enabling AP-passthrough(AP-pt) for PV-guest by using the new CPU
features for PV-AP-pt of KVM.

As usual QEMU first checks which CPU features are available and then
sets them if available and selected by user. An additional check is done
to verify that PV-AP can only be enabled if "regular" AP-pt is enabled
as well. Note that KVM itself does not enforce this restriction.

Reviewed-by: Michael Mueller <mimu@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Message-ID: <20230823142219.1046522-6-seiden@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agotarget/s390x/kvm: Refactor AP functionalities
Steffen Eiden [Wed, 23 Aug 2023 14:22:18 +0000 (16:22 +0200)]
target/s390x/kvm: Refactor AP functionalities

kvm_s390_set_attr() is a misleading name as it only sets attributes for
the KVM_S390_VM_CRYPTO group. Therefore, rename it to
kvm_s390_set_crypto_attr().

Add new functions ap_available() and ap_enabled() to avoid code
duplication later.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael Mueller <mimu@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Message-ID: <20230823142219.1046522-5-seiden@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agolinux-headers: Update to Linux v6.6-rc1
Thomas Huth [Tue, 12 Sep 2023 09:24:40 +0000 (11:24 +0200)]
linux-headers: Update to Linux v6.6-rc1

This update contains the required header changes for the
"target/s390x: AP-passthrough for PV guests" patch from
Steffen Eiden.

Message-ID: <20230912093432.180041-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agos390x: do a subsystem reset before the unprotect on reboot
Janosch Frank [Fri, 1 Sep 2023 11:48:51 +0000 (11:48 +0000)]
s390x: do a subsystem reset before the unprotect on reboot

Bound APQNs have to be reset before tearing down the secure config via
s390_machine_unprotect(). Otherwise the Ultravisor will return a error
code.

So let's do a subsystem_reset() which includes a AP reset before the
unprotect call. We'll do a full device_reset() afterwards which will
reset some devices twice. That's ok since we can't move the
device_reset() before the unprotect as it includes a CPU clear reset
which the Ultravisor does not expect at that point in time.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Message-ID: <20230901114851.154357-1-frankja@linux.ibm.com>
Tested-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agos390x/ap: fix missing subsystem reset registration
Janosch Frank [Wed, 23 Aug 2023 14:22:15 +0000 (16:22 +0200)]
s390x/ap: fix missing subsystem reset registration

A subsystem reset contains a reset of AP resources which has been
missing.  Adding the AP bridge to the list of device types that need
reset fixes this issue.

Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Fixes: a51b3153 ("s390x/ap: base Adjunct Processor (AP) object model")
Message-ID: <20230823142219.1046522-2-seiden@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
9 months agoui: add precondition for dpy_get_ui_info()
Marc-André Lureau [Tue, 12 Sep 2023 06:13:01 +0000 (10:13 +0400)]
ui: add precondition for dpy_get_ui_info()

Ensure that it only get called when dpy_ui_info_supported(). The
function should always return a result. There should be a non-null
console or active_console.

Modify the argument to be const as well.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Albert Esteve <aesteve@redhat.com>
9 months agoui: fix crash when there are no active_console
Marc-André Lureau [Mon, 11 Sep 2023 14:04:47 +0000 (18:04 +0400)]
ui: fix crash when there are no active_console

Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812
812     return con->hw_ops->ui_info != NULL;
(gdb) bt
#0  0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812
#1  0x00005555558a44b1 in protocol_client_msg (vs=0x5555578c76c0, data=0x5555581e93f0 <incomplete sequence \373>, len=24) at ../ui/vnc.c:2585
#2  0x00005555558a19ac in vnc_client_read (vs=0x5555578c76c0) at ../ui/vnc.c:1607
#3  0x00005555558a1ac2 in vnc_client_io (ioc=0x5555581eb0e0, condition=G_IO_IN, opaque=0x5555578c76c0) at ../ui/vnc.c:1635

Fixes:
https://issues.redhat.com/browse/RHEL-2600

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Albert Esteve <aesteve@redhat.com>
9 months agovirtio-gpu/win32: set the destroy function on load
Marc-André Lureau [Wed, 6 Sep 2023 12:37:43 +0000 (16:37 +0400)]
virtio-gpu/win32: set the destroy function on load

Don't forget to unmap the resource memory.

Fixes: commit 9462ff469 ("virtio-gpu/win32: allocate shareable 2d resources/images")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9 months agoui/console: move DisplaySurface to its own header
Marc-André Lureau [Wed, 30 Aug 2023 09:38:24 +0000 (13:38 +0400)]
ui/console: move DisplaySurface to its own header

Mostly for readability reasons.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
9 months agoui/vc: split off the VC part from console.c
Marc-André Lureau [Wed, 30 Aug 2023 09:38:23 +0000 (13:38 +0400)]
ui/vc: split off the VC part from console.c

Move common declarations to console-priv.h, and add a new unit
console-vc.c which will handle VC/chardev rendering, when pixman is
available.

(if necessary, the move could be done chunk by chunks)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
9 months agoui/vc: preliminary QemuTextConsole changes before split
Marc-André Lureau [Wed, 30 Aug 2023 09:38:22 +0000 (13:38 +0400)]
ui/vc: preliminary QemuTextConsole changes before split

Those changes will help to split console.c unit in the following commit.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
9 months agoui/console: remove redundant format field
Marc-André Lureau [Wed, 30 Aug 2023 09:38:21 +0000 (13:38 +0400)]
ui/console: remove redundant format field

It's already part of PIXMAN image.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
9 months agoui/vc: rename kbd_put to qemu_text_console functions
Marc-André Lureau [Wed, 30 Aug 2023 09:38:20 +0000 (13:38 +0400)]
ui/vc: rename kbd_put to qemu_text_console functions

They are QemuTextConsole functions, let's make it clear.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
9 months agoui/vc: remove kbd_put_keysym() and update function calls
Marc-André Lureau [Wed, 30 Aug 2023 09:38:19 +0000 (13:38 +0400)]
ui/vc: remove kbd_put_keysym() and update function calls

The function calls to `kbd_put_keysym` have been updated to now call
`kbd_put_keysym_console` with a NULL console parameter.

Like most console functions, NULL argument is now for the active console.

This will allow to rename the text console functions in a consistent manner.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>