diff options
author | Alexander Graf <agraf@suse.de> | 2011-08-08 11:29:42 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-25 12:52:26 -0400 |
commit | 930b412a005bde2ea3f05911eaaeeb10f11d79ab (patch) | |
tree | aac017faf38837319a24fe9276e056fa6af1f4d8 | |
parent | a668f2bd3f14ce7f92e119f4b5d9b50cdc59e855 (diff) |
KVM: PPC: Enable the PAPR CAP for Book3S
Now that Book3S PV mode can also run PAPR guests, we can add a PAPR cap and
enable it for all Book3S targets. Enabling that CAP switches KVM into PAPR
mode.
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 5 | ||||
-rw-r--r-- | include/linux/kvm.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 17a5c83e1ccc..13bc798a4441 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -189,6 +189,7 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
189 | #else | 189 | #else |
190 | case KVM_CAP_PPC_SEGSTATE: | 190 | case KVM_CAP_PPC_SEGSTATE: |
191 | case KVM_CAP_PPC_HIOR: | 191 | case KVM_CAP_PPC_HIOR: |
192 | case KVM_CAP_PPC_PAPR: | ||
192 | #endif | 193 | #endif |
193 | case KVM_CAP_PPC_UNSET_IRQ: | 194 | case KVM_CAP_PPC_UNSET_IRQ: |
194 | case KVM_CAP_PPC_IRQ_LEVEL: | 195 | case KVM_CAP_PPC_IRQ_LEVEL: |
@@ -572,6 +573,10 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, | |||
572 | r = 0; | 573 | r = 0; |
573 | vcpu->arch.osi_enabled = true; | 574 | vcpu->arch.osi_enabled = true; |
574 | break; | 575 | break; |
576 | case KVM_CAP_PPC_PAPR: | ||
577 | r = 0; | ||
578 | vcpu->arch.papr_enabled = true; | ||
579 | break; | ||
575 | default: | 580 | default: |
576 | r = -EINVAL; | 581 | r = -EINVAL; |
577 | break; | 582 | break; |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 490b041aba45..68840544006d 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -555,6 +555,7 @@ struct kvm_ppc_pvinfo { | |||
555 | #define KVM_CAP_PPC_RMA 65 | 555 | #define KVM_CAP_PPC_RMA 65 |
556 | #define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */ | 556 | #define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */ |
557 | #define KVM_CAP_PPC_HIOR 67 | 557 | #define KVM_CAP_PPC_HIOR 67 |
558 | #define KVM_CAP_PPC_PAPR 68 | ||
558 | #define KVM_CAP_S390_GMAP 71 | 559 | #define KVM_CAP_S390_GMAP 71 |
559 | 560 | ||
560 | #ifdef KVM_CAP_IRQ_ROUTING | 561 | #ifdef KVM_CAP_IRQ_ROUTING |