Code Monkey home page Code Monkey logo

Comments (11)

oxsignal avatar oxsignal commented on July 21, 2024 1

ARM kernel을 사용하면서 qemu를 사용할 시 CPU를 4/8개 쓰면 버그가 발생하는 이슈가 있었습니다. 겨우 찾았네요.
(Default run script가 cpu를 4개 사용합니다.)

Issue

CPU 개수를 수정하고 running하니 잘 동작합니다.

$ ./scripts/run.py -c 3 --arch=aarch64 -e 'hello'
OSv v0.56.0-156-g45ff7d3a
eth0: 192.168.122.15
Booted up in 1220.63 ms
Cmdline: hello
Hello World

다음 step은 RMM porting입니다.

from islet.

oxsignal avatar oxsignal commented on July 21, 2024

위 List는 Slack에 올린 여러가지 unikernel 중, 현재 islet에 porting하기 위해

KVMAARCH64 kernel을 지원하는 목록입니다. 몇년간 maintain되지 않은 project들은 제외하였습니다.

  1. 세 OS모두 AARCH64로 kernel을 compile가능함
  2. Doc은 Osv, rusty-hermit이 잘 되어있음. Osv의 경우 docker처럼 unikernel 전용 application의 compile 환경을 제공함 (https://github.com/cloudius-systems/capstan)
  3. 본격 porting 전 hello world example 구동해볼 예정 / 현재 환경 셋업중인데, kernel 등 dependencies 해결 중
  4. 각 OS 모두 thread-safe한지 확인필요

from islet.

oxsignal avatar oxsignal commented on July 21, 2024

Progress update - Osv

  • ARM용 unikernel image build
  • ARM용 unikernel application build
  • Application test: 다양한 test application이 있는데, 하나같이 오류가 나서 debugging중입니다

Unikernel들은 대부분 single-application / single thread를 지원합니다.
OSv는 thread-safe하지만 spin-lock 대신 lock-free이라는 독특한 algorithm을 사용합니다.

from islet.

oxsignal avatar oxsignal commented on July 21, 2024

Osv unikernel을 가져와서 작동시켰더니 PAS 할당 시 에러가 납니다. 각 realm의 PAS 영역을 수동적으로 할당해줘서 생긴 문제 같은데, Unikernel에서는 memory mappuing구조가 어떻게 되는지 확인할 예정입니다.

from islet.

bokdeuk-jeong avatar bokdeuk-jeong commented on July 21, 2024
  • SMP 동작을 위해 더 구현해줘야 하는 부분이 있습니다. realm으로 실행하실 때 qemu에 cpu는 1개만 지정하시겠어요?
  • realm의 PAS영역을 수동으로 지정하지는 않습니다. IPA는 qemu가 결정하고, IPA에 대응되는 PA는 KVM이 결정을 하고 있어요.
    IPA->PA 를 매핑해 줄 때 PA granule 그대로 GPT에 PAS 업데이트해 주고 있어요.
    qemu에서 unikernel이 동작했다면 PAS 문제는 아닐 거 같습니다.

from islet.

oxsignal avatar oxsignal commented on July 21, 2024
  • 제공하신 guest 에서 실행하는 qemu는 따로 cpu 개수를 수정하지 않았습니다. 일단 1개는 오류가 없는것으로 확인했습니다.
  • OSv의 경우 single address space를 사용하는데, 해당 영역이 어디인지, 어떻게 할당되는지 확인해보겠습니다.

from islet.

oxsignal avatar oxsignal commented on July 21, 2024

정상적인 Kernel image에서도 같은 오류 message가 뜨는것을 확인했습니다.
Guest

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
[INFO]fvp::entry -- Initialized the console!
[INFO]fvp::entry -- pa range is 48
[INFO]fvp -- booted on core  0 with EL2!
[INFO]fvp -- booted on core  1 with EL2!
[INFO]fvp -- booted on core  2 with EL2!
[INFO]fvp -- booted on core  3 with EL2!
[INFO]fvp -- booted on core  4 with EL2!
[INFO]fvp -- booted on core  5 with EL2!
[INFO]fvp -- booted on core  6 with EL2!
[INFO]fvp -- booted on core  7 with EL2!
[INFO]armv9a::rmi::realm -- received VMCreate
[INFO]armv9a::rmi::realm -- create VM 0
[INFO]armv9a::rmi::realm -- received VMCreate
[INFO]armv9a::rmi::realm -- create VM 1
[WARN]armv9a::rmi::realm -- failed to set GPT 8857DD000

rmm

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
ERROR:   RMMD: PAS Transition failed. GPT ret = -22, PA: 0x8857dd000, FID = 0xc40001b0

문제는 해당 message이후로 hang이 걸립니다. Osv Image같은 경우 hello message를 출력하거나 오류메시지가 나와야 되는데 해당 메시지가 나오기 전에 Hang이 걸리는것 같네요.

  • 추가로, Osv에 console driver가 있는 것을 확인했습니다.

from islet.

bokdeuk-jeong avatar bokdeuk-jeong commented on July 21, 2024

네 확인해 주셔서 감사합니다. 뭐가 잘못 됐는지 확인할께요.

from islet.

oxsignal avatar oxsignal commented on July 21, 2024

osv상에서 간단한 webassembly example을 한번 작동시켜 보겠습니다.

이후 JVM, multithread test까지 완료되면 다른 benchmark suit도 시도해보면 될 것 같습니다.

다음 step으로, 아직 islet에서 해결되지 않은 issue들을 한번 살펴보고, kernel과 유저가 메모리를 공유하는 환경에서

해당 Issue들과 관계는 없는지 확인해야 될 것 같습니다.

from islet.

bokdeuk-jeong avatar bokdeuk-jeong commented on July 21, 2024

@oxsignal 건우님,
bootloader 쪽 코드가 제가 사용하던 버전과 올라온 버전이 다릅니다. ㅠㅠ
trusted-firmware-a 프로젝트가 코드가 자주 바뀌면서 각 sw stack(bl1, bl2, bl31, normal world, secure world 등)이 사용하는 메모리 레이아웃이 좀 달라진거 같습니다. 찬찬히 들여다보고 fix를 하겠습니다. (단순히 제가 사용하는 커밋으로 checkout을 했는데도 코드가 다르네요...)
제가 코드를 fix하는 동안, https://github.com/Samsung/islet-asset/tree/debug/prebuilt/tf-a 에 올라온 bin 파일들을 commit 메시지에 나온 대로 islet/trusted-firmware-a/build/fvp/debug/ 에 overwite하신 다음 다시 실행해 보시겠어요?
다시 빌드 하셔야 합니다.

./script/fvp-cca -bo -nw linux -vm linux
./script/fvp-cca -ro -nw linux -vm linux

from islet.

bokdeuk-jeong avatar bokdeuk-jeong commented on July 21, 2024

islet main에 반영했습니다.(위에 남긴 커멘드는 무시하셔도 됩니다.) 기존 디렉토리 삭제하신 후 다시 빌드 하시겠어요?

rm -rf upstream-trusted-firmware
rm -rf trusted-firmware
git checkout upstream-trusted-firmware
./script/init.sh
./script/fvp-cca -bo -nw linux -vm linux
./script/fvp-cca -ro -nw linux -vm linux

from islet.

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.