[PATCH v6 5/8] softmmu: Replace check for RAMBlock offset 0 with xen_mr_is_memory

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" For xen, when checking for the first RAM (xen_memory), use xen_mr_is_memory() rather than checking for a RAMBlock with offset 0. All Xen machines create xen_memory first so this has no functional change for existing machines. Signed-off-by: Edgar E. Iglesias

[PATCH v6 7/8] xen: mapcache: Add support for grant mappings

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add a second mapcache for grant mappings. The mapcache for grants needs to work with XC_PAGE_SIZE granularity since we can't map larger ranges than what has been granted to us. Like with foreign mappings (xen_memory), machines using grants are expected to

[PATCH v6 1/8] xen: mapcache: Make MCACHE_BUCKET_SHIFT runtime configurable

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make MCACHE_BUCKET_SHIFT runtime configurable per cache instance. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/xen/xen-mapcache.c | 54 ++- 1 file changed, 33 insertions(+), 21 deletion

[PATCH v6 0/8] xen: Support grant mappings

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Hi, Grant mappings are a mechanism in Xen for guests to grant each other permissions to map and share pages. These grants can be temporary so both map and unmaps must be respected. See here for more info: https://github.com/xen-project/xen/blob/master/docs/

[PATCH v6 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache()

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Pass the ram_addr offset to xen_map_cache. This is in preparation for adding grant mappings that need to compute the address within the RAMBlock. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 16 +++

[PATCH v6 4/8] softmmu: xen: Always pass offset + addr to xen_map_cache

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Always pass address with offset to xen_map_cache(). This is in preparation for support for grant mappings. Since this is within a block that checks for offset == 0, this has no functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano

[PATCH v6 2/8] xen: mapcache: Unmap first entries in buckets

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" When invalidating memory ranges, if we happen to hit the first entry in a bucket we were never unmapping it. This was harmless for foreign mappings but now that we're looking to reuse the mapcache for transient grant mappings, we must unmap entries when i

[PATCH v6 8/8] hw/arm: xen: Enable use of grant mappings

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 15fa7dfa84..6fad829ede 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm

[PATCH v6 3/8] xen: Add xen_mr_is_memory()

2024-05-16 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Acked-by: David Hildenbrand --- hw/xen/xen-hvm-common.c | 10 -- include/sysemu/xen

Re: [PATCH v5 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache()

2024-05-16 Thread Edgar E. Iglesias
On Thu, May 16, 2024 at 1:08 AM Stefano Stabellini wrote: > > On Fri, 3 May 2024, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Pass the ram_addr offset to xen_map_cache. > > This is in preparation for adding grant mappings tha

[PATCH v5 5/8] softmmu: Replace check for RAMBlock offset 0 with xen_mr_is_memory

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" For xen, when checking for the first RAM (xen_memory), use xen_mr_is_memory() rather than checking for a RAMBlock with offset 0. All Xen machines create xen_memory first so this has no functional change for existing machines. Signed-off-by: Edgar E

[PATCH v5 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache()

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Pass the ram_addr offset to xen_map_cache. This is in preparation for adding grant mappings that need to compute the address within the RAMBlock. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 16 +++

[PATCH v5 2/8] xen: mapcache: Unmap first entries in buckets

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" When invalidating memory ranges, if we happen to hit the first entry in a bucket we were never unmapping it. This was harmless for foreign mappings but now that we're looking to reuse the mapcache for transient grant mappings, we must unmap entries when i

[PATCH v5 7/8] xen: mapcache: Add support for grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add a second mapcache for grant mappings. The mapcache for grants needs to work with XC_PAGE_SIZE granularity since we can't map larger ranges than what has been granted to us. Like with foreign mappings (xen_memory), machines using grants are expected to

[PATCH v5 3/8] xen: Add xen_mr_is_memory()

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Acked-by: David Hildenbrand --- hw/xen/xen-hvm-common.c | 10 -- include/sysemu/xen

[PATCH v5 0/8] xen: Support grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Hi, Grant mappings are a mechanism in Xen for guests to grant each other permissions to map and share pages. These grants can be temporary so both map and unmaps must be respected. See here for more info: https://github.com/xen-project/xen/blob/master/docs/

[PATCH v5 4/8] softmmu: xen: Always pass offset + addr to xen_map_cache

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Always pass address with offset to xen_map_cache(). This is in preparation for support for grant mappings. Since this is within a block that checks for offset == 0, this has no functional changes. Signed-off-by: Edgar E. Iglesias --- system/physmem.c | 3 +

[PATCH v5 1/8] xen: mapcache: Make MCACHE_BUCKET_SHIFT runtime configurable

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make MCACHE_BUCKET_SHIFT runtime configurable per cache instance. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/xen/xen-mapcache.c | 54 ++- 1 file changed, 33 insertions(+), 21 deletion

[PATCH v5 8/8] hw/arm: xen: Enable use of grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 15fa7dfa84..6fad829ede 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm

Re: [PATCH v4 15/17] xen: mapcache: Remove assumption of RAMBlock with 0 offset

2024-05-07 Thread Edgar E. Iglesias
On Thu, May 2, 2024 at 10:02 PM Stefano Stabellini wrote: > > On Thu, 2 May 2024, Edgar E. Iglesias wrote: > > On Thu, May 2, 2024 at 8:53 PM Stefano Stabellini > > wrote: > > > > > > +Xenia > > > > > > On Thu, 2 May 2024, Edgar E. Iglesias

Re: [PATCH v4 14/17] xen: Add xen_mr_is_memory()

2024-05-06 Thread Edgar E. Iglesias
On Mon, May 6, 2024 at 11:59 AM Philippe Mathieu-Daudé wrote: > > On 2/5/24 09:26, David Hildenbrand wrote: > > On 30.04.24 18:49, Edgar E. Iglesias wrote: > >> From: "Edgar E. Iglesias" > >> > >> Add xen_mr_is_memory() to abstract away tests

Re: [PATCH v4 16/17] xen: mapcache: Add support for grant mappings

2024-05-02 Thread Edgar E. Iglesias
On Thu, May 2, 2024 at 9:18 PM Stefano Stabellini wrote: > > On Tue, 30 Apr 2024, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Add a second mapcache for grant mappings. The mapcache for > > grants needs to work with XC_PAGE_SIZE granular

Re: [PATCH v4 15/17] xen: mapcache: Remove assumption of RAMBlock with 0 offset

2024-05-02 Thread Edgar E. Iglesias
On Thu, May 2, 2024 at 8:53 PM Stefano Stabellini wrote: > > +Xenia > > On Thu, 2 May 2024, Edgar E. Iglesias wrote: > > On Wed, May 1, 2024 at 11:24 PM Stefano Stabellini > > wrote: > > > > > > On Tue, 30 Apr 2024, Edgar E. Iglesi

Re: [PATCH v4 12/17] xen: mapcache: Unmap first entries in buckets

2024-05-02 Thread Edgar E. Iglesias
On Tue, Apr 30, 2024 at 6:50 PM Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > When invalidating memory ranges, if we happen to hit the first > entry in a bucket we were never unmapping it. This was harmless > for foreign mappings but now that we're loo

Re: [PATCH v4 13/17] softmmu: Pass RAM MemoryRegion and is_write xen_map_cache()

2024-05-02 Thread Edgar E. Iglesias
On Thu, May 2, 2024 at 9:24 AM David Hildenbrand wrote: > > On 30.04.24 18:49, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Propagate MR and is_write to xen_map_cache(). > > I'm pretty sure the patch subject is missing a "to" :

Re: [PATCH v4 15/17] xen: mapcache: Remove assumption of RAMBlock with 0 offset

2024-05-02 Thread Edgar E. Iglesias
On Wed, May 1, 2024 at 11:24 PM Stefano Stabellini wrote: > > On Tue, 30 Apr 2024, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > The current mapcache assumes that all memory is mapped > > in a single RAM MR (the first one with offset 0).

Re: [PATCH v4 07/17] xen: mapcache: Refactor xen_replace_cache_entry_unlocked

2024-05-02 Thread Edgar E. Iglesias
On Wed, May 1, 2024 at 10:46 PM Stefano Stabellini wrote: > > On Tue, 30 Apr 2024, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Add MapCache argument to xen_replace_cache_entry_unlocked in > > preparation for supporting multiple

[PATCH v4 14/17] xen: Add xen_mr_is_memory()

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-hvm-common.c | 8 +++- include/sysemu/xen.h| 8 system/physmem.c| 2 +- 3 files changed, 16 insertions(+), 2

[PATCH v4 13/17] softmmu: Pass RAM MemoryRegion and is_write xen_map_cache()

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Propagate MR and is_write to xen_map_cache(). This is in preparation for adding support for grant mappings. No functional change. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 10 ++ include/sysemu/xen-mapca

[PATCH v4 04/17] xen: mapcache: Refactor xen_map_cache for multi-instance

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make xen_map_cache take a MapCache as argument. This is in prepaparation to support multiple map caches. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 35 ++- 1 file changed, 18 inserti

[PATCH v4 02/17] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry

2024-04-30 Thread Edgar E. Iglesias
From: Juergen Gross Today xen_ram_addr_from_mapcache() will either abort() or return 0 in case it can't find a matching entry for a pointer value. Both cases are bad, so change that to return an invalid address instead. Signed-off-by: Juergen Gross Signed-off-by: Edgar E. Iglesias Reviewed

[PATCH v4 11/17] xen: mapcache: Make MCACHE_BUCKET_SHIFT runtime configurable

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make MCACHE_BUCKET_SHIFT runtime configurable per cache instance. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 52 ++- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/hw/xen/xen-mapca

[PATCH v4 01/17] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()

2024-04-30 Thread Edgar E. Iglesias
From: Juergen Gross qemu_map_ram_ptr() and qemu_ram_ptr_length() share quite some code, so modify qemu_ram_ptr_length() a little bit and use it for qemu_map_ram_ptr(), too. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano

[PATCH v4 12/17] xen: mapcache: Unmap first entries in buckets

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" When invalidating memory ranges, if we happen to hit the first entry in a bucket we were never unmapping it. This was harmless for foreign mappings but now that we're looking to reuse the mapcache for transient grant mappings, we must unmap entries when i

[PATCH v4 03/17] xen: mapcache: Refactor lock functions for multi-instance

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make the lock functions take MapCache * as argument. This is in preparation for supporting multiple caches. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 34 +- 1 file changed, 17

[PATCH v4 09/17] xen: mapcache: Break out xen_invalidate_map_cache_single()

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Break out xen_invalidate_map_cache_single(). No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/

[PATCH v4 00/17] xen: Support grant mappings

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Hi, This is a follow-up on Vikrams v3: http://next.patchew.org/QEMU/20240227223501.28475-1-vikram.garh...@amd.com/ Grant mappings are a mechanism in Xen for guests to grant each other permissions to map and share pages. These grants can be temporary s

[PATCH v4 05/17] xen: mapcache: Refactor xen_remap_bucket for multi-instance

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add MapCache argument to xen_remap_bucket in preparation to support multiple map caches. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/

[PATCH v4 17/17] hw/arm: xen: Enable use of grant mappings

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias --- hw/arm/xen_arm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 15fa7dfa84..6fad829ede 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -125,6 +125,11 @@ s

[PATCH v4 08/17] xen: mapcache: Refactor xen_invalidate_map_cache_entry_unlocked

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add MapCache argument to xen_invalidate_map_cache_entry_unlocked. This is in preparation for supporting multiple map caches. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 21 +++-- 1 file changed, 11

[PATCH v4 16/17] xen: mapcache: Add support for grant mappings

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add a second mapcache for grant mappings. The mapcache for grants needs to work with XC_PAGE_SIZE granularity since we can't map larger ranges than what has been granted to us. Like with foreign mappings (xen_memory), machines using grants are expected to

[PATCH v4 07/17] xen: mapcache: Refactor xen_replace_cache_entry_unlocked

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add MapCache argument to xen_replace_cache_entry_unlocked in preparation for supporting multiple map caches. No functional change. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-)

[PATCH v4 15/17] xen: mapcache: Remove assumption of RAMBlock with 0 offset

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" The current mapcache assumes that all memory is mapped in a single RAM MR (the first one with offset 0). Remove this assumption and propagate the offset to the mapcache so it can do reverse mappings (from hostptr -> ram_addr). This is in preparation for

[PATCH v4 10/17] xen: mapcache: Break out xen_map_cache_init_single()

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Break out xen_map_cache_init_single() in preparation for adding multiple map caches. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 53 ++- 1 file changed, 32 insertions(+), 21 deletions(-) diff --gi

[PATCH v4 06/17] xen: mapcache: Break out xen_ram_addr_from_mapcache_single

2024-04-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Break out xen_ram_addr_from_mapcache_single(), a multi-cache aware version of xen_ram_addr_from_mapcache. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletion

Re: [QEMU][PATCH v3 5/7] memory: add MemoryRegion map and unmap callbacks

2024-04-17 Thread Edgar E. Iglesias
On Tue, Apr 16, 2024 at 5:55 PM Peter Xu wrote: > > On Tue, Apr 16, 2024 at 03:28:41PM +0200, Jürgen Groß wrote: > > On 16.04.24 13:32, Edgar E. Iglesias wrote: > > > On Wed, Apr 10, 2024 at 8:56 PM Peter Xu wrote: > > > > > > > > On Wed, Apr 10, 2024

Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-16 Thread Edgar E. Iglesias
+ To: Fred On Tue, 16 Apr 2024 at 19:56, Alexandra Diupina wrote: > Peter, thank you! I agree with you that > as mentioned in the documentation > https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/ADDR_EXT-Field, > we should take 32 bits of the address from one field > (for example, case

Re: [QEMU][PATCH v3 5/7] memory: add MemoryRegion map and unmap callbacks

2024-04-16 Thread Edgar E. Iglesias
On Wed, Apr 10, 2024 at 8:56 PM Peter Xu wrote: > > On Wed, Apr 10, 2024 at 06:44:38PM +0200, Edgar E. Iglesias wrote: > > On Tue, Feb 27, 2024 at 11:37 PM Vikram Garhwal > > wrote: > > > > > From: Juergen Gross > > > > > > In order to sup

Re: [PATCH 0/6] disas/cris: Use GString instead of sprintf

2024-04-16 Thread Edgar E. Iglesias
On Sat, Apr 13, 2024 at 7:23 AM Richard Henderson wrote: > > More sprintf cleanup encouraged by the Apple deprecation. > Probably there's a more minimal patch. On the other hand, > there's certainly a larger cleanup possible. > > > r~ On the series: Reviewed-

Re: [PATCH 4/6] hw, target: Add ResetType argument to hold and exit phase methods

2024-04-12 Thread Edgar E. Iglesias
--sp-file scripts/coccinelle/reset-type.cocci \ > --keep-comments --smpl-spacing --in-place \ > --include-headers --dir $dir; done > > and no manual edits. > > Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias > --

Re: [PATCH v4 02/10] hw/core: create Resettable QOM interface

2024-04-12 Thread Edgar E. Iglesias
On Fri, Apr 12, 2024 at 3:05 PM Peter Maydell wrote: > > On Thu, 11 Apr 2024 at 18:23, Philippe Mathieu-Daudé > wrote: > > > > On 11/4/24 15:43, Peter Maydell wrote: > > > On Wed, 21 Aug 2019 at 17:34, Damien Hedde > > > wrote: > > >> > > >> This commit defines an interface allowing

Re: [PATCH 2/9] disas/microblaze: Replace sprintf() by snprintf()

2024-04-11 Thread Edgar E. Iglesias
On Thu, Apr 11, 2024 at 12:43 PM Philippe Mathieu-Daudé wrote: > > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use snprintf() instead. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias

Re: [QEMU][PATCH v3 5/7] memory: add MemoryRegion map and unmap callbacks

2024-04-10 Thread Edgar E. Iglesias
On Tue, Feb 27, 2024 at 11:37 PM Vikram Garhwal wrote: > From: Juergen Gross > > In order to support mapping and unmapping guest memory dynamically to > and from qemu during address_space_[un]map() operations add the map() > and unmap() callbacks to MemoryRegionOps. > > Those will be used e.g.

Re: [QEMU][PATCH v3 0/7] Xen: support grant mappings.

2024-04-10 Thread Edgar E. Iglesias
On Wed, Feb 28, 2024 at 8:00 PM Vikram Garhwal wrote: > Hi Manos, > On Wed, Feb 28, 2024 at 03:27:12PM +0200, Manos Pitsidianakis wrote: > > Hello Vikram, > > > > Series doesn't apply on master. Can you rebase and also provide a > > base-commit with --base= when you use git-format-patch? This >

Re: [QEMU][PATCH v3 5/7] memory: add MemoryRegion map and unmap callbacks

2024-04-10 Thread Edgar E. Iglesias
add the map() > > and unmap() callbacks to MemoryRegionOps. > > > > Those will be used e.g. for Xen grant mappings when performing guest > > I/Os. > > > > Signed-off-by: Juergen Gross > > Signed-off-by: Vikram Garhwal > > Reviewed-by: Stefano Stabell

Re: [QEMU][PATCH v3 3/7] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()

2024-04-10 Thread Edgar E. Iglesias
t; Signed-off-by: Vikram Garhwal > Reviewed-by: Stefano Stabellini > Reviewed-by: Edgar E. Iglesias > --- > system/physmem.c | 56 > 1 file changed, 23 insertions(+), 33 deletions(-) > > diff --git a/system/physmem.c b/sy

Re: [QEMU][PATCH v3 4/7] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry

2024-04-10 Thread Edgar E. Iglesias
reventry->vaddr_req); > > -} > > If these tracepoints aren't useful they need removing from trace-events. > However I suspect it would be better to keep them in as they are fairly > cheap. > > Otherwise: > > Reviewed-by: Alex Bennée > > Reviewed-by: Edgar E. Iglesias

Re: [QEMU][PATCH v3 2/7] xen: add pseudo RAM region for grant mappings

2024-04-10 Thread Edgar E. Iglesias
> distinguish it from normal RAM. > > Is the Xen memory map for HVM guests documented anywhere? I couldn't > find anything googling or on the Xen wiki. I'm guessing this is going to > be shared across all 64 bit HVM arches in Xen? > > Anyway: > > Reviewed-by: Alex Bennée > > Reviewed-by: Edgar E. Iglesias

Re: [QEMU][PATCH v3 6/7] xen: add map and unmap callbacks for grant region

2024-04-10 Thread Edgar E. Iglesias
d-off-by: Juergen Gross > > Signed-off-by: Vikram Garhwal > > Reviewed-by: Stefano Stabellini > > Reviewed-by: Edgar E. Iglesias

Re: [QEMU][PATCH v3 1/7] softmmu: physmem: Split ram_block_add()

2024-04-10 Thread Edgar E. Iglesias
ram_block list. > > > > Signed-off-by: Juergen Gross > > Signed-off-by: Vikram Garhwal > > Reviewed-by: Stefano Stabellini > > Reviewed-by: Alex Bennée > > Reviewed-by: Edgar E. Iglesias

Re: [QEMU][PATCH v3 7/7] hw: arm: Add grant mapping.

2024-04-10 Thread Edgar E. Iglesias
ysmem, GUEST_RAM1_BASE, _hi); > > > } > > > + > > > +DPRINTF("init grant ram mapping for XEN\n"); > > > > I don't think we need the DPRINTF here (there others where recently > > converted to trace-points although I suspect a memory_region tracepoint > > would be a better place to capture this). > May be drop the print? As it's not providing much information anyways. > With the DPRINTF dropped: Reviewed-by: Edgar E. Iglesias

