Re: [PULL 00/10] ppc queue

2023-05-29 Thread Richard Purdie
On Mon, 2023-05-29 at 16:30 +1000, Nicholas Piggin wrote: > On Mon May 29, 2023 at 4:01 PM AEST, Michael Tokarev wrote: > > 29.05.2023 05:18, Nicholas Piggin wrote: > > .. > > > > > > 01/10 target/ppc: Fix fallback to MFSS for MFFS* instructions on pre > > > > 3.0 ISAs > > > > 02/10 target/ppc: F

Re: [PATCH] igb: Add Function Level Reset to PF and VF

2023-05-29 Thread Cédric Le Goater
On 5/29/23 04:45, Akihiko Odaki wrote: On 2023/05/28 19:50, Sriram Yagnaraman wrote: -Original Message- From: Cédric Le Goater Sent: Friday, 26 May 2023 19:31 To: qemu-devel@nongnu.org Cc: Akihiko Odaki ; Sriram Yagnaraman ; Jason Wang ; Cédric Le Goater Subject: [PATCH] igb: Add Fun

Re: [PATCH] hw/sd/sdhci: reset data count in sdhci_buff_access_is_sequential()

2023-05-29 Thread Mauro Matteo Cascella
On Sat, May 27, 2023 at 11:00 AM Michael Tokarev wrote: > > Mon, 7 Nov 2022 11:35:10 +0100, you wrote: > > Make sure to reset data_count if it's equal to (or exceeds) block_size. > > This prevents an off-by-one read / write when accessing s->fifo_buffer > > in sdhci_read_dataport / sdhci_write_

