Re: [PATCH v6 3/3] hw/nvme: add nvme management interface model

2023-09-21 Thread Andrew Jeffery
On Thu, 2023-09-14 at 11:53 +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add the 'nmi-i2c' device that emulates an NVMe Management Interface > controller. > > Initial support is very basic (Read NMI DS, Configuration Get). > > This is based on previously posted code by Padmakar Kalghatgi

Re: [PATCH v2] linux-user: Undo incomplete mmap

2023-09-21 Thread Akihiko Odaki
On 2023/09/03 14:39, Akihiko Odaki wrote: When the host page size is greater than the target page size and MAP_FIXED or MAP_FIXED_NOREPLACE is requested, mmap will be done for three parts: start, middle, and end. If a later part of mmap fail, mmap done in the earlier parts must be reverted. Fixe

Re: [PATCH v6 2/3] hw/i2c: add mctp core

2023-09-21 Thread Andrew Jeffery
On Thu, 2023-09-14 at 11:53 +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add an abstract MCTP over I2C endpoint model. This implements MCTP > control message handling as well as handling the actual I2C transport > (packetization). > > Devices are intended to derive from this and implement

Re: [PATCH] vl: Free machine list

2023-09-21 Thread Akihiko Odaki
On 2023/07/22 15:26, Akihiko Odaki wrote: Free machine list and make LeakSanitizer happy. Signed-off-by: Akihiko Odaki --- softmmu/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..802f728298 100644 --- a/softmmu/vl.c +++

Re: [PATCH v6 1/3] hw/i2c: add smbus pec utility function

2023-09-21 Thread Andrew Jeffery
On Thu, 2023-09-14 at 11:53 +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add i2c_smbus_pec() to calculate the SMBus Packet Error Code for a > message. > > Reviewed-by: Jonathan Cameron > Signed-off-by: Klaus Jensen It at least looks a lot like the linux implementation :) Reviewed-by:

Re: [PATCH v2 0/2] net: Update MemReentrancyGuard for NIC

2023-09-21 Thread Akihiko Odaki
On 2023/06/01 12:18, Akihiko Odaki wrote: Recently MemReentrancyGuard was added to DeviceState to record that the device is engaging in I/O. The network device backend needs to update it when delivering a packet to a device. This implementation follows what bottom half does, but it does not add

[PATCH v3] hw/i386/pc: improve physical address space bound check for 32-bit systems

2023-09-21 Thread Ani Sinha
32-bit systems do not have a reserved memory for hole64 and hotplugging memory devices are not supported on those systems. Therefore, the maximum limit of the guest physical address in the absence of additional memory devices effectively coincides with the end of "above 4G memory space" region. Whe

Re: [PATCH] accel/kvm/kvm-all: Handle register access errors

2023-09-21 Thread Akihiko Odaki
On 2023/06/19 21:19, Peter Maydell wrote: On Sat, 10 Jun 2023 at 04:51, Akihiko Odaki wrote: On 2022/12/01 20:00, Akihiko Odaki wrote: On 2022/12/01 19:40, Peter Maydell wrote: On Thu, 1 Dec 2022 at 10:27, Akihiko Odaki wrote: A register access error typically means something seriously wr

Re: [PATCH] docs/devel/reset.rst: Correct function names

2023-09-21 Thread Akihiko Odaki
On 2022/11/25 23:06, Akihiko Odaki wrote: resettable_class_set_parent_phases() was mistakenly called resettable_class_set_parent_reset_phases() in some places. Signed-off-by: Akihiko Odaki --- docs/devel/reset.rst | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

Re: [PATCH] cxl/vendor: update niagara to only build on linux, add KConfig options

2023-09-21 Thread Philippe Mathieu-Daudé
Hi Gregory, On 20/9/23 17:50, Gregory Price wrote: Niagara uses which presently limits its compatibility to linux hosts. Change build to only build it on linux. Add Kconfig file for skhynix directory, and make niagara depend on CXL_MEM_DEVICE. Add an explicit flag for niagara. Signed-off-by

Re: [PATCH] docs/devel/reset.rst: Correct function names

2023-09-21 Thread Michael Tokarev
21.09.2023 10:33, Akihiko Odaki: .. This patch seems to have been forgotten. Can anyone pull this? Applied to my trivial-patches tree now. Thank you! /mjt