Re: [PATCH 24/32] target/microblaze: Use translator_ldl

2024-04-05 Thread Edgar E. Iglesias
On Fri, Apr 5, 2024 at 12:25 PM Richard Henderson < richard.hender...@linaro.org> wrote: > Cc: Edgar E. Iglesias > Signed-off-by: Richard Henderson > Reviewed-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 3 +-- > 1 file changed, 1 insertion(+),

Re: [PATCH 28/32] target/cris: Use cris_fetch in translate_v10.c.inc

2024-04-05 Thread Edgar E. Iglesias
On Fri, Apr 5, 2024 at 12:25 PM Richard Henderson < richard.hender...@linaro.org> wrote: > Cc: Edgar E. Iglesias > Signed-off-by: Richard Henderson > Reviewed-by: Edgar E. Iglesias > --- > target/cris/translate.c | 1 - > target/cris/

Re: [PATCH 27/32] target/cris: Use translator_ld* in cris_fetch

2024-04-05 Thread Edgar E. Iglesias
On Fri, Apr 5, 2024 at 12:25 PM Richard Henderson < richard.hender...@linaro.org> wrote: > Cc: Edgar E. Iglesias > Signed-off-by: Richard Henderson > Reviewed-by: Edgar E. Iglesias > --- > target/cris/translate.c | 25 - > 1 file chan

