From: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
To: Dave Hansen <dave.hansen@intel.com>,
Ong Boon Leong <boon.leong.ong@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH] x86, setup: add __flush_tlb() for Intel Quark X1000
Date: Fri, 26 Sep 2014 18:22:25 +0100 [thread overview]
Message-ID: <5425A0D1.3020409@nexus-software.ie> (raw)
In-Reply-To: <54257FAB.6010208@nexus-software.ie>
On 26/09/14 16:00, Bryan O'Donoghue wrote:
>> + /*
>> + * Locate the page directory and flush the TLB.
>> + *
>> + * On Quark X1000 CPUs we still have the PGE bit incorrectly set
>> + * due to a processor erratum, so __flush_tlb_all() is not yet
>> + * doing what it says. Fortunately we have a cr3 flush here,
>> + * which is what is needed in this processor to flush TLBs, so
>> + * there's no need to add a Quark X1000 quirk here.
>> + *
>> + * early_init_intel will unset the X86_FEATURE_PGE flag later
>> + * and __flush_tlb_all() will flush via cr3
>> + */
>> + __flush_tlb();
>>
>> With the extra __flush_tlb(); on the end.
>
> Scatch that.
>
> ACK Ong Boon Leong's patch
Hmm.
At the risk of contradicting myself in public I had a think about this
on the drive home and ...
As I see it - the reload @ CR3 should have flushed the TLB. That's what
the documentation says.
Right now with the proposed patch from Ong Boon Leong the code will be
load_cr3(swapper_pg_dir);
__flush_tlb_all();
__flush_tlb();
While there may be no *harm* in adding an extra __flush_tlb(); - there's
not much *sense* in it either.
If however there's a strong feeling that an explicit __flush_tlb() is
required in Quark's case then - I believe the code should revert to the
original logic from the Quark BSP namely.
+ if (boot_cpu_data.x86 == 5 && boot_cpu_data.x86_model == 9)
+ __flush_tlb();
+ else
+ __flush_tlb_all();
This was Peter's initial suggestion in any case and as I see it the
right-thing-to-do rather than have another reduntant __flush_tlb() for
everybody who's not Quark.
How does that make sense ?
I can't imagine it's preferable to do a __flush_tlb(); on *x86 for the
sake of skipping an if/else
I'll resubmit that now with Ong Boon's commentary.
Best,
BOD
next prev parent reply other threads:[~2014-09-26 17:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 4:30 [PATCH] x86, setup: Additional __flush_tlb for Quak X1000 Ong Boon Leong
2014-09-26 4:30 ` [PATCH] x86, setup: add __flush_tlb() for Intel Quark X1000 Ong Boon Leong
2014-09-26 5:32 ` Dave Hansen
2014-09-26 8:44 ` Bryan O'Donoghue
2014-09-26 14:20 ` Dave Hansen
2014-09-26 14:30 ` Bryan O'Donoghue
2014-09-26 15:00 ` Bryan O'Donoghue
2014-09-26 17:22 ` Bryan O'Donoghue [this message]
2014-09-26 8:54 ` Bryan O'Donoghue
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=5425A0D1.3020409@nexus-software.ie \
--to=pure.logic@nexus-software.ie \
--cc=ak@linux.intel.com \
--cc=arjan@linux.intel.com \
--cc=boon.leong.ong@intel.com \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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