All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: "Steven J. Hill" <sjhill@mips.com>, ralf@linux-mips.org
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 2/4] MIPS: Remove kernel_uses_smartmips_rixi use from arch/mips/mm.
Date: Wed, 05 Sep 2012 14:11:26 -0700	[thread overview]
Message-ID: <5047BFFE.1070109@gmail.com> (raw)
In-Reply-To: <1346876878-25965-3-git-send-email-sjhill@mips.com>

On 09/05/2012 01:27 PM, Steven J. Hill wrote:
> From: "Steven J. Hill" <sjhill@mips.com>
>
> Remove usage of the 'kernel_uses_smartmips_rixi' macro from all files
> in the 'arch/mips/mm' subsystem.
>

> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> index e565d45..90c86ee 100644
> --- a/arch/mips/mm/tlbex.c
> +++ b/arch/mips/mm/tlbex.c
> @@ -601,7 +601,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
>   static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
>   								  unsigned int reg)
>   {
> -	if (kernel_uses_smartmips_rixi) {
> +	if (cpu_has_ri | cpu_has_xi) {
>   		UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC));
>   		UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));

Patch is out of date.

This will not apply against mips-for-linux-next.

>   	} else {
> @@ -1021,7 +1021,7 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
>   	if (cpu_has_64bits) {
>   		uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
>   		uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
> -		if (kernel_uses_smartmips_rixi) {
> +		if (cpu_has_ri | cpu_has_xi) {
>   			UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
>   			UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
>   			UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
> @@ -1048,7 +1048,7 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
>   	UASM_i_LW(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
>   	if (r45k_bvahwbug())
>   		build_tlb_probe_entry(p);
> -	if (kernel_uses_smartmips_rixi) {
> +	if (cpu_has_ri | cpu_has_xi) {
>   		UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
>   		UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
>   		UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
> @@ -1214,7 +1214,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
>   		UASM_i_LW(p, even, 0, ptr); /* get even pte */
>   		UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
>   	}
> -	if (kernel_uses_smartmips_rixi) {
> +	if (cpu_has_ri | cpu_has_xi) {
>   		uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC));
>   		uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
>   		uasm_i_drotr(p, even, even,
> @@ -1576,7 +1576,7 @@ build_pte_present(u32 **p, struct uasm_reloc **r,
>   {
>   	int t = scratch >= 0 ? scratch : pte;
>
> -	if (kernel_uses_smartmips_rixi) {
> +	if (cpu_has_ri | cpu_has_xi) {
>   		if (use_bbit_insns()) {
>   			uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid);
>   			uasm_i_nop(p);
> @@ -1906,7 +1906,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
>   	if (m4kc_tlbp_war())
>   		build_tlb_probe_entry(&p);
>
> -	if (kernel_uses_smartmips_rixi) {
> +	if (cpu_has_ri | cpu_has_xi) {

These bits should be made conditional on the value of PageGrain[IEC].

Also when PageGrain[IEC] is set you would have to install the proper 
exception handlers for TLBRI and TLBXI ExecCodes.

>   		/*
>   		 * If the page is not _PAGE_VALID, RI or XI could not
>   		 * have triggered it.  Skip the expensive test..
> @@ -1960,7 +1960,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
>   	build_pte_present(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbl);
>   	build_tlb_probe_entry(&p);
>
> -	if (kernel_uses_smartmips_rixi) {
> +	if (cpu_has_ri | cpu_has_xi) {
>   		/*
>   		 * If the page is not _PAGE_VALID, RI or XI could not
>   		 * have triggered it.  Skip the expensive test..
>

  reply	other threads:[~2012-09-05 21:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 20:27 [PATCH 0/4] Add RI and XI bits to MIPS base architecture Steven J. Hill
2012-09-05 20:27 ` [PATCH 1/4] MIPS: Add base architecture support for RI and XI Steven J. Hill
2012-09-05 20:48   ` David Daney
2012-09-05 21:51     ` David Daney
2012-09-05 23:30       ` Kevin Cernekee
2012-09-05 20:27 ` [PATCH 2/4] MIPS: Remove kernel_uses_smartmips_rixi use from arch/mips/mm Steven J. Hill
2012-09-05 21:11   ` David Daney [this message]
2012-09-05 20:27 ` [PATCH 3/4] MIPS: Remove kernel_uses_smartmips_rixi from page table bits Steven J. Hill
2012-09-05 21:16   ` David Daney
2012-09-05 20:27 ` [PATCH 4/4] MIPS: Remove kernel_uses_smartmips_rixi macro definition Steven J. Hill
2012-09-05 21:22   ` David Daney

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=5047BFFE.1070109@gmail.com \
    --to=ddaney.cavm@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.