Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KVM couldn't execute "str x11, [x13], #8" instruction when opt-level > 1 #604

Open
junsooo opened this issue Feb 25, 2022 · 0 comments
Open

Comments

@junsooo
Copy link
Contributor

junsooo commented Feb 25, 2022

KVM enabled 상태로 opt-level > 1 인 상태로 컴파일하고 실행하면,

error: kvm run failed Function not implemented
 PC=000000004001b864 X00=0000000000000000 X01=0000003ffff7f000
X02=0000000000001000 X03=0000000047f71000 X04=0060000000000400
X05=0000000040045128 X06=0000000000000000 X07=0000000000000000
X08=00000000000f4240 X09=00000000000f4240 X10=00000000a0a0a0a0
X11=0000000008006100 X12=0000000000000000 X13=0000000000000100
X14=0000000000006100 X15=0000000000000120 X16=0000000000000001
X17=0000000000000001 X18=0000000000000000 X19=0000000047fff000
X20=0000003fffffd000 X21=0000000040035868 X22=fffffffffff80000
X23=fffffffffff7e000 X24=0000000000000000 X25=0000000000000000
X26=0000000000000000 X27=0000000000000000 X28=0000000000000000
X29=0000000000000000 X30=000000004001e0e4  SP=0000000040046ee0
PSTATE=20000085 --C- EL1h

에러와 함께 부팅이 멈춥니다.
해당 에러를 gdb로 디버깅해보니, https://github.com/kaist-cp/rv6/blob/main/kernel-rs/src/arch/arm/intr/gicv3.rs#L1015 line에서
unsafe { write_d(self.base_addr + GICD_IROUTER + i * 8, affinity) };
해당 코드를 실행합니다. 이 코드는 어셈블리로 str x11, [x13], #8와 같이 번역되고, kvm이 이 어셈블리를 실행하지 못해 실행이 멈춥니다.

일단 임시 해결책은, asm! 을 이용해 해당 어셈블리 형태로 만들지 않도록 강제하는 방식을 채택했습니다. + 주석에 작성해놓았습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant