[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 10 May 2024 11:32:40 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=y7G/nZPMHErP/m19JHaKGEtBUlctLBSZKr2vW07IE5A=; b=Q6GuujIQX0MFPoPfAFs+DY5hGb8yLrfrZAQSA3CdVnWkROVIM6QxSNQwumN5vC4upC4ffDiNmPR9yT7Q9/J+66y9cHO+D1QgSZwPRC3PRfUpePsVDyd+ito70mKrNe8p8UaFhP8DeFE3eSMEMTPIsuaodb3J9SyHYQLX5V7tkOH+H7Shr52wPJpX2wrlKmzlDWxf7gnSPwPLkYTMGHyzU0MHxTG4ULD5JCbfnsiux4FAtbDto1n+De9ICYXT17yDaNVIuasWgN1dxTb3RhNPMHPcmf/sCFe0uc7icMJncPGQj4MYJeBVZhyIkZxjqaB75+/wM1QCIp5oesXli8VNww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XD3ZOpXdOtqvfHbVGCn/e94EmWIgNx76MxFtbgv7HNDvCuQwzid46w5PgOb1f0sKiST9JxFZBiaRmWe0HeO8bLsx49EdN+/OqPjz8lx1nf1qglE6cNXFtGotzt0vJ6r5uQ1/220U433ycOKlADvlH8eZRhVwOqfiHN7UhWorkd0jLw7TVJjpLT8/5PZ9710ZFm2ySwe8z40ciCPazhgv03BjtaoFppOZQYggoyPe6GTMTLf8SNYrXQNFWNHNqTXFTd/6uuiE2QlN4yWFfC2hu1XuHrkzfwDkx5GAabCOgoEIU1uuoT1wLZ0c35eOnwI+tjTEsLMyQ8M57WFpNNchIA==
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 10 May 2024 09:32:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Luca,

On 10/05/2024 11:25, Luca Fancellu wrote:
> 
> 
>> On 10 May 2024, at 10:17, Michal Orzel <michal.orzel@xxxxxxx> wrote:
>>
>> 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@xxxxxxx>
>>
>> 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?
> 
> Hi Michal,
> 
> Mmm I’m testing with a dom0less setup, without dom0, I think I missed that 
> part because my guests doesn’t have
> the hypervisor node (enhanced), sorry about that, I’ll test using your setup, 
> can you confirm what are you using?
I have these Qemu tests (with and without SMMU):
 - shmem between domU1 and domU2 with/without host address provided (owner 
domIO or domU1)
 - shmem between dom0 and domU1 with/without host address provided (owner domIO 
or dom0)

BTW. What was the conclusion about the issue if shmem region clashes with RAM 
allocated for 1:1 domU e.g. dom0.
Accidentally, I end up with a configuration where Xen allocated for dom0 a 
region of RAM clashing with my shmem region.

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.