Re: [PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-17 Thread Xiaoyao Li
On 3/13/2024 9:27 PM, Gerd Hoffmann wrote: Query kvm for supported guest physical address bits, in cpuid function 8008, eax[23:16]. Usually this is identical to host physical address bits. With NPT or EPT being used this might be restricted to 48 (max 4-level paging address space size)

Re: [PATCH] vhost-vdpa: check vhost_vdpa_set_vring_ready() return value

2024-03-17 Thread Jason Wang
On Fri, Mar 15, 2024 at 4:23 PM Stefano Garzarella wrote: > > On Thu, Mar 14, 2024 at 11:17:01AM +0800, Jason Wang wrote: > >On Wed, Feb 7, 2024 at 5:27 PM Stefano Garzarella > >wrote: > >> > >> vhost_vdpa_set_vring_ready() could already fail, but if Linux's > >> patch [1] will be merged, it

Re: [PATCH for-9.0 v3] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-17 Thread Jason Wang
On Fri, Mar 15, 2024 at 11:59 PM Kevin Wolf wrote: > > VDUSE requires that virtqueues are first enabled before the DRIVER_OK > status flag is set; with the current API of the kernel module, it is > impossible to enable the opposite order in our block export code because > userspace is not

Re: [PATCH 01/12] roms/edk2-build.py: Add --module support

2024-03-17 Thread Sunil V L
On Fri, Mar 15, 2024 at 03:13:44PM +0100, Gerd Hoffmann wrote: > On Fri, Mar 15, 2024 at 06:35:08PM +0530, Sunil V L wrote: > > UefiTestToolsPkg which should use edk2-build.py needs --module parameter > > support. Add this optional parameter handling. > > I don't think this is needed. By default

Re: [PATCH v2 1/2] system/memory.c: support unaligned access

2024-03-17 Thread Tomoyuki Hirose
ping. On Mon, Feb 26, 2024 at 4:28 PM Tomoyuki Hirose wrote: > > Hello, > I would be happy if you could give me some comments. > > ping. > > On Thu, Feb 1, 2024 at 5:14 PM Tomoyuki HIROSE > wrote: > > > > The previous code ignored 'impl.unaligned' and handled unaligned accesses > > as is. But

Re: [PATCH for-9.0] target/riscv: do not enable all named features by default

2024-03-17 Thread Alistair Francis
On Wed, Mar 13, 2024 at 6:33 AM Daniel Henrique Barboza wrote: > > Commit 3b8022269c added the capability of named features/profile > extensions to be added in riscv,isa. To do that we had to assign priv > versions for each one of them in isa_edata_arr[]. But this resulted in a > side-effect:

Re: [PATCH 03/12] uefi-test-tools: Add support for python based build script

2024-03-17 Thread Sunil V L
On Fri, Mar 15, 2024 at 03:17:19PM +0100, Gerd Hoffmann wrote: > > +Build/bios-tables-test.%.efi: > > + $(PYTHON) ../../roms/edk2-build.py --config uefi-test-build.config > > Adding '--match $*' will build one arch instead of all. > Thanks Gerd. Good suggestion. Let me update in next revision.

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-17 Thread Jason Wang
On Sat, Mar 16, 2024 at 2:45 AM Si-Wei Liu wrote: > > > > On 3/14/2024 9:03 PM, Jason Wang wrote: > > On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: > >> On setups with one or more virtio-net devices with vhost on, > >> dirty tracking iteration increases cost the bigger the number > >> amount

Re: [PATCH v4 1/2] vhost: dirty log should be per backend type

2024-03-17 Thread Jason Wang
On Sat, Mar 16, 2024 at 2:33 AM Si-Wei Liu wrote: > > > > On 3/14/2024 8:50 PM, Jason Wang wrote: > > On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: > >> There could be a mix of both vhost-user and vhost-kernel clients > >> in the same QEMU process, where separate vhost loggers for the > >>

[PATCH v2 3/3] qom/object_interfaces: Remove local_err in user_creatable_add_type

2024-03-17 Thread Zhenzhong Duan
In user_creatable_add_type, there is mixed usage of ERRP_GUARD and local_err. This makes error_abort not taking effect in those callee functions with _err passed. Now that we already use ERRP_GUARD, remove local_err and pass errp. Signed-off-by: Zhenzhong Duan --- qom/object_interfaces.c | 8

[PATCH v2 1/3] qom/object_interfaces: Remove unnecessary local error check

2024-03-17 Thread Zhenzhong Duan
The original error handling code indicates "local_err is always set", and error_propagate() can handle the case that local_err is NULL. Use err label instead of out label for error path. Reviewed-by: Zhao Liu Signed-off-by: Zhenzhong Duan --- qom/object_interfaces.c | 16 +++- 1

[PATCH v2 2/3] qom/object_interfaces: Make object_set_properties_from_qdict return bool

2024-03-17 Thread Zhenzhong Duan
Make object_set_properties_from_qdict() return bool, so that user_creatable_add_type() could check its return value instead of local_err pointer. Opportunistically, do the same change to check return value of object_property_try_add_child() instead of local_err pointer. Suggested-by: Zhao Liu

[PATCH v2 0/3] Simplify user_creatable_add_type error path

2024-03-17 Thread Zhenzhong Duan
Hi, This is a simplification to user_creatable_add_type error path. Removed local_err and its check in error path, check return value instead. Tested with make check and guest bootup. Thanks Zhenzhong Changelog: v2: - Use err label to replace out label (Zhao Liu) - Refine patch description

Re: [PATCH] target/i386: Export RFDS bit to guests

2024-03-17 Thread Pawan Gupta
On Fri, Mar 15, 2024 at 03:50:18PM +0800, Zhao Liu wrote: > > Make RFDS_CLEAR and RFDS_NO bits available to guests. > > Are these two bits going to be supported by microcode updates to > existing products? RFDS_CLEAR is supported by the microcode update that is needed to mitigate RFDS. RFDS_NO

[PATCH v2 0/1] cxl/mem: Fix for the index of Clear Event Record Handle

2024-03-17 Thread Yuquan Wang
This is a simple fix for the index of 'Clear Event Record' Handle. The print content of dev_dbg from Clear Event Records mailbox command would report the handle of the next record to clear not the current one. The problem was found when I was doing the debug of CXL Event Error on Qemu. I injected

[PATCH v2 1/1] cxl/mem: Fix for the index of Clear Event Record Handle

2024-03-17 Thread Yuquan Wang
The dev_dbg info for Clear Event Records mailbox command would report the handle of the next record to clear not the current one. This was because the index 'i' had incremented before printing the current handle value. Signed-off-by: Yuquan Wang --- drivers/cxl/core/mbox.c | 2 +- 1 file

[PATCH] build: Re-introduce an 'info' target to build a Texinfo manual.

2024-03-17 Thread Maxim Cournoyer
This reinstates , which was committed at some point but reverted many years later in cleanups that followed the migration from Texinfo sources to the ReStructuredText (RST) format. It's still nice to leave the option for users

[PULL 07/10] migration: cpr-reboot documentation

2024-03-17 Thread peterx
From: Steve Sistare Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/1710338119-330923-1-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- docs/devel/migration/CPR.rst | 147

[PULL 08/10] migration: Fix iocs leaks during file and fd migration

2024-03-17 Thread peterx
From: Fabiano Rosas The memory for the io channels is being leaked in three different ways during file migration: 1) if the offset check fails we never drop the ioc reference; 2) we allocate an extra channel for no reason; 3) if multifd is enabled but channel creation fails when calling