Re: [PATCH-for-9.1 08/21] target/microblaze: Prefix MMU API with 'mb_'

2024-03-23 Thread Edgar E. Iglesias
On Thu, Mar 21, 2024 at 4:49 PM Philippe Mathieu-Daudé wrote: > MicroBlaze MMU API is exposed in "mmu.h". In order to avoid > name clashing with other targets, prefix the API with 'mb_'. > Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Philippe Mathieu-Daudé &

Re: [RFC PATCH-for-9.1 8/8] target/microblaze: Widen $ear to 64-bit

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:55AM +0100, Philippe Mathieu-Daudé wrote: > The Exception Address Register is 64-bit wide. > User emulation only access the 32 lower bits. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/microbla

Re: [PATCH-for-9.1 7/8] target/microblaze: Move MMU helpers to sys_helper.c

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:54AM +0100, Philippe Mathieu-Daudé wrote: > MMU helpers are only used during system emulation, > move them to sys_helper.c. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/microblaze

Re: [PATCH-for-9.1 6/8] target/microblaze: Rename helper.c -> sys_helper.c

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:53AM +0100, Philippe Mathieu-Daudé wrote: > helper.c only contains system emulation helpers, > rename it as sys_helper.c. > Adapt meson and remove pointless #ifdef'ry. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH-for-9.1 4/8] target/microblaze: Use 32-bit destination in gen_goto_tb()

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:51AM +0100, Philippe Mathieu-Daudé wrote: > cpu_pc and jmp_dest are 32-bit. > Reviewed-by: Edgar E. Iglesias > Signed-off-by: Philippe Mathieu-Daudé > --- > target/microblaze/translate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(

Re: [PATCH-for-9.1 3/8] target/microblaze: Widen vaddr in mmu_translate()

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:50AM +0100, Philippe Mathieu-Daudé wrote: > Use 'vaddr' type for virtual addresses. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/microblaze/mmu.h | 2 +- > target/microblaze/mmu.c | 2 +- >

Re: [PATCH-for-9.1 2/8] target/microblaze: Use hwaddr/vaddr in cpu_get_phys_page_attrs_debug()

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:49AM +0100, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias > --- > target/microblaze/helper.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/target/microblaze

Re: [PATCH-for-9.1 1/8] target/microblaze: Use correct string format in do_unaligned_access()

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:48AM +0100, Philippe Mathieu-Daudé wrote: > 'addr' is of type 'vaddr'; no need to cast, use the > corresponding format string. > > Fixes: ab0c8d0f5b ("target/microblaze: Use cc->do_unaligned_access") > Signed-off-by: Philippe Mathieu-

Re: [PATCH-for-9.1 5/8] target/microblaze: Restrict 64-bit 'res_addr' to system emulation

2024-03-19 Thread Edgar E. Iglesias
On Tue, Mar 19, 2024 at 07:28:52AM +0100, Philippe Mathieu-Daudé wrote: > 'res_addr' is only used in system emulation, where we have > TARGET_LONG_BITS = 64, so we can directly use the native > uint64_t type instead of target_ulong. Hi Philippe, This breaks linux-user, lwx and swx are valid

Running x86 hypervisors inside QEMU x86 TCG outer guest?

2024-03-12 Thread Edgar E. Iglesias
Hi! I'm trying to figure out if QEMU supports running x86 hypervisors (KVM and Xen) inside emulated (TCG) x86_64 guests. I.e, using TCG emulated x86 hardware virtualization (Intel VMX/EPT or AMD SVM/NPT). So far, I've been able to run nested x86 KVM when the host is on KVM but no luck with

Re: [PATCH] hw/misc: zynq_slcr: set SLC_RST bit in REBOOT_STATUS register

2024-03-01 Thread Edgar E. Iglesias
On Fri, Mar 1, 2024 at 10:40 AM Peter Maydell wrote: > On Wed, 28 Feb 2024 at 01:40, Gregory Anders wrote: > > > > When the CPU is reset using PSS_RST_CTRL in the SLCR, bit 19 in > > REBOOT_STATUS should be set. > > > Refer to page 1602 of the Xilinx Zynq 7000 Technical Reference Manual. > > >

Re: [PATCH 04/31] docs: mark CRIS support as deprecated

2024-01-24 Thread Edgar E. Iglesias
On Wed, Jan 24, 2024 at 12:06 PM Philippe Mathieu-Daudé wrote: > On 25/9/23 19:17, Edgar E. Iglesias wrote: > > > > On Mon, Sep 25, 2023 at 7:00 PM Alex Bennée > <mailto:alex.ben...@linaro.org>> wrote: > > > > > > Daniel P. Berrang

Re: [PATCH] target/arm: HVC at EL3 should go to EL3, not EL2

2023-11-09 Thread Edgar E. Iglesias
rg > Signed-off-by: Peter Maydell > Reviewed-by: Edgar E. Iglesias > --- > target/arm/tcg/translate-a64.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/target/arm/tcg/translate-a64.c > b/target/arm/tcg/translate-a64.c > index 41484d8ae54.

Re: [PATCH 2/9] target/cris: Use tcg_gen_extract_tl

2023-10-24 Thread Edgar E. Iglesias
| 3 +-- > > target/i386/tcg/translate.c | 9 +++-- > > 2 files changed, 4 insertions(+), 8 deletions(-) > > Accidental merge of two patches, but they both look fine. :-) > > With the split, to both: > Reviewed-by: Richard Henderson > > > CRIS part looks