Re: [PATCH] plugins/hotblocks: Fix potential deadlock in plugin_exit() function

2023-09-21 Thread Philippe Mathieu-Daudé
Hi Cong, On 21/9/23 08:12, Cong Liu wrote: This patch fixes a potential deadlock in the plugin_exit() function of QEMU. The original code does not release the lock mutex if it is NULL. This patch adds a check for it being NULL and releases the mutex in that case. You are correct. Signed-off-

Re: Concerns regarding e17bebd049 ("dump: Set correct vaddr for ELF dump")

2023-09-21 Thread Laszlo Ersek
On 9/20/23 19:35, Stephen Brennan wrote: > Hi Jon, > > Jon Doron writes: >> Hi Stephen, >> Like you have said the reason is as I wrote in the commit message, >> without "fixing" the vaddr GDB is messing up mapping and working with >> the generated core file. > > For the record I totally love t

intermittent qtest-aarch64/xlnx-canfd-test test failure

2023-09-21 Thread Michael Tokarev
Hi! While doing stable-8.1.1 preparation, I've a CI failure of ubuntu-20.04-s390x-all here: https://gitlab.com/qemu-project/qemu/-/jobs/5132720046 ▶ ERROR:../tests/qtest/xlnx-canfd-test.c:265:match_rx_tx_data: \ assertion failed ((buf_rx[size] & DLC_FD_BIT_MASK) == (buf_tx[size] & DLC_FD_BI

Re: [PATCH v3] hw/i386/pc: improve physical address space bound check for 32-bit systems

2023-09-21 Thread Ani Sinha
> On 21-Sep-2023, at 12:47 PM, Ani Sinha wrote: > > 32-bit systems do not have a reserved memory for hole64 and hotplugging memory > devices are not supported on those systems. Relevant thread for Linux kernel https://lore.kernel.org/all/20210929143600.49379-4-da...@redhat.com/ > Therefore

[PATCH v3 0/8] util: Introduce qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH v3 2/8] ivshmem-server: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki --- contrib/ivshmem-server/main.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index 5901

[PATCH v3 6/8] module: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e263163c..580658edf4 100644 --- a/util/module.c +++ b/util/module.c

[PATCH v3 8/8] spice-app: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index 405fb7f9f5..f6c2343213 100644 --- a/ui/spice-app.c +++ b/ui/s

[PULL v2 00/22] implement discard operation for Parallels images

2023-09-21 Thread Denis V. Lunev
The following changes since commit 4907644841e3200aea6475c0f72d3d987e9f3d93: Merge tag 'mem-2023-09-19' of https://github.com/davidhildenbrand/qemu into staging (2023-09-19 13:22:19 -0400) are available in the Git repository at: https://src.openvz.org/scm/~den/qemu.git tags/pull-parallels-2

[PULL v2 07/22] parallels: refactor path when we need to re-check image in parallels_open

2023-09-21 Thread Denis V. Lunev
More conditions follows thus the check should be more scalable. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index bd26c8db63..a

[PATCH v3 1/8] util: Introduce qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PULL v2 01/22] parallels: fix formatting in bdrv_parallels initialization

2023-09-21 Thread Denis V. Lunev
Old code is ugly and contains tabulations. There are no functional changes in this patch. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/block/parallels.

[PULL v2 02/22] parallels: mark driver as supporting CBT

2023-09-21 Thread Denis V. Lunev
Parallels driver indeed support Parallels Dirty Bitmap Feature in read-only mode. The patch adds bdrv_supports_persistent_dirty_bitmap() callback which always return 1 to indicate that. This will allow to copy CBT from Parallels image with qemu-img. Note: read-write support is signalled through b

[PULL v2 03/22] parallels: fix memory leak in parallels_open()

2023-09-21 Thread Denis V. Lunev
We should free opts allocated through qemu_opts_create() at the end. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index 428f72de1c..af7be427c9 100644 --- a/block/parall

[PULL v2 05/22] parallels: return earler in fail_format branch in parallels_open()

2023-09-21 Thread Denis V. Lunev
We do not need to perform any deallocation/cleanup if wrong format is detected. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index ae006e7fc7..12f38cf

[PULL v2 19/22] parallels: naive implementation of parallels_co_pdiscard

2023-09-21 Thread Denis V. Lunev
* Discarding with backing stores is not supported by the format. * There is no buffering/queueing of the discard operation. * Only operations aligned to the cluster are supported. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 46

