[rtems commit] bsp/qoriq: Do not touch MMU as hypervisor guest
Sebastian Huber
sebh at rtems.org
Tue Sep 12 08:01:45 UTC 2017
Module: rtems
Branch: master
Commit: 0ce5bfb984724a6034be7ca8ff7f7a5b4ab39925
Changeset: http://git.rtems.org/rtems/commit/?id=0ce5bfb984724a6034be7ca8ff7f7a5b4ab39925
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Sep 8 10:50:08 2017 +0200
bsp/qoriq: Do not touch MMU as hypervisor guest
Update #3085.
---
c/src/lib/libbsp/powerpc/qoriq/start/start.S | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/c/src/lib/libbsp/powerpc/qoriq/start/start.S b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
index dec1f95..ce57b20 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/start/start.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
@@ -22,7 +22,7 @@
#include <rtems/score/percpu.h>
-#include <bspopts.h>
+#include <bsp.h>
#include <libcpu/powerpc-utility.h>
@@ -177,7 +177,7 @@ _start:
isync
#endif
-#ifdef QORIQ_INITIAL_HID0
+#if defined(QORIQ_INITIAL_HID0) && !defined(QORIQ_IS_HYPERVISOR_GUEST)
/* HID0 initialization */
LWI r0, QORIQ_INITIAL_HID0
mtspr HID0, r0
@@ -200,6 +200,13 @@ _start:
.Linitmore:
mflr SAVED_LINK_REGISTER
+#ifdef QORIQ_IS_HYPERVISOR_GUEST
+ /* MSR initialization with guest state */
+ LWI INITIAL_MSR, QORIQ_INITIAL_MSR
+ oris r0, INITIAL_MSR, MSR_GS >> 16
+ mtmsr r0
+ isync
+#else
/* Invalidate all TS1 MMU entries */
li r3, 1
bl qoriq_tlb1_invalidate_all_by_ts
@@ -221,6 +228,7 @@ _start:
ori r0, INITIAL_MSR, MSR_IS | MSR_DS
mtmsr r0
isync
+#endif
/*
* Initialize start stack. Make sure that we do not share a cache line
@@ -240,6 +248,7 @@ _start:
blr
.Linitmmu:
+#ifndef QORIQ_IS_HYPERVISOR_GUEST
mflr SAVED_LINK_REGISTER
/* Configure MMU */
@@ -254,6 +263,7 @@ _start:
PPC64_NOP_FOR_LINKER_TOC_POINTER_RESTORE
mtlr SAVED_LINK_REGISTER
+#endif
blr
#ifdef INITIALIZE_FPU
More information about the vc
mailing list