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

Re: [Viryaos-discuss] [ImageBuilder] [PATCH 2/2] uboot-script-gen: Enable direct mapping of statically allocated memory


  • To: xenia <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Thu, 23 Jun 2022 14:59:43 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=irgGec9J5jV8MZAKDoUKDvKV/B3cNRwReIAzNSHrDR0=; b=YOq7O4MW5i6TRqgotq1qJhZRRt5wRTBUbmVF9RIAkIp1UVB4K6p8/UG8Bl8kFM2TtYyQ4gwQyFEAYMKLfnhq00FxgxW53VUGAZANsONjEvKK1sDQ9ui8nOIwUMCPvqfbRdZrtjZQ0L3dxhFBsyGLAUYIMTyCE4iviXS+5pJF5JUUJ3/XARoBInxOhAwxpGCLg0x33WRghjyMigyq1SzOHczYSKplgdUObOSHzJOJ+xMlLp3sh781qAH+1Jg45uFlFA/c1oPxpGDvTQtMhpwNWRaSX7lfOn+0n797tJ0y0B0VPYDFHgdeYz3Wm8jXZRW80aMLpiw8CGudPNhw3Zv7IQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jN6la/mCoowuHpRJqrZVK6d7Pg9CxGu3lb2ceoGgDa/poIzbKgVK0kPjRoKlPqxQ3o9j4bh3wNnKCdzXQyyHNAyzl2JuvxTjVywWncNtSXgiRmujHfwQSAS7Z9PaBEY/T9DogCb0bZ1M2De0WSR6piwaHmrXaBDft70ANSIz+SKRXv7ehU+H1e0sPS+YJ/Pl/38DuinssKRpXboRQYNQwj7TJPgYb9zGp7ZMSmCzqyb8hyun3vKgM735vdi/6f72a+cPi4LglyyIlkTn1uWFcggXs97j4BQDe0DUtncUaxufdk554roEd1y4UOOlwd5pfsNom7FXhlJAynFX8p9T5w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: viryaos-discuss@xxxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 23 Jun 2022 13:59:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 23/06/2022 13:05, xenia wrote:
Hi Ayan!
Hi Xenia,

On 6/23/22 13:02, Ayan Kumar Halder wrote:
(Resending mail, as the previous delivery failed)

On 21/06/2022 12:34, Ayan Kumar Halder wrote:
Hi,

On 19/06/2022 13:43, Xenia Ragiadakou wrote:
Direct mapping for dom0less VMs is disabled by default in XEN and can be
enabled through the 'direct-map' property.
Add a new config parameter DOMU_DIRECT_MAP to be able to enable or disable
direct mapping, i.e set to 1 for enabling and to 0 for disabling.
This parameter is optional. Direct mapping is enabled by default for all
dom0less VMs with static allocation.

The property 'direct-map' is a boolean property. Boolean properties are true
if present and false if missing.
Add a new data_type 'bool' in function dt_set() to setup a boolean property.

Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
---
  README.md                |  4 ++++
  scripts/uboot-script-gen | 18 ++++++++++++++++++
  2 files changed, 22 insertions(+)

diff --git a/README.md b/README.md
index c52e4b9..17ff206 100644
--- a/README.md
+++ b/README.md
@@ -168,6 +168,10 @@ Where:
    if specified, indicates the host physical address regions
    [baseaddr, baseaddr + size) to be reserved to the VM for static allocation.
  +- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
+  If set to 1, the VM is direct mapped. The default is 1.
+  This is only applicable when DOMU_STATIC_MEM is specified.

Can't we just use $DOMU_STATIC_MEM to set "direct-map" in dts ?

Is there a valid use-case for static allocation without direct mapping ? Sorry, it is not very clear to me.

Thank you for taking the time to review the patch!

I agree with you that static allocation without direct mapping is not a common configuration, that's why, in the script, direct mapping is enabled by default.

My reasoning was that, since direct mapping is not enabled by default in XEN for all domUs with static allocation but instead requires the 'direct-map' property to be present in the domU dt node, then such a configuration is still valid. I thought that with this parameter it is much easier to setup (and test) both configurations.

Thanks for the explanation. This makes sense to me. :)

In this case, can we remove the below snippet from your patch.

+        if test -z "${DOMU_DIRECT_MAP[$i]}"
+        then
+ DOMU_DIRECT_MAP[$i]=1
+        fi

The reason being if the user wants to set 'direct-map' prop in dts, then the user can specify it in the config. Else, (by default) the direct-map will be set to false. This is inline with XEN's behavior as you described above.

- Ayan

- Ayan



Xenia




 


Rackspace

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