Re: [PATCH 06/43] KVM: x86: Properly reset MMU context at vCPU RESET/INIT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
>  {
> +       unsigned long old_cr0 = kvm_read_cr0(vcpu);
> +       unsigned long old_cr4 = kvm_read_cr4(vcpu);
> +
>         kvm_lapic_reset(vcpu, init_event);
>
>         vcpu->arch.hflags = 0;
> @@ -10483,6 +10485,10 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
>         vcpu->arch.ia32_xss = 0;
>
>         static_call(kvm_x86_vcpu_reset)(vcpu, init_event);
> +
> +       if (kvm_cr0_mmu_role_changed(old_cr0, kvm_read_cr0(vcpu)) ||
> +           kvm_cr4_mmu_role_changed(old_cr4, kvm_read_cr4(vcpu)))
> +               kvm_mmu_reset_context(vcpu);
>  }

I'm wondering if kvm_vcpu_reset() should call kvm_mmu_reset_context()
for a change in EFER.NX as well.

Thanks,
Reiji



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux