lkml.org 
[lkml]   [2011]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86, AMD: Correct F15h IC aliasing issue

* 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


\
 
 \ /
  Last update: 2011-07-27 09:03    [W:0.048 / U:3.044 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site