Skip to content

Commit 9b8456f

Browse files
committed
add a kvm_get/set_msrs()
1 parent 5d62e20 commit 9b8456f

File tree

12 files changed

+127
-41
lines changed

12 files changed

+127
-41
lines changed

kvm/kernel/include/linux/kvm.h

+3
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ struct kvm_msr_entry {
234234

235235
/* for KVM_GET_MSRS and KVM_SET_MSRS */
236236
struct kvm_msrs {
237+
#ifdef __WINKVM__
238+
int vcpu_fd;
239+
#endif
237240
__u32 nmsrs; /* number of msrs in entries */
238241
__u32 pad;
239242

kvm/kernel/kvm_main.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
851851
int cleared;
852852
unsigned long any = 0;
853853

854+
function_enter(DBG_LIVEMIGRATION, __FUNCTION__);
855+
854856
spin_lock(&kvm->lock);
855857

856858
/*
@@ -901,6 +903,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
901903
spin_lock(&kvm->lock);
902904
--kvm->busy;
903905
spin_unlock(&kvm->lock);
906+
function_exit(DBG_LIVEMIGRATION, __FUNCTION__);
904907
return r;
905908
}
906909

@@ -1938,7 +1941,7 @@ static __init void kvm_init_msr_list(void)
19381941
/*
19391942
* Adapt set_msr() to msr_io()'s calling convention
19401943
*/
1941-
static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
1944+
int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
19421945
{
19431946
return set_msr(vcpu, index, *data);
19441947
}
@@ -1971,10 +1974,10 @@ static int __msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs *msrs,
19711974
*
19721975
* @return number of msrs set successfully.
19731976
*/
1974-
static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
1975-
int (*do_msr)(struct kvm_vcpu *vcpu,
1976-
unsigned index, u64 *data),
1977-
int writeback)
1977+
int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
1978+
int (*do_msr)(struct kvm_vcpu *vcpu,
1979+
unsigned index, u64 *data),
1980+
int writeback)
19781981
{
19791982
struct kvm_msrs msrs;
19801983
struct kvm_msr_entry *entries;

vcproj/include/linux/kvm.h

+3
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ struct kvm_msr_entry {
234234

235235
/* for KVM_GET_MSRS and KVM_SET_MSRS */
236236
struct kvm_msrs {
237+
#ifdef __WINKVM__
238+
int vcpu_fd;
239+
#endif
237240
__u32 nmsrs; /* number of msrs in entries */
238241
__u32 pad;
239242

vcproj/include/linux/winkvm.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ enum dbgmsg_level {
122122
DBG_MISC = 0,
123123
DBG_INIT,
124124
DBG_RELEASE,
125-
DBG_DESTROY_KVM_MMU,
125+
DBG_DESTROY_KVM_MMU,
126+
DBG_LIVEMIGRATION,
127+
DBG_IOCTL,
126128
};
127129

128130
#endif

vcproj/include/linux/winkvmint.h

-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef _WINKVMINT_H_
33
#define _WINKVMINT_H_
44

5-
//#ifdef _MSC_VER
6-
75
/* FIXME */
86
#define __WORDSIZE 32
97

@@ -61,6 +59,4 @@ typedef unsigned int size_t;
6159

6260
typedef int bool;
6361

64-
//#endif /* _MSC_VER */
65-
6662
#endif /* _WINKVMINT_H_ */

0 commit comments

Comments
 (0)