[PULL 00/10] Migration 20240317 patches

2024-03-17 Thread peterx
-20240317-pull-request for you to fetch changes up to 9adfb308c1513562d6acec02aa780c5ef9b0193d: migration/multifd: Duplicate the fd for the outgoing_args (2024-03-15 11:26:33 -0400) Migration pull for 9.0-rc0 - Nicholas/Phil's

Re: [PATCH] usb-audio: Fix invalid values in AudioControl descriptors

2024-03-17 Thread Volker Rümelin
Am 09.03.24 um 18:29 schrieb Joonas Kankaala: > This fixes the invalid bInterfaceProtocol value 0x04 in the USB audio > AudioControl descriptors. It should be zero. While Linux and Windows > forgive this error, macOS 14 Sonoma does not. The usb-audio device does > not appear in macOS sound

Re: [PATCH] linux-user: replace calloc() with g_new0()

2024-03-17 Thread Alex Bennée
Nguyen Dinh Phi writes: > Use glib allocation as recommended by the coding convention > > Signed-off-by: Nguyen Dinh Phi > --- > linux-user/main.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index 9277df2e9d..149e35432e

[PATCH] linux-user: replace calloc() with g_new0()

2024-03-17 Thread Nguyen Dinh Phi
Use glib allocation as recommended by the coding convention Signed-off-by: Nguyen Dinh Phi --- linux-user/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 9277df2e9d..149e35432e 100644 --- a/linux-user/main.c +++

[PULL 04/10] physmem: Factor cpu_physical_memory_dirty_bits_cleared() out

2024-03-17 Thread peterx
From: Nicholas Piggin Signed-off-by: Nicholas Piggin Tested-by: Thomas Huth Message-ID: <20240219061731.232570-1-npig...@gmail.com> [PMD: Split patch in 2: part 1/2] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Link:

