Skip to contentSkip to conversation

Mark Hyper-V hypercall and vapic assist pages as dirty

PATCH Applied Vadim Rozenfeld 3 participants 5 messages Jan 23, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Mark Hyper-V hypercall and vapic assist pages as dirty

Vadim Rozenfeld (2):
mark hyper-v hypercall page as dirty
mark hyper-v vapic assist page as dirty

 arch/x86/kvm/x86.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/2 mark hyper-v hypercall page as dirty

---
 arch/x86/kvm/x86.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kvm/x86.c +1 -0
index 59b95b1..e8599ed 100644
@@ -1840,6 +1840,7 @@ static int set_msr_hyperv_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data)
 		if (__copy_to_user((void __user *)addr, instructions, 4))
 			return 1;
 		kvm->arch.hv_hypercall = data;
+		mark_page_dirty(kvm, gfn);
 		break;
 	}
 	case HV_X64_MSR_REFERENCE_TSC: {
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 2/2 mark hyper-v vapic assist page as dirty

In reply to Vadim Rozenfeld
---
 arch/x86/kvm/x86.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/x86/kvm/x86.c +4 -2
index e8599ed..cd8a41f 100644
@@ -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:
Signature · 1 line
1.8.1.4
maintainer Applied
#4 lore raw

Il 23/01/2014 18:08, Marcelo Tosatti ha scritto:

Quoted 5 lines · Vadim Rozenfeld
Quoted 4 lines

Vadim Rozenfeld (2):
mark hyper-v hypercall page as dirty
mark hyper-v vapic assist page as dirty

Quoted 9 lines
Quoted 5 lines
 arch/x86/kvm/x86.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
1.8.1.4

Applied to queue, thanks Vadim and Marcelo!

Paolo