mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Junaid Shahid <junaids@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>
Subject: Re: [PATCH 2/3] KVM: x86: fix nested guest live migration with PML
Date: Thu, 26 Sep 2019 19:39:34 -0700	[thread overview]
Message-ID: <f04f7517-67d9-856b-58e4-f3efdc4566d7@google.com> (raw)
In-Reply-To: <1569518306-46567-3-git-send-email-pbonzini@redhat.com>

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@google.com>

  reply	other threads:[~2019-09-27  2:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26 17:18 [PATCH 0/3] KVM: MMU: " Paolo Bonzini
2019-09-26 17:18 ` [PATCH 1/3] KVM: x86: assign two bits to track SPTE kinds Paolo Bonzini
2019-09-27  2:39   ` Junaid Shahid
2019-09-26 17:18 ` [PATCH 2/3] KVM: x86: fix nested guest live migration with PML Paolo Bonzini
2019-09-27  2:39   ` Junaid Shahid [this message]
2019-09-26 17:18 ` [PATCH 3/3] selftests: kvm: add test for dirty logging inside nested guests Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f04f7517-67d9-856b-58e4-f3efdc4566d7@google.com \
    --to=junaids@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®