2222#include <linux/module.h>
2323#include <linux/vmalloc.h>
2424#include <linux/fs.h>
25+ #include <kvm/arm_psci.h>
2526#include <asm/cputype.h>
2627#include <linux/uaccess.h>
2728#include <asm/kvm.h>
@@ -176,6 +177,7 @@ static unsigned long num_core_regs(void)
176177unsigned long kvm_arm_num_regs (struct kvm_vcpu * vcpu )
177178{
178179 return num_core_regs () + kvm_arm_num_coproc_regs (vcpu )
180+ + kvm_arm_get_fw_num_regs (vcpu )
179181 + NUM_TIMER_REGS ;
180182}
181183
@@ -196,6 +198,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices)
196198 uindices ++ ;
197199 }
198200
201+ ret = kvm_arm_copy_fw_reg_indices (vcpu , uindices );
202+ if (ret )
203+ return ret ;
204+ uindices += kvm_arm_get_fw_num_regs (vcpu );
205+
199206 ret = copy_timer_indices (vcpu , uindices );
200207 if (ret )
201208 return ret ;
@@ -214,6 +221,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
214221 if ((reg -> id & KVM_REG_ARM_COPROC_MASK ) == KVM_REG_ARM_CORE )
215222 return get_core_reg (vcpu , reg );
216223
224+ if ((reg -> id & KVM_REG_ARM_COPROC_MASK ) == KVM_REG_ARM_FW )
225+ return kvm_arm_get_fw_reg (vcpu , reg );
226+
217227 if (is_timer_reg (reg -> id ))
218228 return get_timer_reg (vcpu , reg );
219229
@@ -230,6 +240,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
230240 if ((reg -> id & KVM_REG_ARM_COPROC_MASK ) == KVM_REG_ARM_CORE )
231241 return set_core_reg (vcpu , reg );
232242
243+ if ((reg -> id & KVM_REG_ARM_COPROC_MASK ) == KVM_REG_ARM_FW )
244+ return kvm_arm_set_fw_reg (vcpu , reg );
245+
233246 if (is_timer_reg (reg -> id ))
234247 return set_timer_reg (vcpu , reg );
235248
0 commit comments