linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Greg Ungerer <gerg@linux-m68k.org>
Cc: "Linux/m68k" <linux-m68k@vger.kernel.org>,
	Joachim Dietrich <jo.dietrich@gmx.de>
Subject: Re: [PATCH 1/5] m68knommu: fix overwriting of bits in ColdFire V3 cache control
Date: Mon, 15 Jun 2020 13:26:23 +0200	[thread overview]
Message-ID: <CAMuHMdV=LORyqrFPLTuysHVBEqcKXuDydr15b883yStjaVrWZQ@mail.gmail.com> (raw)
In-Reply-To: <20200615063508.2435061-1-gerg@linux-m68k.org>

Hi Greg,

On Mon, Jun 15, 2020 at 8:38 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> The Cache Control Register (CACR) of the ColdFire V3 has bits that
> control high level caching functions, and also enable/disable the use
> of the alternate stack pointer register (the EUSP bit) to provide
> separate supervisor and user stack pointer registers. The code as
> it is today will blindly clear the EUSP bit on cache actions like
> invalidation. So it is broken for this case - and that will result
> in failed booting (interrupt entry and exit processing will be
> completely hosed).
>
> This only affects ColdFire V3 parts that support the alternate stack
> register (like the 5329 for example) - generally speaking new parts do,
> older parts don't. It has no impact on ColdFire V3 parts with the single
> stack pointer, like the 5307 for example.
>
> Fix the cache bit defines used, so they maintain the EUSP bit when
> carrying out cache actions through the CACR register.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Thanks for your patch!

> --- a/arch/m68k/include/asm/m53xxacr.h
> +++ b/arch/m68k/include/asm/m53xxacr.h
> @@ -89,9 +89,9 @@
>   * coherency though in all cases. And for copyback caches we will need
>   * to push cached data as well.
>   */
> -#define CACHE_INIT       CACR_CINVA
> -#define CACHE_INVALIDATE  CACR_CINVA
> -#define CACHE_INVALIDATED CACR_CINVA
> +#define CACHE_INIT        (CACHE_MODE + CACR_CINVA)

This line is different from the RFC v2 in
https://www.spinics.net/lists/linux-m68k/msg13973.html ?

> +#define CACHE_INVALIDATE  (CACHE_MODE + CACR_CINVA)
> +#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINVA)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2020-06-15 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15  6:35 [PATCH 1/5] m68knommu: fix overwriting of bits in ColdFire V3 cache control Greg Ungerer
2020-06-15 11:26 ` Geert Uytterhoeven [this message]
2020-06-15 13:32   ` Greg Ungerer

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='CAMuHMdV=LORyqrFPLTuysHVBEqcKXuDydr15b883yStjaVrWZQ@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=jo.dietrich@gmx.de \
    --cc=linux-m68k@vger.kernel.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).