[PATCH v3 3/8] contrib/rdmacm-mux: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default Unix socket path. Signed-off-by: Akihiko Odaki --- contrib/rdmacm-mux/main.c | 22 ++ contrib/rdmacm-mux/meson.build | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/rdmacm-mux/main.c

[PULL v2 14/22] tests: test self-cure of parallels image with duplicated clusters

2023-09-21 Thread Denis V. Lunev
The test is quite similar with the original one for duplicated clusters. There is the only difference in the operation which should fix the image. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-checks | 36 +++ tests/qemu-i

[PATCH v3 7/8] util: Remove qemu_get_local_state_dir()

2023-09-21 Thread Akihiko Odaki
There are no users of the function anymore. Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 8 util/oslib-posix.c | 6 -- util/oslib-win32.c | 10 -- 3 files changed, 24 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index bb857c910f..cc

[PULL v2 21/22] parallels: naive implementation of parallels_co_pwrite_zeroes

2023-09-21 Thread Denis V. Lunev
The zero flag is missed in the Parallels format specification. We can resort to discard if we have no backing file. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/block/parallels.c b/block/par

[PULL v2 12/22] parallels: collect bitmap of used clusters at open

2023-09-21 Thread Denis V. Lunev
If the operation is failed, we need to check image consistency if the problem is not about memory allocation. Bitmap adjustments in allocate_cluster are not performed yet. They worth to be separate. This was proven useful during debug of this series. Kept as is for future bissecting. It should be

[PULL v2 18/22] parallels: improve readability of allocate_clusters

2023-09-21 Thread Denis V. Lunev
Replace 'space' representing the amount of data to preallocate with 'bytes'. Rationale: * 'space' at each place is converted to bytes * the unit is more close to the variable name Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 13 + 1 file chang

[PULL v2 08/22] parallels: create mark_used() helper which sets bit in used bitmap

2023-09-21 Thread Denis V. Lunev
This functionality is used twice already and next patch will add more code with it. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block

[PULL v2 20/22] tests: extend test 131 to cover availability of the discard operation

2023-09-21 Thread Denis V. Lunev
This patch contains test which minimally tests discard and new cluster allocation logic. The following checks are added: * write 2 clusters, discard the first allocated * write another cluster, check that the hole is filled * write 2 clusters, discard the first allocated, write 1 cluster at non-

[PULL v2 15/22] parallels: accept multiple clusters in mark_used()

2023-09-21 Thread Denis V. Lunev
This would be useful in the next patch in allocate_clusters(). This change would not imply serious performance drawbacks as usually image is full of data or are at the end of the bitmap. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 18 ++ 1

[PULL v2 10/22] parallels: fix broken parallels_check_data_off()

2023-09-21 Thread Denis V. Lunev
Once we have repaired data_off field in the header we should update s->data_start which is calculated on the base of it. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c in

[PULL v2 04/22] parallels: invent parallels_opts_prealloc() helper to parse prealloc opts

2023-09-21 Thread Denis V. Lunev
This patch creates above mentioned helper and moves its usage to the beginning of parallels_open(). This simplifies parallels_open() a bit. The patch also ensures that we store prealloc_size on block driver state always in sectors. This makes code cleaner and avoids wrong opinion at the assignment

[PATCH v3 5/8] scsi: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index c6c6347e9b..507f23357f 100644 --- a/scsi/qemu-pr-hel

[PULL v2 09/22] tests: ensure that image validation will not cure the corruption

2023-09-21 Thread Denis V. Lunev
Since commit cfce1091d55322789582480798a891cbaf66924e Author: Alexander Ivanov Date: Tue Jul 18 12:44:29 2023 +0200 parallels: Image repairing in parallels_open() there is a potential pit fall with calling qemu-io -c "read" The image is opened in read-write mode and thus coul

[PULL v2 22/22] tests: extend test 131 to cover availability of the write-zeroes

2023-09-21 Thread Denis V. Lunev
This patch contains test which minimally tests write-zeroes on top of working discard. The following checks are added: * write 2 clusters, write-zero to the first allocated cluster * write 2 cluster, write-zero to the half the first allocated cluster Signed-off-by: Denis V. Lunev Reviewed-by: Al

[PULL v2 06/22] parallels: return earlier from parallels_open() function on error

