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

Re: [Minios-devel] [UNIKRAFT early RFC PATCH 06/11] plat/kvm: arm64: Add a parameter to start_mmu



Hi,

On 21/06/2019 07:57, Jia He wrote:
This is to bypass invalidate and clean pgtable D-cache. This is not
required when APs are booting up.

Signed-off-by: Jia He <justin.he@xxxxxxx>
---
  plat/kvm/arm/entry64.S     | 1 +
  plat/kvm/arm/pagetable64.S | 7 ++++++-
  2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/plat/kvm/arm/entry64.S b/plat/kvm/arm/entry64.S
index ff63ee0..df59ef6 100644
--- a/plat/kvm/arm/entry64.S
+++ b/plat/kvm/arm/entry64.S
@@ -125,6 +125,7 @@ ENTRY(_libkvmplat_entry)
        msr VBAR_EL1, x29
/* Enable the mmu */
+       mov x7, #0

Please try to document as much as possible assembly code. For instance, you set x7 here but it is used later in a different function. The diff of the patch makes it clear to understand. However, if you look at the code itself then it becomes impossible to find.

In this context, I think it would be best if start_mmu() is split in two functions. The boot CPU would call the two functions, while the secondary CPU would only call the one.

        bl start_mmu
/* Load dtb address to x0 as a parameter */
diff --git a/plat/kvm/arm/pagetable64.S b/plat/kvm/arm/pagetable64.S
index 7899c19..abb024f 100644
--- a/plat/kvm/arm/pagetable64.S
+++ b/plat/kvm/arm/pagetable64.S
@@ -36,6 +36,8 @@
  #include <uk/asm.h>
  #include <kvm-arm/mm.h>
  #include <arm/cpu_defs.h>
+#include <uk/config.h>
+
  /*
   * The following is the Memory Layout of AArch64 Virtual Machine
   * | 0 - 0x3FFFFFFF |   0x40000000 - 0x7FFFFFFFFF           |  512GB - 1TB   |
@@ -234,6 +236,9 @@ ENTRY(start_mmu)
        bfi x2, x3, #32, #3
        msr tcr_el1, x2
+ cmp x7, #1
+       beq 1f
+
        /* save lr */
        mov x22, x30
@@ -262,7 +267,7 @@ ENTRY(start_mmu) /* restore lr */
        mov x30, x22
-
+1:
        ret
  END(start_mmu)

--
Julien Grall

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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