From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: cache: assume 64-byte L1 cachelines for ARMv7 CPUs
Date: Mon, 16 Jan 2012 16:09:31 +0000 [thread overview]
Message-ID: <20120116160931.GA32049@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAMQu2gxj_MZd_6BxYy2abshA-hcckrF0S1Zoi6v+5ELzc06rJQ@mail.gmail.com>
On Mon, Jan 16, 2012 at 04:52:14PM +0100, Shilimkar, Santosh wrote:
> Will,
> On Mon, Jan 16, 2012 at 4:44 PM, Will Deacon <will.deacon@arm.com> wrote:
> > To ensure correct alignment of cacheline-aligned data, the maximum
> > cacheline size needs to be known at compile time.
> >
> > Since Cortex-A8 and Cortex-A15 have 64-byte cachelines (and it is likely
> > that there will be future ARMv7 implementations with the same line size)
> > then it makes sense to assume that CPU_V7 implies a 64-byte L1 cacheline
> > size. For CPUs with smaller caches, this will result in some harmless
> > padding but will help with single zImage work and avoid hitting subtle
> > bugs with misaligned data structures.
> >
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
> > ---
> > ?arch/arm/mm/Kconfig | ? ?2 +-
> > ?1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> > index 4cefb57..493e5ea5 100644
> > --- a/arch/arm/mm/Kconfig
> > +++ b/arch/arm/mm/Kconfig
> > @@ -887,7 +887,7 @@ config ARM_L1_CACHE_SHIFT_6
> >
> > ?config ARM_L1_CACHE_SHIFT
> > ? ? ? ?int
> > - ? ? ? default 6 if ARM_L1_CACHE_SHIFT_6
> > + ? ? ? default 6 if ARM_L1_CACHE_SHIFT_6 || CPU_V7
>
> Will be really harmless on A9 ? We have L2 also to be
> considered here which hard codes the line size as 32.
Going for a larger cache line size is safe: this is used for aligning
data structures and similar, and aligning to 64-byte means that it's
also 32-byte aligned.
next prev parent reply other threads:[~2012-01-16 16:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 15:44 [PATCH 1/2] ARM: vmlinux.lds.S: do not hardcode cacheline size as 32 bytes Will Deacon
2012-01-16 15:44 ` [PATCH 2/2] ARM: cache: assume 64-byte L1 cachelines for ARMv7 CPUs Will Deacon
2012-01-16 15:52 ` Shilimkar, Santosh
2012-01-16 16:09 ` Russell King - ARM Linux [this message]
2012-01-16 16:14 ` Will Deacon
2012-01-16 16:24 ` Shilimkar, Santosh
2012-01-16 18:22 ` [PATCH 1/2] ARM: vmlinux.lds.S: do not hardcode cacheline size as 32 bytes Stephen Boyd
2012-01-16 18:26 ` Will Deacon
2012-01-16 18:30 ` Stephen Boyd
2012-01-16 19:11 ` Will Deacon
2012-01-16 19:35 ` Nicolas Pitre
2012-01-17 10:11 ` Will Deacon
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=20120116160931.GA32049@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).