Re: [RFC PATCH 8/9] target/cris: Use tcg_gen_sextract_tl

2023-10-24 Thread Edgar E. Iglesias
On Tue, Oct 24, 2023 at 2:26 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 10/23/23 09:09, Philippe Mathieu-Daudé wrote: > > Inspired-by: Richard Henderson > > Signed-off-by: Philippe Mathieu-Daudé > > --- > > RFC: please double-check bits > > --- > >

Re: [PATCH 04/31] docs: mark CRIS support as deprecated

2023-09-25 Thread Edgar E. Iglesias
e are "check-tcg" ones. The aging > >> fedora-criss-cross image works well enough for developers but can't be > >> used in CI as we need supported build platforms to build QEMU. > >> > >> Does this mean the writing is on the wall for this architecture? > >

Re: [PATCH v2 8/8] target/cris: Fix a typo in gen_swapr()

2023-09-01 Thread Edgar E. Iglesias
On Wed, Aug 23, 2023 at 4:56 PM Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Edgar E. Iglesias > --- > target/cris/translate.c | 20 +++- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/targ

Re: [PATCH v1 0/8] Xilinx Versal CFI support

2023-07-12 Thread Edgar E. Iglesias
of the CFU_APB, CFU_FDRO and CFU_SFR are introduced and > also models of the CFRAME controller and CFRAME broadcast controller. > > The series thereafter ends with connecting the models to Xilinx Versal > machine. > I just had a quick look and the series LGTM! Acked-by: Edgar E. Iglesias &g

