From: Michael Neuling <[email protected]>

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

Signed-off-by: Michael Neuling <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
---
 arch/powerpc/kvm/book3s_hv.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

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;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to