kesl/khypervisor

Proto 2 on ARNDALE: SP(Stack Pointer) initialization in HYP mode

Closed this issue · 1 comments

Original Problem Description:

monitor.S 파일내에 trap_hvc에서 사용하는 push {sp, lr} 과 같이 stack을 사용해야하는 명령어의 경우 해당 명령어의 수행 이전에 해당 명령어가 수행되는 CPU모드의 SP(stack pointer)가 초기화 되어야 함.
현재 HYP mode에서 sp를 사용하려고하나 해당 부분의 초기화가 되지 않는 문제 발생.
(해당 부분의 문제는 에뮬레이터 사용시 발생하지 않는 것으로 추측)

Suggested Correction:

Commit: 92a1553
In trap_hvc: monitor/monitor.S,
push {sp, lr} et al, causes use of a random address as Stack Pointer due to uninitialized SP in Hyp Mode. It might not have show an issue with FastModels for some reason.

However, on Arndale board, where DRAM physical address range is : 0x6000_0000 ~ 0xC000_0000, a problem occurs.

((( DESCRIBE THE PROBLEM YOU HAVE FACED HERE. For Example: Data Abort trapped into Hyp Mode from Hyp Mode when it attempts the first push of trap_hvc: )))

@Wonseok Please review https://github.com/kesl/khypervisor/pull/7/files and see if it makes sense for you.
monitor_secure.S is one of the newly added file and __mon_enter_hyp and trap_hyp_entry are where the fix is manly applied.

Before merging, please test it to see if this fixes the problem. Any comments are welcome.