Skip to content

Commit 1968ae3

Browse files
author
Lai Jiangshan
committed
KVM: X86/PVM: Add assertion for PVM_EVENT_FLAGS_IF
The code uses the fact that PVM_EVENT_FLAGS_IF == X86_EFLAGS_IF, but it is better to have the assertion before using it. Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
1 parent 36cc29e commit 1968ae3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/x86/kvm/pvm/pvm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,6 +2791,7 @@ static fastpath_t pvm_vcpu_run(struct kvm_vcpu *vcpu)
27912791
* directly without triggering a VM exit.
27922792
*/
27932793
pvm->rflags &= ~X86_EFLAGS_IF;
2794+
static_assert(PVM_EVENT_FLAGS_IF == X86_EFLAGS_IF);
27942795
if (likely(pvm->msr_vcpu_struct))
27952796
pvm->rflags |= X86_EFLAGS_IF & pvcs->event_flags;
27962797

0 commit comments

Comments
 (0)