Re: [PATCH] misc: introduce strim-memory qapi to support free memory trimming

2024-07-06 Thread Guoyi Tu
Hi there, please review this patch,any comments are welcome. On 2024/6/28 18:22, Guoyi Tu wrote: In the test environment, we conducted IO stress tests on all storage disks within a virtual machine that had five storage devices mounted.During testing, we found that the qemu process allocated

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-06 Thread David Gibson
On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > On Fri, 5 Jul 2024 at 06:13, David Gibson wrote: > > > > On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: > > > On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: > > > > On Fri, Jul 05, 2024 at 11:18:47AM +1000

Re: [PATCH v2 0/4] ui/cocoa: Add cursor composition

2024-07-06 Thread Phil Dennis-Jordan
On Thu, 27 Jun 2024 at 13:17, Akihiko Odaki wrote: > Add accelerated cursor composition to ui/cocoa. This does not only > improve performance for display devices that exposes the capability to > the guest according to dpy_cursor_define_supported(), but fixes the > cursor display for devices that

[PATCH] meson.build: fix libgcrypt detection on system without libgcrypt-config

2024-07-06 Thread Yao Zi
libgcrypt starts providing correct pkg-config configuration and dropping libgcrypt-config since 1.11.0. So use auto method for detection of libgcrypt, in which meson will try both pkg-config and libgcrypt-config. This fixes build failure when libgcrypt is enabled on a system without ligcrypt-confi

Re: [PATCH 41/43] target/ppc: Change MMU xlate functions to take CPUState

2024-07-06 Thread BALATON Zoltan
On Thu, 4 Jul 2024, Nicholas Piggin wrote: On Mon May 27, 2024 at 9:13 AM AEST, BALATON Zoltan wrote: The callers of xlate functions get CPUState which is then cast to PowerPCCPU that is then cast back to CPUState by most xlate functions. Avoid this back and forth casting by passing the existing

Re: [PATCH 36/43] target/ppc/mmu-hash32: Remove some static inlines from header

2024-07-06 Thread BALATON Zoltan
On Thu, 4 Jul 2024, Nicholas Piggin wrote: On Mon May 27, 2024 at 9:13 AM AEST, BALATON Zoltan wrote: Two of these are not used anywhere and the other two are used only once and can be inlined and removed from the header. I'd prefer to put these in the .c file. Probably calculating the base on

Re: [PATCH 33/43] target/ppc: Remove single use static inline function

2024-07-06 Thread BALATON Zoltan
On Thu, 4 Jul 2024, Nicholas Piggin wrote: On Mon May 27, 2024 at 9:13 AM AEST, BALATON Zoltan wrote: The ger_pack_masks() function is only used once and the inverse of this operation is already inlined so it can be inlined too in the only caller and removed from the header. Is this needed for

Re: [PATCH 1/8] docs/qapidoc: factor out do_parse()

2024-07-06 Thread John Snow
On Sat, Jul 6, 2024, 10:47 AM Markus Armbruster wrote: > John Snow writes: > > > Factor out the compatibility parser helper into a base class, so it can > > be shared by other directives. > > > > Signed-off-by: John Snow > > R-by stands. > Assuming true even if I rebase on top of the 3.x patch

Re: [PATCH 5/8] qapi: convert "Example" sections without titles

2024-07-06 Thread John Snow
On Sat, Jul 6, 2024, 10:42 AM Markus Armbruster wrote: > John Snow writes: > > > Use the no-option form of ".. qmp-example::" to convert any Examples > > that do not have any form of caption or explanation whatsoever. Note > > that in a few cases, example sections are split into two or more > >

[PATCH v6 1/7] plugins: fix mem callback array size

2024-07-06 Thread Pierrick Bouvier
data was correctly copied, but size of array was not set (g_array_sized_new only reserves memory, but does not set size). As a result, callbacks were not called for code path relying on plugin_register_vcpu_mem_cb(). Found when trying to trigger mem access callbacks for atomic instructions. Revi

[PATCH v6 7/7] tests/tcg/x86_64: add test for plugin memory access

2024-07-06 Thread Pierrick Bouvier
Add an explicit test to check expected memory values are read/written. For sizes 8, 16, 32, 64 and 128, we generate a load/store operation. For size 8 -> 64, we generate an atomic __sync_val_compare_and_swap too. For 128bits memory access, we rely on SSE2 instructions. By default, atomic accesses

[PATCH v6 6/7] tests/plugin/mem: add option to print memory accesses

