Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80677
b: refs/heads/master
c: 8c39269
h: refs/heads/master
i:
  80675: 3ad2498
v: v3
  • Loading branch information
Eddie Dong authored and Avi Kivity committed Jan 30, 2008
1 parent 168e3ec commit 569be10
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2fcceae145645ec6a4fab0a806bb674d7484d97b
refs/heads/master: 8c392696e749171531d155ea5cefdfc1c970fd18
17 changes: 13 additions & 4 deletions trunk/drivers/kvm/ioapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,27 @@ static void ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len,
}
}

void kvm_ioapic_reset(struct kvm_ioapic *ioapic)
{
int i;

for (i = 0; i < IOAPIC_NUM_PINS; i++)
ioapic->redirtbl[i].fields.mask = 1;
ioapic->base_address = IOAPIC_DEFAULT_BASE_ADDRESS;
ioapic->ioregsel = 0;
ioapic->irr = 0;
ioapic->id = 0;
}

int kvm_ioapic_init(struct kvm *kvm)
{
struct kvm_ioapic *ioapic;
int i;

ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL);
if (!ioapic)
return -ENOMEM;
kvm->vioapic = ioapic;
for (i = 0; i < IOAPIC_NUM_PINS; i++)
ioapic->redirtbl[i].fields.mask = 1;
ioapic->base_address = IOAPIC_DEFAULT_BASE_ADDRESS;
kvm_ioapic_reset(ioapic);
ioapic->dev.read = ioapic_mmio_read;
ioapic->dev.write = ioapic_mmio_write;
ioapic->dev.in_range = ioapic_in_range;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/kvm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu);
int kvm_create_lapic(struct kvm_vcpu *vcpu);
void kvm_lapic_reset(struct kvm_vcpu *vcpu);
void kvm_pic_reset(struct kvm_kpic_state *s);
void kvm_ioapic_reset(struct kvm_ioapic *ioapic);
void kvm_free_lapic(struct kvm_vcpu *vcpu);
u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);
void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8);
Expand Down

0 comments on commit 569be10

Please sign in to comment.