[PULL 02/10] migration: Fix error handling after dup in file migration

2024-03-17 Thread peterx
From: Fabiano Rosas The file migration code was allowing a possible -1 from a failed call to dup() to propagate into the new QIOFileChannel::fd before checking for validity. Coverity doesn't like that, possibly due to the the lseek(-1, ...) call that would ensue before returning from the channel

[PULL 01/10] io: Introduce qio_channel_file_new_dupfd

2024-03-17 Thread peterx
From: Fabiano Rosas Add a new helper function for creating a QIOChannelFile channel with a duplicated file descriptor. This saves the calling code from having to do error checking on the dup() call. Suggested-by: "Daniel P. Berrangé" Signed-off-by: Fabiano Rosas Reviewed-by: "Daniel P.

[PULL 06/10] migration: Skip only empty block devices

2024-03-17 Thread peterx
From: Cédric Le Goater The block .save_setup() handler calls a helper routine init_blk_migration() which builds a list of block devices to take into account for migration. When one device is found to be empty (sectors == 0), the loop exits and all the remaining devices are ignored. This is a

[PULL 09/10] migration/multifd: Ensure we're not given a socket for file migration

2024-03-17 Thread peterx
From: Fabiano Rosas When doing migration using the fd: URI, QEMU will fetch the file descriptor passed in via the monitor at fd_start_outgoing|incoming_migration(), which means the checks at migration_channels_and_transport_compatible() happen too soon and we don't know at that point whether the

[PULL 03/10] physmem: Expose tlb_reset_dirty_range_all()

2024-03-17 Thread peterx
From: Philippe Mathieu-Daudé In order to call tlb_reset_dirty_range_all() outside of system/physmem.c, expose its prototype. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Link: https://lore.kernel.org/r/20240312201458.79532-2-phi...@linaro.org Signed-off-by: Peter Xu

[PULL 10/10] migration/multifd: Duplicate the fd for the outgoing_args

2024-03-17 Thread peterx
From: Fabiano Rosas We currently store the file descriptor used during the main outgoing channel creation to use it again when creating the multifd channels. Since this fd is used for the first iochannel, there's risk that the QIOChannel gets freed and the fd closed while outgoing_args.fd still

[PULL 05/10] physmem: Fix migration dirty bitmap coherency with TCG memory access

2024-03-17 Thread peterx
From: Nicholas Piggin The fastpath in cpu_physical_memory_sync_dirty_bitmap() to test large aligned ranges forgot to bring the TCG TLB up to date after clearing some of the dirty memory bitmap bits. This can result in stores though the TCG TLB not setting the dirty memory bitmap and ultimately

[PATCH 3/7] target/hppa: fix access_id check

2024-03-17 Thread Sven Schnelle
PA2.0 provides 8 instead of 4 PID registers. Signed-off-by: Sven Schnelle --- roms/SLOF| 2 +- target/hppa/mem_helper.c | 67 +++- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/roms/SLOF b/roms/SLOF index

[PATCH 0/7] few fixes for hppa target

2024-03-17 Thread Sven Schnelle
Hi, here are a few fixes for the hppa target i made while debugging some wide mode issues. Sven Schnelle (7): target/hppa: ldcw,s uses static shift of 3 target/hppa: fix shrp for wide mode target/hppa: fix access_id check target/hppa: exit tb on flush cache instructions target/hppa:

[PATCH 7/7] target/hppa: fix do_stdby_e()

2024-03-17 Thread Sven Schnelle
stdby,e,m was writing data from the wrong half of the register into memory for cases 0-3. Signed-off-by: Sven Schnelle --- target/hppa/op_helper.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index

[PATCH 6/7] target/hppa: mask privilege bits in mfia

2024-03-17 Thread Sven Schnelle
mfia should return only the iaoq bits without privilege bits. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a09112e4ae..e47f8f9f47 100644 ---

[PATCH 5/7] target/hppa: copy new_spc to iasq_f on be,n instruction

2024-03-17 Thread Sven Schnelle
Otherwise the first instruction at the new location gets executed from the old space. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 58d7ec1ade..a09112e4ae 100644 ---

[PATCH 2/7] target/hppa: fix shrp for wide mode

2024-03-17 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6a513d7d5c..8ba31567e8 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3462,7 +3462,7 @@

[PATCH 4/7] target/hppa: exit tb on flush cache instructions

2024-03-17 Thread Sven Schnelle
When the guest modifies the tb it is currently executing from, it executes a fic instruction. Exit the tb on such instruction, otherwise we might execute stale code. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH 1/7] target/hppa: ldcw,s uses static shift of 3

2024-03-17 Thread Sven Schnelle
Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index eb2046c5ad..6a513d7d5c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3085,7 +3085,7 @@

