Patchwork [PULL,09/51] KVM: PPC: BookE: Add GET/SET_ONE_REG interface for VRSAVE

login
register
mail settings
Submitter Alexander Graf
Date Oct. 31, 2013, 9:17 p.m.
Message ID <1383254316-11243-10-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/287669/
State New
Headers show

Comments

Alexander Graf - Oct. 31, 2013, 9:17 p.m.
From: Paul Mackerras <paulus@samba.org>

This makes the VRSAVE register value for a vcpu accessible through
the GET/SET_ONE_REG interface on Book E systems (in addition to the
existing GET/SET_SREGS interface), for consistency with Book 3S.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/booke.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 17722d8..65fa775 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -1479,6 +1479,9 @@  int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
 	case KVM_REG_PPC_DEBUG_INST:
 		val = get_reg_val(reg->id, KVMPPC_INST_EHPRIV);
 		break;
+	case KVM_REG_PPC_VRSAVE:
+		val = get_reg_val(reg->id, vcpu->arch.vrsave);
+		break;
 	default:
 		r = kvmppc_get_one_reg(vcpu, reg->id, &val);
 		break;
@@ -1552,6 +1555,9 @@  int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
 		kvmppc_set_tcr(vcpu, tcr);
 		break;
 	}
+	case KVM_REG_PPC_VRSAVE:
+		vcpu->arch.vrsave = set_reg_val(reg->id, val);
+		break;
 	default:
 		r = kvmppc_set_one_reg(vcpu, reg->id, &val);
 		break;