linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Paul Burton <paul.burton@mips.com>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>
Cc: Serge Semin <fancer.lancer@gmail.com>,
	Paul Burton <pburton@wavecomp.com>
Subject: Re: [PATCH 1/4] MIPS: Use memblock_phys_alloc() for exception vector
Date: Wed, 1 May 2019 16:32:53 +0200	[thread overview]
Message-ID: <c982e1f3-8145-9c73-ae20-0694a7bd5855@amsat.org> (raw)
In-Reply-To: <20190430225216.7164-2-paul.burton@mips.com>

On 5/1/19 12:53 AM, Paul Burton wrote:
> Allocate the exception vector using memblock_phys_alloc() which gives us
> a physical address, rather than the previous convoluted setup which
> obtained a virtual address using memblock_alloc(), converted it to a
> physical address & then back to a virtual address.
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>
> ---
>  arch/mips/kernel/traps.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> index 98ca55d62201..00f44b16385e 100644
> --- a/arch/mips/kernel/traps.c
> +++ b/arch/mips/kernel/traps.c
> @@ -2292,9 +2292,8 @@ void __init trap_init(void)
>  		unsigned long size = 0x200 + VECTORSPACING*64;
>  		phys_addr_t ebase_pa;
>  
> -		ebase = (unsigned long)
> -			memblock_alloc(size, 1 << fls(size));
> -		if (!ebase)
> +		ebase_pa = memblock_phys_alloc(size, 1 << fls(size));
> +		if (!ebase_pa)
>  			panic("%s: Failed to allocate %lu bytes align=0x%x\n",
>  			      __func__, size, 1 << fls(size));
>  
> @@ -2309,9 +2308,10 @@ void __init trap_init(void)
>  		 * EVA is special though as it allows segments to be rearranged
>  		 * and to become uncached during cache error handling.
>  		 */
> -		ebase_pa = __pa(ebase);
>  		if (!IS_ENABLED(CONFIG_EVA) && !WARN_ON(ebase_pa >= 0x20000000))
>  			ebase = CKSEG0ADDR(ebase_pa);
> +		else
> +			ebase = (unsigned long)phys_to_virt(ebase_pa);
>  	} else {
>  		ebase = CAC_BASE;
>  
> 

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

  reply	other threads:[~2019-05-01 14:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 22:53 [PATCH 0/4] MIPS: Exception vector improvements Paul Burton
2019-04-30 22:53 ` [PATCH 2/4] MIPS: Always allocate exception vector for MIPSr2+ Paul Burton
2019-04-30 22:53 ` [PATCH 1/4] MIPS: Use memblock_phys_alloc() for exception vector Paul Burton
2019-05-01 14:32   ` Philippe Mathieu-Daudé [this message]
2019-04-30 22:53 ` [PATCH 4/4] MIPS: Remove duplicate EBase configuration Paul Burton
2019-04-30 22:53 ` [PATCH 3/4] MIPS: Sync icache for whole exception vector Paul Burton
2019-05-01 15:09   ` Philippe Mathieu-Daudé
2019-05-02 13:59 ` [PATCH 0/4] MIPS: Exception vector improvements Serge Semin
2019-05-02 18:35 ` Paul Burton

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=c982e1f3-8145-9c73-ae20-0694a7bd5855@amsat.org \
    --to=f4bug@amsat.org \
    --cc=fancer.lancer@gmail.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=pburton@wavecomp.com \
    /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).