Commit decdbf6a authored by Joerg Roedel's avatar Joerg Roedel Committed by Avi Kivity

KVM: SVM: Add clean-bit for interrupt state

This patch implements the clean-bit for all interrupt
related state in the vmcb. This corresponds to vmcb offset
0x60-0x67.
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent d48086d1
...@@ -190,10 +190,12 @@ enum { ...@@ -190,10 +190,12 @@ enum {
pause filter count */ pause filter count */
VMCB_PERM_MAP, /* IOPM Base and MSRPM Base */ VMCB_PERM_MAP, /* IOPM Base and MSRPM Base */
VMCB_ASID, /* ASID */ VMCB_ASID, /* ASID */
VMCB_INTR, /* int_ctl, int_vector */
VMCB_DIRTY_MAX, VMCB_DIRTY_MAX,
}; };
#define VMCB_ALWAYS_DIRTY_MASK 0U /* TPR is always written before VMRUN */
#define VMCB_ALWAYS_DIRTY_MASK (1U << VMCB_INTR)
static inline void mark_all_dirty(struct vmcb *vmcb) static inline void mark_all_dirty(struct vmcb *vmcb)
{ {
...@@ -2508,6 +2510,8 @@ static int clgi_interception(struct vcpu_svm *svm) ...@@ -2508,6 +2510,8 @@ static int clgi_interception(struct vcpu_svm *svm)
svm_clear_vintr(svm); svm_clear_vintr(svm);
svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
mark_dirty(svm->vmcb, VMCB_INTR);
return 1; return 1;
} }
...@@ -2878,6 +2882,7 @@ static int interrupt_window_interception(struct vcpu_svm *svm) ...@@ -2878,6 +2882,7 @@ static int interrupt_window_interception(struct vcpu_svm *svm)
kvm_make_request(KVM_REQ_EVENT, &svm->vcpu); kvm_make_request(KVM_REQ_EVENT, &svm->vcpu);
svm_clear_vintr(svm); svm_clear_vintr(svm);
svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
mark_dirty(svm->vmcb, VMCB_INTR);
/* /*
* If the user space waits to inject interrupts, exit as soon as * If the user space waits to inject interrupts, exit as soon as
* possible * possible
...@@ -3169,6 +3174,7 @@ static inline void svm_inject_irq(struct vcpu_svm *svm, int irq) ...@@ -3169,6 +3174,7 @@ static inline void svm_inject_irq(struct vcpu_svm *svm, int irq)
control->int_ctl &= ~V_INTR_PRIO_MASK; control->int_ctl &= ~V_INTR_PRIO_MASK;
control->int_ctl |= V_IRQ_MASK | control->int_ctl |= V_IRQ_MASK |
((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT); ((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT);
mark_dirty(svm->vmcb, VMCB_INTR);
} }
static void svm_set_irq(struct kvm_vcpu *vcpu) static void svm_set_irq(struct kvm_vcpu *vcpu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment