This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How MMU work In ARMv8 to prevent Access to EL1 virtual address from EL0

Hello,

I got a little problem in ARMv8's MMU.

Obviously, when we access the kernel virtual address in application such as :

    unsigned long *p = 0xffffffff28008000;
    unsigned long x = *p;
    *p = 1;

The application will be killed by kernel and then reports "segment fault".

But What the actual action does by MMU in ARMv8? When does it find the permission fault?

In the first time it gets the VA? OR when MMU obtains the value from the TTBR1_EL1? OR at the time when MMU translates the table and gets some descriptor which determines the permission?

Parents
  • Thanks for your answer.

    In my circumstance, I just use Linux OS. And I made a module to check what TCR_EL1's value is. I found that in my processor, the TCR_EL1.E0PD1 ==0 and TCR_EL1.EPDn==0. And in my test_module,  I Set the page table descriptor (translated from TTBR1_EL1) 's AP filed  to be 0b01 (means allow user rw).

    But after all of things done, I still get "segment fault" when access kernel virtual address in user application.

    So, I still have this question.

Reply
  • Thanks for your answer.

    In my circumstance, I just use Linux OS. And I made a module to check what TCR_EL1's value is. I found that in my processor, the TCR_EL1.E0PD1 ==0 and TCR_EL1.EPDn==0. And in my test_module,  I Set the page table descriptor (translated from TTBR1_EL1) 's AP filed  to be 0b01 (means allow user rw).

    But after all of things done, I still get "segment fault" when access kernel virtual address in user application.

    So, I still have this question.

Children