Re: Regression in v7.2.10 - ui-dbus.so requires -fPIC

2024-03-17 Thread Michael Tokarev
17.03.2024 01:19, Olaf Hering: Sat, 16 Mar 2024 22:40:14 +0300 Michael Tokarev : meson: ensure dbus-display generated code is built before other units (cherry picked from commit 1222070e772833c6875e0ca63565db12c22df39e) "static_library" is used often. Some use the 'pic' option,

Re: [PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-17 Thread Tao Su
On Wed, Mar 13, 2024 at 02:27:18PM +0100, Gerd Hoffmann wrote: > Query kvm for supported guest physical address bits, in cpuid > function 8008, eax[23:16]. Usually this is identical to host > physical address bits. With NPT or EPT being used this might be > restricted to 48 (max 4-level

[PATCH v1 0/2] Some fixes for pause and resume all vcpus

2024-03-17 Thread Keqian Zhu via
I hit these bugs when I test the RFC patch of ARM vCPU hotplug feature. This patch has been verified valid. Keqian Zhu (2): system/cpus: Fix pause_all_vcpus() under concurrent environment system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition system/cpus.c | 32

[PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-17 Thread Keqian Zhu via
Both main loop thread and vCPU thread are allowed to call pause_all_vcpus(), and in general resume_all_vcpus() is called after it. Two issues live in pause_all_vcpus(): 1. There is possibility that during thread T1 waits on qemu_pause_cond with bql unlocked, other thread has called

[PATCH v1 2/2] system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition

2024-03-17 Thread Keqian Zhu via
For vCPU being hotplugged, qemu_init_vcpu() is called. In this function, we set vcpu state as stopped, and then wait vcpu thread to be created. As the vcpu state is stopped, it will inform us it has been created and then wait on halt_cond. After we has realized vcpu object, we will resume the

[PATCH 2/7] hw/char: Implement STM32L4x5 USART skeleton

2024-03-17 Thread Arnaud Minier
Add the basic infrastructure (register read/write, type...) to implement the STM32L4x5 USART. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- MAINTAINERS | 1 + hw/char/Kconfig | 3 + hw/char/meson.build | 1 +

[PATCH 1/7] hw/misc/stm32l4x5_rcc: Propagate period when enabling a clock

2024-03-17 Thread Arnaud Minier
The "clock_set_mul_div" function doesn't propagate the clock period to the children if it is changed (e.g. by enabling/disabling a clock multiplexer). This was overlooked during the implementation due to late changes. This commit propagates the change if the multiplier or divider changes. The

[PATCH 0/7] hw/char: Implement the STM32L4x5 USART, UART and LPUART

2024-03-17 Thread Arnaud Minier
This patch adds the STM32L4x5 USART (Universal Synchronous/Asynchronous Receiver/Transmitter) device and is part of a series implementing the STM32L4x5 with a few peripherals. It implements the necessary functionalities to receive/send characters over the serial port, which are useful to

[PATCH 3/7] hw/char/stm32l4x5_usart: Add USART, UART, LPUART types

2024-03-17 Thread Arnaud Minier
Create different types for the USART, UART and LPUART of the STM32L4x5 to deduplicate code and enable the implementation of different behaviors depending on the type. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/char/stm32l4x5_usart.c | 113

[PATCH 5/7] hw/char/stm32l4x5_usart: Add options for serial parameters setting

2024-03-17 Thread Arnaud Minier
Add a function to change the settings of the serial connection. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/char/stm32l4x5_usart.c | 97 +++ 1 file changed, 97 insertions(+) diff --git a/hw/char/stm32l4x5_usart.c

[PATCH 4/7] hw/char/stm32l4x5_usart: Enable serial read and write

2024-03-17 Thread Arnaud Minier
Implement the ability to read and write characters to the usart using the serial port. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/char/stm32l4x5_usart.c | 105 +- hw/char/trace-events | 1 + 2 files changed, 105 insertions(+), 1

[PATCH 7/7] tests/qtest: Add tests for the STM32L4x5 USART

2024-03-17 Thread Arnaud Minier
Test: - read/write from/to the usart registers - send/receive a character/string over the serial port The test to detect overrun is implemented but disabled because overruns are currently impossible due to how we signal in the USART when we are ready to receive a new character. Signed-off-by:

[PATCH 6/7] hw/arm: Add the USART to the stm32l4x5 SoC

2024-03-17 Thread Arnaud Minier
Add the USART to the SoC and connect it to the other implemented devices. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- docs/system/arm/b-l475e-iot01a.rst | 2 +- hw/arm/Kconfig | 1 + hw/arm/stm32l4x5_soc.c | 88 +++---