Re: [PATCH v3 1/5] target/microblaze: Define TCG_GUEST_DEFAULT_MO

2023-06-24 Thread Edgar E. Iglesias
defined when enabling MTTCG. Reviewed-by: Edgar E. Iglesias There might be MicroBlaze systems that allow reordering of load vs store streams but it doesn't seem to be documented and I'm not 100% certain so this change LGTM! Thanks, Edgar > > Cc: Alistair Francis > Cc: Edgar E.

Re: [PATCH] hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop.

2023-05-19 Thread Edgar E. Iglesias
hange all of these helpers to return booleans... Anyway, this fix looks good to me: Reviewed-by: Edgar E. Iglesias > +{ > +return !!(s->regs[R_DMASR] & DMASR_HALTED); > +} > + > static void stream_reset(struct Stream *s) > { > s->regs[R_DMASR] = DMASR_HALTED

Re: [PATCH] hw/ssi: Fix Linux driver init issue with xilinx_spi

2023-03-31 Thread Edgar E. Iglesias
et indicates this bit is active on reset. > > See page 25, SPI Control Register section: > > https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf > > Yes, MTI should be set when the device comes out of reset.

Re: [PATCH for-8.0] hw/char/cadence_uart: Fix guards on invalid BRGR/BDIV settings

2023-03-14 Thread Edgar E. Iglesias
https://gitlab.com/qemu-project/qemu/-/issues/1493 > Signed-off-by: Peter Maydell > Reviewed-by: Edgar E. Iglesias > --- > hw/char/cadence_uart.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c

Re: hw/ppc/virtex_ml507: Problem with CPU IRQ#3 (PPC40x_INPUT_CINT)

2023-02-21 Thread Edgar E. Iglesias
On Tue, Feb 21, 2023 at 7:28 AM Philippe Mathieu-Daudé wrote: > Hi Edgar, > > The Xilinx Virtex ML507 model uses 2 different interrupt controllers: > - Universal Interrupt Controller > - Xilinx OPB Interrupt Controller > Both are connected to the same CPU IRQ line, IRQ#3 (PPC40x_INPUT_CINT): > >

Re: [PATCH] target/microblaze: Add gdbstub xml

2023-02-15 Thread Edgar E. Iglesias
e" command within gdb. > > > > (I built gdb from source, to try and debug why this still wasn't > > working, only to find that it did. :-P) > > > > Alex, any way to modify our gdb test to fail gracefully here? > > > > Regardless, having proper xml for all

Re: [PATCH] hw/display/xlnx_dp: fix overflow in xlnx_dp_aux_push_tx_fifo()

2023-01-10 Thread Edgar E. Iglesias
On Mon, Jan 09, 2023 at 01:59:33PM +0800, Qiang Liu wrote: > This patch checks if the s->tx_fifo is full. + CC: Fred Reviewed-by: Edgar E. Iglesias > > Fixes: 58ac482a66de ("introduce xlnx-dp") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1424 > Repo

Re: [PATCH 14/14] hw/timer/xilinx_timer: Use XpsTimerState instead of 'struct timerblock'

2023-01-10 Thread Edgar E. Iglesias
be a definition > DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, >^ Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/timer/xilinx_timer.c | 27 +-- > 1 file changed, 13 insertions(+),

Re: [PATCH 13/14] hw/intc/xilinx_intc: Use 'XpsIntc' typedef instead of 'struct xlx_pic'

2023-01-10 Thread Edgar E. Iglesias
t; a definition > DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, Reviewed-by: Edgar E. Iglesias >^ > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/intc/xilinx_intc.c | 28 +--- > 1 file changed, 13 insertions(+), 15 de

Re: [PATCH] target/microblaze: Add gdbstub xml

2022-12-30 Thread Edgar E. Iglesias
On Fri, Dec 30, 2022 at 08:24:19AM -0800, Richard Henderson wrote: > Mirroring the upstream gdb xml files, the two stack boundary > registers are separated out. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Richard Henderson > --- > > I did this thinking I would b

Re: [PATCH 5/6] hw/arm/xilinx_zynq: Remove tswap32() calls and constify smpboot[]

2022-12-22 Thread Edgar E. Iglesias
On Thu, Dec 22, 2022 at 10:55:48PM +0100, Philippe Mathieu-Daudé wrote: > ARM CPUs fetch instructions in little-endian. > > smpboot[] encoded instructions are written in little-endian. > > We call tswap32() on the array. tswap32 function swap a 32-bit > value if the target endianness doesn't

Re: [PATCH v2 1/4] include/hw/virtio: Break inclusion loop

2022-12-22 Thread Edgar E. Iglesias
to > > break the loop. > > > > Signed-off-by: Markus Armbruster > > Reviewed-by: Philippe Mathieu-Daudé > > Reviewed-by: Alistair Francis > > Reviewed-by: Stefano Garzarella Reviewed-by: Edgar E. Iglesias > > Acked-by: Jason Wang > > Thanks > &

Re: [PATCH 3/6] hw/ppc/virtex_ml507: Prefer local over global variable

2022-12-16 Thread Edgar E. Iglesias
On Fri, Dec 16, 2022 at 03:57:06PM +0100, Bernhard Beschow wrote: > Signed-off-by: Bernhard Beschow Reviewed-by: Edgar E. Iglesias > --- > hw/ppc/virtex_ml507.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virt

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread Edgar E. Iglesias
On Tue, Dec 13, 2022 at 05:23:06PM +, Peter Maydell wrote: > On Tue, 13 Dec 2022 at 16:53, Cédric Le Goater wrote: > > > > On 12/13/22 17:27, Richard Henderson wrote: > > > On 12/13/22 10:21, Peter Maydell wrote: > > >> It does seem odd, though. We have a value in host endianness > > >> (the

Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu()

2022-12-13 Thread Edgar E. Iglesias
On Tue, Dec 13, 2022 at 03:22:54PM +, Peter Maydell wrote: > On Tue, 13 Dec 2022 at 14:23, Edgar E. Iglesias > wrote: > > > > On Tue, Dec 13, 2022 at 02:18:42PM +, Peter Maydell wrote: > > > On Tue, 13 Dec 2022 at 14:14, Edgar E. Iglesias > > > wrote:

Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu()

2022-12-13 Thread Edgar E. Iglesias
On Tue, Dec 13, 2022 at 02:18:42PM +, Peter Maydell wrote: > On Tue, 13 Dec 2022 at 14:14, Edgar E. Iglesias > wrote: > > > > On Tue, Dec 13, 2022 at 01:53:15PM +, Peter Maydell wrote: > > > On Tue, 13 Dec 2022 at 12:52, Philippe Mathieu-Daudé > > >

Re: Single system binary & Dynamic machine model (KVM developers conference call 2022-12-13)

2022-12-13 Thread Edgar E. Iglesias
On Tue, Dec 13, 2022 at 09:17:40AM -0500, Stefan Hajnoczi wrote: > On Tue, 13 Dec 2022 at 09:08, Philippe Mathieu-Daudé > wrote: > > > > On 12/12/22 00:41, Philippe Mathieu-Daudé wrote: > > > Hi, > > > > > > In the last years we had few discussions on "simplifying" QEMU (system > > > emulation /

Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu()

2022-12-13 Thread Edgar E. Iglesias
On Tue, Dec 13, 2022 at 01:53:15PM +, Peter Maydell wrote: > On Tue, 13 Dec 2022 at 12:52, Philippe Mathieu-Daudé > wrote: > > > > This partly revert commit d48751ed4f ("xilinx-ethlite: > > Simplify byteswapping to/from brams") which states the > > packet data is stored in big-endian. > > >

  1   2   3   4   5   6   7   8   9   10   >