[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f04f7517-67d9-856b-58e4-f3efdc4566d7@google.com>
Date: Thu, 26 Sep 2019 19:39:34 -0700
From: Junaid Shahid <junaids@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [PATCH 2/3] KVM: x86: fix nested guest live migration with PML
On 9/26/19 10:18 AM, Paolo Bonzini wrote:
> @@ -1597,8 +1615,11 @@ static bool spte_clear_dirty(u64 *sptep)
>
> rmap_printk("rmap_clear_dirty: spte %p %llx\n", sptep, *sptep);
>
> - spte &= ~shadow_dirty_mask;
> + WARN_ON(!spte_ad_enabled(spte));
> + if (spte_ad_need_write_protect(spte))
> + return spte_write_protect(sptep, false);
>
> + spte &= ~shadow_dirty_mask;
> return mmu_spte_update(sptep, spte);
> }
>
I think that it would be a bit cleaner to move the spte_ad_need_write_protect() check to the if statement inside __rmap_clear_dirty() instead, since it already checks for spte_ad_enabled() to decide between write-protection and dirty-clearing.
Reviewed-by: Junaid Shahid <junaids@...gle.com>
Powered by blists - more mailing lists