From nobody Thu Sep 19 01:37:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1716554499623918.8783623591489; Fri, 24 May 2024 05:41:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.729486.1134692 (Exim 4.92) (envelope-from ) id 1sAUEX-00015Q-Ks; Fri, 24 May 2024 12:41:17 +0000 Received: by outflank-mailman (output) from mailman id 729486.1134692; Fri, 24 May 2024 12:41:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sAUEX-00014Q-8P; Fri, 24 May 2024 12:41:17 +0000 Received: by outflank-mailman (input) for mailman id 729486; Fri, 24 May 2024 12:41:15 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sAUEV-00082M-CV for xen-devel@lists.xenproject.org; Fri, 24 May 2024 12:41:15 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id e7f8bfe5-19ca-11ef-90a1-e314d9c70b13; Fri, 24 May 2024 14:41:14 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8970B169C; Fri, 24 May 2024 05:41:37 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 63B653F641; Fri, 24 May 2024 05:41:12 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e7f8bfe5-19ca-11ef-90a1-e314d9c70b13 From: Luca Fancellu To: xen-devel@lists.xenproject.org Cc: Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Penny Zheng Subject: [PATCH v4 7/7] xen/docs: Describe static shared memory when host address is not provided Date: Fri, 24 May 2024 13:40:55 +0100 Message-Id: <20240524124055.3871399-8-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240524124055.3871399-1-luca.fancellu@arm.com> References: <20240524124055.3871399-1-luca.fancellu@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1716554499824100007 Content-Type: text/plain; charset="utf-8" From: Penny Zheng This commit describe the new scenario where host address is not provided in "xen,shared-mem" property and a new example is added to the page to explain in details. Take the occasion to fix some typos in the page. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - Add Michal R-by v1: - patch from https://patchwork.kernel.org/project/xen-devel/patch/20231206= 090623.1932275-10-Penny.Zheng@arm.com/ with some changes in the commit message. --- docs/misc/arm/device-tree/booting.txt | 52 ++++++++++++++++++++------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-t= ree/booting.txt index bbd955e9c2f6..ac4bad6fe5e0 100644 --- a/docs/misc/arm/device-tree/booting.txt +++ b/docs/misc/arm/device-tree/booting.txt @@ -590,7 +590,7 @@ communication. An array takes a physical address, which is the base address of the shared memory region in host physical address space, a size, and a gue= st physical address, as the target address of the mapping. - e.g. xen,shared-mem =3D < [host physical address] [guest address] [siz= e] > + e.g. xen,shared-mem =3D < [host physical address] [guest address] [siz= e] >; =20 It shall also meet the following criteria: 1) If the SHM ID matches with an existing region, the address range of= the @@ -601,8 +601,8 @@ communication. The number of cells for the host address (and size) is the same as the guest pseudo-physical address and they are inherited from the parent n= ode. =20 - Host physical address is optional, when missing Xen decides the locati= on - (currently unimplemented). + Host physical address is optional, when missing Xen decides the locati= on. + e.g. xen,shared-mem =3D < [guest address] [size] >; =20 - role (Optional) =20 @@ -629,7 +629,7 @@ chosen { role =3D "owner"; xen,shm-id =3D "my-shared-mem-0"; xen,shared-mem =3D <0x10000000 0x10000000 0x10000000>; - } + }; =20 domU1 { compatible =3D "xen,domain"; @@ -640,25 +640,36 @@ chosen { vpl011; =20 /* - * shared memory region identified as 0x0(xen,shm-id =3D <0x0>) - * is shared between Dom0 and DomU1. + * shared memory region "my-shared-mem-0" is shared + * between Dom0 and DomU1. */ domU1-shared-mem@10000000 { compatible =3D "xen,domain-shared-memory-v1"; role =3D "borrower"; xen,shm-id =3D "my-shared-mem-0"; xen,shared-mem =3D <0x10000000 0x50000000 0x10000000>; - } + }; =20 /* - * shared memory region identified as 0x1(xen,shm-id =3D <0x1>) - * is shared between DomU1 and DomU2. + * shared memory region "my-shared-mem-1" is shared between + * DomU1 and DomU2. */ domU1-shared-mem@50000000 { compatible =3D "xen,domain-shared-memory-v1"; xen,shm-id =3D "my-shared-mem-1"; xen,shared-mem =3D <0x50000000 0x60000000 0x20000000>; - } + }; + + /* + * shared memory region "my-shared-mem-2" is shared between + * DomU1 and DomU2. + */ + domU1-shared-mem-2 { + compatible =3D "xen,domain-shared-memory-v1"; + xen,shm-id =3D "my-shared-mem-2"; + role =3D "owner"; + xen,shared-mem =3D <0x80000000 0x20000000>; + }; =20 ...... =20 @@ -672,14 +683,21 @@ chosen { cpus =3D <1>; =20 /* - * shared memory region identified as 0x1(xen,shm-id =3D <0x1>) - * is shared between domU1 and domU2. + * shared memory region "my-shared-mem-1" is shared between + * domU1 and domU2. */ domU2-shared-mem@50000000 { compatible =3D "xen,domain-shared-memory-v1"; xen,shm-id =3D "my-shared-mem-1"; xen,shared-mem =3D <0x50000000 0x70000000 0x20000000>; - } + }; + + domU2-shared-mem-2 { + compatible =3D "xen,domain-shared-memory-v1"; + xen,shm-id =3D "my-shared-mem-2"; + role =3D "borrower"; + xen,shared-mem =3D <0x90000000 0x20000000>; + }; =20 ...... }; @@ -699,3 +717,11 @@ shared between DomU1 and DomU2. It will get mapped at = 0x60000000 in DomU1 guest physical address space, and at 0x70000000 in DomU2 guest physical address = space. DomU1 and DomU2 are both the borrower domain, the owner domain is the defa= ult owner domain DOMID_IO. + +For the static shared memory region "my-shared-mem-2", since host physical +address is not provided by user, Xen will automatically allocate 512MB +from heap as static shared memory to be shared between DomU1 and DomU2. +The automatically allocated static shared memory will get mapped at +0x80000000 in DomU1 guest physical address space, and at 0x90000000 in Dom= U2 +guest physical address space. DomU1 is explicitly defined as the owner dom= ain, +and DomU2 is the borrower domain. --=20 2.34.1