Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: "Steven J. Hill" <sjhill@mips.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, jchandra@broadcom.com
Subject: Re: [PATCH v2] MIPS: Optimise TLB handlers for MIPS32/64 R2 cores.
Date: Thu, 03 Jan 2013 14:37:57 -0800	[thread overview]
Message-ID: <50E60845.9060700@gmail.com> (raw)
In-Reply-To: <1357249536-2308-1-git-send-email-sjhill@mips.com>

On 01/03/2013 01:45 PM, Steven J. Hill wrote:
> From: "Steven J. Hill" <sjhill@mips.com>
>
> The EXT and INS instructions can be used to decrease code size and
> thus speed up TLB handlers on MIPS32R2 and MIPS64R2 cores.
>
[...]
> @@ -1012,6 +1019,24 @@ static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx)
>
>   static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
>   {
> +	if (cpu_has_mips_r2) {
> +		/* PTE ptr offset is obtained from BadVAddr */
> +		UASM_i_MFC0(p, tmp, C0_BADVADDR);
> +		UASM_i_LW(p, ptr, 0, ptr);
> +#ifdef CONFIG_CPU_MIPS64

Is this the right condition?  Is is correct for a 32-bit kernel running 
on a 64-bit CPU?  Will OCTEON be covered? (no, but it should)

> +		uasm_i_dext(p, tmp, tmp, (PAGE_SHIFT + 1),
> +			(PAGE_SHIFT - PTE_ORDER - PTE_T_LOG2 - 1));
> +		uasm_i_dins(p, ptr, tmp, (PTE_T_LOG2 + 1),
> +			(PAGE_SHIFT - PTE_ORDER - PTE_T_LOG2 - 1));
> +#else
> +		uasm_i_ext(p, tmp, tmp, (PAGE_SHIFT + 1),
> +			(PGDIR_SHIFT - PAGE_SHIFT - 1);

Did you even compile this?  It looks like a mismatch in the number of 
'(' and ')'.

> +		uasm_i_ins(p, ptr, tmp, (PTE_T_LOG2 + 1),
> +			(PGDIR_SHIFT - PAGE_SHIFT - 1);
> +#endif
> +		return;
> +	}


Can this whole thing be made more clear by defining UASM_i_EXT(...) that 
does the proper thing for either 32 or 64 bit kernels as the rest of the 
capitolized versions of the macros do?


Is (PAGE_SHIFT - PTE_ORDER - PTE_T_LOG2 - 1) != (PGDIR_SHIFT - 
PAGE_SHIFT - 1) for any combinations of config options?  Why are they 
different for the two cases?

David Daney

  reply	other threads:[~2013-01-03 22:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 21:45 [PATCH v2] MIPS: Optimise TLB handlers for MIPS32/64 R2 cores Steven J. Hill
2013-01-03 22:37 ` David Daney [this message]
2013-01-03 23:00   ` Hill, Steven

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=50E60845.9060700@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=jchandra@broadcom.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sjhill@mips.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