2024-07-06 Thread Pierrick Bouvier
By using "print-accesses=true" option, mem plugin will now print every value accessed, with associated size, type (store vs load), symbol, instruction address and phys/virt address accessed. Reviewed-by: Richard Henderson Reviewed-by: Xingtao Yao Signed-off-by: Pierrick Bouvier --- tests/plugi

[PATCH v6 3/7] plugins: extend API to get latest memory value accessed

2024-07-06 Thread Pierrick Bouvier
This value can be accessed only during a memory callback, using new qemu_plugin_mem_get_value function. Returned value can be extended when QEMU will support accesses wider than 128 bits. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1719 Resolves: https://gitlab.com/qemu-project/qemu/-

[PATCH v6 4/7] tests/tcg: add mechanism to run specific tests with plugins

2024-07-06 Thread Pierrick Bouvier
Only multiarch tests are run with plugins, and we want to be able to run per-arch test with plugins too. Tested-by: Xingtao Yao Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- tests/tcg/Makefile.target | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tes

[PATCH v6 5/7] tests/tcg: allow to check output of plugins

2024-07-06 Thread Pierrick Bouvier
A specific plugin test can now read and check a plugin output, to ensure it contains expected values. Tested-by: Xingtao Yao Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- tests/tcg/Makefile.target | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tests/tcg/Makefil

Re: [PATCH v5 0/7] plugins: access values during a memory read/write

2024-07-06 Thread Pierrick Bouvier
Posted v6. On 7/4/24 17:34, Pierrick Bouvier wrote: This series allows plugins to know which value is read/written during a memory access. For every memory access, we know copy this value before calling mem callbacks, and those can query it using new API function: - qemu_plugin_mem_get_value M

[PATCH v6 2/7] plugins: save value during memory accesses

2024-07-06 Thread Pierrick Bouvier
Different code paths handle memory accesses: - tcg generated code - load/store helpers - atomic helpers This value is saved in cpu->neg.plugin_mem_value_{high,low}. Values are written only for accessed word size (upper bits are not set). Atomic operations are doing read/write at the same time, so

[PATCH v6 0/7] plugins: access values during a memory read/write

2024-07-06 Thread Pierrick Bouvier
This series allows plugins to know which value is read/written during a memory access. For every memory access, we know copy this value before calling mem callbacks, and those can query it using new API function: - qemu_plugin_mem_get_value Mem plugin was extended to print accesses, and a new tes

Re: [PATCH v5 2/7] plugins: save value during memory accesses

