Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Steven J. Hill" <Steven.Hill@imgtec.com>
To: Jonas Gorski <jogo@openwrt.org>
Cc: <linux-mips@linux-mips.org>,
	Jayachandran C <jchandra@broadcom.com>,
	"David Daney" <david.daney@cavium.com>
Subject: Re: [PATCH V2] MIPS: flush TLB handlers before calling them
Date: Thu, 20 Jun 2013 15:37:44 -0500	[thread overview]
Message-ID: <51C36818.5040902@imgtec.com> (raw)
In-Reply-To: <1371760182-637-1-git-send-email-jogo@openwrt.org>

On 06/20/2013 03:29 PM, Jonas Gorski wrote:
> When having enabled MIPS_PGD_C0_CONTEXT, trap_init() might call the
> generated tlbmiss_handler_setup_pgd before it was committed to memory,
> causing boot failures:
>
>    trap_init()
>     |- per_cpu_trap_init()
>     |   |- TLBMISS_HANDLER_SETUP()
>     |       |- tlbmiss_handler_setup_pgd()
>     |- flush_tlb_handlers()
>
> To avoid this, move flush_tlb_handlers() into per_cpu_trap_init() to
> ensure the generated handler is always committed on all cpus.
>
> This issue was introduced in 3d8bfdd0307223de678962f1c1907a7cec549136
> ("MIPS: Use C0_KScratch (if present) to hold PGD pointer.").
>
> Signed-off-by: Jonas Gorski <jogo@openwrt.org>
> ---
>
> V1 -> V2:
>   * Move flush_tlb_handlers into per_cpu_trap_init() to also fix it for
>     !boot_cpu.
>
Great work on finding this! This works on Malta with a 1074K in
uniprocessor and SMP kernel configurations. Linking a microMIPS kernel
is still broken as evidenced with:

    mips-linux-gnu-ld: arch/mips/built-in.o: .cpuinit.text+0x1572:
    Unsupported jump between ISA modes; consider recompiling with
    interlinking enabled.
    mips-linux-gnu-ld: final link failed: Bad value
    make: *** [vmlinux] Error 1

The array:

    u32 tlbmiss_handler_setup_pgd_array[16] __cacheline_aligned;

Needs to be replaced using the method in the commit "MIPS: Refactor
'clear_page' and 'copy_page' functions." with hash
c022630633624a75b3b58f43dd3c6cc896a56cff.

-Steve

WARNING: multiple messages have this Message-ID (diff)
From: "Steven J. Hill" <Steven.Hill@imgtec.com>
To: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org, Jayachandran C <jchandra@broadcom.com>,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH V2] MIPS: flush TLB handlers before calling them
Date: Thu, 20 Jun 2013 15:37:44 -0500	[thread overview]
Message-ID: <51C36818.5040902@imgtec.com> (raw)
Message-ID: <20130620203744.C5TeW2WiUdL12_5NbD_572ysIGBaFruScmGP2L6lGpk@z> (raw)
In-Reply-To: <1371760182-637-1-git-send-email-jogo@openwrt.org>

On 06/20/2013 03:29 PM, Jonas Gorski wrote:
> When having enabled MIPS_PGD_C0_CONTEXT, trap_init() might call the
> generated tlbmiss_handler_setup_pgd before it was committed to memory,
> causing boot failures:
>
>    trap_init()
>     |- per_cpu_trap_init()
>     |   |- TLBMISS_HANDLER_SETUP()
>     |       |- tlbmiss_handler_setup_pgd()
>     |- flush_tlb_handlers()
>
> To avoid this, move flush_tlb_handlers() into per_cpu_trap_init() to
> ensure the generated handler is always committed on all cpus.
>
> This issue was introduced in 3d8bfdd0307223de678962f1c1907a7cec549136
> ("MIPS: Use C0_KScratch (if present) to hold PGD pointer.").
>
> Signed-off-by: Jonas Gorski <jogo@openwrt.org>
> ---
>
> V1 -> V2:
>   * Move flush_tlb_handlers into per_cpu_trap_init() to also fix it for
>     !boot_cpu.
>
Great work on finding this! This works on Malta with a 1074K in
uniprocessor and SMP kernel configurations. Linking a microMIPS kernel
is still broken as evidenced with:

    mips-linux-gnu-ld: arch/mips/built-in.o: .cpuinit.text+0x1572:
    Unsupported jump between ISA modes; consider recompiling with
    interlinking enabled.
    mips-linux-gnu-ld: final link failed: Bad value
    make: *** [vmlinux] Error 1

The array:

    u32 tlbmiss_handler_setup_pgd_array[16] __cacheline_aligned;

Needs to be replaced using the method in the commit "MIPS: Refactor
'clear_page' and 'copy_page' functions." with hash
c022630633624a75b3b58f43dd3c6cc896a56cff.

-Steve

  reply	other threads:[~2013-06-20 20:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 20:29 [PATCH V2] MIPS: flush TLB handlers before calling them Jonas Gorski
2013-06-20 20:37 ` Steven J. Hill [this message]
2013-06-20 20:37   ` Steven J. Hill

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=51C36818.5040902@imgtec.com \
    --to=steven.hill@imgtec.com \
    --cc=david.daney@cavium.com \
    --cc=jchandra@broadcom.com \
    --cc=jogo@openwrt.org \
    --cc=linux-mips@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