From: "Jim Hull" <jim.hull@hp.com>
To: "'KAMEZAWA Hiroyuki'" <kamezawa.hiroyu@jp.fujitsu.com>,
"'David Mosberger-Tang'" <dmosberger@gmail.com>
Cc: "'LKML'" <linux-kernel@vger.kernel.org>,
<linux-ia64@vger.kernel.org>, <tony.luck@intel.com>,
<Zoltan.Menyhart@bull.net>,
"'Christoph Lameter'" <clameter@sgi.com>
Subject: RE: [PATCH] flush icache before set_pte take6. [4/4] optimization for cpus other than montecito
Date: Tue, 31 Jul 2007 10:06:36 -0700 [thread overview]
Message-ID: <019b01c7d395$27d692b0$3e3af40f@americas.hpqcorp.net> (raw)
In-Reply-To: <20070731132932.8e21d48c.kamezawa.hiroyu@jp.fujitsu.com>
Not just crazy, but wrong - this *can* happen on pre-Montecito. Even though
L1D is write-through and L2 was mixed I/D, the L1 I-cache could contain
stale instrutions if there are missing flushes. I think the only reason this
has never been observed is that the L1I is so small (32K) that it's likely
that any stale data has been displaced.
-- Jim
> -----Original Message-----
> From: linux-ia64-owner@vger.kernel.org
> [mailto:linux-ia64-owner@vger.kernel.org] On Behalf Of
> KAMEZAWA Hiroyuki
> Sent: Monday, July 30, 2007 9:30 PM
> To: David Mosberger-Tang
> Cc: LKML; linux-ia64@vger.kernel.org; tony.luck@intel.com;
> Zoltan.Menyhart@bull.net; Christoph Lameter
> Subject: Re: [PATCH] flush icache before set_pte take6. [4/4]
> optimization for cpus other than montecito
>
> On Mon, 30 Jul 2007 22:15:50 -0600
> "David Mosberger-Tang" <dmosberger@gmail.com> wrote:
>
> > This seems crazy to me. Flushing should occur according to the
> > *architecture*, not model-by-model. Even if we happen to
> get "lucky"
> > on pre-Montecito CPUs, that doesn't justify such ugly hacks.
>
> I'm not sure this can happen before Montecito because L1 was
> write-through
> and L2 was mixed.
>
> > Or you really want to debug this *again* come next CPU?
>
> No.
> I should add RFC to this patch. I just want to hear opinions.
> This is why I separated this patch. I can drop this.
>
> Thanks,
> -Kame
>
>
>
>
>
>
> > --david
> >
> > On 7/30/07, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > >
> > > Add "L2 cache is separated? check flag" as read_mostly
> global variable.
> > >
> > > This add one memory reference to global variable to page
> faults of "executable"
> > > map in do_wp_page(page copy case), file-mapped page fault
> and some system calls
> > > which does memory map changes. But not so bad as calling
> sync_icache_dcache in
> > > architectures which doesn't need it.
> > >
> > > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > >
> > >
> > > ---
> > > arch/ia64/kernel/setup.c | 7 +++++++
> > > include/asm-ia64/pgtable.h | 3 ++-
> > > 2 files changed, 9 insertions(+), 1 deletion(-)
> > >
> > > Index: linux-2.6.23-rc1.test/arch/ia64/kernel/setup.c
> > >
> ===================================================================
> > > --- linux-2.6.23-rc1.test.orig/arch/ia64/kernel/setup.c
> > > +++ linux-2.6.23-rc1.test/arch/ia64/kernel/setup.c
> > > @@ -106,6 +106,8 @@ struct io_space io_space[MAX_IO_SPACES];
> > > EXPORT_SYMBOL(io_space);
> > > unsigned int num_io_spaces;
> > >
> > > +int separated_l2_icache_dcache __read_mostly;
> > > +
> > > /*
> > > * "flush_icache_range()" needs to know what processor
> dependent stride size to use
> > > * when it makes i-cache(s) coherent with d-caches.
> > > @@ -718,6 +720,11 @@ get_model_name(__u8 family, __u8 model)
> > > printk(KERN_ERR
> > > "%s: Table overflow. Some
> processor model information will be missing\n",
> > > __FUNCTION__);
> > > + /* Montecito has separated L2 Icache and Dcache.
> This requires
> > > + synchronize Icache and Dcache before set_pte() */
> > > + if (family == 0x20)
> > > + separated_l2_icache_dcache = 1;
> > > +
> > > return "Unknown";
> > > }
> > >
> > > Index: linux-2.6.23-rc1.test/include/asm-ia64/pgtable.h
> > >
> ===================================================================
> > > --- linux-2.6.23-rc1.test.orig/include/asm-ia64/pgtable.h
> > > +++ linux-2.6.23-rc1.test/include/asm-ia64/pgtable.h
> > > @@ -489,9 +489,10 @@ extern struct page *zero_page_memmap_ptr
> > > * as an executable pte.
> > > */
> > > extern void __sync_icache_dcache(pte_t pte);
> > > +extern int separated_l2_icache_dcache;
> > > static inline void sync_icache_dcache(pte_t pte)
> > > {
> > > - if (pte_exec(pte))
> > > + if (pte_exec(pte) && separated_l2_icache_dcache)
> > > __sync_icache_dcache(pte);
> > > }
> > > #define __HAVE_ARCH_SYNC_ICACHE_DCACHE
> > >
> > > -
> > > To unsubscribe from this list: send the line "unsubscribe
> linux-ia64" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > >
> >
> >
> > --
> > Mosberger Consulting LLC, http://www.mosberger-consulting.com/
> >
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-ia64" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2007-07-31 17:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 2:35 [PATCH] flush icache before set_pte take6. [0/4] KAMEZAWA Hiroyuki
2007-07-31 2:38 ` [PATCH] flush icache before set_pte take6. [1/4] migration fix KAMEZAWA Hiroyuki
2007-07-31 2:39 ` [PATCH] flush icache before set_pte take6. [2/4] sync icache dcache KAMEZAWA Hiroyuki
2007-07-31 2:40 ` [PATCH] flush icache before set_pte take6. [3/4] add montecito brand name KAMEZAWA Hiroyuki
2007-07-31 16:39 ` Luck, Tony
2007-08-01 0:17 ` KAMEZAWA Hiroyuki
2007-07-31 2:41 ` [PATCH] flush icache before set_pte take6. [4/4] optimization for cpus other than montecito KAMEZAWA Hiroyuki
2007-07-31 4:15 ` David Mosberger-Tang
2007-07-31 4:29 ` KAMEZAWA Hiroyuki
2007-07-31 5:02 ` KAMEZAWA Hiroyuki
2007-07-31 17:06 ` Jim Hull [this message]
2007-08-01 9:27 ` Zoltan Menyhart
2007-07-31 8:38 ` Zoltan Menyhart
2007-07-31 10:17 ` KAMEZAWA Hiroyuki
2007-07-31 11:02 ` Zoltan Menyhart
2007-07-31 16:44 ` Luck, Tony
2007-08-01 9:38 ` Zoltan Menyhart
2007-08-01 13:44 ` David Mosberger-Tang
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='019b01c7d395$27d692b0$3e3af40f@americas.hpqcorp.net' \
--to=jim.hull@hp.com \
--cc=Zoltan.Menyhart@bull.net \
--cc=clameter@sgi.com \
--cc=dmosberger@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.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®