mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Singh, Balbir" <sblbir@amazon.com>
To: "bp@alien8.de" <bp@alien8.de>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"dave.hansen@intel.com" <dave.hansen@intel.com>
Subject: Re: [PATCH 3/3] arch/x86: Optionally flush L1D on context switch
Date: Thu, 2 Apr 2020 22:18:54 +0000	[thread overview]
Message-ID: <b6655e68246bb19bd1dde17602c80dc4d9c9d2c8.camel@amazon.com> (raw)
In-Reply-To: <20200402221109.GJ9352@zn.tnic>

On Fri, 2020-04-03 at 00:11 +0200, Borislav Petkov wrote:
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you can confirm the sender and know
> the content is safe.
> 
> 
> 
> On Thu, Apr 02, 2020 at 05:24:01PM +1100, Balbir Singh wrote:
> > +int enable_l1d_flush_for_task(struct task_struct *tsk)
> > +{
> > +     struct page *page;
> > +     int ret = 0;
> > +
> > +     if (static_cpu_has(X86_FEATURE_FLUSH_L1D))
> > +             goto done;
> > +
> > +     page = READ_ONCE(l1d_flush_pages);
> > +     if (unlikely(!page)) {
> > +             mutex_lock(&l1d_flush_mutex);
> > +             if (!l1d_flush_pages) {
> > +                     l1d_flush_pages = alloc_l1d_flush_pages();
> > +                     if (!l1d_flush_pages)
> > +                             return -ENOMEM;
> 
> Do I see it correctly that you'll return here with l1d_flush_mutex still
> held?

Darn.. :(

I had goto done to release the mutex earlier, let me fix that :)

Thanks,
Balbir Singh

> 
> > +             }
> > +             mutex_unlock(&l1d_flush_mutex);
> > +     }
> > +     /* I don't think we need to worry about KSM */
> 
> Pls use passive voice: no "we" or "I", etc.
> 
> --
> Regards/Gruss,
>     Boris.
> 
> https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2020-04-02 22:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02  6:23 [PATCH 0/3] " Balbir Singh
2020-04-02  6:23 ` [PATCH 1/3] arch/x86/kvm: Refactor l1d flush lifecycle management Balbir Singh
2020-04-02  6:24 ` [PATCH 2/3] arch/x86: Refactor tlbflush and l1d flush Balbir Singh
2020-04-02  6:24 ` [PATCH 3/3] arch/x86: Optionally flush L1D on context switch Balbir Singh
2020-04-02 22:11   ` Borislav Petkov
2020-04-02 22:18     ` Singh, Balbir [this message]
2020-04-02 20:13 ` [PATCH 0/3] " Josh Poimboeuf
2020-04-02 20:35   ` Singh, Balbir
2020-04-02 20:47     ` Josh Poimboeuf
2020-04-02 21:45       ` Thomas Gleixner
2020-04-02 22:23         ` Singh, Balbir

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=b6655e68246bb19bd1dde17602c80dc4d9c9d2c8.camel@amazon.com \
    --to=sblbir@amazon.com \
    --cc=benh@kernel.crashing.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome