diff options
author | Anup Patel <anup.patel@linaro.org> | 2013-09-30 04:50:06 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2013-10-02 14:29:40 -0400 |
commit | 473bdc0e6565ebb22455657a40daa21b6b4ee16b (patch) | |
tree | 06284390516ff0ea5eb3296bc6bf0bf88e734940 /arch/arm64 | |
parent | 4a6fee805d5e278e4733bf933cb5b184b7a8be1f (diff) |
ARM64: KVM: Implement kvm_vcpu_preferred_target() function
This patch implements kvm_vcpu_preferred_target() function for
KVM ARM64 which will help us implement KVM_ARM_PREFERRED_TARGET
ioctl for user space.
Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/asm/kvm_host.h | 1 | ||||
-rw-r--r-- | arch/arm64/kvm/guest.c | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 0859a4ddd1e7..4cc8c7078f39 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h | |||
@@ -151,6 +151,7 @@ struct kvm_vcpu_stat { | |||
151 | struct kvm_vcpu_init; | 151 | struct kvm_vcpu_init; |
152 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, | 152 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, |
153 | const struct kvm_vcpu_init *init); | 153 | const struct kvm_vcpu_init *init); |
154 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); | ||
154 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); | 155 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); |
155 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); | 156 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); |
156 | struct kvm_one_reg; | 157 | struct kvm_one_reg; |
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 2c3ff67a8ecb..3f0731e53274 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c | |||
@@ -248,6 +248,26 @@ int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, | |||
248 | return kvm_reset_vcpu(vcpu); | 248 | return kvm_reset_vcpu(vcpu); |
249 | } | 249 | } |
250 | 250 | ||
251 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init) | ||
252 | { | ||
253 | int target = kvm_target_cpu(); | ||
254 | |||
255 | if (target < 0) | ||
256 | return -ENODEV; | ||
257 | |||
258 | memset(init, 0, sizeof(*init)); | ||
259 | |||
260 | /* | ||
261 | * For now, we don't return any features. | ||
262 | * In future, we might use features to return target | ||
263 | * specific features available for the preferred | ||
264 | * target type. | ||
265 | */ | ||
266 | init->target = (__u32)target; | ||
267 | |||
268 | return 0; | ||
269 | } | ||
270 | |||
251 | int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) | 271 | int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) |
252 | { | 272 | { |
253 | return -EINVAL; | 273 | return -EINVAL; |