Re: [PATCH 0/6] s390x/cpu_models: Misc cleanup on returned error code and local @err variables

2024-04-18 Thread Philippe Mathieu-Daudé
On 19/4/24 08:57, Zhao Liu wrote: From: Zhao Liu --- Zhao Liu (6): target/s390x/cpu_model: Make check_compatibility() return boolean target/s390x/cpu_model: Drop local @err in s390_realize_cpu_model() target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-18 Thread Philippe Mathieu-Daudé
On 19/4/24 08:57, Zhao Liu wrote: From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_get_host_cpu_model() return boolean and check the returned boolean in get_max_cpu_model() instead of accessing @err. Addit

Re: [PATCH v7 0/5] ui/console: Private QemuDmaBuf struct

2024-04-18 Thread Philippe Mathieu-Daudé
On 19/4/24 00:05, dongwon@intel.com wrote: From: Dongwon Kim This series introduces privacy enhancements to the QemuDmaBuf struct and its contained data to bolster security. it accomplishes this by introducing of helper functions for allocating, deallocating, and accessing individual fields

Re: [PATCH v7 5/5] ui/dmabuf: New dmabuf.c and dmabuf.h for QemuDmaBuf struct and helpers

2024-04-18 Thread Philippe Mathieu-Daudé
On 19/4/24 00:05, dongwon@intel.com wrote: From: Dongwon Kim Create new header and source files to encapsulate QemuDmaBuf struct and its data for privatization. Suggested-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by: Dongwon

[PATCH 0/6] s390x/cpu_models: Misc cleanup on returned error code and local @err variables

2024-04-18 Thread Zhao Liu
From: Zhao Liu Hi list, This series is the followup of Thomas' suggestion in previous ERRP_GUARD() cleanup[1]. And based on Thomas' thoughts, I tried to clean up as many of the other related places (in s390x/cpu_models.c). [1]: https://lore.kernel.org/qemu-devel/6e7eff95-cfd3-46f9-9937-7597b2e

[PATCH 6/6] target/s390x/cpu_models_sysemu: Drop local @err in apply_cpu_model()

2024-04-18 Thread Zhao Liu
From: Zhao Liu Use @errp to fetech error information directly and drop the local virable @err. Signed-off-by: Zhao Liu --- target/s390x/cpu_models_sysemu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c

[PATCH 2/6] target/s390x/cpu_model: Drop local @err in s390_realize_cpu_model()

2024-04-18 Thread Zhao Liu
From: Zhao Liu Use @errp to fetech error information directly and drop the local virable @err. Suggested-by: Thomas Huth Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_mo

[PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model()

2024-04-18 Thread Zhao Liu
From: Zhao Liu Use @errp to fetech error information directly and drop the local virable @err. Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index a0e4acb707d7..

[PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_get_host_cpu_model() return boolean and check the returned boolean in get_max_cpu_model() instead of accessing @err. Additionally, since now get_max_cpu_model

[PATCH 1/6] target/s390x/cpu_model: Make check_compatibility() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to check @err. Suggested-by: Thomas Huth Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c | 14 +++--- 1 file changed, 7

[PATCH 5/6] target/s390x/cpu_models: Make kvm_s390_apply_cpu_model() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_apply_cpu_model() return boolean and check the returned boolean in apply_cpu_model() instead of accessing @err. Signed-off-by: Zhao Liu --- target/s390x/cpu

Re: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-18 Thread Cédric Le Goater
Hello Zhenzhong, On 4/18/24 10:42, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap Hello Zhenzhong On 4/17/24 11:24, Duan, Zhenzhong wrote: ---

RE: [PATCH v3 08/16] aspeed/smc: support 64 bits dma dram address

2024-04-18 Thread Jamin Lin
Hi Cedric, > > Hello Jamin, > > On 4/16/24 11:18, Jamin Lin wrote: > > AST2700 support the maximum dram size is 8GiB and has a "DMA DRAM > Side > > Address High Part(0x7C)" > > register to support 64 bits dma dram address. > > Add helper routines functions to compute the dma dram address, new > >

Re: [PATCH 4/5] docs/system/target-sparc: Improve the Sparc documentation

2024-04-18 Thread Mark Cave-Ayland
On 19/04/2024 05:59, Thomas Huth wrote: On 18/04/2024 22.27, Mark Cave-Ayland wrote: On 07/03/2024 17:43, Thomas Huth wrote: Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed lon

Re: Deprecation/removal of nios2 target support

2024-04-18 Thread Marek Vasut
On 4/18/24 8:41 PM, Arnd Bergmann wrote: On Thu, Apr 18, 2024, at 17:44, Joseph Myers wrote: On Wed, 17 Apr 2024, Sandra Loosemore wrote: Therefore I'd like to mark Nios II as obsolete in GCC 14 now, and remove support from all toolchain components after the release is made. I'm not sure ther

Re: [PATCH 4/5] docs/system/target-sparc: Improve the Sparc documentation

2024-04-18 Thread Thomas Huth
On 18/04/2024 22.27, Mark Cave-Ayland wrote: On 07/03/2024 17:43, Thomas Huth wrote: Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed long ago already). Signed-off-by: Thomas Hut

[PATCH 21/27] docs/qapi-domain: RFC patch - add malformed field list entries

2024-04-18 Thread John Snow
This patch demonstrates what happens when you mess up a field list entry. The next patch adds a safeguard against this. Signed-off-by: John Snow --- docs/qapi/index.rst | 4 1 file changed, 4 insertions(+) diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst index c68e2044890..5bb1c37a5e

[PATCH 11/27] docs/qapi-domain: add "Errors:" field lists

2024-04-18 Thread John Snow
``:error type: descr`` can now be used to document error conditions, naming the type of error object and a description of when the error is surfaced. Like the previous Arguments patch, this patch does not apply any special QAPI syntax highlighting or cross-referencing for the types, but this can b

[PATCH 20/27] docs/qapi-domain: add :ifcond: directive option

2024-04-18 Thread John Snow
Add a special :ifcond: option that allows us to annotate the definition-level conditionals. RFC: This patch renders IFCOND information in two places, because I'm undecided about how to style this information. One option is in the signature bar, and another option is in an eye-catch, like :deprecat

[PATCH 13/27] docs/qapi-domain: add qapi:enum directive

2024-04-18 Thread John Snow
Add the .. qapi:enum:: directive, object, and :qapi:enum:`name` cross-reference role. Add the :value name: field list for documenting Enum values. Of note, also introduce a new "type" role that is intended to be used by other QAPI object directives to cross-reference arbitrary QAPI type names, bu

[PATCH 14/27] docs/qapi-domain: add qapi:alternate directive

2024-04-18 Thread John Snow
Add the .. qapi:alternate:: directive, object, and qapi:alt:`name` cross-reference role. Add the "Choices:" field list for describing alternate choices. Like other field lists that reference QAPI types, a forthcoming commit will add cross-referencing support to this field. RFC: In the future, it

[PATCH 08/27] docs/qapi-domain: add :since: directive option

2024-04-18 Thread John Snow
Add a little special markup for registering "Since:" information. Adding it as an option instead of generic content lets us hoist the information into the Signature bar, optionally put it in the index, etc. Signed-off-by: John Snow --- docs/qapi/index.rst| 1 + docs/sphinx/qapi-domain.p

[PATCH 24/27] docs/qapi-domain: add type cross-refs to field lists

2024-04-18 Thread John Snow
This commit, finally, adds cross-referencing support to various field lists; modeled tightly after Sphinx's own Python domain code. Cross-referencing support is added to type names provided to :arg:, :memb:, :returns: and :choice:. :feat:, :error: and :value:, which do not take type names, do not

[PATCH 04/27] docs/qapi-domain: add QAPI index

2024-04-18 Thread John Snow
Use the QAPI object registry to generate a special index just for QAPI definitions. The index can show entries both by definition type and alphabetically. The index can be linked from anywhere in the QEMU manual by using `qapi-index`. Signed-off-by: John Snow --- docs/qapi/index.rst| 6

[PATCH 02/27] docs/qapi-domain: add qapi:module directive

2024-04-18 Thread John Snow
This adds a qapi:module directive, which just notes the current module being documented and performs a nested parse of the content block, if present. This code is based pretty heavily on Sphinx's PyModule directive, but with the modindex functionality excised. This commit also adds the _nested_pa

[PATCH 25/27] docs/qapi-domain: implement error context reporting fix

2024-04-18 Thread John Snow
Sphinx 5.3.0 to Sphinx 6.2.0 has a bug where nested content in an ObjectDescription content block has its error position reported incorrectly due to an oversight when they added nested section support to this directive. (This bug is present in Sphinx's own Python and C domains; test it yourself by

[PATCH 17/27] docs/qapi-domain: add qapi:union and qapi:branch directives

2024-04-18 Thread John Snow
Adds the .. qapi:union:: directive, object, and :qapi:union:`name` cross-referencing role. In order to support discriminated branches of unions, a new qapi:branch directive is created whose only purpose is to create a dynamically named field list section based on the name of the branch key and val

[PATCH 18/27] docs/qapi-domain: add :deprecated: directive option

2024-04-18 Thread John Snow
Although "deprecated" is a feature (and *will* appear in the features list), add a special :deprecated: option to generate an eye-catch that makes this information very hard to miss. (The intent is to modify qapidoc.py to add this option whenever it detects that the features list attached to a def

[PATCH 07/27] docs/qapi-domain: add qapi:command directive

2024-04-18 Thread John Snow
This commit adds a generic QAPIObject class for use in documenting various QAPI entities in the Sphinx ecosystem. It also adds a stubbed version of QAPICommand that utilizes the QAPIObject class; along with the qapi:command directive, the :qapi:cmd: cross-reference role, and the "command" object t

[PATCH 16/27] docs/qapi-domain: add qapi:struct directive

2024-04-18 Thread John Snow
Adds the .. qapi:struct:: directive, object, and :qapi:struct:`name` cross-referencing role. As per usual, QAPI cross-referencing for types in the member field list will be added in a forthcoming commit. RFC Note: The "?" syntax sneaks into the example document again. Please ignore that for now.

[PATCH 15/27] docs/qapi-domain: add qapi:event directive

2024-04-18 Thread John Snow
Adds the .. qapi:event:: directive, object, and :qapi:event:`name` cross-referencing role. Adds the :memb type name: field list syntax for documenting event data members. As this syntax and phrasing will be shared with Structs and Unions as well, add the field list definition to a shared abstract

[PATCH 19/27] docs/qapi-domain: add :unstable: directive option

2024-04-18 Thread John Snow
Although "unstable" is a feature (and *will* appear in the features list), add a special :unstable: option to generate an eye-catch that makes this information very hard to miss. (The intent is to modify qapidoc.py to add this option whenever it detects that the features list attached to a definit

[PATCH 10/27] docs/qapi-domain: add "Features:" field lists

2024-04-18 Thread John Snow
Add support for Features field lists. There is no QAPI-specific functionality here, but this could be changed if desired (if we wanted the feature names to link somewhere, for instance.) This feature list doesn't have any restrictions, so it can be used to document object-wide features or per-memb

[PATCH 06/27] docs/qapi-domain: add QAPI xref roles

2024-04-18 Thread John Snow
Add domain-specific cross-reference syntax. As of this commit, that means new :qapi:mod:`block-core` and :qapi:obj:`block-core` referencing syntax. :mod: will only find modules, but :obj: will find anything registered to the QAPI domain. (In forthcoming commits, this means commands, events, enums,

[PATCH 27/27] docs/qapi-domain: add CSS styling

2024-04-18 Thread John Snow
From: Harmonie Snow Improve the general look and feel of generated QAPI docs. Attempt to limit line lengths to offer a more comfortable measure on maximized windows, and improve some margin and spacing for field lists. Signed-off-by: Harmonie Snow Signed-off-by: John Snow --- docs/sphinx-sta

[PATCH 23/27] docs/qapi-domain: RFC patch - delete malformed field lists

2024-04-18 Thread John Snow
Cleanup of the last patch to fix the build before closing out this RFC series. Signed-off-by: John Snow --- docs/qapi/index.rst | 4 1 file changed, 4 deletions(-) diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst index ef58dfc4bcd..8352a27d4a5 100644 --- a/docs/qapi/index.rst +++ b/d

[PATCH 01/27] docs/sphinx: create QAPI domain extension stub

2024-04-18 Thread John Snow
It doesn't really do anything yet, we'll get to it brick-by-brick in the forthcoming commits to keep the series breezy and the git history informative. Signed-off-by: John Snow --- docs/conf.py | 3 ++- docs/sphinx/qapi-domain.py | 50 ++ 2 file

[PATCH 22/27] docs/qapi-domain: add warnings for malformed field lists

2024-04-18 Thread John Snow
Normally, Sphinx will silently fall back to its standard field list processing if it doesn't match one of your defined fields. A lot of the time, that's not what we want - we want to be warned if we goof something up. For instance, the canonical argument field list form is: :arg type name: descr

[PATCH 09/27] docs/qapi-domain: add "Arguments:" field lists

2024-04-18 Thread John Snow
This adds special rendering for Sphinx's typed field lists. This patch does not add any QAPI-aware markup, rendering, or cross-referencing for the type names, yet. That feature requires a subclass to TypedField which will happen in its own commit quite a bit later in this series; after all the bas

[PATCH 26/27] docs/qapi-domain: RFC patch - Add one last sample command

2024-04-18 Thread John Snow
Just to have a bit more to look at in the generated doc, here's a fairly complex command with a lot of bells and whistles. Signed-off-by: John Snow --- docs/qapi/index.rst | 67 + 1 file changed, 67 insertions(+) diff --git a/docs/qapi/index.rst b/doc

[PATCH 03/27] docs/qapi-module: add QAPI domain object registry

2024-04-18 Thread John Snow
This is the first step towards QAPI domain cross-references and a QAPI reference index. For now, just create the object registry and amend the qapi:module directive to use that registry. Update the merge_domaindata method now that we have actual data we may need to merge. RFC: Much of this code i

[PATCH 00/27] Add qapi-domain Sphinx extension

2024-04-18 Thread John Snow
This series adds a new qapi-domain extension for Sphinx, which adds a series of custom directives for documenting QAPI definitions. GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/1259566476 (Link to a demo HTML page at the end of this cover letter, but I want you to read the cover letter fi

[PATCH 05/27] docs/qapi-domain: add resolve_any_xref()

2024-04-18 Thread John Snow
Add the ability to resolve cross-references using the `any` cross-reference syntax. Adding QAPI-specific cross-reference roles will be added in a forthcoming commit, and will share the same find_obj() helper. (There's less code needed for the generic cross-reference resolver, so it comes first in

[PATCH 12/27] docs/qapi-domain: add "Returns:" field lists

2024-04-18 Thread John Snow
Add "Returns:" field list syntax to QAPI Commands. Like "Arguments:" and "Errors:", the type name isn't currently processed for cross-referencing, but this will be addressed in a forthcoming commit. This patch adds "errors" as a GroupedField, which means that multiple return values can be annotat

Re: [PATCH 22/24] exec: Remove 'exec/tswap.h' from 'exec/cpu-all.h'

2024-04-18 Thread Harsh Prateek Bora
On 4/19/24 00:55, Philippe Mathieu-Daudé wrote: "exec/cpu-all.h" doesn't require "exec/tswap.h". Remove it, including it in the sources when required. Signed-off-by: Philippe Mathieu-Daudé --- hw/xtensa/bootparam.h | 1 + include/exec/cpu-all.h | 1 - accel/tcg/translator.c

[RFC QEMU PATCH v6 0/1] Support device passthrough when dom0 is PVH on Xen

2024-04-18 Thread Jiqian Chen
Hi All, This is v6 series to support passthrough on Xen when dom0 is PVH. v5->v6 changes: * Due to changes in the implementation of obtaining gsi in the kernel and Xen. Change to use xc_physdev_gsi_from_irq, instead of gsi sysfs. Best regards, Jiqian Chen v4->v5 changes: * Add review by Stefano

[RFC QEMU PATCH v6 1/1] xen/pci: get gsi from irq for passthrough devices

2024-04-18 Thread Jiqian Chen
In PVH dom0, it uses the linux local interrupt mechanism, when it allocs irq for a gsi, it is dynamic, and follow the principle of applying first, distributing first. And the irq number is alloced from small to large, but the applying gsi number is not, may gsi 38 comes before gsi 28, that causes t

回复:[PATCH] tcg: Fix the overflow in indexing tcg_ctx->temps

2024-04-18 Thread 姜智伟
> On 4/18/24 03:27, Zhiwei Jiang wrote: > > Sometimes, when the address of the passed TCGTemp *ts variable is the same > > as tcg_ctx, > > Pardon?  When would TCGTemp *ts == TCGContext *tcg_ctx? > > > > the index calculated in the temp_idx function, i.e., ts - tcg_ctx->temps, > > can result in

[PATCH v7 04/12] hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices

2024-04-18 Thread nifan . cxl
From: Fan Ni With the change, when setting up memory for type3 memory device, we can create DC regions. A property 'num-dc-regions' is added to ct3_props to allow users to pass the number of DC regions to create. To make it easier, other region parameters like region base, length, and block size

[PATCH v7 10/12] hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions

2024-04-18 Thread nifan . cxl
From: Fan Ni All DPA ranges in the DC regions are invalid to access until an extent covering the range has been successfully accepted by the host. A bitmap is added to each region to record whether a DC block in the region has been backed by a DC extent. Each bit in the bitmap represents a DC blo

[PATCH v7 05/12] hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument

2024-04-18 Thread nifan . cxl
From: Fan Ni The function ct3_build_cdat_entries_for_mr only uses size of the passed memory region argument, refactor the function definition to make the passed arguments more specific. Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni --- hw/mem/cxl_type3.c | 15 +-- 1 file cha

[PATCH v7 11/12] hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support

2024-04-18 Thread nifan . cxl
From: Fan Ni With the change, we extend the extent release mailbox command processing to allow more flexible release. As long as the DPA range of the extent to release is covered by accepted extent(s) in the device, the release can be performed. Signed-off-by: Fan Ni --- hw/cxl/cxl-mailbox-uti

[PATCH v7 12/12] hw/mem/cxl_type3: Allow to release extent superset in QMP interface

2024-04-18 Thread nifan . cxl
From: Fan Ni Before the change, the QMP interface used for add/release DC extents only allows to release an extent whose DPA range is contained by a single accepted extent in the device. With the change, we relax the constraints. As long as the DPA range of the extent is covered by accepted ext

[PATCH v7 07/12] hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support

2024-04-18 Thread nifan . cxl
From: Fan Ni Add dynamic capacity extent list representative to the definition of CXLType3Dev and implement get DC extent list mailbox command per CXL.spec.3.1:.8.2.9.9.9.2. Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 73 ++

[PATCH v7 08/12] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response

2024-04-18 Thread nifan . cxl
From: Fan Ni Per CXL spec 3.1, two mailbox commands are implemented: Add Dynamic Capacity Response (Opcode 4802h) 8.2.9.9.9.3, and Release Dynamic Capacity (Opcode 4803h) 8.2.9.9.9.4. For the process of the above two commands, we use two-pass approach. Pass 1: Check whether the input payload is

[PATCH v7 03/12] include/hw/cxl/cxl_device: Rename mem_size as static_mem_size for type3 memory devices

2024-04-18 Thread nifan . cxl
From: Fan Ni Rename mem_size as static_mem_size for type3 memdev to cover static RAM and pmem capacity, preparing for the introduction of dynamic capacity to support dynamic capacity devices. Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 4 ++-- hw/mem/

[PATCH v7 06/12] hw/mem/cxl_type3: Add host backend and address space handling for DC regions

2024-04-18 Thread nifan . cxl
From: Fan Ni Add (file/memory backed) host backend for DCD. All the dynamic capacity regions will share a single, large enough host backend. Set up address space for DC regions to support read/write operations to dynamic capacity for DCD. With the change, the following support is added: 1. Add a

[PATCH v7 09/12] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-04-18 Thread nifan . cxl
From: Fan Ni To simulate FM functionalities for initiating Dynamic Capacity Add (Opcode 5604h) and Dynamic Capacity Release (Opcode 5605h) as in CXL spec r3.1 7.6.7.6.5 and 7.6.7.6.6, we implemented two QMP interfaces to issue add/release dynamic capacity extents requests. With the change, we al

[PATCH v7 02/12] hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative and mailbox command support

2024-04-18 Thread nifan . cxl
From: Fan Ni Per cxl spec r3.1, add dynamic capacity region representative based on Table 8-165 and extend the cxl type3 device definition to include DC region information. Also, based on info in 8.2.9.9.9.1, add 'Get Dynamic Capacity Configuration' mailbox support. Note: we store region decode

[PATCH v7 01/12] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command

2024-04-18 Thread nifan . cxl
From: Fan Ni Based on CXL spec r3.1 Table 8-127 (Identify Memory Device Output Payload), dynamic capacity event log size should be part of output of the Identify command. Add dc_event_log_size to the output payload for the host to get the info. Reviewed-by: Jonathan Cameron Signed-off-by: Fan N

[PATCH v7 00/12] Enabling DCD emulation support in Qemu

2024-04-18 Thread nifan . cxl
A git tree of this series can be found here (with one extra commit on top for printing out accepted/pending extent list): https://github.com/moking/qemu/tree/dcd-v7 v6->v7: 1. Fixed the dvsec range register issue mentioned in the the cover letter in v6. Only relevant bits are set to mark the

Re: [PATCH 1/2] libvhost-user: Fix pointer arithmetic in indirect read

2024-04-18 Thread Raphael Norwitz
The change looks right to me. As is, it looks like the code is skipping over descriptors when the intent should be to bounce data into a single descriptor. I agree the variable rename should go in as a separate change. On Thu, Apr 18, 2024 at 6:56 AM Daniel P. Berrangé wrote: > > On Sat, Jan 13,

[PATCH v7 4/5] ui/console: Introduce qemu_dmabuf_new() and free() helpers

2024-04-18 Thread dongwon . kim
From: Dongwon Kim This commit introduces utility functions for the creation and deallocation of QemuDmaBuf instances. Additionally, it updates all relevant sections of the codebase to utilize these new utility functions. v7: remove prefix, "dpy_gl_" from all helpers qemu_dmabuf_free() return

[PATCH v7 5/5] ui/dmabuf: New dmabuf.c and dmabuf.h for QemuDmaBuf struct and helpers

2024-04-18 Thread dongwon . kim
From: Dongwon Kim Create new header and source files to encapsulate QemuDmaBuf struct and its data for privatization. Suggested-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- include/ui/console.h | 52 +-

[PATCH v7 2/5] ui/console: Introduce qemu_dmabuf_get_..() helpers

2024-04-18 Thread dongwon . kim
From: Dongwon Kim This commit introduces qemu_dmabuf_get_... helpers to extract specific fields from the QemuDmaBuf struct. It also updates all instances where fields within the QemuDmaBuf struct are directly accessed, replacing them with calls to these new helper functions. v6: fix typos in hel

[PATCH v7 3/5] ui/console: Introduce qemu_dmabuf_set_..() helpers

2024-04-18 Thread dongwon . kim
From: Dongwon Kim To enhance security in accessing the QemuDmaBuf struct, new helper functions for setting specific fields within the struct were introduced. And all occurrences where these fields were previously set directly have been updated to utilize these helper functions. v7: removed prefi

[PATCH v7 0/5] ui/console: Private QemuDmaBuf struct

2024-04-18 Thread dongwon . kim
From: Dongwon Kim This series introduces privacy enhancements to the QemuDmaBuf struct and its contained data to bolster security. it accomplishes this by introducing of helper functions for allocating, deallocating, and accessing individual fields within the struct and replacing all direct refer

[PATCH v7 1/5] ui/gtk: Check if fence_fd is equal to or greater than 0

2024-04-18 Thread dongwon . kim
From: Dongwon Kim 'fence_fd' needs to be validated always before being referenced And the passing condition should include '== 0' as 0 is a valid value for the file descriptor. Suggested-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by

[PATCH] hw/sparc64: set iommu_platform=on for virtio devices attached to the sun4u machine

2024-04-18 Thread Mark Cave-Ayland
The sun4u machine has an IOMMU and therefore it is possible to program it such that the virtio-device IOVA does not map directly to the CPU physical address. This is not a problem with Linux which always maps the IOVA directly to the CPU physical address, however it is required for the NetBSD virt

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-18 Thread Si-Wei Liu
On 4/10/2024 3:03 AM, Eugenio Pérez wrote: IOVA tree is also used to track the mappings of virtio-net shadow virtqueue. This mappings may not match with the GPA->HVA ones. This causes a problem when overlapped regions (different GPA but same translated HVA) exists in the tree, as looking the

Re: [PATCH] hw/core/clock: always iterate through childs in clock_propagate_period

2024-04-18 Thread Raphael Poggi
Hi Philippe, Le jeu. 18 avr. 2024 à 20:43, Philippe Mathieu-Daudé a écrit : > > Hi Raphael, > > On 18/4/24 21:16, Raphael Poggi wrote: > > When dealing with few clocks depending with each others, sometimes > > we might only want to update the multiplier/diviser on a specific clock > > (cf clockB

Re: [PATCH 0/5] Sparc CPU naming and help text improvements

2024-04-18 Thread Mark Cave-Ayland
On 18/04/2024 21:08, Mark Cave-Ayland wrote: On 15/04/2024 08:26, Thomas Huth wrote: On 07/03/2024 18.43, Thomas Huth wrote: The Sparc CPU naming and the corresponding help text is somewhat confusing for the users. We should avoid spaces in the Names and provide clear information to the users

Re: [PATCH 5/5] docs/about: Deprecate the old "UltraSparc" CPU names that contain a "+"

2024-04-18 Thread Mark Cave-Ayland
On 07/03/2024 17:43, Thomas Huth wrote: For consistency we should drop the names with a "+" in it in the long run. Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst inde

Re: [PATCH 4/5] docs/system/target-sparc: Improve the Sparc documentation

2024-04-18 Thread Mark Cave-Ayland
On 07/03/2024 17:43, Thomas Huth wrote: Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed long ago already). Signed-off-by: Thomas Huth --- docs/system/target-sparc.rst | 8

Re: [PATCH 0/5] Sparc CPU naming and help text improvements

2024-04-18 Thread Mark Cave-Ayland
On 15/04/2024 08:26, Thomas Huth wrote: On 07/03/2024 18.43, Thomas Huth wrote: The Sparc CPU naming and the corresponding help text is somewhat confusing for the users. We should avoid spaces in the Names and provide clear information to the users what can be passed to the "-cpu" option. While

[Stable-7.2.11 45/59] hw/display/virtio-gpu: Protect from DMA re-entrancy bugs

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Replace qemu_bh_new_guarded() by virtio_bh_new_guarded() so the bus and device use the same guard. Otherwise the DMA-reentrancy protection can be bypassed: $ cat << EOF | qemu-system-i386 -display none -nodefaults \ -machine q35,ac

[Stable-7.2.11 50/59] hw/block/nand: Have blk_load() take unsigned offset and return boolean

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Negative offset is meaningless, use unsigned type. Return a boolean value indicating success. Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409135944.24997-3-phi...@linaro.org> (cherry picked from co

[RFC] linux-newbie thread on dev setup using Qemu

2024-04-18 Thread Josh Marshall
Hello all, I started a thread a thread at https://lore.kernel.org/linux-newbie/CAFkJGRcg+ThJ-xUve0=WorChW=-6prelhxem8ywtwzwpkht...@mail.gmail.com/T/#m563ab52dd2bfe7ac8d85f838f866a1a9d1a6d0a9 . It is using Qemu, but both Linux and Qemu and rather complex pieces of software. I was wondering if som

[Stable-7.2.11 56/59] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Per "SD Host Controller Standard Specification Version 3.00": * 2.2.5 Transfer Mode Register (Offset 00Ch) Writes to this register shall be ignored when the Command Inhibit (DAT) in the Present State register is 1. Do not update the TRNMOD register when C

[Stable-7.2.11 52/59] hw/misc/applesmc: Fix memory leak in reset() handler

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé AppleSMCData is allocated with g_new0() in applesmc_add_key(): release it with g_free(). Leaked since commit 1ddda5cd36 ("AppleSMC device emulation"). Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2272 Reported-by: Zheyu Ma Sign

[Stable-7.2.11 49/59] hw/block/nand: Factor nand_load_iolen() method out

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409135944.24997-2-phi...@linaro.org> (cherry picked from commit 7a86544f286d8af4fa5251101c1026ddae92cc3d) Signed-off-by: Michael Tokarev diff --git a/hw

[Stable-7.2.11 54/59] hw/net/lan9118: Fix overflow in MIL TX FIFO

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé When the MAC Interface Layer (MIL) transmit FIFO is full, truncate the packet, and raise the Transmitter Error (TXE) flag. Broken since model introduction in commit 2a42499017 ("LAN9118 emulation"). When using the reproducer from https://gitlab.com/qemu-project/qemu

Re: [PATCH 1/5] target/sparc/cpu: Rename the CPU models with a "+" in their names

2024-04-18 Thread Mark Cave-Ayland
On 07/03/2024 17:43, Thomas Huth wrote: Commit b447378e12 ("qom/object: Limit type names to alphanumerical ...") cut down the amount of allowed characters for QOM types to a saner set. The "+" character was not meant to be included in this set, so we had to add a hack there to still allow the le

Re: [PATCH 2/5] target/sparc/cpu: Avoid spaces by default in the CPU names

2024-04-18 Thread Mark Cave-Ayland
On 07/03/2024 17:43, Thomas Huth wrote: The output of "-cpu help" is currently rather confusing to the users: It is not clear which part of the output defines the CPU names since the CPU names contain white spaces (which we later have to convert into dashes internally) For example: Sparc TI Ult

[Stable-7.2.11 57/59] target/sh4: add missing CHECK_NOT_DELAY_SLOT

2024-04-18 Thread Michael Tokarev
From: Zack Buhman CHECK_NOT_DELAY_SLOT is correctly applied to the branch-related instructions, but not to the PC-relative mov* instructions. I verified the existence of an illegal slot exception on a SH7091 when any of these instructions are attempted inside a delay slot. This also matches the

[Stable-7.2.11 48/59] qemu-options: Fix CXL Fixed Memory Window interleave-granularity typo

2024-04-18 Thread Michael Tokarev
From: Yuquan Wang Fix the unit typo of interleave-granularity of CXL Fixed Memory Window in qemu-option.hx. Fixes: 03b39fcf64 ("hw/cxl: Make the CFMW a machine parameter.") Signed-off-by: Yuquan Wang wangyuquan1...@phytium.com.cn Message-ID: <20240407083539.1488172-2-wangyuquan1...@phytium.com.c

[Stable-7.2.11 53/59] backends/cryptodev: Do not abort for invalid session ID

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Instead of aborting when a session ID is invalid, return VIRTIO_CRYPTO_INVSESS ("Invalid session id"). Reproduced using: $ cat << EOF | qemu-system-i386 -display none \ -machine q35,accel=qtest -m 512M -nodefaults \ -object cryptodev-backend-builtin,id=c

[Stable-7.2.11 51/59] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé nand_command() and nand_getio() don't check @offset points into the block, nor the available data length (s->iolen) is not negative. In order to fix: - check the offset is in range in nand_blk_load_NAND_PAGE_SIZE(), - do not set @iolen if blk_load() failed. Reprodu

[Stable-7.2.11 58/59] ppc/spapr: Introduce SPAPR_IRQ_NR_IPIS to refer IRQ range for CPU IPIs.

2024-04-18 Thread Michael Tokarev
From: Harsh Prateek Bora spapr_irq_init currently uses existing macro SPAPR_XIRQ_BASE to refer to the range of CPU IPIs during initialization of nr-irqs property. It is more appropriate to have its own define which can be further reused as appropriate for correct interpretation. Suggested-by: Ce

[Stable-7.2.11 42/59] tcg/optimize: Do not attempt to constant fold neg_vec

2024-04-18 Thread Michael Tokarev
From: Richard Henderson Split out the tail of fold_neg to fold_neg_no_const so that we can avoid attempting to constant fold vector negate. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2150 Signed-off-by: Richard Henderson (cherry picked from commit e25fe886b89a396bae5847520b70c14858

[Stable-7.2.11 44/59] hw/virtio: Introduce virtio_bh_new_guarded() helper

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Introduce virtio_bh_new_guarded(), similar to qemu_bh_new_guarded() but using the transport memory guard, instead of the device one (there can only be one virtio device per virtio bus). Inspired-by: Gerd Hoffmann Reviewed-by: Gerd Hoffmann Acked-by: Michael S. Tsir

[Stable-7.2.11 55/59] hw/net/lan9118: Replace magic '2048' value by MIL_TXFIFO_SIZE definition

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé The magic 2048 is explained in the LAN9211 datasheet (DS2414A) in chapter 1.4, "10/100 Ethernet MAC": The MAC Interface Layer (MIL), within the MAC, contains a 2K Byte transmit and a 128 Byte receive FIFO which is separate from the TX and RX FIFOs. [...] N

Re: [PATCH RFC 00/26] Multifd 🔀 device state transfer support with VFIO consumer

2024-04-18 Thread Peter Xu
On Thu, Apr 18, 2024 at 08:14:15PM +0200, Maciej S. Szmigiero wrote: > On 18.04.2024 12:39, Daniel P. Berrangé wrote: > > On Thu, Apr 18, 2024 at 11:50:12AM +0200, Maciej S. Szmigiero wrote: > > > On 17.04.2024 18:35, Daniel P. Berrangé wrote: > > > > On Wed, Apr 17, 2024 at 02:11:37PM +0200, Macie

[Stable-7.2.11 59/59] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS.

2024-04-18 Thread Michael Tokarev
From: Harsh Prateek Bora Initialize the machine specific max_cpus limit as per the maximum range of CPU IPIs available. Keeping between 4096 to 8192 will throw IRQ not free error due to XIVE/XICS limitation and keeping beyond 8192 will hit assert in tcg_region_init or spapr_xive_claim_irq. Logs:

[Stable-7.2.11 46/59] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Replace qemu_bh_new_guarded() by virtio_bh_new_guarded() so the bus and device use the same guard. Otherwise the DMA-reentrancy protection can be bypassed. Fixes: CVE-2024-3446 Cc: qemu-sta...@nongnu.org Suggested-by: Alexander Bulekov Reviewed-by: Gerd Hoffmann Ac

[Stable-7.2.11 43/59] linux-user: Fix waitid return of siginfo_t and rusage

2024-04-18 Thread Michael Tokarev
From: Richard Henderson The copy back to siginfo_t should be conditional only on arg3, not the specific values that might have been written. The copy back to rusage was missing entirely. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2262 Signed-off-by: Richard Henderson Tested-by: Ale

[Stable-7.2.11 47/59] hw/virtio/virtio-crypto: Protect from DMA re-entrancy bugs

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Replace qemu_bh_new_guarded() by virtio_bh_new_guarded() so the bus and device use the same guard. Otherwise the DMA-reentrancy protection can be bypassed. Fixes: CVE-2024-3446 Cc: qemu-sta...@nongnu.org Suggested-by: Alexander Bulekov Reviewed-by: Gerd Hoffmann Ac

[Stable-7.2.11 v2 00/59] Patch Round-up for stable 7.2.11, freeze on 2024-04-20

2024-04-18 Thread Michael Tokarev
The following patches are queued for QEMU stable v7.2.11: https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2 Patch freeze is 2024-04-20, and the release is planned for 2024-04-22: https://wiki.qemu.org/Planning/7.2 Please respond here or CC qemu-sta...@nongnu.org on any additional p

Re: [PATCH] hw/core/clock: always iterate through childs in clock_propagate_period

2024-04-18 Thread Philippe Mathieu-Daudé
Hi Raphael, On 18/4/24 21:16, Raphael Poggi wrote: When dealing with few clocks depending with each others, sometimes we might only want to update the multiplier/diviser on a specific clock (cf clockB in drawing below) and call "clock_propagate(clockA)" to update the childs period according to t

Re: [PATCH 00/24] include/exec: Rework (part 2)

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 21:24, Philippe Mathieu-Daudé wrote: Reordering exec/, second round. Mostly splitting: - TCG LDST API (to "exec/cpu_ldst.h") - CPU TLB APIs (to "exec/cputlb.h") from "exec/cpu-all.h" and "exec/exec-all.h", and reducing inclusions of "hw/core/cpu.h". Based-on: <20240417182806.69446-1-p

  1   2   3   >