Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 930b412a authored by Alexander Graf's avatar Alexander Graf Committed by Avi Kivity
Browse files

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: default avatarAlexander Graf <agraf@suse.de>
parent a668f2bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -189,6 +189,7 @@ int kvm_dev_ioctl_check_extension(long ext)
#else
#else
	case KVM_CAP_PPC_SEGSTATE:
	case KVM_CAP_PPC_SEGSTATE:
	case KVM_CAP_PPC_HIOR:
	case KVM_CAP_PPC_HIOR:
	case KVM_CAP_PPC_PAPR:
#endif
#endif
	case KVM_CAP_PPC_UNSET_IRQ:
	case KVM_CAP_PPC_UNSET_IRQ:
	case KVM_CAP_PPC_IRQ_LEVEL:
	case KVM_CAP_PPC_IRQ_LEVEL:
@@ -572,6 +573,10 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
		r = 0;
		r = 0;
		vcpu->arch.osi_enabled = true;
		vcpu->arch.osi_enabled = true;
		break;
		break;
	case KVM_CAP_PPC_PAPR:
		r = 0;
		vcpu->arch.papr_enabled = true;
		break;
	default:
	default:
		r = -EINVAL;
		r = -EINVAL;
		break;
		break;
+1 −0
Original line number Original line Diff line number Diff line
@@ -555,6 +555,7 @@ struct kvm_ppc_pvinfo {
#define KVM_CAP_PPC_RMA	65
#define KVM_CAP_PPC_RMA	65
#define KVM_CAP_MAX_VCPUS 66       /* returns max vcpus per vm */
#define KVM_CAP_MAX_VCPUS 66       /* returns max vcpus per vm */
#define KVM_CAP_PPC_HIOR 67
#define KVM_CAP_PPC_HIOR 67
#define KVM_CAP_PPC_PAPR 68
#define KVM_CAP_S390_GMAP 71
#define KVM_CAP_S390_GMAP 71


#ifdef KVM_CAP_IRQ_ROUTING
#ifdef KVM_CAP_IRQ_ROUTING