Giter Site home page Giter Site logo

khypervisor's Introduction

Hypervisor for ARMv7 Virtualization Extensions

Basic directory structure

  • hypervisor Contains the real time hypervisor source code.

    • hvc call for manual guest switching
    • LPAE stage 2 address translation
    • Interrupt Handling through GICv2
    • Generic Timer and Scheduler (Round-robin)
  • platform-device Contains the device starting point.

    • common common interface source code.
    • cortex_a15x2_arndale based on arndale board code.
      • config Contains the platform specific configuration files.
      • drivers Contains the platform specific driver for hypervisor.
      • guestbl Contains the guest bootloader.
      • guestimages Contains the guest images.
      • guestos Contains the guest os source code.
    • cortex_a15x2_rtsm based on rtsm fastmodels code.
      • config Contains the platform specific configuration files.
      • drivers Contains the platform specific drivers for hypervisor.
      • guestbl Contains the guest bootloader.
      • guestimages Contains the guest images.
      • guestos Contains the guest os source code.

The easiest way to use k-hypervisor is to start with one of the pre-configured platform-device projects (locate in the platform-device/<device_name> directory).

See also - arndale port : https://github.com/kesl/khypervisor/tree/v1/platform-device/cortex_a15x2_arndale rtsm port : https://github.com/kesl/khypervisor/tree/v1/platform-device/cortex_a15x2_rtsm

khypervisor's People

Contributors

beomjun avatar felixonmars avatar hyeji avatar igxactly avatar in1004kyu avatar joohyun0115 avatar kesl avatar mijong avatar simonkim avatar wonseok avatar xiane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

khypervisor's Issues

directory restructuring required for proto2-arndale branch

  • board depended code under boards/arndale looks good
  • directory for soc (exynos 5250) depended code seems to be necessary
    • How about socs/exynos/ ?
  • boot.S and boards/arndale/boot.S share common code too much
    • Suggestions: use the same source file: boot.S
    • Define configuration parameters such as
      • CONFIG_GIC_BASEADDR
      • CONFIG_EXYNOS5250, CONFIG_GENERIC_CA15
  • model.lds.S and boards/arndale/model.lds.S share common structure
    • Suggenstion: use the same file - model.lds.S
    • Define configuration parameters such as
    • CONFIG_MEM_PHYS_OFFSET
    • CONFIG_MEM_MON_OFFSET
    • CONFIG_MEM_GUEST_OFFSET
    • CONFIG_GUEST2_OFFSET
  • UART driver
    • Suggestion: Keep the same header file : uart_print.h
    • Separate uart driver files for different uart hardwares
    • Define configuration parameters such as
    • CONFIG_UART_BASEADDR or such
  • Device Drivers such as MCT
    • Suggestion: new directories for device depended code
      • devices/generic/ - gic, generic timer and such
      • devices/exynos5250/ - mct
      • devices/arndale/

Guest pc, lr의 data abort 핸들링 이슈

hyp_hvc_service 루틴에서
srt가 14(lr), 15(pc)인 경우에 대해서 처리가 안 되어 있음.

guest 가 아래 와 같은 어셈블리를 수행하는 중 Data abort 가 발생하면
add pc r0 #(데이타 어보트 주소)

하이퍼바이저가 게스트의 PC, LR 값을 제대로 핸들링 할수 없음.
라즈베리포팅에서 생긴 이슈

enum hyp_hvc_result _hyp_hvc_service(struct arch_regs *regs)
{
,,,,
srt = (iss & ISS_SRT_MASK) >> ISS_SRT_SHIFT;

// 아래코드는 임시방편으로 만든 코드
if (srt == 14)
info.value = &data;
else if (srt == 15)
info.value = &(regs->pc);
else
info.value = &(regs->gpr[srt]);

Guest 1 Launching fails with invalid cpu state (Guest 0 cpu state remains) since VGIC

commit: 31c93d5 (Branch proto2)

When Guest 1 Launched first time, IRQ exception occurs even before executing the first instruction a 0x00000000 (IPA)
Hyp mode then trapped with Data Abort

Observed cause:

  • While Guest 0 is running
  • Hyp mode receives the first NS Physical Timer interrupt and it injects a VIRQ to the current guest
  • And then context switching to Guest 1triggered by Hyp
    • VGIC restore does not happen since it's never been saved
    • This causes VGIC state of Guest 0 remains which will be viewed in Guest 1
  • The context switching performed
    • No VBAR init/save/restore handling and it causes use of Guest 0's VBAR in Guest 1
    • and then Guest 1 jumps to IRQ exception vector address set in Guest 0, due to the remained VGIC state triggers the VIRQ intended for Guest 0 by Hyp

Possible Solution

  • Maintain init/save/restore of VBAR and VGIC correctly in guest context switching code of Hypervisor
    • Initial VGIC state for guest launching case
    • Initialize and save/restore VBAR for each guest

Serial console issue for the arndale 5250.

Dear all,

I am currently trying to run the khypervisor on my arndale 5250, I compiled/built the system exactly using the steps documented on github (for different guests linux, bm, linaro), However, I am not able to see any output on the console. The system hangs at "starting application at : ". In all cases, the code in boot.S for UART seems weird (e.g. ldr r0, = 0x1c090000 which is for the versatile platform).

Could you please route me to a more recent/updated version of the code and the documentation. Please help me by pointing me to a reliable document on how to run the khypervisor on the arndale 5250.

Also what EXACT patches are required for u-boot, linux kernel, linaro kernel when running the khypervisor on the arndale? I am applying the patches explicitly.

Thank you so much and best regards.

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

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: )))

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.