From: Ingo Molnar <mingo@elte.hu>
To: Borislav Petkov <bp@amd64.org>
Cc: Avi Kivity <avi@redhat.com>,
"Przywara, Andre" <Andre.Przywara@amd.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"Pohlack, Martin" <Martin.Pohlack@amd.com>
Subject: Re: [PATCH] x86, AMD: Correct F15h IC aliasing issue
Date: Wed, 27 Jul 2011 08:59:32 +0200 [thread overview]
Message-ID: <20110727065932.GA16555@elte.hu> (raw)
In-Reply-To: <20110727062120.GA5272@aftab>
* Borislav Petkov <bp@amd64.org> wrote:
> On Wed, Jul 27, 2011 at 12:14:26AM -0400, Avi Kivity wrote:
> > On 07/26/2011 10:42 PM, Andre Przywara wrote:
> > >
> > > There is no need to determine it by calculating, because it caused by
> > > the special design of the BD L1 cache and thus fixed.
> > > And a calculation would be even more confusing:
> > >
> > > The L1I is virtually indexed, but physically tagged.
> > > 64KB L1I cache, 64 Bytes per Cacheline = 1024 cache lines
> > > 1024 lines / 2 way associative = 512 indexes
> > > 64 Bytes per Cacheline (6 bits) + 512 indexes (9 bits) = bits [14:0]
> > > virtual and physical addresses are the same for bits [11:0], which
> > > leaves the remaining 14:12 susceptible for aliasing.
> > >
> > > So bit 12 comes from PAGESIZE and yes, the 14 could be derived from
> > > the CPUID cache info, but I don't see much value in breaking this down
> > > this way.
> > > But I agree that there should be some comment in the patch which at
> > > least notes that bits [14:12] are due to the L1I design, maybe we can
> > > copy a nicer version of the above math in the commit message for
> > > reference.
> > >
> >
> > If among the 12,432.8 cpuid leaves exposed by the cpu we had a bit that
> > said L1I was shared, and another that said it was virtually indexed, and
> > others describing the cache size, cache line size, and number of ways,
> > then we could perform the arithmetic at runtime, yes?
> >
> > That means that if the caches grow or increase their associativity, then
> > we don't need to patch the kernel again.
>
> Yeah, actually the idea is to patch the kernel only this one time
> and never ever be needing to do this for future CPUs, for this
> matter.
But the check you have added turns this workaround on for all family
0x15 CPUs. If a family 0x15 CPU is built with a larger or more
associative cache, one that does not need the workaround, we would
still turn on the workaround.
Or is it impossible that family 0x15 CPUs will ever be fixed?
Thanks,
Ingo
next prev parent reply other threads:[~2011-07-27 7:00 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 13:15 [PATCH] x86, AMD: Correct F15h IC aliasing issue Borislav Petkov
2011-07-24 11:13 ` Ingo Molnar
2011-07-24 13:40 ` Borislav Petkov
2011-07-24 13:47 ` Ingo Molnar
2011-07-24 16:16 ` Andrew Morton
2011-07-26 18:33 ` Borislav Petkov
2011-07-24 16:04 ` Linus Torvalds
2011-07-24 17:22 ` Borislav Petkov
2011-07-24 17:39 ` Linus Torvalds
2011-07-24 18:12 ` Ingo Molnar
2011-07-24 18:23 ` Borislav Petkov
2011-07-24 18:30 ` Ingo Molnar
2011-07-24 19:07 ` Borislav Petkov
2011-07-24 20:44 ` Ingo Molnar
2011-07-25 20:00 ` Borislav Petkov
2011-07-25 20:06 ` Ingo Molnar
2011-07-25 21:53 ` Borislav Petkov
2011-07-26 5:58 ` Ray Lee
2011-07-26 17:28 ` Borislav Petkov
2011-07-26 18:34 ` Ingo Molnar
2011-07-26 18:39 ` Borislav Petkov
2011-07-26 18:47 ` Ingo Molnar
2011-07-26 19:33 ` Borislav Petkov
2011-07-27 17:10 ` Borislav Petkov
2011-07-27 17:16 ` H. Peter Anvin
2011-07-28 13:44 ` Borislav Petkov
2011-07-28 14:02 ` H. Peter Anvin
2011-07-28 14:13 ` Borislav Petkov
2011-07-28 14:18 ` H. Peter Anvin
2011-07-28 14:35 ` Borislav Petkov
2011-07-26 17:59 ` Avi Kivity
2011-07-26 18:13 ` Borislav Petkov
2011-07-26 18:16 ` H. Peter Anvin
2011-07-26 18:37 ` Borislav Petkov
2011-07-26 18:38 ` H. Peter Anvin
2011-07-26 19:42 ` Andre Przywara
2011-07-26 22:34 ` H. Peter Anvin
2011-07-27 4:14 ` Avi Kivity
2011-07-27 6:21 ` Borislav Petkov
2011-07-27 6:59 ` Ingo Molnar [this message]
2011-07-27 9:30 ` Avi Kivity
2011-07-27 15:37 ` Borislav Petkov
2011-07-27 15:45 ` Avi Kivity
2011-07-27 15:49 ` Borislav Petkov
2011-07-27 15:57 ` Avi Kivity
2011-07-27 16:42 ` Borislav Petkov
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=20110727065932.GA16555@elte.hu \
--to=mingo@elte.hu \
--cc=Andre.Przywara@amd.com \
--cc=Martin.Pohlack@amd.com \
--cc=avi@redhat.com \
--cc=bp@amd64.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--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