Skip to content

Commit 3e10449

Browse files
author
ddk
committed
Merge branch 'master' of [email protected]:ddk50/winkvm
2 parents 16f9179 + 9e88216 commit 3e10449

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

kvm/kernel/kvm_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ EXPORT_SYMBOL_GPL(kvm_get_msr_common);
15461546
* Returns 0 on success, non-0 otherwise.
15471547
* Assumes vcpu_load() was already called.
15481548
*/
1549-
static int get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
1549+
int get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
15501550
{
15511551
return kvm_arch_ops->get_msr(vcpu, msr_index, pdata);
15521552
}

vcproj/kernel/init.c

+5
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,12 @@ __winkvmstab_ioctl(IN PDEVICE_OBJECT DeviceObject,
512512

513513
case KVM_GET_MSRS:
514514
{
515+
int r;
516+
struct kvm_msrs *umsrs = (struct kvm_msrs*)outBuf;
515517
function_enter(DBG_IOCTL, "KVM_GET_MSRS");
518+
r = msr_io(get_vcpu(umsrs->vcpu_fd), umsrs, get_msr, 1);
519+
Irp->IoStatus.Information = sizeof(struct kvm_msrs) + umsrs->nmsrs * sizeof(struct kvm_msr_entry);
520+
ntStatus = ConvertRetval(r);
516521
function_exit(DBG_IOCTL, "KVM_GET_MSRS");
517522
break;
518523
} /* end KVM_GET_MSRS */

vcproj/kernel/kvmdefined.h

+1
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@ extern int _cdecl msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs *user_msrs,
5252
* Adapt set_msr() to msr_io()'s calling convention
5353
*/
5454
int _cdecl do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data);
55+
int _cdecl get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata);
5556

5657
#endif

0 commit comments

Comments
 (0)