2023-09-21 Thread Denis V. Lunev
At the beginning of the function we can return immediately until we really allocate s->header. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block/parallels

Re: [PATCH v2 01/10] qga: Remove platform GUID definitions

2023-09-21 Thread Akihiko Odaki
On 2022/11/17 18:45, Konstantin Kostiuk wrote: Reviewed-by: Konstantin Kostiuk > Will merge this patch in QGA series On Thu, Nov 10, 2022 at 12:06 PM Akihiko Odaki > wrote: GUID_DEVINTERFACE_DISK and GUID_DEVINTERFACE_STORAGEPOR

[PULL v2 11/22] parallels: add test which will validate data_off fixes through repair

2023-09-21 Thread Denis V. Lunev
We have only check through self-repair and that proven to be not enough. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-checks | 17 + tests/qemu-iotests/tests/parallels-checks.out | 18 ++ 2 files changed,

[PULL v2 13/22] tests: fix broken deduplication check in parallels format test

2023-09-21 Thread Denis V. Lunev
Original check is broken as supposed reading from 2 different clusters results in read from the same file offset twice. This is definitely wrong. We should be sure that * the content of both clusters is correct after repair * clusters are at the different offsets after repair In order to check the

[PATCH v3 4/8] qga: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki --- qga/main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index 8668b9f3d3..145ee02df3 100644 --- a/qga/main.c +++ b/qga/main.c @@ -45,1

[PULL v2 17/22] parallels: naive implementation of allocate_clusters with used bitmap

2023-09-21 Thread Denis V. Lunev
The access to the bitmap is not optimized completely. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 51 --- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/block/parallels.c b/block/parallels.c ind

[PULL v2 16/22] parallels: update used bitmap in allocate_cluster

2023-09-21 Thread Denis V. Lunev
We should extend the bitmap if the file is extended and set the bit in the image used bitmap once the cluster is allocated. Sanity check at that moment also looks like a good idea. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 14 ++ 1 file chan

Re: [PATCH] cutils: Fix get_relocated_path on Windows

2023-09-21 Thread Akihiko Odaki
On 2022/10/31 9:59, Akihiko Odaki wrote: get_relocated_path() did not have error handling for PathCchSkipRoot() because a path given to get_relocated_path() was expected to be a valid path containing a drive letter or UNC server/share path elements on Windows, but sometimes it turned out otherwis

Re: [PATCH v3] hw/i386/pc: improve physical address space bound check for 32-bit systems

2023-09-21 Thread David Hildenbrand
On 21.09.23 09:17, Ani Sinha wrote: 32-bit systems do not have a reserved memory for hole64 and hotplugging memory devices are not supported on those systems. Therefore, the maximum limit of the guest physical address in the absence of additional memory devices effectively coincides with the end

Re: [PATCH 00/52] migration/rdma: Error handling fixes

2023-09-21 Thread Zhijian Li (Fujitsu)
Perter, On 20/09/2023 00:49, Peter Xu wrote: > On Mon, Sep 18, 2023 at 04:41:14PM +0200, Markus Armbruster wrote: >> Oh dear, where to start. There's so much wrong, and in pretty obvious >> ways. This code should never have passed review. I'm refraining from >> saying more; see the commit mess

Re: [PATCH v1 04/22] vfio/common: Introduce vfio_container_add|del_section_window()

2023-09-21 Thread Cédric Le Goater
Hello Zhenzhong, On 8/30/23 12:37, Zhenzhong Duan wrote: From: Eric Auger Introduce helper functions that isolate the code used for VFIO_SPAPR_TCE_v2_IOMMU. This code reliance is IOMMU backend specific whereas the rest of the code in the callers, ie. vfio_listener_region_add|del is not. Signe

[PATCH v3] input: Allow to choose console with qemu_input_is_absolute

2023-09-21 Thread Akihiko Odaki
Although an input is routed depending on the console, qemu_input_is_absolute() had no mechanism to specify the console. Accept QemuConsole as an argument for qemu_input_is_absolute, and let the display know the absolute/relative state for a particular console. Signed-off-by: Akihiko Odaki --- V2

Re: [PATCH v2 5/7] block/vdi: Clean up local variable shadowing

2023-09-21 Thread Kevin Wolf
Am 20.09.2023 um 20:31 hat Markus Armbruster geschrieben: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Tracked down with -Wshadow=local. > Clean up: delete inner declarations when they are actually redundant, > else rename variables

