Coder Social home page Coder Social logo

Comments (4)

MrVan avatar MrVan commented on September 17, 2024

When blx r3 which is the instruction which cause system hangs. Seems this is cache or mmu set issue. Still have no clear idea.


movw r3, #35e5
movt r3, #9c10
blx r3 --> system hangs

from optee_os.

jenswi-linaro avatar jenswi-linaro commented on September 17, 2024

Without LPAE ttbr0 is only supposed to cover low address (<= 32 MiB), perhaps TTBCR.N isn't 7.

from optee_os.

MrVan avatar MrVan commented on September 17, 2024

Hi Jens,

I have found the root cause. Actually TTBCR.N is 7. We should first clear the tbl_info.table before fill mmu entries. From my debug info, the first entry is leaved and not set. So when set ttbr0, it corrupts system and hangs. After the following piece of code, all is fine.


diff --git a/core/arch/arm/mm/core_mmu_v7.c b/core/arch/arm/mm/core_mmu_v7.c
index 0ea0da3..10ed12b 100644
--- a/core/arch/arm/mm/core_mmu_v7.c
+++ b/core/arch/arm/mm/core_mmu_v7.c
@@ -379,6 +379,13 @@ static paddr_t populate_user_map(struct tee_mmu_info *mmu)
tbl_info.shift = SECTION_SHIFT;
tbl_info.num_entries = TEE_MMU_UL1_NUM_ENTRIES;

+ /*

  •    \* Need to clear the table before use, because there maybe junk
    
  •    \* data at tlb_info.table, which may corrupt system when set ttbr0
    
  •    */
    
  •   memset(tbl_info.table, 0x00,
    
  •          sizeof(unsigned long) \* tbl_info.num_entries);
    
  •   region.pa = 0;
      region.va = va_range_base;
      region.attr = 0;
    

from optee_os.

 avatar commented on September 17, 2024

Fix in #342

from optee_os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.