[PATCH v3 0/3] Enable -cpu ,help

2023-07-30 Thread Dinah Baum
This patch adds the ability to query for CPU features. Currently it is limited to the architecture that support feature probing (arm, i386, and s390x). Ex: athlon features: 3dnow= 3dnowext= 3dnowprefetch= ... Suggested-by: Peter Maydell Resolves:

[PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.

2023-07-30 Thread Dinah Baum
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480 Signed-off-by: Dinah Baum Signed-off-by: Dinah Baum --- cpu.c| 41 include/qapi/qmp/qdict.h | 1 + qemu-options.hx | 7 --- qobject/qdict.c | 5

[PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`

2023-07-30 Thread Dinah Baum
Signed-off-by: Dinah Baum --- qapi/machine-target.json | 78 +--- qapi/machine.json| 77 +++ 2 files changed, 78 insertions(+), 77 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index

Re: [PATCH for-8.2 0/6] vfio/migration: Add P2P support for VFIO migration

2023-07-30 Thread Avihai Horon
On 18/07/2023 18:46, Jason Gunthorpe wrote: On Sun, Jul 16, 2023 at 11:15:35AM +0300, Avihai Horon wrote: Hi all, The first patch in this series adds a small optimization to VFIO migration by moving the STOP_COPY->STOP transition to vfio_save_cleanup(). Testing with a ConnectX-7 VFIO device

Re: [PATCH for-8.2 2/6] sysemu: Add pre VM state change callback

2023-07-30 Thread Avihai Horon
On 27/07/2023 19:23, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 7/16/23 10:15, Avihai Horon wrote: Add pre VM state change callback to struct VMChangeStateEntry. This sentence could be the subject. Sure. The pre VM state change callback is

Re: [PATCH for-8.2 2/2] target/ppc: use g_free() in test_opcode_table()

2023-07-30 Thread Daniel Henrique Barboza
On 7/29/23 12:32, Peter Maydell wrote: On Fri, 28 Jul 2023 at 21:47, Daniel Henrique Barboza wrote: Use g_free(table[i]) instead of free(table[i]) to comply with QEMU low level memory management guidelines. Signed-off-by: Daniel Henrique Barboza --- target/ppc/translate.c | 2 +- 1

Re: [PATCH 5/6] hw/ppc: Always store the decrementer value

2023-07-30 Thread Nicholas Piggin
On Thu Jul 27, 2023 at 10:26 PM AEST, Cédric Le Goater wrote: > Hello Nick, > > On 7/26/23 20:22, Nicholas Piggin wrote: > > When writing a value to the decrementer that raises an exception, the > > irq is raised, but the value is not stored so the store doesn't appear > > to have changed the

[PATCH] hda-audio: use log-scale for amplifier levels

2023-07-30 Thread Yuanqing Li
According Intel's High Definition Audio Specification (Revision 1.0a, Section 7.3.4.10: Amplifier Capabilities), the amplifier gain levels should be evenly spaced in dB, i.e. using a log scale instead of linear. Here, the hda-codec reports amplifier levels from 0 to -48 dB at 1-dB steps matching

[PATCH QEMU v3 2/3] qapi: Craft the dirty-limit capability comment

2023-07-30 Thread ~hyman
From: Hyman Huang(黄勇) Signed-off-by: Markus Armbruster Signed-off-by: Hyman Huang(黄勇) --- qapi/migration.json | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index a74ade4d72..62ab151da2 100644 ---

[PATCH QEMU v3 0/3] migration: craft the doc comments

2023-07-30 Thread ~hyman
Hi, please review the version 3 of the series, thanks. V3: - craft the commit message of "Add section for migration dirty limit and dirty page rate", and put the section after section "Migration", suggested by Markus. V2: - split the first commit in v1 into 2 - add commit message of

Re: [PATCH for-8.2 0/2] ppc: get rid of free() (gitlab #1798)

2023-07-30 Thread Daniel Henrique Barboza
On 7/29/23 12:35, Peter Maydell wrote: On Fri, 28 Jul 2023 at 21:57, Daniel Henrique Barboza wrote: Here's some trivial changes following Peter's call to arms against free() and friends in gitlab issue #1798 in an attempt to enforce our memory management guidelines [1]. To clarify, this

Re: [RFC][PATCH] accel/tcg: Use lookup_and_goto_ptr() for linux-user in translator_use_goto_tb()

2023-07-30 Thread Helge Deller
On 7/30/23 20:02, Richard Henderson wrote: On 7/30/23 11:01, Richard Henderson wrote: On 7/30/23 10:56, Helge Deller wrote: +++ b/accel/tcg/translator.c @@ -124,8 +124,13 @@ bool translator_use_goto_tb(DisasContextBase *db, vaddr dest)   return false;   } +#ifndef

[PATCH v2] target/ppc: Fix VRMA page size for ISA v3.0

2023-07-30 Thread Nicholas Piggin
Until v2.07s, the VRMA page size (L||LP) was encoded in LPCR[VRMASD]. In v3.0 that moved to the partition table PS field. The powernv machine can now run KVM HPT guests on POWER9/10 CPUs with this fix and the patch to add ASDR. Fixes: 3367c62f522b ("target/ppc: Support for POWER9 native hash")

Re: [PATCH 5/6] hw/ppc: Always store the decrementer value

2023-07-30 Thread Cédric Le Goater
On 7/30/23 11:40, Nicholas Piggin wrote: On Thu Jul 27, 2023 at 10:26 PM AEST, Cédric Le Goater wrote: Hello Nick, On 7/26/23 20:22, Nicholas Piggin wrote: When writing a value to the decrementer that raises an exception, the irq is raised, but the value is not stored so the store doesn't

[PATCH QEMU v3 3/3] MAINTAINERS: Add section "Migration dirty limit and dirty page rate"

2023-07-30 Thread ~hyman
From: Hyman Huang(黄勇) I've built interests in dirty limit and dirty page rate features and also have been working on projects related to this subsystem. Add a section to the MAINTAINERS file for migration dirty limit and dirty page rate. Add myself as a maintainer for this subsystem so that I

[PATCH QEMU v2 0/3] migration: enrich the dirty-limit test case

2023-07-30 Thread ~hyman
The dirty-limit migration test involves many passes and takes about 1 minute on average, so put it in the slow mode of migration-test. Inspired by Peter. V2: - put the dirty-limit migration test in slow mode and enrich the test case comment Dirty-limit feature was introduced in 8.1, and the

Re: [PATCH] target/openrisc: Set EPCR to next PC on FPE exceptions

2023-07-30 Thread Richard Henderson
On 7/29/23 14:08, Stafford Horne wrote: The architecture specification calls for the EPCR to be set to "Address of next not executed instruction" when there is a floating point exception (FPE). This was not being done, so fix it by using the same method as syscall. Note, this may need a lot

Re: [PATCH] target/hppa: Move iaoq registers and thus reduce generated code size

2023-07-30 Thread Richard Henderson
On 7/30/23 09:30, Helge Deller wrote: On hppa the Instruction Address Offset Queue (IAOQ) registers specifies the next to-be-executed instructions addresses. Each generated TB writes those registers at least once, so those registers are used heavily in generated code. Looking at the generated

[PATCH v3 2/3] qapi, target/: Enable 'query-cpu-model-expansion' on all architectures

2023-07-30 Thread Dinah Baum
Only architectures that implement the command will return results, others will return an error message as before. Signed-off-by: Dinah Baum --- cpu.c| 20 +++ include/exec/cpu-common.h| 7 qapi/machine-target.json | 60

Re: [PATCH v3 0/3] Enable -cpu ,help

2023-07-30 Thread Peter Maydell
On Sun, 30 Jul 2023 at 08:21, Dinah Baum wrote: > > This patch adds the ability to query for CPU > features. Currently it is limited to the architecture that > support feature probing (arm, i386, and s390x). > > Ex: > athlon features: > 3dnow= > 3dnowext= > 3dnowprefetch= > ... > >

[PATCH] target/hppa: Move iaoq registers and thus reduce generated code size

2023-07-30 Thread Helge Deller
On hppa the Instruction Address Offset Queue (IAOQ) registers specifies the next to-be-executed instructions addresses. Each generated TB writes those registers at least once, so those registers are used heavily in generated code. Looking at the generated assembly, for a x86-64 host this code to

[PATCH QEMU v3 1/3] qapi: Reformat the dirty-limit migration doc comments

2023-07-30 Thread ~hyman
From: Hyman Huang(黄勇) Reformat the dirty-limit migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions). Signed-off-by: Markus Armbruster Signed-off-by: Hyman Huang(黄勇) --- qapi/migration.json | 69

[PATCH QEMU v2 2/3] tests/migration: Introduce dirty-ring-size option into guestperf

2023-07-30 Thread ~hyman
From: Hyman Huang(黄勇) Dirty ring size configuration is not supported by guestperf tool. Introduce dirty-ring-size (ranges in [1024, 65536]) option so developers can play with dirty-ring and dirty-limit feature easier. To set dirty ring size with 4096 during migration test: $

Re: [RFC][PATCH] accel/tcg: Use lookup_and_goto_ptr() for linux-user in translator_use_goto_tb()

2023-07-30 Thread Richard Henderson
On 7/30/23 11:01, Richard Henderson wrote: On 7/30/23 10:56, Helge Deller wrote: +++ b/accel/tcg/translator.c @@ -124,8 +124,13 @@ bool translator_use_goto_tb(DisasContextBase *db, vaddr dest)   return false;   } +#ifndef CONFIG_USER_ONLY   /* Check for the dest on the same

Re: [RFC][PATCH] accel/tcg: Use lookup_and_goto_ptr() for linux-user in translator_use_goto_tb()

2023-07-30 Thread Richard Henderson
On 7/30/23 10:56, Helge Deller wrote: +++ b/accel/tcg/translator.c @@ -124,8 +124,13 @@ bool translator_use_goto_tb(DisasContextBase *db, vaddr dest) return false; } +#ifndef CONFIG_USER_ONLY /* Check for the dest on the same page as the start of the TB. */ return

[RFC][PATCH] accel/tcg: Use lookup_and_goto_ptr() for linux-user in translator_use_goto_tb()

2023-07-30 Thread Helge Deller
I'm quite unclear about translator_use_goto_tb() for qemu-user emulation(and in general). Based on the function name, the function translator_use_goto_tb() shall help to decide if a program should use goto_tb() and exit_tb() to jump to the next instruction. Currently, if the destination is

Re: [PATCH] gdbstub: Fix client Ctrl-C handling

2023-07-30 Thread Nicholas Piggin
On Wed Jul 26, 2023 at 4:35 PM AEST, Joel Stanley wrote: > On Wed, 12 Jul 2023 at 02:12, Nicholas Piggin wrote: > > > > On Tue Jul 11, 2023 at 9:03 PM AEST, Matheus Tavares Bernardino wrote: > > > > Nicholas Piggin wrote: > > > > > > > > diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c > > > >

Re: [PATCH for-8.2 1/6] vfio/migration: Move from STOP_COPY to STOP in vfio_save_cleanup()

2023-07-30 Thread Cédric Le Goater
On 7/16/23 10:15, Avihai Horon wrote: Changing the device state from STOP_COPY to STOP can take time as the device may need to free resources and do other operations as part of the transition. Currently, this is done in vfio_save_complete_precopy() and therefore it is counted in the migration

Re: [PATCH for-8.2 2/6] sysemu: Add pre VM state change callback

2023-07-30 Thread Cédric Le Goater
[ ... ] + * qemu_add_vm_change_state_handler_prio_full: qemu_add_vm_change_state_handler_prio_all() may be. I don't have much better but 'full' doesn't sound right. minor. I followed the GLib naming convention. For example, g_tree_new and g_tree_new_full, or g_hash_table_new and

[PATCH QEMU v2 1/3] tests: Add migration dirty-limit capability test

2023-07-30 Thread ~hyman
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The

[PATCH QEMU v2 3/3] tests/migration: Introduce dirty-limit into guestperf

2023-07-30 Thread ~hyman
From: Hyman Huang(黄勇) Currently, guestperf does not cover the dirty-limit migration, support this feature. Note that dirty-limit requires 'dirty-ring-size' set. To enable dirty-limit, setting x-vcpu-dirty-limit-period as 500ms and x-vcpu-dirty-limit as 10MB/s: $ ./tests/migration/guestperf.py

Re: [PATCH v2] target/ppc: Fix VRMA page size for ISA v3.0

2023-07-30 Thread Cédric Le Goater
On 7/30/23 13:18, Nicholas Piggin wrote: Until v2.07s, the VRMA page size (L||LP) was encoded in LPCR[VRMASD]. In v3.0 that moved to the partition table PS field. The powernv machine can now run KVM HPT guests on POWER9/10 CPUs with this fix and the patch to add ASDR. Fixes: 3367c62f522b

[PATCH] Fix some typos in documentation and comments

2023-07-30 Thread Stefan Weil via
Signed-off-by: Stefan Weil --- This patch was triggered by a spelling check for the generated QEMU documentation using codespell. It does not try to fix all typos which still exist in the QEMU code, but has a focus on those required to fix the documentation. Nevertheless some code comments with

[PULL 1/1] hw/nvme: use stl/ldl pci dma api

2023-07-30 Thread Klaus Jensen
From: Klaus Jensen Use the stl/ldl pci dma api for writing/reading doorbells. This removes the explicit endian conversions. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Reviewed-by: Thomas Huth Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c

[PULL 0/1] hw/nvme fixes

2023-07-30 Thread Klaus Jensen
From: Klaus Jensen Hi, This should also fix coverity cid 1518067 and 1518066. The following changes since commit ccb86f079a9e4d94918086a9df18c1844347aff8: Merge tag 'pull-nbd-2023-07-28' of https://repo.or.cz/qemu/ericb into staging (2023-07-28 09:56:57 -0700) are available in the Git

Re: [PATCH] elf2dmp: Don't abandon when Prcb is set to 0

2023-07-30 Thread Viktor Prutyanov
>> On 2023/06/12 12:42, Viktor Prutyanov wrote: >> Prcb may be set to 0 for some CPUs if the dump was taken before they start. The dump may still contain valuable information for started CPUs so don't abandon conversion in such a case. Signed-off-by: Akihiko Odaki

Re: [RFC][PATCH] accel/tcg: Use lookup_and_goto_ptr() for linux-user in translator_use_goto_tb()

2023-07-30 Thread Richard Henderson
On 7/30/23 10:56, Helge Deller wrote: I'm quite unclear about translator_use_goto_tb() for qemu-user emulation(and in general). Based on the function name, the function translator_use_goto_tb() shall help to decide if a program should use goto_tb() and exit_tb() to jump to the next

RE: [PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-30 Thread Liu, Jing2
Hi Alex, > On July 28, 2023 11:41 PM, Alex Williamson wrote: > > On Fri, 28 Jul 2023 10:27:17 +0200 > Cédric Le Goater wrote: > > > On 7/28/23 10:09, Liu, Jing2 wrote: > > > Hi Alex, > > > > > > Thanks very much for reviewing the patches. > > > > > >> On July 28, 2023 1:25 AM, Alex Williamson

[PATCH] kvm: Fix crash by initializing kvm_state early

2023-07-30 Thread Gavin Shan
Runs into core dump on arm64 and the backtrace extracted from the core dump is shown as below. It's caused by accessing @kvm_state which isn't initialized at that point due to commit 176d073029 ("hw/arm/virt: Use machine_memory_devices_init()"), where the machine's memory region is added ealier

Re: [PATCH v2 3/8] machine: Print supported CPU models instead of typenames

2023-07-30 Thread Gavin Shan
On 7/27/23 19:00, Igor Mammedov wrote: On Thu, 27 Jul 2023 15:16:18 +1000 Gavin Shan wrote: On 7/27/23 09:08, Richard Henderson wrote: On 7/25/23 17:32, Gavin Shan wrote: -static const char *q800_machine_valid_cpu_types[] = { +static const char * const q800_machine_valid_cpu_types[] = {  

Re: [RFC][PATCH] accel/tcg: Use lookup_and_goto_ptr() for linux-user in translator_use_goto_tb()

2023-07-30 Thread Helge Deller
On 7/30/23 22:03, Richard Henderson wrote: On 7/30/23 10:56, Helge Deller wrote: I'm quite unclear about translator_use_goto_tb() for qemu-user emulation(and in general). Based on the function name, the function translator_use_goto_tb() shall help to decide if a program should use

Re: [PATCH v2 1/4] vhost: fix the fd leak

2023-07-30 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:42 AM, Li Feng wrote: > > When the vhost-user reconnect to the backend, the notifer should be > cleanup. Otherwise, the fd resource will be exhausted. > > Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") > > Signed-off-by: Li Feng Reviewed-by:

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-30 Thread Raphael Norwitz
> On Jul 28, 2023, at 3:48 AM, Li Feng wrote: > > Thanks for your reply. > >> 2023年7月28日 上午5:21,Raphael Norwitz 写道: >> >> >> >>> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: >>> >>> Thanks for your comments. >>> 2023年7月25日 上午1:21,Raphael Norwitz 写道: Very excited to see

Re: [PATCH] hda-audio: use log-scale for amplifier levels

2023-07-30 Thread Marc-André Lureau
Hi On Sun, Jul 30, 2023 at 5:52 PM Yuanqing Li wrote: > > According Intel's High Definition Audio Specification (Revision 1.0a, > Section 7.3.4.10: Amplifier Capabilities), the amplifier gain levels > should be evenly spaced in dB, i.e. using a log scale instead of linear. > > Here, the

Re: [PATCH v2 4/4] vhost-user-scsi: support reconnect to backend

2023-07-30 Thread Raphael Norwitz
I don’t think we should be changing any vhost-scsi-common code here. I’d rather implement wrappers around vhost_user_scsi_start/stop() around vhost_user_scsi_common_start/stop() and check started_vu there. Otherwise I think this is looking good. Glad to see you caught the

Re: [PATCH v2 3/4] vhost: move and rename the conn retry times

2023-07-30 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:42 AM, Li Feng wrote: > > Multile devices need this macro, move it to a common header. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/block/vhost-user-blk.c | 4 +--- > hw/virtio/vhost-user-gpio.c | 3 +-- > include/hw/virtio/vhost.h | 2 ++ >

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-30 Thread Raphael Norwitz
> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: > > > >> 2023年7月28日 下午2:04,Michael S. Tsirkin 写道: >> >> On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: >>> Get_inflight_fd is sent only once. When reconnecting to the backend, >>> qemu sent set_inflight_fd to the backend. >> >> I

[PATCH] hw/riscv: split RAM into low and high memory

2023-07-30 Thread Fei Wu
riscv virt platform's memory started at 0x8000 and straddled the 4GiB boundary. Curiously enough, this choice of a memory layout will prevent from launching a VM with a bit more than 2000MiB and PCIe pass-thru on an x86 host, due to identity mapping requirements for the MSI doorbell on x86,

RE: [PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-30 Thread Liu, Jing2
Hi C. > On July 28, 2023 4:44 PM, Cédric Le Goater wrote: > > [ ... ] > > > Sorry I didn't quite understand "info.flags be tested against > VFIO_IRQ_INFO_NORESIZE". > > I saw kernel < 6.4 simply added NORESIZE to info.flags and latest kernel > > adds > if has_dyn_msix. > > Would you please

Re: [PATCH v3 6/6] qtest: microbit-test: add tests for nRF51 DETECT

2023-07-30 Thread Thomas Huth
On 28/07/2023 18.05, Chris Laplante wrote: Exercise the DETECT mechanism of the GPIO peripheral. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- tests/qtest/microbit-test.c | 42 + 1 file changed, 42 insertions(+) diff --git

Re: [PATCH v2 3/8] machine: Print supported CPU models instead of typenames

2023-07-30 Thread Gavin Shan
On 7/28/23 00:27, Richard Henderson wrote: On 7/26/23 22:16, Gavin Shan wrote: On 7/27/23 09:08, Richard Henderson wrote: On 7/25/23 17:32, Gavin Shan wrote: -static const char *q800_machine_valid_cpu_types[] = { +static const char * const q800_machine_valid_cpu_types[] = {