Re: [PATCH v2 6/7] block: Clean up local variable shadowing

2023-09-21 Thread Kevin Wolf
Am 20.09.2023 um 20:31 hat Markus Armbruster geschrieben: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Tracked down with -Wshadow=local. > Clean up: delete inner declarations when they are actually redundant, > else rename variables

[PULL 00/17] Trivial patches for 2023-09-21

2023-09-21 Thread Michael Tokarev
The following changes since commit 4907644841e3200aea6475c0f72d3d987e9f3d93: Merge tag 'mem-2023-09-19' of https://github.com/davidhildenbrand/qemu into staging (2023-09-19 13:22:19 -0400) are available in the Git repository at: https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches f

[PULL 06/17] hw/tpm: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis.h| 2 +- hw/tpm/tpm_tis_common.c | 2 +- hw/tpm/tpm_tis_i2c.c| 4 ++-- hw/tpm/tpm_tis_isa.c| 2 +- hw/tpm/tpm_tis_sysbus.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/tpm/tp

[PULL 03/17] i386: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell --- host/include/i386/host/cpuinfo.h | 2 +- hw/i386/acpi-build.c | 4 ++-- hw/i386/amd_iommu.c | 4 ++-- hw/i386/intel_iommu.c| 4 ++-- hw/i386/kvm/xen_xenstore.c | 2 +- hw/i386/kvm/xenstore_im

[PULL 02/17] bsd-user: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Kyle Evans Reviewed-by: Warner Losh --- bsd-user/errno_defs.h| 2 +- bsd-user/freebsd/target_os_siginfo.h | 2 +- bsd-user/freebsd/target_os_stack.h | 4 ++-- bsd-user/freebsd/target_os_user.h| 2 +- bsd-user/qemu.h

[PULL 04/17] hw/net: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell --- hw/net/cadence_gem.c | 10 +- hw/net/dp8393x.c | 2 +- hw/net/e1000_regs.h | 2 +- hw/net/e1000x_regs.h | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/net/igb_regs.h | 4 ++-- hw/net/mcf_fec

[PULL 01/17] ppc: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Cédric Le Goater --- host/include/ppc/host/cpuinfo.h | 2 +- hw/ppc/ppc.c| 2 +- hw/ppc/prep_systemio.c | 2 +- hw/ppc/spapr.c | 8 hw/ppc/spapr_hcall.c| 2 +-

[PULL 07/17] hw/other: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell --- hw/acpi/aml-build.c | 6 +++--- hw/acpi/hmat.c | 2 +- hw/acpi/nvdimm.c | 2 +- hw/block/hd-geometry.c | 4 ++-- hw/block/pflash_cfi01.c | 2 +- hw/char/cadence_ua

[PULL 11/17] hw/pci-bridge/cxl_upstream: Fix bandwidth entry base unit for SSLBIS

2023-09-21 Thread Michael Tokarev
From: Dave Jiang According to ACPI spec 6.5 5.2.28.4 System Locality Latency and Bandwidth Information Structure, if the "Entry Base Unit" is 1024 for BW and the matrix entry has the value of 100, the BW is 100 GB/s. So the entry_base_unit should be changed from 1000 to 1024 given the comment not

[PULL 15/17] hw/mem/cxl_type3: Add missing copyright and license notice

2023-09-21 Thread Michael Tokarev
From: Jonathan Cameron This has been missing from the start. Assume it should match with cxl/cxl-component-utils.c as both were part of early postings from Ben. Reported-by: Philippe Mathieu-Daudé Acked-by: Dave Jiang Acked-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron S

[PULL 08/17] subprojects: Use the correct .git suffix in the repository URLs

2023-09-21 Thread Michael Tokarev
From: Thomas Huth This avoids the warnings à la: "warning: redirecting to https://gitlab.com/qemu-project/xyz.git/"; Signed-off-by: Thomas Huth Reviewed-by: Michael Tokarev Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- subprojects/berkeley-softfloat-3.wrap | 2 +- s

[PULL 05/17] hw/pci: spelling fixes

2023-09-21 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell --- hw/pci-bridge/cxl_downstream.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/pci-host/bonito.c| 2 +- hw/pci-host/designware.c| 4 ++-- hw/pci-host/dino.c | 2 +- hw/pci-host/