Re: [PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-29 Thread Stefano Garzarella
On Fri, May 26, 2023 at 04:20:14PM -0500, Jonathon Jongsma wrote: On 5/26/23 10:03 AM, Stefano Garzarella wrote: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd passing through the new 'fd' property. Since now we are using qemu_open() on '@path' if the virtio-blk driver suppo

Re: [PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-29 Thread Stefano Garzarella
On Sat, May 27, 2023 at 07:56:13AM +0200, Markus Armbruster wrote: Stefano Garzarella writes: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd passing through the new 'fd' property. Since now we are using qemu_open() on '@path' if the virtio-blk driver supports the fd passin

Re: [PATCH] igb: Add Function Level Reset to PF and VF

2023-05-29 Thread Akihiko Odaki
On 2023/05/29 16:01, Cédric Le Goater wrote: On 5/29/23 04:45, Akihiko Odaki wrote: On 2023/05/28 19:50, Sriram Yagnaraman wrote: -Original Message- From: Cédric Le Goater Sent: Friday, 26 May 2023 19:31 To: qemu-devel@nongnu.org Cc: Akihiko Odaki ; Sriram Yagnaraman ; Jason Wang ; C

[PATCH] hw/clx: Fix CFMW config memory leak

2023-05-29 Thread Li Zhijian
Only 'fw' pointer is marked as g_autofree, so we shoud free other resource manually in error path. Signed-off-by: Li Zhijian --- hw/cxl/cxl-host.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 034c7805b3e..dd1a7c83f71 1

[PATCH] meson: Avoid implicit declaration of functions

2023-05-29 Thread Michal Privoznik
While detecting a presence of a function via 'cc.links()' gives desired result (i.e. detects whether function is present), it also produces a warning on systems where the function is not present, e.g.: qemu.git/build/meson-private/tmph74x3p38/testfile.c:2:34: \ warning: implicit declaration of

Re: [PATCH v3 01/14] nbd/client: Use smarter assert

2023-05-29 Thread Vladimir Sementsov-Ogievskiy
On 15.05.23 22:53, Eric Blake wrote: Assigning strlen() to a uint32_t and then asserting that it isn't too large doesn't catch the case of an input string 4G in length. Thankfully, the incoming strings can never be that large: if the export name or query is reflecting a string the client got from

Re: [PATCH v3 02/14] nbd/client: Add safety check on chunk payload length

2023-05-29 Thread Vladimir Sementsov-Ogievskiy
On 15.05.23 22:53, Eric Blake wrote: Our existing use of structured replies either reads into a qiov capped at 32M (NBD_CMD_READ) or caps allocation to 1000 bytes (see NBD_MAX_MALLOC_PAYLOAD in block/nbd.c). But the existing length checks are rather late; if we encounter a buggy (or malicious) s

Re: [PATCH v2 5/6] block/linux-aio: convert to blk_io_plug_call() API

2023-05-29 Thread Stefano Garzarella
On Wed, May 24, 2023 at 03:36:34PM -0400, Stefan Hajnoczi wrote: On Wed, May 24, 2023 at 10:52:03AM +0200, Stefano Garzarella wrote: On Tue, May 23, 2023 at 01:12:59PM -0400, Stefan Hajnoczi wrote: > Stop using the .bdrv_co_io_plug() API because it is not multi-queue > block layer friendly. Use

Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol.

2023-05-29 Thread Het Gala
On 25/05/23 11:04 pm, Markus Armbruster wrote: Het Gala writes: This patch introduces well defined MigrateAddress struct and its related child objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of string type. The current migration flow follows double encodin

Re: [PULL 00/10] ppc queue

2023-05-29 Thread Daniel Henrique Barboza
On 5/28/23 14:36, Michael Tokarev wrote: 28.05.2023 19:49, Daniel Henrique Barboza wrote:    https://gitlab.com/danielhb/qemu.git tags/pull-ppc-20230528 ppc patch queue for 2023-05-28: This queue includes several assorted fixes for PowerPC SPR emulation, a change in the default Pegasos2 CP

Re: [PATCH v1] hw/pvrdma: Protect against buggy or malicious guest driver

2023-05-29 Thread Mauro Matteo Cascella
On Mon, May 15, 2023 at 6:13 PM Michael Tokarev wrote: > > 01.03.2023 17:29, Yuval Shaia wrote: > > Guest driver allocates and initialize page tables to be used as a ring > > of descriptors for CQ and async events. > > The page table that represents the ring, along with the number of pages > > in

Re: [PATCH v7 0/1] arm: enable MTE for QEMU + kvm

2023-05-29 Thread Andrea Bolognani
On Mon, May 22, 2023 at 02:04:28PM +0200, Cornelia Huck wrote: > On Fri, Apr 28 2023, Cornelia Huck wrote: > > Another open problem is mte vs mte3: tcg emulates mte3, kvm gives the guest > > whatever the host supports. Without migration support, this is not too much > > of a problem yet, but for c

Re: [PATCH] meson: Avoid implicit declaration of functions

2023-05-29 Thread Peter Maydell
On Mon, 29 May 2023 at 08:58, Michal Privoznik wrote: > > While detecting a presence of a function via 'cc.links()' > gives desired result (i.e. detects whether function is present), > it also produces a warning on systems where the function is not > present, e.g.: > > qemu.git/build/meson-priva

Re: [PATCH v7 0/1] arm: enable MTE for QEMU + kvm

2023-05-29 Thread Peter Maydell
On Mon, 29 May 2023 at 11:15, Andrea Bolognani wrote: > > On Mon, May 22, 2023 at 02:04:28PM +0200, Cornelia Huck wrote: > > On Fri, Apr 28 2023, Cornelia Huck wrote: > > > Another open problem is mte vs mte3: tcg emulates mte3, kvm gives the > > > guest > > > whatever the host supports. Without

Re: [PATCH] meson: Avoid implicit declaration of functions

2023-05-29 Thread Paolo Bonzini
On 5/29/23 12:24, Peter Maydell wrote: On Mon, 29 May 2023 at 08:58, Michal Privoznik wrote: While detecting a presence of a function via 'cc.links()' gives desired result (i.e. detects whether function is present), it also produces a warning on systems where the function is not present, e.g.:

Re: [PATCH] meson: Avoid implicit declaration of functions

2023-05-29 Thread Michael Tokarev
29.05.2023 10:56, Michal Privoznik пишет: While detecting a presence of a function via 'cc.links()' gives desired result (i.e. detects whether function is present), it also produces a warning on systems where the function is not present, e.g.: qemu.git/build/meson-private/tmph74x3p38/testfile

Re: [PATCH v1] hw/loongarch: Add numa support

2023-05-29 Thread Song Gao
在 2023/5/29 上午11:12, Tianrui Zhao 写道: 在 2023年05月18日 17:06, Song Gao 写道: 1. Implement some functions for LoongArch numa support; 2. Implement fdt_add_memory_node() for fdt; 3. build_srat() fills node_id and adds build numa memory. Base-on: https://patchew.org/QEMU/20230518014115.117869-1-ga

Re: [PATCH v5 6/9] migration: modified migration QAPIs to accept 'channels' argument for migration

2023-05-29 Thread Het Gala
On 25/05/23 11:20 pm, Markus Armbruster wrote: Het Gala writes: MigrateChannelList allows to connect accross multiple interfaces. Added MigrateChannelList struct as argument to migration QAPIs. Future patchset series plans to include multiple MigrateChannels for multiple interfaces to be co

Re: [PATCH v5 8/9] migration: Introduced MigrateChannelList struct to migration code flow.

2023-05-29 Thread Het Gala
On 25/05/23 11:32 pm, Markus Armbruster wrote: Het Gala writes: Integrated MigrateChannelList with all transport backends (socket, exec and rdma) for both source and destination migration code flow. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala clang warns for me: ../migratio

Re: [PATCH 15/30] asc: generate silence if FIFO empty but engine still running

2023-05-29 Thread Volker Rümelin
MacOS (un)helpfully leaves the FIFO engine running even when all the samples have been written to the hardware, and expects the FIFO status flags and IRQ to be updated continuously. Since not all audio backends guarantee an all-zero output when no data is provided, explicitly generate an all-zer

[PATCH v2 0/2] vhost: release memory objects in an error path

2023-05-29 Thread P J P
From: Prasad Pandit Hi, vhost_dev_start function does not release memory objects in case of an error. These couple of patches fix this glitch. Thank you. --- Prasad Pandit (2): vhost: release memory_listener object in error path vhost: release virtqueue objects in error path hw/virtio/vho

[PATCH v2 1/2] vhost: release memory_listener object in error path

2023-05-29 Thread P J P
From: Prasad Pandit vhost_dev_start function does not release memory_listener object in case of an error. This may crash the guest when vhost is unable to set memory table: stack trace of thread 125653: Program terminated with signal SIGSEGV, Segmentation fault #0 memory_listener_register

[PATCH v2 2/2] vhost: release virtqueue objects in error path

2023-05-29 Thread P J P
From: Prasad Pandit vhost_dev_start function does not release virtqueue objects when event_notifier_init() function fails. Release virtqueue objects and log a message about function failure. Signed-off-by: Prasad Pandit --- hw/virtio/vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

Re: [PATCH 14/30] audio: add Apple Sound Chip (ASC) emulation

2023-05-29 Thread Volker Rümelin
The Apple Sound Chip was primarily used by the Macintosh II to generate sound in hardware which was previously handled by the toolbox ROM with software interrupts. Implement both the standard ASC and also the enhanced ASC (EASC) functionality which is used in the Quadra 800. Note that whilst rea

[PATCH v13 03/10] accel: collecting TB execution count

2023-05-29 Thread Fei Wu
From: "Vanderson M. do Rosario" If a TB has a TBS (TBStatistics) with the TB_EXEC_STATS enabled, then we instrument the start code of this TB to atomically count the number of times it is executed. We count both the number of "normal" executions and atomic executions of a TB. The execution count

[PATCH v13 04/10] accel/tcg: add jit stats and time to TBStatistics

2023-05-29 Thread Fei Wu
This collects all the statistics for TBStatistics, not only for the whole emulation but for each TB. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 20 - accel/tcg/tb-stats.c | 146 ++

[PATCH v13 00/10] TCG code quality tracking

2023-05-29 Thread Fei Wu
v12 --- * remove CONFIG_PROFILER completely at the first * squash original patches 3-8 into one * use Richard's inline version gen_tb_exec_count * convert how-to to rst format as suggested by Thomas * small change to patch 6 of hmp command Alex Bennée (1): tb-stats: reset the tracked TBs on a t

[PATCH v13 01/10] accel/tcg: remove CONFIG_PROFILER

2023-05-29 Thread Fei Wu
TBStats will be introduced to replace CONFIG_PROFILER totally, here remove all CONFIG_PROFILER related stuffs first. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 25 accel/tcg/tcg-accel-ops.c | 10 -- acc

[PATCH v13 06/10] monitor: adding tb_stats hmp command

2023-05-29 Thread Fei Wu
From: "Vanderson M. do Rosario" Adding tb_stats [start|pause|stop|filter] command to hmp. This allows controlling the collection of statistics. It is also possible to set the level of collection: all, jit, or exec. tb_stats filter allow to only collect statistics for the TB in the last_search li

[PATCH v13 05/10] debug: add -d tb_stats to control TBStatistics collection:

2023-05-29 Thread Fei Wu
From: "Vanderson M. do Rosario" -d tb_stats[[,level=(+all+jit+exec+time)][,dump_limit=]] "dump_limit" is used to limit the number of dumped TBStats in linux-user mode. [all+jit+exec+time] control the profilling level used by the TBStats. Can be used as follow: -d tb_stats -d tb_stats,level=ji

[PATCH v13 09/10] tb-stats: dump hot TBs at the end of the execution

2023-05-29 Thread Fei Wu
From: "Vanderson M. do Rosario" Dump the hottest TBs if -d tb_stats,dump_limit=N is used. Example of output for the 3 hottest TBs: TB id:1 | phys:0x34d54 virt:0x00034d54 flags:0xf0 | exec:4828932/0 guest inst cov:16.38% | trans:1 ints: g:3 op:82 op_opt:34 spills:3

[PATCH v13 08/10] Adding info [tb-list|tb] commands to HMP (WIP)

2023-05-29 Thread Fei Wu
From: "Vanderson M. do Rosario" These commands allow the exploration of TBs generated by the TCG. Understand which one hotter, with more guest/host instructions... and examine their guest, host and IR code. The goal of this command is to allow the dynamic exploration of TCG behavior and code qua

[PATCH v13 10/10] docs: add tb-stats how to

2023-05-29 Thread Fei Wu
Signed-off-by: Fei Wu --- docs/devel/tcg-tbstats.rst | 129 + 1 file changed, 129 insertions(+) create mode 100644 docs/devel/tcg-tbstats.rst diff --git a/docs/devel/tcg-tbstats.rst b/docs/devel/tcg-tbstats.rst new file mode 100644 index 00..bfba222e9

[PATCH v13 02/10] accel/tcg: introduce TBStatistics structure

2023-05-29 Thread Fei Wu
From: "Vanderson M. do Rosario" To store statistics for each TB, we created a TBStatistics structure which is linked with the TBs. TBStatistics can stay alive after tb_flush and be relinked to a regenerated TB. So the statistics can be accumulated even through flushes. The goal is to have all pr

[PATCH v13 07/10] tb-stats: reset the tracked TBs on a tb_flush

2023-05-29 Thread Fei Wu
From: Alex Bennée We keep track of translations but can only do so up until the translation cache is flushed. At that point we really have no idea if we can re-create a translation because all the active tracking information has been reset. Signed-off-by: Alex Bennée Reviewed-by: Richard Hender

[PATCH v3 2/2] hw/vfio: Add nr of dirty pages to vfio_get_dirty_bitmap tracepoint

2023-05-29 Thread Joao Martins
Include the number of dirty pages on the vfio_get_dirty_bitmap tracepoint. These are fetched from the newly added return value in cpu_physical_memory_set_lebitmap(). Signed-off-by: Joao Martins --- hw/vfio/common.c | 7 --- hw/vfio/trace-events | 2 +- 2 files changed, 5 insertions(+), 4

[PATCH v3 0/2] hw/vfio: Improve vfio_get_dirty_bitmap() tracepoint

2023-05-29 Thread Joao Martins
Hey, This tiny series changes the tracepoint to include the number of dirty pages via the vfio_get_dirty_bitmap. I find it useful for observability in general to understand the number of dirty pages in an IOVA range. With dirty tracking supported by device or IOMMU it's specially relevant data to

[PATCH v3 1/2] exec/ram_addr: return nr of dirty pages in cpu_physical_memory_set_dirty_lebitmap()

2023-05-29 Thread Joao Martins
In preparation for including the number of dirty pages in the vfio_get_dirty_bitmap() tracepoint, return the number of dirty pages in cpu_physical_memory_set_dirty_lebitmap() similar to cpu_physical_memory_sync_dirty_bitmap(). To avoid counting twice when GLOBAL_DIRTY_RATE is enabled, stash the nu

[PATCH 3/4] target/riscv: Support MSTATUS.MPV/GVA only when RVH is enabled

2023-05-29 Thread Weiwei Li
MPV and GVA bits are added by hypervisor extension to mstatus and mstatush (if MXLEN=32). Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/csr.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 584

[PATCH 0/4] target/riscv: Fix mstatus related problems

2023-05-29 Thread Weiwei Li
This patchset tries to fix some problems in the fields of mstatus, such as make MPV only work when MPP != PRM. The port is available here: https://github.com/plctlab/plct-qemu/tree/plct-mpv-upstream Weiwei Li (4): target/riscv: Make MPV only work when MPP != PRV_M target/riscv: Remove check

[PATCH 1/4] target/riscv: Make MPV only work when MPP != PRV_M

2023-05-29 Thread Weiwei Li
Upon MRET or explicit memory access with MPRV=1, MPV should be ignored when MPP=PRV_M. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/cpu_helper.c | 3 ++- target/riscv/op_helper.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu_

[PATCH 4/4] target/riscv: Remove redundant assignment to SXL

2023-05-29 Thread Weiwei Li
SXL is initialized as env->misa_mxl which is also the mxl value. So we can just remain it unchanged to keep it read-only. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/csr.c | 4 1 file changed, 4 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c i

[PATCH 2/4] target/riscv: Remove check on mode for MPRV

2023-05-29 Thread Weiwei Li
Normally, MPRV can be set to 1 only in M mode (It will be cleared when returning to lower-privilege mode by MRET/SRET). Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu_helper

[PATCH v2 00/17] Support smp.clusters for x86

2023-05-29 Thread Zhao Liu
From: Zhao Liu Hi list, This is the our v2 patch series, rebased on the master branch at the commit ac84b57b4d74 ("Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging"). Comparing with v1 [1], v2 mainly reorganizes patches and does some cleanup. This series add the cluster

[PATCH v2 02/17] tests: Rename test-x86-cpuid.c to test-x86-topo.c

2023-05-29 Thread Zhao Liu
From: Zhao Liu In fact, this unit tests APIC ID other than CPUID. Rename to test-x86-topo.c to make its name more in line with its actual content. Signed-off-by: Zhao Liu --- Changes since v1: * Rename test-x86-apicid.c to test-x86-topo.c. (Yanan) --- MAINTAINERS

[PATCH v2 04/17] i386/cpu: Fix i/d-cache topology to core level for Intel CPU

2023-05-29 Thread Zhao Liu
From: Zhao Liu For i-cache and d-cache, the maximum IDs for CPUs sharing cache ( CPUID.04H.00H:EAX[bits 25:14] and CPUID.04H.01H:EAX[bits 25:14]) are both 0, and this means i-cache and d-cache are shared in the SMT level. This is correct if there's single thread per core, but is wrong for the hyp

[PATCH v2 06/17] i386/cpu: Consolidate the use of topo_info in cpu_x86_cpuid()

2023-05-29 Thread Zhao Liu
From: Zhao Liu In cpu_x86_cpuid(), there are many variables in representing the cpu topology, e.g., topo_info, cs->nr_cores/cs->nr_threads. Since the names of cs->nr_cores/cs->nr_threads does not accurately represent its meaning, the use of cs->nr_cores/cs->nr_threads is prone to confusion and m

[PATCH v2 17/17] i386: Add new property to control L2 cache topo in CPUID.04H

2023-05-29 Thread Zhao Liu
From: Zhao Liu The property x-l2-cache-topo will be used to change the L2 cache topology in CPUID.04H. Now it allows user to set the L2 cache is shared in core level or cluster level. If user passes "-cpu x-l2-cache-topo=[core|cluster]" then older L2 cache topology will be overrided by the new

[PATCH v2 16/17] i386: Use CPUCacheInfo.share_level to encode CPUID[0x8000001D].EAX[bits 25:14]

2023-05-29 Thread Zhao Liu
From: Zhao Liu CPUID[0x801D].EAX[bits 25:14] is used to represent the cache topology for amd CPUs. After cache models have topology information, we can use CPUCacheInfo.share_level to decide which topology level to be encoded into CPUID[0x801D].EAX[bits 25:14]. Signed-off-by: Zhao Liu

[PATCH v2 09/17] i386: Support module_id in X86CPUTopoIDs

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding Add module_id member in X86CPUTopoIDs. module_id can be parsed from APIC ID, so also update APIC ID parsing rule to support module level. With this support, the conversions with module level between X86CPUTopoIDs, X86CPUTopoInfo and APIC ID are completed. module_id can be a

[PATCH v2 10/17] i386/cpu: Introduce cluster-id to X86CPU

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding We introduce cluster-id other than module-id to be consistent with CpuInstanceProperties.cluster-id, and this avoids the confusion of parameter names when hotplugging. Following the legacy smp check rules, also add the cluster_id validity into x86_cpu_pre_plug(). Signed-off

[PATCH v2 07/17] i386: Introduce module-level cpu topology to CPUX86State

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding smp command has the "clusters" parameter but x86 hasn't supported that level. "cluster" is a CPU topology level concept above cores, in which the cores may share some resources (L2 cache or some others like L3 cache tags, depending on the Archs) [1][2]. For x86, the resource

[PATCH v2 15/17] i386: Fix NumSharingCache for CPUID[0x8000001D].EAX[bits 25:14]

2023-05-29 Thread Zhao Liu
From: Zhao Liu The commit 8f4202fb1080 ("i386: Populate AMD Processor Cache Information for cpuid 0x801D") adds the cache topology for AMD CPU by encoding the number of sharing threads directly. >From AMD's APM, NumSharingCache (CPUID[0x801D].EAX[bits 25:14]) means [1]: The number of lo

[PATCH v2 05/17] i386/cpu: Use APIC ID offset to encode cache topo in CPUID[4]

2023-05-29 Thread Zhao Liu
From: Zhao Liu Refer to the fixes of cache_info_passthrough ([1], [2]) and SDM, the CPUID.04H:EAX[bits 25:14] and CPUID.04H:EAX[bits 31:26] should use the nearest power-of-2 integer. The nearest power-of-2 integer can be caculated by pow2ceil() or by using APIC ID offset (like L3 topology using

[PATCH v2 08/17] i386: Support modules_per_die in X86CPUTopoInfo

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding Support module level in i386 cpu topology structure "X86CPUTopoInfo". Since x86 does not yet support the "clusters" parameter in "-smp", X86CPUTopoInfo.modules_per_die is currently always 1. Therefore, the module level width in APIC ID, which can be calculated by "apicid_bit

[PATCH v2 12/17] hw/i386/pc: Support smp.clusters for x86 PC machine

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding As module-level topology support is added to X86CPU, now we can enable the support for the cluster parameter on PC machines. With this support, we can define a 5-level x86 CPU topology with "-smp": -smp cpus=*,maxcpus=*,sockets=*,dies=*,clusters=*,cores=*,threads=*. Additio

[PATCH v2 11/17] tests: Add test case of APIC ID for module level parsing

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding After i386 supports module level, it's time to add the test for module level's parsing. Signed-off-by: Zhuocheng Ding Co-developed-by: Zhao Liu Signed-off-by: Zhao Liu Reviewed-by: Yanan Wang --- tests/unit/test-x86-topo.c | 19 +++ 1 file changed, 15 in

[PATCH v2 13/17] i386: Add cache topology info in CPUCacheInfo

2023-05-29 Thread Zhao Liu
From: Zhao Liu Currently, by default, the cache topology is encoded as: 1. i/d cache is shared in one core. 2. L2 cache is shared in one core. 3. L3 cache is shared in one die. This default general setting has caused a misunderstanding, that is, the cache topology is completely equated with a sp

[PATCH v2 14/17] i386: Use CPUCacheInfo.share_level to encode CPUID[4]

2023-05-29 Thread Zhao Liu
From: Zhao Liu CPUID[4].EAX[bits 25:14] is used to represent the cache topology for intel CPUs. After cache models have topology information, we can use CPUCacheInfo.share_level to decide which topology level to be encoded into CPUID[4].EAX[bits 25:14]. And since maximum_processor_id (original

[PATCH v2 01/17] i386: Fix comment style in topology.h

2023-05-29 Thread Zhao Liu
From: Zhao Liu For function comments in this file, keep the comment style consistent with other places. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé --- include/hw/i386/topology.h | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --

[PATCH v2 03/17] softmmu: Fix CPUSTATE.nr_cores' calculation

2023-05-29 Thread Zhao Liu
From: Zhuocheng Ding >From CPUState.nr_cores' comment, it represents "number of cores within this CPU package". After 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology"), the meaning of smp.cores changed to "the number of cores in one die", but this commit missed

[PATCH] i386/WHPX: Fix error message when fail to set ProcessorCount

2023-05-29 Thread Zhao Liu
From: Zhao Liu 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology") changes the meaning of MachineState.smp.cores from "the number of cores in one package" to "the number of cores in one die" and doesn't fix other uses of MachineState.smp.cores. And because of the i

RE: [PATCH v1] migration: fix migrate_params_test_apply to set the dest param correctly

2023-05-29 Thread Wang, Wei W
On Saturday, May 27, 2023 5:49 AM, Peter Xu wrote: > On Wed, May 24, 2023 at 04:01:57PM +0800, Wei Wang wrote: > > qmp_migrate_set_parameters expects to use tmp for parameters check, so > > migrate_params_test_apply is expected to copy the related fields from > > params to tmp. So fix migrate_param

[PATCH 0/2] Vhost-vdpa Shadow Virtqueue Offloads support

2023-05-29 Thread Hawkins Jiawei
This series enables shadowed CVQ to intercept Offloads commands through shadowed CVQ, update the virtio NIC device model so qemu send it in a migration, and the restore of that Offloads state in the destination. Hawkins Jiawei (2): vdpa: Add vhost_vdpa_net_load_offloads vdpa: Allow VIRTIO_NET_

[PATCH 1/2] vdpa: Add vhost_vdpa_net_load_offloads

2023-05-29 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_offloads() to restore offloads state at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..682c749b19

[PATCH 2/2] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-05-29 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 682c749b19..cc52b7f0ad 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -85,6 +85,7 @@

[PATCH v10 7/7] e1000e: rename e1000e_ba_state and e1000e_write_hdr_to_rx_buffers

2023-05-29 Thread Tomasz Dzieciol
Rename e1000e_ba_state according and e1000e_write_hdr_to_rx_buffers for consistency with IGB. Signed-off-by: Tomasz Dzieciol --- hw/net/e1000e_core.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c ind

[PATCH v10 5/7] igb: add IPv6 extended headers traffic detection

2023-05-29 Thread Tomasz Dzieciol
Signed-off-by: Tomasz Dzieciol --- hw/net/igb_core.c | 4 +++- hw/net/igb_regs.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 8c248683c3..b54d7af8d8 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1420,7 +1420,9 @@ igb

[PATCH v10 4/7] igb: RX payload guest writting refactoring

2023-05-29 Thread Tomasz Dzieciol
Refactoring is done in preparation for support of multiple advanced descriptors RX modes, especially packet-split modes. Signed-off-by: Tomasz Dzieciol --- hw/net/e1000e_core.c | 18 ++-- hw/net/igb_core.c| 213 +-- tests/qtest/libqos/igb.c | 5

[PATCH v10 3/7] igb: RX descriptors guest writting refactoring

2023-05-29 Thread Tomasz Dzieciol
Refactoring is done in preparation for support of multiple advanced descriptors RX modes, especially packet-split modes. Signed-off-by: Tomasz Dzieciol --- hw/net/igb_core.c | 170 +++- hw/net/igb_regs.h | 10 +-- hw/net/trace-events | 4 +- 3 files

[PATCH v10 2/7] igb: rename E1000E_RingInfo_st

2023-05-29 Thread Tomasz Dzieciol
Rename E1000E_RingInfo_st and E1000E_RingInfo according to qemu typdefs guide. Signed-off-by: Tomasz Dzieciol --- hw/net/e1000e_core.c | 34 +- hw/net/igb_core.c| 42 +- 2 files changed, 38 insertions(+), 38 deletions(-)

[PATCH v10 6/7] igb: packet-split descriptors support

2023-05-29 Thread Tomasz Dzieciol
Packet-split descriptors are used by Linux VF driver for MTU values from 2048 Signed-off-by: Tomasz Dzieciol --- hw/net/igb_core.c | 348 ++-- hw/net/igb_regs.h | 9 ++ hw/net/trace-events | 2 +- 3 files changed, 316 insertions(+), 43 deletions(-)

[PATCH v10 1/7] igb: remove TCP ACK detection

2023-05-29 Thread Tomasz Dzieciol
TCP ACK detection is no longer present in igb. Signed-off-by: Tomasz Dzieciol --- hw/net/igb_core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index d00b1caa6a..e927c51061 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1327,11 +1327,

[PATCH v10 0/7] igb: packet-split descriptors support

2023-05-29 Thread Tomasz Dzieciol
Purposes of this series of patches: * introduce packet-split RX descriptors support. This feature is used by Linux VF driver for MTU values from 2048. * refactor RX descriptor handling for introduction of packet-split RX descriptors support * fix descriptors flags handling Tomasz Dzieciol (7):

Re: [PATCH v3] target: ppc: Use MSR_HVB bit to get the target endianness for memory dump

2023-05-29 Thread Fabiano Rosas
"Nicholas Piggin" writes: > On Tue May 23, 2023 at 2:02 AM AEST, Narayana Murty N wrote: >> Changes since V2: >> commit message modified as per feedbak from Nicholas Piggin. >> Changes since V1: >> https://lore.kernel.org/qemu-devel/20230420145055.10196-1-nnmli...@linux.ibm.com/ >> The approach t

[PATCH v2] meson: Avoid implicit declaration of functions

2023-05-29 Thread Michal Privoznik
While detecting a presence of a function via 'cc.links()' gives desired result (i.e. detects whether function is present), it also produces a warning on systems where the function is not present (into meson-log.txt), e.g.: qemu.git/build/meson-private/tmph74x3p38/testfile.c:2:34: \ warning: im

Re: [PULL 00/10] ppc queue

2023-05-29 Thread Michael Tokarev
29.05.2023 09:30, Nicholas Piggin wrote: On Mon May 29, 2023 at 4:01 PM AEST, Michael Tokarev wrote: .. They certainly fix some parts of target emulation, but what is the guidance for backporting those type of fixes? Most of the patches I sent including 2,3 were just found from inspection or ne

Re: [PATCH v3 03/14] nbd/server: Prepare for alternate-size headers

2023-05-29 Thread Vladimir Sementsov-Ogievskiy
On 15.05.23 22:53, Eric Blake wrote: Upstream NBD now documents[1] an extension that supports 64-bit effect lengths in requests. As part of that extension, the size of the reply headers will change in order to permit a 64-bit length in the reply for symmetry[2]. Additionally, where the reply he

Re: [PATCH v1] migration: fix migrate_params_test_apply to set the dest param correctly

2023-05-29 Thread Peter Xu
On Mon, May 29, 2023 at 12:55:30PM +, Wang, Wei W wrote: > On Saturday, May 27, 2023 5:49 AM, Peter Xu wrote: > > On Wed, May 24, 2023 at 04:01:57PM +0800, Wei Wang wrote: > > > qmp_migrate_set_parameters expects to use tmp for parameters check, so > > > migrate_params_test_apply is expected to

Re: [PATCH v4 2/9] migration: Implement switchover ack logic

2023-05-29 Thread Peter Xu
On Sun, May 28, 2023 at 05:06:45PM +0300, Avihai Horon wrote: > Implement switchover ack logic. This prevents the source from stopping > the VM and completing the migration until an ACK is received from the > destination that it's OK to do so. > > To achieve this, a new SaveVMHandlers handler swit

Re: [PATCH v2 2/2] vhost: release virtqueue objects in error path

2023-05-29 Thread Peter Xu
On Mon, May 29, 2023 at 05:13:33PM +0530, P J P wrote: > From: Prasad Pandit > > vhost_dev_start function does not release virtqueue objects when > event_notifier_init() function fails. Release virtqueue objects > and log a message about function failure. > > Signed-off-by: Prasad Pandit Fixes

Re: [PATCH v2 1/2] vhost: release memory_listener object in error path

2023-05-29 Thread Peter Xu
On Mon, May 29, 2023 at 05:13:32PM +0530, P J P wrote: > From: Prasad Pandit > > vhost_dev_start function does not release memory_listener object > in case of an error. This may crash the guest when vhost is unable > to set memory table: > > stack trace of thread 125653: > Program terminated

Re: [PATCH] igb: Add Function Level Reset to PF and VF

2023-05-29 Thread Cédric Le Goater
On 5/29/23 09:45, Akihiko Odaki wrote: On 2023/05/29 16:01, Cédric Le Goater wrote: On 5/29/23 04:45, Akihiko Odaki wrote: On 2023/05/28 19:50, Sriram Yagnaraman wrote: -Original Message- From: Cédric Le Goater Sent: Friday, 26 May 2023 19:31 To: qemu-devel@nongnu.org Cc: Akihiko Od

[PATCH v5 5/5] parallels: Image repairing in parallels_open()

2023-05-29 Thread Alexander Ivanov
Repair an image at opening if the image is unclean or out-of-image corruption was detected. Signed-off-by: Alexander Ivanov --- block/parallels.c | 65 +-- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/block/parallels.c b/block/parall

[PATCH v5 1/5] parallels: Incorrect data end calculation in parallels_open()

2023-05-29 Thread Alexander Ivanov
The BDRVParallelsState structure contains data_end field that is measured in sectors. In parallels_open() initially this field is set by data_off field from parallels image header. According to the parallels format documentation, data_off field contains an offset, in sectors, from the start of the

[PATCH v5 2/5] parallels: Split image leak handling to separate check and fix helpers

2023-05-29 Thread Alexander Ivanov
We need to fix leak after deduplication in the next patch. Move leak fixing to a separate helper parallels_fix_leak() and add parallels_get_leak_size() helper wich used in parallels_fix_leak() and parallels_check_leak(). Signed-off-by: Alexander Ivanov --- block/parallels.c | 86

[PATCH v5 3/5] parallels: Add checking and repairing duplicate offsets in BAT

2023-05-29 Thread Alexander Ivanov
Cluster offsets must be unique among all the BAT entries. Find duplicate offsets in the BAT and fix it by copying the content of the relevant cluster to a newly allocated cluster and set the new cluster offset to the duplicated entry. Add host_cluster_index() helper to deduplicate the code. Move

[PATCH v5 0/5] parallels: Add duplication check, repair at open, fix bugs

2023-05-29 Thread Alexander Ivanov
This patchset should be applied on the top of [PATCH v11 00/12] parallels: Refactor the code of images checks and fix a bug. Fix incorrect data end calculation in parallels_open(). Split image leak handling to separate check and fix helpers. Add checking and repairing duplicate offsets in BAT R

[PATCH v5 4/5] parallels: Replace fprintf by qemu_log in check

2023-05-29 Thread Alexander Ivanov
If the check is called during normal work, tracking of the check must be present in VM logs to have some clues if something going wrong with user's data. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 18 +- 1 file changed, 9 insertions(+), 9

Re: [PATCH v4 1/2] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-29 Thread Stefan Hajnoczi
On Fri, May 26, 2023 at 05:03:03PM +0200, Stefano Garzarella wrote: > Some virtio-blk drivers (e.g. virtio-blk-vhost-vdpa) supports the fd > passing. Let's expose this to the user, so the management layer > can pass the file descriptor of an already opened path. > > If the libblkio virtio-blk driv

Re: [PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-29 Thread Stefan Hajnoczi
On Fri, May 26, 2023 at 05:03:04PM +0200, Stefano Garzarella wrote: > The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd > passing through the new 'fd' property. > > Since now we are using qemu_open() on '@path' if the virtio-blk driver > supports the fd passing, let's announce it.

Re: [PATCH v1 3/9] virt: Implement Heki common code

2023-05-29 Thread Mickaël Salaün
On 17/05/2023 14:47, Madhavan T. Venkataraman wrote: Sorry for the delay. See inline... On 5/8/23 12:29, Wei Liu wrote: On Fri, May 05, 2023 at 05:20:40PM +0200, Mickaël Salaün wrote: From: Madhavan T. Venkataraman Hypervisor Enforced Kernel Integrity (Heki) is a feature that will use the

Re: [PATCH 1/2] vdpa: Add vhost_vdpa_net_load_offloads

2023-05-29 Thread Eugenio Perez Martin
On Mon, May 29, 2023 at 3:18 PM Hawkins Jiawei wrote: > > This patch introduces vhost_vdpa_net_load_offloads() to > restore offloads state at device's startup. > > Signed-off-by: Hawkins Jiawei > --- > net/vhost-vdpa.c | 26 ++ > 1 file changed, 26 insertions(+) > > diff

[PATCH 2/3] hw/smbios: Fix thread count in type4

2023-05-29 Thread Zhao Liu
From: Zhao Liu >From SMBIOS 3.0 specification, thread count field means: Thread Count is the total number of threads detected by the BIOS for this processor socket. It is a processor-wide count, not a thread-per-core count. [1] So here we should use threads per socket other than threads per cor

[PATCH 3/3] hw/smbios: Fix core count in type4

2023-05-29 Thread Zhao Liu
From: Zhao Liu >From SMBIOS 3.0 specification, core count field means: Core Count is the number of cores detected by the BIOS for this processor socket. [1] Before 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology"), MachineState.smp.cores means "the number of co

[PATCH 0/3] hw/smbios: Cleanup topology related variables

2023-05-29 Thread Zhao Liu
From: Zhao Liu Hi all, This patchset is split from my previous hybrid topology RFC [1] for easier review. There are three places for topology-related cleanup: 1. Fix the use of smp.cores. The meaning of CPU topology members in MachineState.smp has changed since 003f230e37d7 ("machine: T

[PATCH 1/3] hw/smbios: Fix smbios_smp_sockets caculation

2023-05-29 Thread Zhao Liu
From: Zhao Liu Here're 2 mistakes: 1. 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology") changes the meaning of smp.cores but doesn't fix original smp.cores uses. And because of the introduction of cluster, now smp.cores means the number of cores in one c

  1   2   >