[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 Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Thu, 23 Jun 2022 11:02:28 +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=IiKyNOVJI2mz2xvxS4XSkjceT6GMKGp26YhVkTb5B1Q=; b=dofuDIDlcjvixTKg7pZQSija0850h2XFRFUm/Bq7DFEWRMNkSdeDjzsVYbu01gqCDoxhGoiCLiu80AYhL8xBzhPGyTUvLWn/henuc6Mv7fw9XM/Trl5GPapkPH06+ztXnLk4DLPqHDVzlc8yA6k97RTFI75YFKe3x5tX9qAuY/5v0XlbfvtF/1Ivr5wEOpFnbYLhNFS7IZtw8HM6wh37jNvEqYsHROO8nM/TQYA2sba4MJ9dwxu+0elPqToZH/yqt2PpZBlZyysWiiw/klDlQOsz94yhy5QO789QbzbNBWztqG7TMt9HTu9Rlfri3ykKsqyT4tnQyqAPiS6O53Pfdg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=niCB6CK+be5qMPInEHa254ZoOyZAGj5cOsf6RRo7xd8JTuPvWFwQW/k2JXgw7Rr3Hl8m6TMN8t7cADn23xaul6dGNiKrKIKon7fyO+sIOsB6faIYODvL2kwEvmCA4hWneXy5Udsg4xfGhigkDhR7/CBG32NKxKvjR7QDWzJtf+6lweDSlp/fR2OWjvKxGbn/cGLHq+DE89hIrxr5DFeCbqeyZnuZvqHtAcg72g3/UKywY9bZEmRUgC9qyyRTEjeT29hM/Ya4ThhKZ5vNP+l/byf5BqiRSadWHUtbvs5M1NSDPxfKhUp0c9ce8CgEGHy2NO94vuWET/ukofaW30a3PQ==
  • 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 10:08:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

(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.

- Ayan

+
  - LINUX is optional but specifies the Linux kernel for when Xen is NOT
    used.  To enable this set any LINUX\_\* variables and do NOT set the
    XEN variable.
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index bdc8a6b..e85c6ec 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -27,6 +27,7 @@ function dt_mknode()
  #   hex
  #   str
  #   str_a
+#   bool
  function dt_set()
  {
      local path=$1
@@ -49,6 +50,12 @@ function dt_set()
                  array+=" \"$element\""
              done
              echo "fdt set $path $var $array" >> $UBOOT_SOURCE
+        elif test $data_type = "bool"
+        then
+            if test "$data" -eq 1
+            then
+                echo "fdt set $path $var" >> $UBOOT_SOURCE
+            fi
          else
              echo "fdt set $path $var \"$data\"" >> $UBOOT_SOURCE
          fi
@@ -65,6 +72,12 @@ function dt_set()
          elif test $data_type = "str_a"
          then
              fdtput $FDTEDIT -p -t s $path $var $data
+        elif test $data_type = "bool"
+        then
+            if test "$data" -eq 1
+            then
+                fdtput $FDTEDIT -p $path $var
+            fi
          else
              fdtput $FDTEDIT -p -t s $path $var "$data"
          fi
@@ -206,6 +219,7 @@ function xen_device_tree_editing()
          if test "${DOMU_STATIC_MEM[$i]}"
          then
              add_device_tree_static_mem "/chosen/domU$i" "${DOMU_STATIC_MEM[$i]}" +            dt_set "/chosen/domU$i" "direct-map" "bool" "${DOMU_DIRECT_MAP[$i]}"
          fi
          dt_set "/chosen/domU$i" "vpl011" "hex" "0x1"
          if test "$DOM0_KERNEL"
@@ -470,6 +484,10 @@ function xen_config()
          then
              DOMU_CMD[$i]="console=ttyAMA0"
          fi
+        if test -z "${DOMU_DIRECT_MAP[$i]}"
+        then
+             DOMU_DIRECT_MAP[$i]=1
+        fi
          i=$(( $i + 1 ))
      done
  }



 


Rackspace

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