[PULL 10/17] hw/cxl: Fix CFMW config memory leak

2023-09-21 Thread Michael Tokarev
From: Li Zhijian Allocate targets and targets[n] resources when all sanity checks are passed to avoid memory leaks. Cc: qemu-sta...@nongnu.org Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Li Zhijian Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jonathan Cameron Reviewed-by: Fan N

[PULL 16/17] docs/cxl: Cleanout some more aarch64 examples.

2023-09-21 Thread Michael Tokarev
From: Jonathan Cameron These crossed with the previous fix to get rid of examples using aarch64 for which support is not yet upstream. Reviewed-by: Fan Ni Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1892 Signed-off-by: Jonathan Cameron Signed-off-by: Michael Tokarev --- docs/syst

[PULL 09/17] hw/i386/pc: fix code comment on cumulative flash size

2023-09-21 Thread Michael Tokarev
From: Laszlo Ersek - The comment is incorrectly indented / formatted. - The comment states a 8MB limit, even though the code enforces a 16MB limit. Both of these warts come from commit 0657c657eb37 ("hw/i386/pc: add max combined fw size as machine configuration option", 2020-12-09); clean the

[PULL 14/17] hw/cxl: Fix out of bound array access

2023-09-21 Thread Michael Tokarev
From: Dmitry Frolov According to cxl_interleave_ways_enc(), fw->num_targets is allowed to be up to 16. This also corresponds to CXL r3.0 spec. So, the fw->target_hbs[] array is iterated from 0 to 15. But it is statically declared of length 8. Thus, out of bound array access may occur. Fixes: c28

[PULL 12/17] hw/cxl/cxl_device: Replace magic number in CXLError definition

2023-09-21 Thread Michael Tokarev
From: Fan Ni Replace the magic number 32 with CXL_RAS_ERR_HEADER_NUM for better code readability and maintainability. Signed-off-by: Fan Ni Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Signed-off-by: Jonathan Cameron Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev

[PULL 13/17] docs/cxl: Change to lowercase as others

2023-09-21 Thread Michael Tokarev
From: Li Zhijian Using the same style as elsewhere for topology / topo Signed-off-by: Li Zhijian Link: https://lore.kernel.org/r/20230519085802.2106900-2-lizhij...@cn.fujitsu.com Signed-off-by: Jonathan Cameron Reviewed-by: Fan Ni Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael T

Re: [PATCH v2 4/7] block/dirty-bitmap: Clean up local variable shadowing

2023-09-21 Thread Kevin Wolf
Am 20.09.2023 um 20:31 hat Markus Armbruster geschrieben: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Tracked down with -Wshadow=local. > Clean up: rename both the pair of parameters and the pair of local > variables. While there,

[PULL 17/17] docs/devel/reset.rst: Correct function names

2023-09-21 Thread Michael Tokarev
From: Akihiko Odaki resettable_class_set_parent_phases() was mistakenly called resettable_class_set_parent_reset_phases() in some places. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- docs/devel/reset.rst | 17

Re: [PULL 4/5] hw/ufs: Support for UFS logical unit

2023-09-21 Thread Jeuk Kim
On 2023-09-15 4:59 PM, Paolo Bonzini wrote: On 9/15/23 00:19, Jeuk Kim wrote: First, ufs-lu has a feature called "unit descriptor". This feature shows the status of the ufs-lu and only works with UFS-specific "query request" commands, not SCSI commands. This looks like something that can

Re: [RFC PATCH v2 03/21] HostMem: Add private property and associate it with RAM_KVM_GMEM

2023-09-21 Thread Xiaoyao Li
On 9/20/2023 11:42 PM, Markus Armbruster wrote: David Hildenbrand writes: On 20.09.23 16:35, Xiaoyao Li wrote: On 9/20/2023 3:30 PM, Markus Armbruster wrote: Xiaoyao Li writes: On 9/19/2023 5:46 PM, Markus Armbruster wrote: Xiaoyao Li writes: From: Isaku Yamahata Add a new property

Re: [PATCH v1 05/22] vfio/common: Extract out vfio_kvm_device_[add/del]_fd

