diff mbox

[14/15] KVM: PPC: Book3S HV: Add H_SET_MODE CIABR setting

Message ID 1383995103-24732-15-git-send-email-paulus@samba.org
State New, archived
Headers show

Commit Message

Paul Mackerras Nov. 9, 2013, 11:05 a.m. UTC
From: Michael Neuling <mikey@neuling.org>

This add setting the CIABR via the H_SET_MODE hcall.  This is set per cpu.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/kvm/book3s_hv.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3bafc6f..ca21ec2 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -568,6 +568,17 @@  static int kvmppc_h_set_mode(struct kvm_vcpu *vcpu, unsigned long mflags,
 	int n;
 
 	switch (resource) {
+	case H_SET_MODE_RESOURCE_SET_CIABR:
+		if (!kvmppc_power8_compatible(vcpu))
+			return H_P2;
+		if (value2)
+			return H_P4;
+		if (mflags)
+			return H_UNSUPPORTED_FLAG_START;
+		if ((value1 & 0x3) == 0x3)
+			return H_P3;
+		vcpu->arch.ciabr  = value1;
+		return H_SUCCESS;
 	case H_SET_MODE_RESOURCE_SET_DAWR:
 		if (!kvmppc_power8_compatible(vcpu))
 			return H_P2;