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

Re: [PATCH v3 0/8] Follow-up static shared memory PART I


  • To: Michal Orzel <michal.orzel@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <penny.zheng@xxxxxxx>
  • Date: Tue, 22 Aug 2023 13:32:05 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • 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=LsS4oWBA9/vtIEFbwcGqI3MGXfMc95jve6vSxzHI7NQ=; b=YurdAJ264dQ5HryUKK4JyA/X0njn0H6lzQoZ5M1IfbTEuTiY0T4Pdh1fRZxoTLwYeoGaWUxGQ8TnDUL7EXej0UiU31o1SS3PuY2/WdwYbinBpp+ulU1+MilBcc/YhHkTa8bs6vdmJ8kS8Sv1nLqLKtcCWzEafvPevZfYEemEDfs7bFZij9I7xbA4g0bOJb3emOxxfR0/0Dm+tZlRVud8OT+VmrL/WN3LRlq84DeMv4XDH9K94vX+TO+O5v6Kq39hrrSZ4clVCfgJueuRhZHMZ+KzropzL/KqpmNgqmcn0q+uFGjhhXe5YmFXBz4SxlQykFq/yYO9pe6ASNL8I6glzA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K3wUPdqNB9mE61T1Pc3GxBSsjI+94o4kWxKPF1FJI3RhbsRjOHlYJwqdBu06ZW0Fa0qhrPN1Hkl5417WvMyCecAAd8Pzufbu8pVD+Yxz7y0ceX3w9CqaCyOip8gcbPcg8Bf7A1WQ3sVTsuCn718Oln5+UW7iVGYBVQY/kyd9xWx8cQjzuGj54+YSJqwhsUVdmpTv2u/TbD/Sg/iRhGvy49w2VXpHEss/Ef6ZHC/IIlkBGGfxfCpjM/IMulkz6t6lZDVIxU8iTCvHrKXI/XR6azucHwCIAjjM+9WPuWzhFxAzk3fIyTGVPRgYM96MxsdxlxIncHV4Vldbzr67efqRQg==
  • Cc: <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 22 Aug 2023 08:02:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Hi, michal

On 2023/8/21 18:49, Michal Orzel wrote:
Hi Penny,

On 21/08/2023 06:00, Penny Zheng wrote:


There are some unsolving issues on current 4.17 static shared memory
feature[1], including:
- In order to avoid keeping growing 'membank', having the shared memory
info in separate structures is preferred.
- Missing implementation on having the host address optional in
"xen,shared-mem" property
- Removing static shared memory from extended regions
- Missing reference release on foreign superpage
- Missing "xen,offset" feature, which is introduced in Linux DOC[2]

All above objects have been divided into two parts to complete. And this
patch serie is PART I.

[1] https://lore.kernel.org/all/20220908135513.1800511-1-Penny.Zheng@xxxxxxx/
[2] 
https://www.kernel.org/doc/Documentation/devicetree/bindings/reserved-memory/xen%2Cshared-memory.txt

It looks like there is a problem with the changes introduced in this series.
The gitlab static shared memory tests failed:
https://gitlab.com/xen-project/patchew/xen/-/pipelines/973985190
No Xen logs meaning the failure occurred before serial console initialization.

Now, I would like to share some observations after playing around with the 
current static shared mem code today.
1) Static shared memory region is advertised to a domain by creating a child 
node under reserved-memory.
/reserved-memory is nothing but a way to carve out a region from the normal 
memory specified in /memory node.
For me, such regions should be described in domain's /memory node as well. This 
is not the case at the moment
for static shm unlike to other sub-nodes of /reserved-memory (present in host 
dtb) for which Xen creates separate
/memory nodes.


Hmm, correct me if I'm wrong,
If we describe twice in domain's /memory node too, it will be treated as normal memory, then any application could use it. The reason why we put static shm under /reserved-memory is that we only hope special driver, like static shm linux driver, could access it.

If you track down in make_memory_node(), only memory range that is reserved for device (or firmware) will be described twice as normal memory in Dom0. Memory like static shm, will get passed.

2) Domain dtb parsing issue with two /reserved-memory nodes present.
In case there is a /reserved-memory node already present in the host dtb, Xen 
would create yet another /reserved-memory
node for the static shm (to be observed in case of dom0). This is a bug as 
there can be only one /reserved-memory node.
This leads to an error when dumping with dtc and leads to a shm node not being 
visible to a domain (guest OS relies on
a presence of a single /reserved-memory node). The issue is because in 
make_resv_memory_node(), you are not checking if
such node already exists.

Yes, you're true.
In Dom0, we could see two /reserved-memory nodes. I think, if there is a /reserved-memory node already present in the host dtb, we shall reserve it in kinfo for make_resv_memory_node().


I haven't looked closely at this series yet. It might be that these issues are 
fixed. If not, I would definitely
suggest to fix them in the first place.

~Michal



 


Rackspace

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