All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@amd.com>
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap
Date: Fri, 10 May 2024 11:17:23 +0200	[thread overview]
Message-ID: <cb496741-dd76-4536-818a-cbfdbd496b0d@amd.com> (raw)
In-Reply-To: <20240423082532.776623-7-luca.fancellu@arm.com>

Hi Luca,

On 23/04/2024 10:25, Luca Fancellu wrote:
> 
> 
> This commit implements the logic to have the static shared memory banks
> from the Xen heap instead of having the host physical address passed from
> the user.
> 
> When the host physical address is not supplied, the physical memory is
> taken from the Xen heap using allocate_domheap_memory, the allocation
> needs to occur at the first handled DT node and the allocated banks
> need to be saved somewhere, so introduce the 'shm_heap_banks' static
> global variable of type 'struct meminfo' that will hold the banks
> allocated from the heap, its field .shmem_extra will be used to point
> to the bootinfo shared memory banks .shmem_extra space, so that there
> is not further allocation of memory and every bank in shm_heap_banks
> can be safely identified by the shm_id to reconstruct its traceability
> and if it was allocated or not.
> 
> A search into 'shm_heap_banks' will reveal if the banks were allocated
> or not, in case the host address is not passed, and the callback given
> to allocate_domheap_memory will store the banks in the structure and
> map them to the current domain, to do that, some changes to
> acquire_shared_memory_bank are made to let it differentiate if the bank
> is from the heap and if it is, then assign_pages is called for every
> bank.
> 
> When the bank is already allocated, for every bank allocated with the
> corresponding shm_id, handle_shared_mem_bank is called and the mapping
> are done.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

I tested this patch and it resulted in assertion:
Assertion 's <= e' failed at common/rangeset.c:189

I checked and in find_unallocated_memory(), given that start is ~0UL (host address not provided),
start + size would overflow. Did you test this patch?

~Michal


  reply	other threads:[~2024-05-10  9:17 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23  8:25 [PATCH 0/7] Static shared memory followup v2 - pt2 Luca Fancellu
2024-04-23  8:25 ` [PATCH 1/7] xen/arm: Lookup bootinfo shm bank during the mapping Luca Fancellu
2024-05-06 13:24   ` Michal Orzel
2024-05-07 13:44     ` Luca Fancellu
2024-05-07 14:01       ` Michal Orzel
2024-05-07 14:12         ` Luca Fancellu
2024-04-23  8:25 ` [PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function Luca Fancellu
2024-05-06 13:39   ` Michal Orzel
2024-05-07 13:57     ` Luca Fancellu
2024-05-07 14:08       ` Michal Orzel
2024-05-07 14:15         ` Luca Fancellu
2024-05-08  6:33           ` Michal Orzel
2024-04-23  8:25 ` [PATCH 3/7] xen/p2m: put reference for superpage Luca Fancellu
2024-05-07 12:26   ` Michal Orzel
2024-05-07 13:20   ` Julien Grall
2024-05-07 13:30     ` Luca Fancellu
2024-05-08 21:05       ` Julien Grall
2024-05-08 22:11         ` Julien Grall
2024-05-09  8:13           ` Roger Pau Monné
2024-05-09  9:50             ` Julien Grall
2024-05-09 11:28               ` Roger Pau Monné
2024-05-09 12:12                 ` Julien Grall
2024-05-09 12:58                   ` Roger Pau Monné
2024-05-10 21:37                     ` Julien Grall
2024-05-13  8:04                       ` Roger Pau Monné
2024-05-14  7:55                       ` Luca Fancellu
2024-05-09  7:55   ` Roger Pau Monné
2024-04-23  8:25 ` [PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided Luca Fancellu
2024-05-08 12:09   ` Michal Orzel
2024-05-08 13:28     ` Luca Fancellu
2024-05-09  8:58       ` Luca Fancellu
2024-04-23  8:25 ` [PATCH 5/7] xen/arm: Rework heap page allocation outside allocate_bank_memory Luca Fancellu
2024-05-09 11:04   ` Michal Orzel
2024-04-23  8:25 ` [PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap Luca Fancellu
2024-05-10  9:17   ` Michal Orzel [this message]
2024-05-10  9:25     ` Luca Fancellu
2024-05-10  9:32       ` Michal Orzel
2024-05-10  9:37         ` Luca Fancellu
2024-04-23  8:25 ` [PATCH 7/7] xen/docs: Describe static shared memory when host address is not provided Luca Fancellu
2024-05-10  9:33   ` Michal Orzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb496741-dd76-4536-818a-cbfdbd496b0d@amd.com \
    --to=michal.orzel@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=luca.fancellu@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.