All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Cfir Cohen <cfir@google.com>,
	"kvm @ vger . kernel . org" <kvm@vger.kernel.org>,
	Lendacky Thomas <thomas.lendacky@amd.com>,
	Singh Brijesh <brijesh.singh@amd.com>,
	Grimm Jon <Jon.Grimm@amd.com>,
	David Rientjes <rientjes@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: SVM: Mark SEV launch secret pages as dirty.
Date: Wed, 23 Sep 2020 10:26:46 -0700	[thread overview]
Message-ID: <20200923172646.GB32044@linux.intel.com> (raw)
In-Reply-To: <548b7b73-7a13-8267-414e-2b9e1569c7f7@redhat.com>

On Wed, Sep 23, 2020 at 07:16:08PM +0200, Paolo Bonzini wrote:
> On 23/09/20 19:04, Sean Christopherson wrote:
> >> Two of the three instances are a bit different though.  What about this
> >> which at least shortens the comment to 2 fewer lines:
> > Any objection to changing those to "Flush (on non-coherent CPUs)"?  I agree
> > it would be helpful to call out the details, especially for DBG_*, but I
> > don't like that it reads as if the flush is unconditional.
> 
> Hmm... It's already fairly long lines so that would wrap to 3 lines, and

Dang, I was hoping it would squeeze into 2.

> the reference to the conditional flush wasn't there before either.

Well, the flush wasn't conditional before (ignoring the NULL check).
 
> sev_clflush_pages could be a better place to mention that (or perhaps
> it's self-explanatory).

I agree, but with

	/*
	 * Flush before LAUNCH_UPDATE encrypts pages in place, in case the cache
	 * contains the data that was written unencrypted.
 	 */
 	sev_clflush_pages(inpages, npages);

there's nothing in the comment or code that even suggests sev_clflush_pages() is
conditional, i.e. no reason for the reader to peek at the implemenation.

What about:

	/*
	 * Flush (on non-coherent CPUs) before LAUNCH_UPDATE encrypts pages in
	 * place, the cache may contain data that was written unencrypted.
	 */

  reply	other threads:[~2020-09-23 17:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07  1:23 [PATCH] KVM: SVM: Mark SEV launch secret pages as dirty Cfir Cohen
2020-08-07 17:55 ` David Rientjes
2020-08-08  0:02 ` Krish Sadhukhan
2020-08-08  0:37 ` [PATCH v2] " Cfir Cohen
2020-08-10 11:05   ` Brijesh Singh
     [not found] ` <20200919045505.GC21189@sjchrist-ice>
2020-09-23 16:59   ` [PATCH] " Paolo Bonzini
     [not found]     ` <20200923170444.GA20076@linux.intel.com>
2020-09-23 17:16       ` Paolo Bonzini
2020-09-23 17:26         ` Sean Christopherson [this message]
2020-09-23 17:27           ` Paolo Bonzini
2020-09-25  2:00 ` Cfir Cohen
2020-09-25  4:54   ` Greg KH

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=20200923172646.GB32044@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=Jon.Grimm@amd.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=cfir@google.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rientjes@google.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.