aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-10-08 18:06:20 -0400
committerAlexander Graf <agraf@suse.de>2012-12-05 19:33:50 -0500
commit0e673fb679027600cad45bd61a4cc9ebd2ed2bb1 (patch)
tree305737e89b8fbfc558ec05d887ccf1e5c935748a /arch
parent914daba865cb5c38cd5fdee024ca38029315b38f (diff)
KVM: PPC: Support eventfd
In order to support the generic eventfd infrastructure on PPC, we need to call into the generic KVM in-kernel device mmio code. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/Kconfig1
-rw-r--r--arch/powerpc/kvm/Makefile4
-rw-r--r--arch/powerpc/kvm/powerpc.c17
3 files changed, 20 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
index 71f0cd9edf33..4730c953f435 100644
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
@@ -20,6 +20,7 @@ config KVM
20 bool 20 bool
21 select PREEMPT_NOTIFIERS 21 select PREEMPT_NOTIFIERS
22 select ANON_INODES 22 select ANON_INODES
23 select HAVE_KVM_EVENTFD
23 24
24config KVM_BOOK3S_HANDLER 25config KVM_BOOK3S_HANDLER
25 bool 26 bool
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index c2a08636e6d4..cd8965828676 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -6,7 +6,8 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
6 6
7ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm 7ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
8 8
9common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o) 9common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o \
10 eventfd.o)
10 11
11CFLAGS_44x_tlb.o := -I. 12CFLAGS_44x_tlb.o := -I.
12CFLAGS_e500_tlb.o := -I. 13CFLAGS_e500_tlb.o := -I.
@@ -76,6 +77,7 @@ kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HV) := \
76 77
77kvm-book3s_64-module-objs := \ 78kvm-book3s_64-module-objs := \
78 ../../../virt/kvm/kvm_main.o \ 79 ../../../virt/kvm/kvm_main.o \
80 ../../../virt/kvm/eventfd.o \
79 powerpc.o \ 81 powerpc.o \
80 emulate.o \ 82 emulate.o \
81 book3s.o \ 83 book3s.o \
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index f9ab12aea829..d583ea15e151 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -314,6 +314,7 @@ int kvm_dev_ioctl_check_extension(long ext)
314 case KVM_CAP_PPC_IRQ_LEVEL: 314 case KVM_CAP_PPC_IRQ_LEVEL:
315 case KVM_CAP_ENABLE_CAP: 315 case KVM_CAP_ENABLE_CAP:
316 case KVM_CAP_ONE_REG: 316 case KVM_CAP_ONE_REG:
317 case KVM_CAP_IOEVENTFD:
317 r = 1; 318 r = 1;
318 break; 319 break;
319#ifndef CONFIG_KVM_BOOK3S_64_HV 320#ifndef CONFIG_KVM_BOOK3S_64_HV
@@ -618,6 +619,13 @@ int kvmppc_handle_load(struct kvm_run *run, struct kvm_vcpu *vcpu,
618 vcpu->mmio_is_write = 0; 619 vcpu->mmio_is_write = 0;
619 vcpu->arch.mmio_sign_extend = 0; 620 vcpu->arch.mmio_sign_extend = 0;
620 621
622 if (!kvm_io_bus_read(vcpu->kvm, KVM_MMIO_BUS, run->mmio.phys_addr,
623 bytes, &run->mmio.data)) {
624 kvmppc_complete_mmio_load(vcpu, run);
625 vcpu->mmio_needed = 0;
626 return EMULATE_DONE;
627 }
628
621 return EMULATE_DO_MMIO; 629 return EMULATE_DO_MMIO;
622} 630}
623 631
@@ -627,8 +635,8 @@ int kvmppc_handle_loads(struct kvm_run *run, struct kvm_vcpu *vcpu,
627{ 635{
628 int r; 636 int r;
629 637
630 r = kvmppc_handle_load(run, vcpu, rt, bytes, is_bigendian);
631 vcpu->arch.mmio_sign_extend = 1; 638 vcpu->arch.mmio_sign_extend = 1;
639 r = kvmppc_handle_load(run, vcpu, rt, bytes, is_bigendian);
632 640
633 return r; 641 return r;
634} 642}
@@ -666,6 +674,13 @@ int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu,
666 } 674 }
667 } 675 }
668 676
677 if (!kvm_io_bus_write(vcpu->kvm, KVM_MMIO_BUS, run->mmio.phys_addr,
678 bytes, &run->mmio.data)) {
679 kvmppc_complete_mmio_load(vcpu, run);
680 vcpu->mmio_needed = 0;
681 return EMULATE_DONE;
682 }
683
669 return EMULATE_DO_MMIO; 684 return EMULATE_DO_MMIO;
670} 685}
671 686