From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrii Anisov Subject: Re: [PATCH V4] xen/arm: domain_build: allocate lowmem for dom0 as much as possible Date: Fri, 11 Nov 2016 13:35:27 +0200 Message-ID: References: <1474599334-30709-1-git-send-email-peng.fan@nxp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4306666259067137474==" Return-path: In-Reply-To: <1474599334-30709-1-git-send-email-peng.fan@nxp.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Peng Fan Cc: van.freenix@gmail.com, Julien Grall , Stefano Stabellini , wei.liu2@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============4306666259067137474== Content-Type: multipart/alternative; boundary=089e010d829c038a2b054104e377 --089e010d829c038a2b054104e377 Content-Type: text/plain; charset=UTF-8 Sorry for the late intrusion into this discussion. I would introduce my vision of the issues behind the 32 bits addressing DMA controllers in ARMv7/v8 SoCs. On AArch64 SoCs, some IPs may only have the capability to access > 32 bits address space. The physical memory assigned for Dom0 maybe > not in 4GB address space, then the IPs will not work properly. > So need to allocate memory under 4GB for Dom0. > IMHO that is a wrong approach. Unfortunately the problem is much bigger. Normally you would need to run guest domains as well. With at least PV Block and PV NET drivers. Due to the fact that PV drivers made in a way that DMA controller at last will work with DomU's pages, those pages should be from below 4GB. So any DomU running PV drivers should have some amount of pages from below 4GB. Moreover, the OS running in DomU should be knowing that only those pages are DMA-able, and that PV drivers should be working with DMA-able pages only: I.e. pages should be mapped correspondingly into different banks under and over 4GB. The approach, I believe is more suitable, is to specify explicitly an amount of RAM below 4GB and above 4GB for any domain. For dom0 through xen command line, for domU through domain configuration file. Such approach was implemented by GL. You can find preliminary patches over here: https://lists.xen.org/archives/html/xen-devel/2016-05/msg01785.html https://lists.xen.org/archives/html/xen-devel/2016-05/msg01786.html . I really hope GL will decide to tailor and upstream the feature. I am undecided whether this should be considered as a bug fix for Xen 4.8. > Are you aware of any ARM64 platform we currently support requiring > allocation of memory below 4GB? That is not only ARM64 problem. Any ARMv7/v8 based platform having no IOMMU supported (or owned) by XEN with 32-bit DMA controllers and RAM over 4GB will suffer from this problem. From living products: new J6 EVM with 4GB RAM, Salvator-X. Sincerely, Andrii Anisov. --089e010d829c038a2b054104e377 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry for the late intrusion into this discussion. I would= introduce my vision of the issues behind the 32 bits addressing DMA contro= llers in ARMv7/v8 SoCs.

On AArch64 SoCs, some IPs may only have the capability to= access
32 bits address space. The physical memory assigned for Dom0 may= be
not in 4GB address space, then the IPs will not work properly.
So = need to allocate memory under 4GB for Dom0.
IMHO that = is a wrong approach. Unfortunately the problem is much bigger. Normally you= would need to run guest domains as well. With at least PV Block and PV NET= drivers. Due to the fact that PV drivers made in a way that DMA controller= at last will work with DomU's pages, those pages should be from below = 4GB.=C2=A0
So any DomU running PV drivers should have some amount= of pages from below 4GB. Moreover, the OS running in DomU should be knowin= g that only those pages are DMA-able, and that PV drivers should be working= with DMA-able pages only: I.e. pages should be mapped correspondingly into= different banks under and over 4GB.
<= br>
The approach, I believe is more suitabl= e, is to specify=C2=A0explicitly=C2=A0an amount of RAM below 4GB and above = 4GB for any domain. For dom0 through xen command line, for domU through dom= ain configuration file.

Such approach was implemented by GL. You can find prelimi= nary patches over here:=C2=A0https://lists.xen.org/archives/html/xen-d= evel/2016-05/msg01785.html=C2=A0https://lists.xen.org/archives/htm= l/xen-devel/2016-05/msg01786.html .
I r= eally hope GL will decide to tailor and upstream the feature.

I am undecided whether this should be considered as a bug fix for Xen 4= .8. Are you aware of any ARM64 platform we currently support requiring allo= cation of memory below 4GB?=C2=A0
That is not only ARM64 p= roblem. Any ARMv7/v8 based platform having no IOMMU supported (or owned) by= XEN with 32-bit DMA controllers and RAM over 4GB will suffer from this pro= blem. From living products: new J6 EVM with 4GB RAM, Salvator-X.=C2=A0

Sincerely,
Andrii Anisov.
--089e010d829c038a2b054104e377-- --===============4306666259067137474== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============4306666259067137474==--