diff options
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/i8254.c | 14 | ||||
-rw-r--r-- | arch/x86/kvm/i8259.c | 12 | ||||
-rw-r--r-- | arch/x86/kvm/ioapic.c | 8 | ||||
-rw-r--r-- | arch/x86/kvm/lapic.c | 4 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 13 |
6 files changed, 29 insertions, 24 deletions
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 298781d4cfb4..4dce6f8b6129 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -443,7 +443,8 @@ static inline int pit_in_range(gpa_t addr) | |||
443 | (addr < KVM_PIT_BASE_ADDRESS + KVM_PIT_MEM_LENGTH)); | 443 | (addr < KVM_PIT_BASE_ADDRESS + KVM_PIT_MEM_LENGTH)); |
444 | } | 444 | } |
445 | 445 | ||
446 | static int pit_ioport_write(struct kvm_io_device *this, | 446 | static int pit_ioport_write(struct kvm_vcpu *vcpu, |
447 | struct kvm_io_device *this, | ||
447 | gpa_t addr, int len, const void *data) | 448 | gpa_t addr, int len, const void *data) |
448 | { | 449 | { |
449 | struct kvm_pit *pit = dev_to_pit(this); | 450 | struct kvm_pit *pit = dev_to_pit(this); |
@@ -519,7 +520,8 @@ static int pit_ioport_write(struct kvm_io_device *this, | |||
519 | return 0; | 520 | return 0; |
520 | } | 521 | } |
521 | 522 | ||
522 | static int pit_ioport_read(struct kvm_io_device *this, | 523 | static int pit_ioport_read(struct kvm_vcpu *vcpu, |
524 | struct kvm_io_device *this, | ||
523 | gpa_t addr, int len, void *data) | 525 | gpa_t addr, int len, void *data) |
524 | { | 526 | { |
525 | struct kvm_pit *pit = dev_to_pit(this); | 527 | struct kvm_pit *pit = dev_to_pit(this); |
@@ -589,7 +591,8 @@ static int pit_ioport_read(struct kvm_io_device *this, | |||
589 | return 0; | 591 | return 0; |
590 | } | 592 | } |
591 | 593 | ||
592 | static int speaker_ioport_write(struct kvm_io_device *this, | 594 | static int speaker_ioport_write(struct kvm_vcpu *vcpu, |
595 | struct kvm_io_device *this, | ||
593 | gpa_t addr, int len, const void *data) | 596 | gpa_t addr, int len, const void *data) |
594 | { | 597 | { |
595 | struct kvm_pit *pit = speaker_to_pit(this); | 598 | struct kvm_pit *pit = speaker_to_pit(this); |
@@ -606,8 +609,9 @@ static int speaker_ioport_write(struct kvm_io_device *this, | |||
606 | return 0; | 609 | return 0; |
607 | } | 610 | } |
608 | 611 | ||
609 | static int speaker_ioport_read(struct kvm_io_device *this, | 612 | static int speaker_ioport_read(struct kvm_vcpu *vcpu, |
610 | gpa_t addr, int len, void *data) | 613 | struct kvm_io_device *this, |
614 | gpa_t addr, int len, void *data) | ||
611 | { | 615 | { |
612 | struct kvm_pit *pit = speaker_to_pit(this); | 616 | struct kvm_pit *pit = speaker_to_pit(this); |
613 | struct kvm_kpit_state *pit_state = &pit->pit_state; | 617 | struct kvm_kpit_state *pit_state = &pit->pit_state; |
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index cc31f7c06d3d..8ff4eaa2bf19 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c | |||
@@ -528,42 +528,42 @@ static int picdev_read(struct kvm_pic *s, | |||
528 | return 0; | 528 | return 0; |
529 | } | 529 | } |
530 | 530 | ||
531 | static int picdev_master_write(struct kvm_io_device *dev, | 531 | static int picdev_master_write(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, |
532 | gpa_t addr, int len, const void *val) | 532 | gpa_t addr, int len, const void *val) |
533 | { | 533 | { |
534 | return picdev_write(container_of(dev, struct kvm_pic, dev_master), | 534 | return picdev_write(container_of(dev, struct kvm_pic, dev_master), |
535 | addr, len, val); | 535 | addr, len, val); |
536 | } | 536 | } |
537 | 537 | ||
538 | static int picdev_master_read(struct kvm_io_device *dev, | 538 | static int picdev_master_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, |
539 | gpa_t addr, int len, void *val) | 539 | gpa_t addr, int len, void *val) |
540 | { | 540 | { |
541 | return picdev_read(container_of(dev, struct kvm_pic, dev_master), | 541 | return picdev_read(container_of(dev, struct kvm_pic, dev_master), |
542 | addr, len, val); | 542 | addr, len, val); |
543 | } | 543 | } |
544 | 544 | ||
545 | static int picdev_slave_write(struct kvm_io_device *dev, | 545 | static int picdev_slave_write(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, |
546 | gpa_t addr, int len, const void *val) | 546 | gpa_t addr, int len, const void *val) |
547 | { | 547 | { |
548 | return picdev_write(container_of(dev, struct kvm_pic, dev_slave), | 548 | return picdev_write(container_of(dev, struct kvm_pic, dev_slave), |
549 | addr, len, val); | 549 | addr, len, val); |
550 | } | 550 | } |
551 | 551 | ||
552 | static int picdev_slave_read(struct kvm_io_device *dev, | 552 | static int picdev_slave_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, |
553 | gpa_t addr, int len, void *val) | 553 | gpa_t addr, int len, void *val) |
554 | { | 554 | { |
555 | return picdev_read(container_of(dev, struct kvm_pic, dev_slave), | 555 | return picdev_read(container_of(dev, struct kvm_pic, dev_slave), |
556 | addr, len, val); | 556 | addr, len, val); |
557 | } | 557 | } |
558 | 558 | ||
559 | static int picdev_eclr_write(struct kvm_io_device *dev, | 559 | static int picdev_eclr_write(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, |
560 | gpa_t addr, int len, const void *val) | 560 | gpa_t addr, int len, const void *val) |
561 | { | 561 | { |
562 | return picdev_write(container_of(dev, struct kvm_pic, dev_eclr), | 562 | return picdev_write(container_of(dev, struct kvm_pic, dev_eclr), |
563 | addr, len, val); | 563 | addr, len, val); |
564 | } | 564 | } |
565 | 565 | ||
566 | static int picdev_eclr_read(struct kvm_io_device *dev, | 566 | static int picdev_eclr_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, |
567 | gpa_t addr, int len, void *val) | 567 | gpa_t addr, int len, void *val) |
568 | { | 568 | { |
569 | return picdev_read(container_of(dev, struct kvm_pic, dev_eclr), | 569 | return picdev_read(container_of(dev, struct kvm_pic, dev_eclr), |
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index b1947e0f3e10..8bf2e49708e3 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c | |||
@@ -498,8 +498,8 @@ static inline int ioapic_in_range(struct kvm_ioapic *ioapic, gpa_t addr) | |||
498 | (addr < ioapic->base_address + IOAPIC_MEM_LENGTH))); | 498 | (addr < ioapic->base_address + IOAPIC_MEM_LENGTH))); |
499 | } | 499 | } |
500 | 500 | ||
501 | static int ioapic_mmio_read(struct kvm_io_device *this, gpa_t addr, int len, | 501 | static int ioapic_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *this, |
502 | void *val) | 502 | gpa_t addr, int len, void *val) |
503 | { | 503 | { |
504 | struct kvm_ioapic *ioapic = to_ioapic(this); | 504 | struct kvm_ioapic *ioapic = to_ioapic(this); |
505 | u32 result; | 505 | u32 result; |
@@ -541,8 +541,8 @@ static int ioapic_mmio_read(struct kvm_io_device *this, gpa_t addr, int len, | |||
541 | return 0; | 541 | return 0; |
542 | } | 542 | } |
543 | 543 | ||
544 | static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, | 544 | static int ioapic_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this, |
545 | const void *val) | 545 | gpa_t addr, int len, const void *val) |
546 | { | 546 | { |
547 | struct kvm_ioapic *ioapic = to_ioapic(this); | 547 | struct kvm_ioapic *ioapic = to_ioapic(this); |
548 | u32 data; | 548 | u32 data; |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index e55b5fc344eb..ba57bb79e795 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -1038,7 +1038,7 @@ static int apic_mmio_in_range(struct kvm_lapic *apic, gpa_t addr) | |||
1038 | addr < apic->base_address + LAPIC_MMIO_LENGTH; | 1038 | addr < apic->base_address + LAPIC_MMIO_LENGTH; |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | static int apic_mmio_read(struct kvm_io_device *this, | 1041 | static int apic_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *this, |
1042 | gpa_t address, int len, void *data) | 1042 | gpa_t address, int len, void *data) |
1043 | { | 1043 | { |
1044 | struct kvm_lapic *apic = to_lapic(this); | 1044 | struct kvm_lapic *apic = to_lapic(this); |
@@ -1358,7 +1358,7 @@ static int apic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val) | |||
1358 | return ret; | 1358 | return ret; |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | static int apic_mmio_write(struct kvm_io_device *this, | 1361 | static int apic_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this, |
1362 | gpa_t address, int len, const void *data) | 1362 | gpa_t address, int len, const void *data) |
1363 | { | 1363 | { |
1364 | struct kvm_lapic *apic = to_lapic(this); | 1364 | struct kvm_lapic *apic = to_lapic(this); |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f7b20b417a3a..317da9bde728 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -5822,7 +5822,7 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu) | |||
5822 | gpa_t gpa; | 5822 | gpa_t gpa; |
5823 | 5823 | ||
5824 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); | 5824 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
5825 | if (!kvm_io_bus_write(vcpu->kvm, KVM_FAST_MMIO_BUS, gpa, 0, NULL)) { | 5825 | if (!kvm_io_bus_write(vcpu, KVM_FAST_MMIO_BUS, gpa, 0, NULL)) { |
5826 | skip_emulated_instruction(vcpu); | 5826 | skip_emulated_instruction(vcpu); |
5827 | return 1; | 5827 | return 1; |
5828 | } | 5828 | } |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bd7a70be41b3..5573d633144c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4115,8 +4115,8 @@ static int vcpu_mmio_write(struct kvm_vcpu *vcpu, gpa_t addr, int len, | |||
4115 | do { | 4115 | do { |
4116 | n = min(len, 8); | 4116 | n = min(len, 8); |
4117 | if (!(vcpu->arch.apic && | 4117 | if (!(vcpu->arch.apic && |
4118 | !kvm_iodevice_write(&vcpu->arch.apic->dev, addr, n, v)) | 4118 | !kvm_iodevice_write(vcpu, &vcpu->arch.apic->dev, addr, n, v)) |
4119 | && kvm_io_bus_write(vcpu->kvm, KVM_MMIO_BUS, addr, n, v)) | 4119 | && kvm_io_bus_write(vcpu, KVM_MMIO_BUS, addr, n, v)) |
4120 | break; | 4120 | break; |
4121 | handled += n; | 4121 | handled += n; |
4122 | addr += n; | 4122 | addr += n; |
@@ -4135,8 +4135,9 @@ static int vcpu_mmio_read(struct kvm_vcpu *vcpu, gpa_t addr, int len, void *v) | |||
4135 | do { | 4135 | do { |
4136 | n = min(len, 8); | 4136 | n = min(len, 8); |
4137 | if (!(vcpu->arch.apic && | 4137 | if (!(vcpu->arch.apic && |
4138 | !kvm_iodevice_read(&vcpu->arch.apic->dev, addr, n, v)) | 4138 | !kvm_iodevice_read(vcpu, &vcpu->arch.apic->dev, |
4139 | && kvm_io_bus_read(vcpu->kvm, KVM_MMIO_BUS, addr, n, v)) | 4139 | addr, n, v)) |
4140 | && kvm_io_bus_read(vcpu, KVM_MMIO_BUS, addr, n, v)) | ||
4140 | break; | 4141 | break; |
4141 | trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, *(u64 *)v); | 4142 | trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, *(u64 *)v); |
4142 | handled += n; | 4143 | handled += n; |
@@ -4630,10 +4631,10 @@ static int kernel_pio(struct kvm_vcpu *vcpu, void *pd) | |||
4630 | int r; | 4631 | int r; |
4631 | 4632 | ||
4632 | if (vcpu->arch.pio.in) | 4633 | if (vcpu->arch.pio.in) |
4633 | r = kvm_io_bus_read(vcpu->kvm, KVM_PIO_BUS, vcpu->arch.pio.port, | 4634 | r = kvm_io_bus_read(vcpu, KVM_PIO_BUS, vcpu->arch.pio.port, |
4634 | vcpu->arch.pio.size, pd); | 4635 | vcpu->arch.pio.size, pd); |
4635 | else | 4636 | else |
4636 | r = kvm_io_bus_write(vcpu->kvm, KVM_PIO_BUS, | 4637 | r = kvm_io_bus_write(vcpu, KVM_PIO_BUS, |
4637 | vcpu->arch.pio.port, vcpu->arch.pio.size, | 4638 | vcpu->arch.pio.port, vcpu->arch.pio.size, |
4638 | pd); | 4639 | pd); |
4639 | return r; | 4640 | return r; |