summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvm_ioapic.c8
-rw-r--r--kvm_x86.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/kvm_ioapic.c b/kvm_ioapic.c
index 37dbded..89d3008 100644
--- a/kvm_ioapic.c
+++ b/kvm_ioapic.c
@@ -67,9 +67,11 @@ ioapic_read_indirect(struct kvm_ioapic *ioapic,
uint32_t redir_index = (ioapic->ioregsel - 0x10) >> 1;
uint64_t redir_content;
- ASSERT(redir_index < IOAPIC_NUM_PINS);
-
- redir_content = ioapic->redirtbl[redir_index].bits;
+ if (redir_index < IOAPIC_NUM_PINS) {
+ redir_content = ioapic->redirtbl[redir_index].bits;
+ } else {
+ redir_content = ~0ULL;
+ }
result = (ioapic->ioregsel & 0x1) ?
(redir_content >> 32) & 0xffffffff :
redir_content & 0xffffffff;
diff --git a/kvm_x86.c b/kvm_x86.c
index 81e6773..07c3810 100644
--- a/kvm_x86.c
+++ b/kvm_x86.c
@@ -1170,6 +1170,12 @@ kvm_set_msr_common(struct kvm_vcpu *vcpu, uint32_t msr, uint64_t data)
vcpu->kvm->arch.wall_clock = data;
kvm_write_wall_clock(vcpu->kvm, data);
break;
+
+ /*
+ * If in the future we go to update this code, we must go sync
+ * back up with the Linux for this MSR to address several important
+ * bugs.
+ */
case MSR_KVM_SYSTEM_TIME: {
#ifdef XXX
if (vcpu->arch.time_page) {