提交 0fa4a313 编写于 作者: M Marc Zyngier

KVM: arm64: Document why pause cannot be turned into a flag

It would be tempting to turn the 'pause' state into a flag.

However, this cannot easily be done as it is updated out of context,
while all the flags expect to only be updated from the vcpu thread.
Turning it into a flag would require to make all flag updates
atomic, which isn't necessary desireable.

Document this, and take this opportunity to move the field next
to the flag sets, filling a hole in the vcpu structure.
Reviewed-by: NFuad Tabba <tabba@google.com>
Reviewed-by: NReiji Watanabe <reijiw@google.com>
Signed-off-by: NMarc Zyngier <maz@kernel.org>
上级 54ddda91
...@@ -341,6 +341,15 @@ struct kvm_vcpu_arch { ...@@ -341,6 +341,15 @@ struct kvm_vcpu_arch {
/* State flags for kernel bookkeeping, unused by the hypervisor code */ /* State flags for kernel bookkeeping, unused by the hypervisor code */
u8 sflags; u8 sflags;
/*
* Don't run the guest (internal implementation need).
*
* Contrary to the flags above, this is set/cleared outside of
* a vcpu context, and thus cannot be mixed with the flags
* themselves (or the flag accesses need to be made atomic).
*/
bool pause;
/* /*
* We maintain more than a single set of debug registers to support * We maintain more than a single set of debug registers to support
* debugging the guest from the host and to maintain separate host and * debugging the guest from the host and to maintain separate host and
...@@ -394,9 +403,6 @@ struct kvm_vcpu_arch { ...@@ -394,9 +403,6 @@ struct kvm_vcpu_arch {
/* vcpu power state */ /* vcpu power state */
struct kvm_mp_state mp_state; struct kvm_mp_state mp_state;
/* Don't run the guest (internal implementation need) */
bool pause;
/* Cache some mmu pages needed inside spinlock regions */ /* Cache some mmu pages needed inside spinlock regions */
struct kvm_mmu_memory_cache mmu_page_cache; struct kvm_mmu_memory_cache mmu_page_cache;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册