aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-12-03 05:45:52 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:30:28 -0500
commitdecdbf6a4c4f5cf14343946031aff24ff815c909 (patch)
tree07991f7f56d7f157730683bc2c2bb80783e1299c /arch/x86/kvm
parentd48086d1e316e0cefd69b6d2ce75a42856cfba57 (diff)
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: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/svm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index e188d9e0db91..748569ef8505 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -190,10 +190,12 @@ enum {
190 pause filter count */ 190 pause filter count */
191 VMCB_PERM_MAP, /* IOPM Base and MSRPM Base */ 191 VMCB_PERM_MAP, /* IOPM Base and MSRPM Base */
192 VMCB_ASID, /* ASID */ 192 VMCB_ASID, /* ASID */
193 VMCB_INTR, /* int_ctl, int_vector */
193 VMCB_DIRTY_MAX, 194 VMCB_DIRTY_MAX,
194}; 195};
195 196
196#define VMCB_ALWAYS_DIRTY_MASK 0U 197/* TPR is always written before VMRUN */
198#define VMCB_ALWAYS_DIRTY_MASK (1U << VMCB_INTR)
197 199
198static inline void mark_all_dirty(struct vmcb *vmcb) 200static inline void mark_all_dirty(struct vmcb *vmcb)
199{ 201{
@@ -2508,6 +2510,8 @@ static int clgi_interception(struct vcpu_svm *svm)
2508 svm_clear_vintr(svm); 2510 svm_clear_vintr(svm);
2509 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; 2511 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
2510 2512
2513 mark_dirty(svm->vmcb, VMCB_INTR);
2514
2511 return 1; 2515 return 1;
2512} 2516}
2513 2517
@@ -2878,6 +2882,7 @@ static int interrupt_window_interception(struct vcpu_svm *svm)
2878 kvm_make_request(KVM_REQ_EVENT, &svm->vcpu); 2882 kvm_make_request(KVM_REQ_EVENT, &svm->vcpu);
2879 svm_clear_vintr(svm); 2883 svm_clear_vintr(svm);
2880 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; 2884 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
2885 mark_dirty(svm->vmcb, VMCB_INTR);
2881 /* 2886 /*
2882 * If the user space waits to inject interrupts, exit as soon as 2887 * If the user space waits to inject interrupts, exit as soon as
2883 * possible 2888 * possible
@@ -3169,6 +3174,7 @@ static inline void svm_inject_irq(struct vcpu_svm *svm, int irq)
3169 control->int_ctl &= ~V_INTR_PRIO_MASK; 3174 control->int_ctl &= ~V_INTR_PRIO_MASK;
3170 control->int_ctl |= V_IRQ_MASK | 3175 control->int_ctl |= V_IRQ_MASK |
3171 ((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT); 3176 ((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT);
3177 mark_dirty(svm->vmcb, VMCB_INTR);
3172} 3178}
3173 3179
3174static void svm_set_irq(struct kvm_vcpu *vcpu) 3180static void svm_set_irq(struct kvm_vcpu *vcpu)