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

RE: [PATCH v7 7/9] xen/arm: create shared memory nodes in guest device tree


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Thu, 8 Sep 2022 03:21:06 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=s/U9476IZa6u7fPevpiXhRXPuEl/tX5jEKvw3hV00AQ=; b=hK+A0plFKOtCsdGL8pwMriyscXdWD8Cue6Ag6Z4lt2IG+vlAMGs4sWTrhAjsNiefb/pmqofzVO0T8wx7NNYAueEx2gEILlP2liw8hgrmbLl+6JxAttBApkrR2VkwScLJ8Zl5GzLPGvKCMMfeIHK6GAjLyPvoCbDMi3X8z/iFyZtK+A47NnbjPsoxF+HEXp0e/d4X/wLKIqklBucY/SCmndvW05IDVFc8LvgPdTVjqUH09ok8oob8YF1MFFLGGgetevE5QSEnvoH9wxLVAa+jOHPi+804PVPZXA9WMl60VaAwBvwHQqJYBtmONy1P0E/abXkXyeIZuFYFQNzzautjqA==
  • 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=s/U9476IZa6u7fPevpiXhRXPuEl/tX5jEKvw3hV00AQ=; b=lHnz9j15+MY45IZNgI8S0lYclQKKywv5w6a630s0t8bBY7mftAh5jtfoVLn4OU8L0Da5sN/iJ2aV4Oi5/o7+7xEQT2ZWxkOJ0qUGP9gNpKT+S+cEgGbG1WkyldKn7IfsI78TtLMbqFzvxSWQWOB6eoL4+ox5iVBqma8847Lc/pVPa4Nv5b+bcqSNj121HsaDaSIpSIAm7c21wfMqbK74gdQmJ60zpzgTJGnwz4d6dSiczhTTVo/ESQU0tpLgFSuwH03sgO9xMTZlt++IRXaTsHPIVj0YviVvErTQGwLyvi/wNbA+vgP3A7xMy9w0CKUfJjEG2RKWh+57A84nCMjAKw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=MCbkN2ky87FE8tHkikPT+Zn2PSSIaIGWoeEwkd+36zT4O8rBRJWUtGbsh/vqfPI1VG4L46qLgqTpxS5zCdAErunx1IyKHRXcv4/eKksvmjDR3w1Yr81ff62pohhXNdxFfqgPtPDllHBFcbwhtIthInjZ+5Azsx7mbUMdjIdFHdh5Da8mq/HVWEhQScLHG8b6kud9aN88PawEJ+brybSvabuoIGW+ZGEx9/1AE0K9KC1bLl6CMKaY7XHq2XH7cZJNnBc2eiVIvW+GpEXlaIi6mQp5wZQxQngMRhFmBum6n54D4ntGPGTd6LXsVvHboiNmvmUEnKGbR/fOSWzSk2FHJw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSNe3tONmhn8yNT1LgakwOIRp8VkyPh96xTRMrKOB0I6AbGMNZhlLd9Da/7vpqbx2W4kpYpZtIe0gjbj/fZjk/inJdZ4aBFiEUQpQnQATOcKASmT6+R05PqH4Q554+2cQqrQQuY3DztQPt8s/bQpjniFmZdH0fD5PN8i2ga5zWvwlR9y22O/bQuUAaWu0UySvNDRp3RE07V7DmiKrH3MNNbdjPrljWGuf22xvvfpH9AZ5jEBfYZNPeXhLi6toAf16o7UVivwb96SmToR0vGVtcDytNIwhSYNZbVmAJZ/8hnEwwbsr7vJLQyRUWC2IeyX+BfTCnB+HhmXVsDMozWviQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 08 Sep 2022 03:21:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYwc8kvpCr5kBYNkK7uFgrNrDZ3a3T+1kAgACxgYCAACtxoA==
  • Thread-topic: [PATCH v7 7/9] xen/arm: create shared memory nodes in guest device tree

Hi stefano

> -----Original Message-----
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Sent: Thursday, September 8, 2022 8:16 AM
> To: Julien Grall <julien@xxxxxxx>
> Cc: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>;
> Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Subject: Re: [PATCH v7 7/9] xen/arm: create shared memory nodes in guest
> device tree
> 
> On Wed, 7 Sep 2022, Julien Grall wrote:
> > On 06/09/2022 09:59, Penny Zheng wrote:
> > > We expose the shared memory to the domU using the "xen,shared-
> memory-v1"
> > > reserved-memory binding. See
> > > Documentation/devicetree/bindings/reserved-memory/xen,shared-
> memory.
> > > txt in Linux for the corresponding device tree binding.
> > >
> > > To save the cost of re-parsing shared memory device tree
> > > configuration when creating shared memory nodes in guest device
> > > tree, this commit adds new field "shm_mem" to store shm-info per
> > > domain.
> > >
> > > For each shared memory region, a range is exposed under the
> > > /reserved-memory node as a child node. Each range sub-node is named
> > > xen-shmem@<address> and has the following properties:
> > > - compatible:
> > >          compatible = "xen,shared-memory-v1"
> > > - reg:
> > >          the base guest physical address and size of the shared
> > > memory region
> > > - xen,id:
> > >          a string that identifies the shared memory region.
> >
> > So technically, there is a property "xen,offset" that should be
> > specified for the borrowers.
> >
> > TBH, I don't quite understand what this property is used for. So it is
> > not quite clear why this is skipped.
> >
> > The Stefano is the author of the binding. So maybe he can explain the
> > purpose of the property and help to document it in the commit message
> > why this is ignored.
> 
> It looks like it is something we introduced to handle the case where memory
> from the owner is shared with multiple borrowers. Each borrower would
> have its own offset within the region shared by the owner:
> 
> https://marc.info/?l=xen-devel&m=154110446604365&w=2
> 

IMHO, "xen,offset" more fits in the xen dts? We configure it in borrower memory 
node,
then later we shall only set up foreign memory map starting at the offset?
'''
        domU1-shared-mem@10000000 {
            compatible = "xen,domain-shared-memory-v1";
            role = "borrower";
            xen,shm-id = "my-shared-mem-0";
            xen,shared-mem = <0x10000000 0x50000000 0x10000000>;
            xen,offset = <0x0 0x01000000>;
        }
'''
For borrower domain, only [0x11000000, 0x20000000) need to get mapped...
Of course, we could limit the memory map in related Linux driver, but for 
safety,
it should be at Xen?
 
> 
> The use-case is a bit of a corner case but it looks valid. If I had to do it 
> now, I
> would at least mark "xen,offset" as "optional".
> 
> I think we have two options here and I am happy with either one:
> 
> 1) we add xen,offset = <0x0>;
> 

I will let v8 stay with this configuration, and a TODO for actual 
implementation.

> 2) we do *not* add xen,offset and instead send a patch to the LKML to fix
> Documentation/devicetree/bindings/reserved-memory/xen,shared-
> memory.txt
> so that it clearly states that xen,offset is optional. I don't know if Rob 
> would
> accept such a patch without changing the version in the compatible string.
> 
> Given the release deadline, I would go with 1). We can always remove it once
> it becomes clearly optional.



 


Rackspace

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