2024-07-06 Thread Pierrick Bouvier
On 7/5/24 09:34, Richard Henderson wrote: On 7/4/24 17:34, Pierrick Bouvier wrote: +static void +plugin_gen_mem_callbacks_i32(TCGv_i32 val, + TCGv_i64 copy_addr, TCGTemp *orig_addr, + MemOpIdx oi, enum qemu_plugin_mem_rw rw) +{ +#ifdef CONF

RE: [PATCH v3 4/6] target/i386: add support for VMX FRED controls

2024-07-06 Thread Li, Xin3
On 7/6/2024 9:23 AM, Paolo Bonzini wrote: > > > Il sab 6 lug 2024, 17:57 Li, Xin3 > ha scritto: > > >> The bits in the secondary vmexit controls are not supported, and > in general the same > >> is true for the secondary vmexit case. I think it's better

Re: [PATCH v3 4/6] target/i386: add support for VMX FRED controls

2024-07-06 Thread Paolo Bonzini
Il sab 6 lug 2024, 17:57 Li, Xin3 ha scritto: > >> The bits in the secondary vmexit controls are not supported, and in > general the same > >> is true for the secondary vmexit case. I think it's better to not > include the vmx-entry- > >> load-fred bit either, and only do the vmxcap changes. > >

RE: [PATCH v3 4/6] target/i386: add support for VMX FRED controls

2024-07-06 Thread Li, Xin3
>> The bits in the secondary vmexit controls are not supported, and in general >> the same >> is true for the secondary vmexit case. I think it's better to not include >> the vmx-entry- >> load-fred bit either, and only do the vmxcap changes. > Right, we don't need it at all. Hi Paolo, We act

[PATCH RFC v4] virtio: Implement Virtio Backend for SD/MMC in QEMU

2024-07-06 Thread Mikhail Krasheninnikov
From: Mi Add a Virtio backend for SD/MMC devices. Confirmed interoperability with Linux. Linux patch link: https://lore.kernel.org/linux-mmc/20240701120642.30001-1-krashmi...@gmail.com/ Signed-off-by: Mikhail Krasheninnikov CC: Matwey Kornilov CC: qemu-bl...@nongnu.org CC: Michael S. Tsirkin

Re: [PATCH V13 1/8] accel/kvm: Extract common KVM vCPU {creation,parking} code

2024-07-06 Thread Salil Mehta
Hi Igor, Thanks for taking out time to review. On Sat, Jul 6, 2024 at 1:12 PM Igor Mammedov wrote: > On Fri, 7 Jun 2024 12:56:42 +0100 > Salil Mehta wrote: > > > KVM vCPU creation is done once during the vCPU realization when Qemu > vCPU thread > > is spawned. This is common to all the architec

[RFC PATCH v3] ptp: Add vDSO-style vmclock support

2024-07-06 Thread David Woodhouse
From: David Woodhouse The vmclock "device" provides a shared memory region with precision clock information. By using shared memory, it is safe across Live Migration. Like the KVM PTP clock, this can convert TSC-based cross timestamps into KVM clock values. Unlike the KVM PTP clock, it does so o

Re: [PATCH] i386/cpu: Drop the check of phys_bits in host_cpu_realizefn()

2024-07-06 Thread Igor Mammedov
On Thu, 4 Jul 2024 07:12:31 -0400 Xiaoyao Li wrote: > The check of cpu->phys_bits to be in range between > [32, TARGET_PHYS_ADDR_SPACE_BITS] in host_cpu_realizefn() > is duplicated with check in x86_cpu_realizefn(). > > Since the ckeck in x86_cpu_realizefn() is called later and can cover all >

Re: [PATCH 1/8] docs/qapidoc: factor out do_parse()

2024-07-06 Thread Markus Armbruster
John Snow writes: > Factor out the compatibility parser helper into a base class, so it can > be shared by other directives. > > Signed-off-by: John Snow R-by stands.

Re: [PATCH V13 8/8] docs/specs/acpi_hw_reduced_hotplug: Add the CPU Hotplug Event Bit

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:49 +0100 Salil Mehta wrote: > GED interface is used by many hotplug events like memory hotplug, NVDIMM > hotplug > and non-hotplug events like system power down event. Each of these can be > selected using a bit in the 32 bit GED IO interface. A bit has been reserved >

Re: [PATCH 5/8] qapi: convert "Example" sections without titles

2024-07-06 Thread Markus Armbruster
John Snow writes: > Use the no-option form of ".. qmp-example::" to convert any Examples > that do not have any form of caption or explanation whatsoever. Note > that in a few cases, example sections are split into two or more > separate example blocks. This is only done stylistically to create a

Re: [PATCH V13 7/8] gdbstub: Add helper function to unregister GDB register space

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:48 +0100 Salil Mehta wrote: > Add common function to help unregister the GDB register space. This shall be > done in context to the CPU unrealization. > > Note: These are common functions exported to arch specific code. For example, > for ARM this code is being referred

Re: [PATCH V13 6/8] physmem: Add helper function to destroy CPU AddressSpace

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:47 +0100 Salil Mehta wrote: > Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also > involves destruction of the CPU AddressSpace. Add common function to help > destroy the CPU AddressSpace. > > Signed-off-by: Salil Mehta > Tested-by: Vishnu Pajjuri

Re: [PATCH V13 5/8] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:46 +0100 Salil Mehta wrote: > CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is IO port > based and existing CPUs AML code assumes _CRS objects would evaluate to a > system > resource which describes IO Port address. But on ARM arch CPUs control > de

Re: [PATCH V13 4/8] hw/acpi: Update GED _EVT method AML with CPU scan

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:45 +0100 Salil Mehta wrote: > OSPM evaluates _EVT method to map the event. The CPU hotplug event eventually > results in start of the CPU scan. Scan figures out the CPU and the kind of > event(plug/unplug) and notifies it back to the guest. Update the GED AML _EVT > metho

Re: [PATCH V13 3/8] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:44 +0100 Salil Mehta wrote: > ACPI GED (as described in the ACPI 6.4 spec) uses an interrupt listed in the > _CRS object of GED to intimate OSPM about an event. Later then demultiplexes > the > notified event by evaluating ACPI _EVT method to know the type of event. Use

Re: [PATCH V13 2/8] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:43 +0100 Salil Mehta wrote: > CPU ctrl-dev MMIO region length could be used in ACPI GED and various other > architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more > appropriate common header file. > > Signed-off-by: Salil Mehta > Reviewed-by: Alex Ben

Re: [PATCH V13 1/8] accel/kvm: Extract common KVM vCPU {creation,parking} code

2024-07-06 Thread Igor Mammedov
On Fri, 7 Jun 2024 12:56:42 +0100 Salil Mehta wrote: > KVM vCPU creation is done once during the vCPU realization when Qemu vCPU > thread > is spawned. This is common to all the architectures as of now. > > Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the > correspond

Re: [PATCH v2 09/15] memory: Do not create circular reference with subregion

2024-07-06 Thread Akihiko Odaki
On 2024/07/03 2:44, Peter Xu wrote: On Thu, Jun 27, 2024 at 10:37:52PM +0900, Akihiko Odaki wrote: A memory region does not use their own reference counters, but instead piggybacks on another QOM object, "owner" (unless the owner is not the memory region itself). When creating a subregion, a new

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-06 Thread Peter Maydell
On Fri, 5 Jul 2024 at 06:13, David Gibson wrote: > > On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: > > On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: > > > On Fri, Jul 05, 2024 at 11:18:47AM +1000, Nicholas Piggin wrote: > > > > On Thu Jul 4, 2024 at 10:15 PM AEST, Pet

[PATCH 4/4] hw/qdev: Remove opts member

2024-07-06 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- include/hw/qdev-core.h | 4 hw/core/qdev.c | 1 - system/qdev-monitor.c | 12 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/i

[PATCH 3/4] hw/pci: Convert rom_bar into OnOffAuto

2024-07-06 Thread Akihiko Odaki
rom_bar is tristate but was defined as uint32_t so convert it into OnOffAuto to clarify that. For compatibility, a uint32 value set via QOM will be converted into OnOffAuto. Signed-off-by: Akihiko Odaki --- docs/igd-assign.txt | 2 +- include/hw/pci/pci_device.h | 2 +- hw/

[PATCH 2/4] qapi: Do not consume a value when visit_type_enum() fails

2024-07-06 Thread Akihiko Odaki
Consuming a value when visit_type_enum() fails makes it impossible to reinterpret the value with a different type. Signed-off-by: Akihiko Odaki --- include/qapi/visitor.h | 5 - qapi/opts-visitor.c| 5 - qapi/qapi-visit-core.c | 4 +++- 3 files changed, 3 insertions(+), 11 deletions(

[PATCH 1/4] qapi: Add visit_type_str_preserving()

2024-07-06 Thread Akihiko Odaki
visit_type_str_preserving() is mostly indentical with visit_type_str() but leaves the value intact. This is useful when the caller may interpret the value with a different type. Signed-off-by: Akihiko Odaki --- include/qapi/visitor-impl.h | 3 ++- include/qapi/visitor.h| 20 ++

[PATCH 0/4] hw/pci: Convert rom_bar into OnOffAuto

2024-07-06 Thread Akihiko Odaki
rom_bar is tristate but was defined as uint32_t so convert it into OnOffAuto to clarify that. For compatibility, a uint32 value set via QOM will be converted into OnOffAuto. Signed-off-by: Akihiko Odaki --- Akihiko Odaki (4): qapi: Add visit_type_str_preserving() qapi: Do not consume

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-06 Thread Akihiko Odaki
On 2024/07/05 16:50, Nicholas Piggin wrote: On Fri Jul 5, 2024 at 3:12 PM AEST, David Gibson wrote: On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: On Fri, Jul 05, 2024 at 11:18:47AM +1000, Nicholas Piggin wrote: On Thu

[PULL 06/13] docs/qapidoc: fix nested parsing under untagged sections

2024-07-06 Thread Markus Armbruster
From: John Snow Sphinx does not like sections without titles, because it wants to convert every section into a reference. When there is no title, it struggles to do this and transforms the tree inproperly. Depending on the rST used, this may result in an assertion error deep in the docutils HTML

[PULL 05/13] qapi/parser: fix comment parsing immediately following a doc block

2024-07-06 Thread Markus Armbruster
From: John Snow If a comment immediately follows a doc block, the parser doesn't ignore that token appropriately. Fix that. e.g. > ## > # = Hello World! > ## > > # I'm a comment! will break the parser, because it does not properly ignore the comment token if it immediately follows a doc block.

[PULL 10/13] qapi: update prose in note blocks

2024-07-06 Thread Markus Armbruster
From: John Snow Where I've noticed, rephrase the note to read more fluently. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-ID: <20240626222128.406106-12-js...@redhat.com> Signed-off-by: Markus Armbruster --- qapi/block-core.json | 4 ++-- qga/qapi-schema.json | 2 +- 2 file

[PULL 08/13] qapi: nail down convention that Errors sections are lists

2024-07-06 Thread Markus Armbruster
From: John Snow By unstated convention, Errors sections are rST lists. Document the convention, and make the one exception conform. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-ID: <20240626222128.406106-10-js...@redhat.com> Signed-off-by: Markus Armbruster --- docs/devel

[PULL 04/13] qapi/parser: preserve indentation in QAPIDoc sections

2024-07-06 Thread Markus Armbruster
From: John Snow Change get_doc_indented() to preserve indentation on all subsequent text lines, and create a compatibility dedent() function for qapidoc.py that removes indentation the same way get_doc_indented() did. This is being done for the benefit of a new qapidoc generator which requires t

[PULL 12/13] qapi/parser: don't parse rST markup as section headers

2024-07-06 Thread Markus Armbruster
From: John Snow The double-colon synax is rST formatting that precedes a literal code block. We do not want to capture these as QAPI-specific sections. Coerce blocks that start with e.g. "Example::" to be parsed as untagged paragraphs instead of special tagged sections. Signed-off-by: John Snow

[PULL 13/13] sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments

2024-07-06 Thread Markus Armbruster
When a command's arguments are specified as an explicit type T, generated documentation points to the members of T. Example: ## # @announce-self: # # Trigger generation of broadcast RARP frames to update network [...] ## { 'command': 'announce-self', 'boxed': true,

[PULL 07/13] qapi: fix non-compliant JSON examples

2024-07-06 Thread Markus Armbruster
From: John Snow The new QMP documentation generator wants to parse all examples as "QMP". We have an existing QMP lexer in docs/sphinx/qmp_lexer.py (Seen in-use here: https://qemu-project.gitlab.io/qemu/interop/bitmaps.html) that allows the use of "->", "<-" and "..." tokens to denote QMP protoco

[PULL 03/13] docs/qapidoc: delint a tiny portion of the module

2024-07-06 Thread Markus Armbruster
From: John Snow In a forthcoming series that adds a new QMP documentation generator, it will be helpful to have a linting baseline. However, there's no need to shuffle around the deck chairs too much, because most of this code will be removed once that new qapidoc generator (the "transmogrifier")

[PULL 11/13] qapi: add markup to note blocks

2024-07-06 Thread Markus Armbruster
From: John Snow Generally, surround command-line options with ``literal`` markup to help it stand out from prose in rendered HTML, and add cross-references to replace "see also" messages. References to types, values, and other QAPI definitions are not yet adjusted here; they will be converted en

[PULL 01/13] qapi: linter fixups

2024-07-06 Thread Markus Armbruster
From: John Snow Fix minor irritants to pylint/flake8 et al. (Yes, these need to be guarded by the Python tests. That's a work in progress, a series that's quite likely to follow once I finish this Sphinx project. Please pardon the temporary irritation.) Signed-off-by: John Snow Reviewed-by: Ma

[PULL 09/13] qapi: convert "Note" sections to plain rST

2024-07-06 Thread Markus Armbruster
From: John Snow We do not need a dedicated section for notes. By eliminating a specially parsed section, these notes can be treated as normal rST paragraphs in the new QMP reference manual, and can be placed and styled much more flexibly. Convert all existing "Note" and "Notes" sections to pure

[PULL 00/13] QAPI patches patches for 2024-07-06

2024-07-06 Thread Markus Armbruster
The following changes since commit f2cb4026fccfe073f84a4b440e41d3ed0c3134f6: Merge tag 'pull-maintainer-july24-050724-1' of https://gitlab.com/stsquad/qemu into staging (2024-07-05 09:15:48 -0700) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-qapi-2024

[PULL 02/13] docs/qapidoc: remove unused intersperse function

2024-07-06 Thread Markus Armbruster
From: John Snow This function has been unused since since commit fd62bff901b (sphinx/qapidoc: Drop code to generate doc for simple union tag). Signed-off-by: John Snow Message-ID: <20240626222128.406106-4-js...@redhat.com> Reviewed-by: Markus Armbruster [Commit message tweaked] Signed-off-by: