From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: <linux-mips@linux-mips.org>, "Steven J. Hill" <Steven.Hill@imgtec.com>
Subject: Re: 74K/1074K support
Date: Mon, 30 Sep 2013 14:29:02 -0700 [thread overview]
Message-ID: <5249ED1E.4050106@imgtec.com> (raw)
In-Reply-To: <20130925052715.GB473@linux-mips.org>
On 09/24/2013 10:27 PM, Ralf Baechle wrote:
> Commit 006a851b10a395955c153a145ad8241494d43688 adds 74K support in c-r4k.c:
>
> +static inline void alias_74k_erratum(struct cpuinfo_mips *c)
> +{
> + /*
> + * Early versions of the 74K do not update the cache tags on a
> + * vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG
> + * aliases. In this case it is better to treat the cache as always
> + * having aliases.
> + */
> + if ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(2, 4, 0))
> + c->dcache.flags |= MIPS_CACHE_VTAG;
> + if ((c->processor_id & 0xff) == PRID_REV_ENCODE_332(2, 4, 0))
> + write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
> + if (((c->processor_id & 0xff00) == PRID_IMP_1074K) &&
> + ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(1, 1, 0))) {
> + c->dcache.flags |= MIPS_CACHE_VTAG;
> + write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
> + }
> +}
>
> But MIPS D-caches are never virtually tagged, so there is nothing in
> the kernel that ever tests the MIPS_CACHE_VTAG flag in a D-cache
> descriptor.
>
> Cargo cult programming at its finest? Or was MIPS_CACHE_ALIASES what
> really was meant to be set?
>
> Ralf
There is a problem on early versions of 74K/1074K which can be effectively cured by setting MIPS_CACHE_VTAG.
It enforces the needed cache handling.
I hope it will go away as customers replace RTL for newer versions.
But I prefer the patch version from Maciej W. Rozycki, it is more clear.
- Leonid.
WARNING: multiple messages have this Message-ID (diff)
From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, "Steven J. Hill" <Steven.Hill@imgtec.com>
Subject: Re: 74K/1074K support
Date: Mon, 30 Sep 2013 14:29:02 -0700 [thread overview]
Message-ID: <5249ED1E.4050106@imgtec.com> (raw)
Message-ID: <20130930212902.F1y8Glfy77VPKHum1I_s9j9hOWk_fmrwWoJFhZ0GXRg@z> (raw)
In-Reply-To: <20130925052715.GB473@linux-mips.org>
On 09/24/2013 10:27 PM, Ralf Baechle wrote:
> Commit 006a851b10a395955c153a145ad8241494d43688 adds 74K support in c-r4k.c:
>
> +static inline void alias_74k_erratum(struct cpuinfo_mips *c)
> +{
> + /*
> + * Early versions of the 74K do not update the cache tags on a
> + * vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG
> + * aliases. In this case it is better to treat the cache as always
> + * having aliases.
> + */
> + if ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(2, 4, 0))
> + c->dcache.flags |= MIPS_CACHE_VTAG;
> + if ((c->processor_id & 0xff) == PRID_REV_ENCODE_332(2, 4, 0))
> + write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
> + if (((c->processor_id & 0xff00) == PRID_IMP_1074K) &&
> + ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(1, 1, 0))) {
> + c->dcache.flags |= MIPS_CACHE_VTAG;
> + write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
> + }
> +}
>
> But MIPS D-caches are never virtually tagged, so there is nothing in
> the kernel that ever tests the MIPS_CACHE_VTAG flag in a D-cache
> descriptor.
>
> Cargo cult programming at its finest? Or was MIPS_CACHE_ALIASES what
> really was meant to be set?
>
> Ralf
There is a problem on early versions of 74K/1074K which can be effectively cured by setting MIPS_CACHE_VTAG.
It enforces the needed cache handling.
I hope it will go away as customers replace RTL for newer versions.
But I prefer the patch version from Maciej W. Rozycki, it is more clear.
- Leonid.
next prev parent reply other threads:[~2013-09-30 21:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 5:27 74K/1074K support Ralf Baechle
2013-09-30 21:29 ` Leonid Yegoshin [this message]
2013-09-30 21:29 ` Leonid Yegoshin
2013-10-01 12:54 ` Ralf Baechle
2013-10-01 18:06 ` Leonid Yegoshin
2013-10-01 18:06 ` Leonid Yegoshin
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=5249ED1E.4050106@imgtec.com \
--to=leonid.yegoshin@imgtec.com \
--cc=Steven.Hill@imgtec.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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