All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>, <linux-mips@linux-mips.org>,
	"David Daney" <ddaney@caviumnetworks.com>,
	Markos Chandras <Markos.Chandras@imgtec.com>
Subject: Re: [PATCH 2/2] MIPS: Partially disable RIXI support.
Date: Thu, 23 Jul 2015 11:06:12 +0100	[thread overview]
Message-ID: <55B0BC94.2050106@imgtec.com> (raw)
In-Reply-To: <6066e46d74d2314ecc19e6562afe33e369fe9557.1437644062.git.ralf@linux-mips.org>

[-- Attachment #1: Type: text/plain, Size: 2904 bytes --]

On 23/07/15 10:10, Ralf Baechle wrote:
> Execution of break instruction, trap instructions, emulation of unaligned
> loads or floating point instructions - anything that tries to read the
> instruction's opcode from userspace - needs read access to a page.
> 
> RIXI (Read Inhibit / Execute Inhibit) support however allows the creation of
> pags that are executable but not readable.  On such a mapping the attempted
> load of the opcode by the kernel is going to cause an endless loop of
> page faults.
> 
> The quick workaround for this is to disable the combinations that the kernel
> currently isn't able to handle which are executable mappings.
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Reviewed-by: James Hogan <james.hogan@imgtec.com>

Cheers
James

> ---
>  arch/mips/mm/cache.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
> index 77d96db..aab218c 100644
> --- a/arch/mips/mm/cache.c
> +++ b/arch/mips/mm/cache.c
> @@ -160,18 +160,18 @@ static inline void setup_protection_map(void)
>  		protection_map[1]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
>  		protection_map[2]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
>  		protection_map[3]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
> -		protection_map[4]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
> +		protection_map[4]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  		protection_map[5]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
> -		protection_map[6]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
> +		protection_map[6]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  		protection_map[7]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  
>  		protection_map[8]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
>  		protection_map[9]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
>  		protection_map[10] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | _PAGE_NO_READ);
>  		protection_map[11] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE);
> -		protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
> +		protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  		protection_map[13] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
> -		protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE  | _PAGE_NO_READ);
> +		protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE);
>  		protection_map[15] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE);
>  
>  	} else {
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org,
	David Daney <ddaney@caviumnetworks.com>,
	Markos Chandras <Markos.Chandras@imgtec.com>
Subject: Re: [PATCH 2/2] MIPS: Partially disable RIXI support.
Date: Thu, 23 Jul 2015 11:06:12 +0100	[thread overview]
Message-ID: <55B0BC94.2050106@imgtec.com> (raw)
Message-ID: <20150723100612.46vWSRYLDKC4mOxbU6-mMQf1dsm4Mb38GXmjqwRqB8U@z> (raw)
In-Reply-To: <6066e46d74d2314ecc19e6562afe33e369fe9557.1437644062.git.ralf@linux-mips.org>

[-- Attachment #1: Type: text/plain, Size: 2904 bytes --]

On 23/07/15 10:10, Ralf Baechle wrote:
> Execution of break instruction, trap instructions, emulation of unaligned
> loads or floating point instructions - anything that tries to read the
> instruction's opcode from userspace - needs read access to a page.
> 
> RIXI (Read Inhibit / Execute Inhibit) support however allows the creation of
> pags that are executable but not readable.  On such a mapping the attempted
> load of the opcode by the kernel is going to cause an endless loop of
> page faults.
> 
> The quick workaround for this is to disable the combinations that the kernel
> currently isn't able to handle which are executable mappings.
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Reviewed-by: James Hogan <james.hogan@imgtec.com>

Cheers
James

> ---
>  arch/mips/mm/cache.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
> index 77d96db..aab218c 100644
> --- a/arch/mips/mm/cache.c
> +++ b/arch/mips/mm/cache.c
> @@ -160,18 +160,18 @@ static inline void setup_protection_map(void)
>  		protection_map[1]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
>  		protection_map[2]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
>  		protection_map[3]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
> -		protection_map[4]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
> +		protection_map[4]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  		protection_map[5]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
> -		protection_map[6]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
> +		protection_map[6]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  		protection_map[7]  = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  
>  		protection_map[8]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
>  		protection_map[9]  = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
>  		protection_map[10] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | _PAGE_NO_READ);
>  		protection_map[11] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE);
> -		protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ);
> +		protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
>  		protection_map[13] = __pgprot(_page_cachable_default | _PAGE_PRESENT);
> -		protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE  | _PAGE_NO_READ);
> +		protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE);
>  		protection_map[15] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE);
>  
>  	} else {
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-07-23 10:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23  9:34 [PATCH 0/2] RIXI fixes Ralf Baechle
2015-07-23  9:10 ` [PATCH 1/2] MIPS: Handle page faults of executable but unreadable pages correctly Ralf Baechle
2015-07-23 10:15   ` James Hogan
2015-07-23 10:15     ` James Hogan
2015-07-23 12:35     ` Ralf Baechle
2015-07-23  9:10 ` [PATCH 2/2] MIPS: Partially disable RIXI support Ralf Baechle
2015-07-23 10:06   ` James Hogan [this message]
2015-07-23 10:06     ` James Hogan

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=55B0BC94.2050106@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=Markos.Chandras@imgtec.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@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 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.