2023-09-21 Thread Cédric Le Goater
On 9/20/23 13:49, Eric Auger wrote: Hi Zhenzhong, On 8/30/23 12:37, Zhenzhong Duan wrote: ...which will be used by both legacy and iommufd backend. I prefer genuine sentences in the commit msg. Also you explain what you do but not why. suggestion: Introduce two new helpers, vfio_kvm_device_[a

Re: [PATCH v2 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-21 Thread Kevin Wolf
Am 20.09.2023 um 20:31 hat Markus Armbruster geschrieben: > Variables declared in macros can shadow other variables. Much of the > time, this is harmless, e.g.: > > #define _FDT(exp) \ > do {

Re: [RFC PATCH v2 03/21] HostMem: Add private property and associate it with RAM_KVM_GMEM

2023-09-21 Thread David Hildenbrand
I think as long as there is no demand to have a TDX guest with this property be set to "off", then just don't add it. With a TDX VM, it will can be implicitly active. If we ever have to disable it for selective memory backends, we can add the property and have something like on/off/auto. For n

Re: [RFC PATCH v2 04/21] memory: Introduce memory_region_has_gmem_fd()

2023-09-21 Thread David Hildenbrand
On 14.09.23 05:51, Xiaoyao Li wrote: Introduce memory_region_has_gmem_fd() to query if the MemoryRegion has KVM gmem fd allocated. *probably* best to just squash that into patch #2. -- Cheers, David / dhildenb

Re: [RFC PATCH v2 07/21] i386/pc: Drop pc_machine_kvm_type()

2023-09-21 Thread David Hildenbrand
On 14.09.23 05:51, Xiaoyao Li wrote: pc_machine_kvm_type() was introduced by commit e21be724eaf5 ("i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode") to do Xen specific initialization by utilizing kvm_type method. commit eeedfe6c6316 ("hw/xen: Simplify emulated Xen platform init"

Re: [PATCH 01/52] migration/rdma: Clean up qemu_rdma_poll()'s return type

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > qemu_rdma_poll()'s return type is uint64_t, even though it returns 0, > -1, or @ret, which is int. Its callers assign the return value to int > variables, then check whether it's negative. Unclean. > > Return int instead. > > Signed-off-by: Mark

Re: [PATCH 02/52] migration/rdma: Clean up qemu_rdma_data_init()'s return type

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > qemu_rdma_data_init() return type is void *. It actually returns > RDMAContext *, and all its callers assign the value to an > RDMAContext *. Unclean. > > Return RDMAContext * instead. > > Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijia

Re: [PATCH 03/52] migration/rdma: Clean up rdma_delete_block()'s return type

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > rdma_delete_block() always returns 0, which its only caller ignores. > Return void instead. > > Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian

Re: [PATCH 04/52] migration/rdma: Drop fragile wr_id formatting

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > wrid_desc[] uses 4001 pointers to map four integer values to strings. > > print_wrid() accesses wrid_desc[] out of bounds when passed a negative > argument. It returns null for values 2..1999 and 2001..3999. > > qemu_rdma_poll() and qemu_rdma_blo

Re: [RFC PATCH v2 02/21] RAMBlock: Add support of KVM private gmem

2023-09-21 Thread David Hildenbrand
On 14.09.23 05:50, Xiaoyao Li wrote: From: Chao Peng Add KVM gmem support to RAMBlock so both normal hva based memory and kvm gmem fd based private memory can be associated in one RAMBlock. Introduce new flag RAM_KVM_GMEM. It calls KVM ioctl to create private gmem for the RAMBlock when it's se

Re: [RFC PATCH v2 05/21] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot

2023-09-21 Thread David Hildenbrand
On 14.09.23 05:51, Xiaoyao Li wrote: From: Chao Peng Switch to KVM_SET_USER_MEMORY_REGION2 when supported by KVM. With KVM_SET_USER_MEMORY_REGION2, QEMU can set up memory region that backend'ed both by hva-based shared memory and gmem fd based private memory. Signed-off-by: Chao Peng Codevel

Re: [PATCH 07/52] migration/rdma: Give qio_channel_rdma_source_funcs internal linkage

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian

Re: [RFC PATCH v2 00/21] QEMU gmem implemention

2023-09-21 Thread David Hildenbrand
This version still leave some opens to be discussed: 1. whether we need "private" propery to be user-settable?     It seems unnecessary because vm-type is determined. If the VM is     confidential-guest, then the RAM of the guest must be able to be     mapped as private, i.e., have kvm gmem b

Re: [PATCH 4/4] target/i386: add live migration support for FRED

2023-09-21 Thread Yang, Weijiang
On 9/1/2023 1:30 PM, Li, Xin3 wrote: FRED CPU states are managed in 10 FRED MSRs, in addtion to a few existing CPU registers and MSRs, e.g., the CR4.FRED bit. Add the 10 new FRED MSRs to x86 CPUArchState for live migration support. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/

Re: [PATCH 08/52] migration/rdma: Fix qemu_rdma_accept() to return failure on errors

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > qemu_rdma_accept() returns 0 in some cases even when it didn't > complete its job due to errors. Impact is not obvious. I figure the > caller will soon fail again with a misleading error message. > > Fix it to return -1 on any failure. > > Signe

Re: [PATCH 09/52] migration/rdma: Put @errp parameter last

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > include/qapi/error.h demands: > > * - Functions that use Error to report errors have an Error **errp > * parameter. It should be the last parameter, except for functions > * taking variable arguments. > > qemu_rdma_connect() does not co

Re: [RFC PATCH v2 00/21] QEMU gmem implemention

2023-09-21 Thread David Hildenbrand
2. hugepage support. KVM gmem can be allocated from hugetlbfs. How does QEMU determine Not yet it can't. gmem only supports THP, hugetlbfs is a future thing, if it's ever supported. I wouldn't be at all surprised if we end up going down a slightly different route and don't use hugetlbfs

[PATCH v2] plugins/hotblocks: Fix potential deadlock in plugin_exit() function

2023-09-21 Thread Cong Liu
This patch fixes a potential deadlock in the plugin_exit() function of QEMU. The original code does not release the lock mutex if it is NULL. This patch adds a check for it being NULL and releases the mutex in that case. Signed-off-by: Cong Liu Suggested-by: Philippe Mathieu-Daudé --- contrib/p

Re: [PATCH 10/52] migration/rdma: Eliminate error_propagate()

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > When all we do with an Error we receive into a local variable is > propagating to somewhere else, we can just as well receive it there > right away. > > Signed-off-by: Markus Armbruster Reviewed-by: Li Zhijian > --- > migration/rdma.c | 19 +

[PATCH] Revert "tap: setting error appropriately when calling net_init_tap_one()"

2023-09-21 Thread Akihiko Odaki
This reverts commit 46d4d36d0bf2b24b205f2f604f0905db80264eef. The reverted commit changed to emit warnings instead of errors when vhost is requested but vhost initialization fails if vhostforce option is not set. However, vhostforce is not meant to ignore vhost errors. It was once introduced as a

Re: [PATCH 11/52] migration/rdma: Drop rdma_add_block() error handling

2023-09-21 Thread Zhijian Li (Fujitsu)
On 18/09/2023 22:41, Markus Armbruster wrote: > rdma_add_block() can't fail. Return void, and drop the unreachable > error handling. > > Signed-off-by: Markus Armbruster > --- > migration/rdma.c | 30 +- > 1 file changed, 9 insertions(+), 21 deletions(-) > [...]

Re: [PATCH v3] hw/i386/pc: improve physical address space bound check for 32-bit systems

2023-09-21 Thread Ani Sinha
> On 21-Sep-2023, at 12:47 PM, Ani Sinha wrote: > > 32-bit systems do not have a reserved memory for hole64 and hotplugging memory > devices are not supported on those systems. Therefore, the maximum limit of > the > guest physical address in the absence of additional memory devices effective

Re: [PATCH v3] hw/i386/pc: improve physical address space bound check for 32-bit systems

2023-09-21 Thread Ani Sinha
> On 21-Sep-2023, at 1:45 PM, David Hildenbrand wrote: > > On 21.09.23 09:17, Ani Sinha wrote: >> 32-bit systems do not have a reserved memory for hole64 and hotplugging >> memory >> devices are not supported on those systems. Therefore, the maximum limit of >> the >> guest physical address

Re: [PATCH v1 09/22] vfio/container: Introduce vfio_[attach/detach]_device

2023-09-21 Thread Cédric Le Goater
On 8/30/23 12:37, Zhenzhong Duan wrote: From: Eric Auger We want the VFIO devices to be able to use two different IOMMU callbacks, the legacy VFIO one and the new iommufd one. Introduce vfio_[attach/detach]_device which aim at hiding the underlying IOMMU backend (IOCTLs, datatypes, ...). Once

  1   2   3   >