mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
KVM: x86: mark hyper-v vapic assist page as dirty
Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b94b64c9a7
commit
b3af1e889e
1 changed files with 4 additions and 2 deletions
|
@ -1869,19 +1869,21 @@ static int set_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 data)
|
|||
{
|
||||
switch (msr) {
|
||||
case HV_X64_MSR_APIC_ASSIST_PAGE: {
|
||||
u64 gfn;
|
||||
unsigned long addr;
|
||||
|
||||
if (!(data & HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE)) {
|
||||
vcpu->arch.hv_vapic = data;
|
||||
break;
|
||||
}
|
||||
addr = gfn_to_hva(vcpu->kvm, data >>
|
||||
HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT);
|
||||
gfn = data >> HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT;
|
||||
addr = gfn_to_hva(vcpu->kvm, gfn);
|
||||
if (kvm_is_error_hva(addr))
|
||||
return 1;
|
||||
if (__clear_user((void __user *)addr, PAGE_SIZE))
|
||||
return 1;
|
||||
vcpu->arch.hv_vapic = data;
|
||||
mark_page_dirty(vcpu->kvm, gfn);
|
||||
break;
|
||||
}
|
||||
case HV_X64_MSR_EOI:
|
||||
|
|
Loading…
Add table
Reference in a new issue