Commit b3af1e88 authored by Vadim Rozenfeld's avatar Vadim Rozenfeld Committed by Paolo Bonzini

KVM: x86: mark hyper-v vapic assist page as dirty

Signed-off-by: default avatarVadim Rozenfeld <vrozenfe@redhat.com>
Reviewed-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent b94b64c9
...@@ -1869,19 +1869,21 @@ static int set_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 data) ...@@ -1869,19 +1869,21 @@ static int set_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 data)
{ {
switch (msr) { switch (msr) {
case HV_X64_MSR_APIC_ASSIST_PAGE: { case HV_X64_MSR_APIC_ASSIST_PAGE: {
u64 gfn;
unsigned long addr; unsigned long addr;
if (!(data & HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE)) { if (!(data & HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE)) {
vcpu->arch.hv_vapic = data; vcpu->arch.hv_vapic = data;
break; break;
} }
addr = gfn_to_hva(vcpu->kvm, data >> gfn = data >> HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT;
HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT); addr = gfn_to_hva(vcpu->kvm, gfn);
if (kvm_is_error_hva(addr)) if (kvm_is_error_hva(addr))
return 1; return 1;
if (__clear_user((void __user *)addr, PAGE_SIZE)) if (__clear_user((void __user *)addr, PAGE_SIZE))
return 1; return 1;
vcpu->arch.hv_vapic = data; vcpu->arch.hv_vapic = data;
mark_page_dirty(vcpu->kvm, gfn);
break; break;
} }
case HV_X64_MSR_EOI: case HV_X64_MSR_EOI:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment