forked from project-oak/hafnium-verification
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wrap mutable states of VCpu with SpinLock (partially done) #39
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ocking. - One is in `api_vcpu_prepare_run` (by kaist-cp#22) - The other is in `api_spci_msg_recv` (from upstream)
…rrent vcpu is locked
`offset_of` is not powerful enough so we cannot correctly calculate the offset of nested fields.
jeehoonkang
reviewed
Aug 27, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 일단 코멘트 남깁니다.
- 이 PR은 제가 마무리할게요. 애써주셔서 감사합니다!
@jeehoonkang 제 생각이 따로 있는 것들에 대해서는 모두 댓글을 달았습니다. 감사합니다 (__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SpinLock
instead ofRawSpinLock
#20.VCpu
의interrupts
에 대한 락을 명시적으로 타입으로 나타냅니다.inner
로 만들고 기존의execution_lock
의 락을 가지도록 합니다.Cpu
의 내부 상태를 묶어서 기존의 락을 가지도록 합니다.Interrupts
에 넣습니다.api_switch_to_primary
를 바꾸어서 더 정리할 수 있을 듯 합니다.Mailbox
관련 함수도 따로 또 정리해야 합니다..SpinLockGuard::into_raw
#37.concurrent_save_store
가 느려졌던 문제(A test got slower afterapi_vcpu_prepare_run
was ported #10) 의 실제 원인이 이것인 걸로 보입니다.enable_and_pending_count
is not locked but accessed #26.이 PR은 아직 완성된 것은 아닙니다. 개인적인 생각으로는,
별로 좋은 생각이 아니었습니다.Cpu
의is_on
그리고lock
이 굉장히 수상합니다.is_on
을 수정할 때만 락을 거는 게 아니라 실제로 PSCI에 명령을 주고 완료될 때까지 걸려있어야 할 것 같아요.VCpuLockedPair
라는 이름과 그 방식이 너무 구려요. 더 좋은 방법을 생각해야 합니다.VCpuInner
는 락이 걸리면서 그 내부가 invalidate됩니다. 타입으로 나타내면 좋을 듯...?AtomicOption
따위가 없을까요?VCpuInner
의 락 (execution_lock)은 다른 하프늄의 락과 달리 하프늄을 벗어날 때 락이 걸려 있습니다. 지금은 문제가 없지만 한 VCPU가 Hafnium을 통해 다른 VCPU를 접근할 때는 매우 조심해야 합니다.VcpuInner
에 대한 락이 안 걸려 있는 지 수동으로 체크해야 합니다.