From: nschichan@freebox.fr (Nicolas Schichan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 10/10] ARM: software-based priviledged-no-access support
Date: Tue, 25 Aug 2015 19:07:39 +0200 [thread overview]
Message-ID: <55DCA0DB.7000103@freebox.fr> (raw)
In-Reply-To: <E1ZUGMS-0000BG-8B@rmk-PC.arm.linux.org.uk>
On 08/25/2015 05:42 PM, Russell King wrote:
> Provide a software-based implementation of the priviledged no access
> support found in ARMv8.1.
[...]
> diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
> index a91177043467..ff74f0b54b0e 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -446,15 +446,45 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
> .endm
>
> .macro uaccess_disable, tmp, isb=1
> +#ifdef CONFIG_CPU_SW_DOMAIN_PAN
> + /*
> + * Whenever we re-enter userspace, the domains should always be
> + * set appropriately.
> + */
> + mov \tmp, #DACR_UACCESS_DISABLE
> + mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
> + .if \isb
> + isb
> + .endif
> +#endif
> .endm
>
> .macro uaccess_enable, tmp, isb=1
> +#ifdef CONFIG_CPU_SW_DOMAIN_PAN
> + /*
> + * Whenever we re-enter userspace, the domains should always be
> + * set appropriately.
> + */
> + mov \tmp, #DACR_UACCESS_ENABLE
> + mcr p15, 0, \tmp, c3, c0, 0
> + .if \isb
> + isb
> + .endif
> +#endif
> .endm
Thanks for the updated serie,
on ARMv5, I get the following compile error:
arch/arm/kernel/entry-common.S: Assembler messages:
arch/arm/kernel/entry-common.S:200: Error: selected processor does not support
ARM mode `isb'
replacing those two "isb" occurences with "instr_sync" fixed it.
With that added access to LIST_POISON are still correctly catched, when
CONFIG_CPU_SW_DOMAIN_PAN is set. Also the transmit of an ipv6 packet does not
result in a fault anymore. Also with CONFIG_CPU_SW_DOMAIN_PAN disabled, the
system now boots fine.
This has been tested on Linux 4.1 / kirkwood and Linux 4.2-rc8 / qemu,armv5.
Thanks,
--
Nicolas Schichan
Freebox SAS
next prev parent reply other threads:[~2015-08-25 17:07 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-25 15:40 [PATCH v2 00/10] Prevent list poison values from being mapped by userspace processes Russell King - ARM Linux
2015-08-25 15:41 ` [PATCH v2 01/10] ARM: domains: switch to keeping domain value in register Russell King
2015-08-25 15:41 ` [PATCH v2 02/10] ARM: domains: provide domain_mask() Russell King
2015-08-25 15:41 ` [PATCH v2 03/10] ARM: domains: move initial domain setting value to asm/domains.h Russell King
2015-08-25 15:41 ` [PATCH v2 04/10] ARM: domains: get rid of manager mode for user domain Russell King
2015-08-25 15:41 ` [PATCH v2 05/10] ARM: domains: keep vectors in separate domain Russell King
2015-08-25 15:41 ` [PATCH v2 06/10] ARM: domains: remove DOMAIN_TABLE Russell King
2015-08-25 15:41 ` [PATCH v2 07/10] ARM: mm: improve do_ldrd_abort macro Russell King
2015-08-25 15:41 ` [PATCH v2 08/10] ARM: uaccess: provide uaccess_save_and_enable() and uaccess_restore() Russell King
2015-08-25 15:42 ` [PATCH v2 09/10] ARM: entry: provide uaccess assembly macro hooks Russell King
2015-08-25 15:42 ` [PATCH v2 10/10] ARM: software-based priviledged-no-access support Russell King
2015-08-25 16:53 ` Will Deacon
2015-08-25 17:07 ` Nicolas Schichan [this message]
2015-08-25 17:48 ` Russell King - ARM Linux
2015-08-26 13:36 ` Nicolas Schichan
2015-10-09 8:28 ` Linus Walleij
2015-10-09 10:53 ` Will Deacon
2015-10-09 11:24 ` Russell King - ARM Linux
2015-10-09 12:32 ` Will Deacon
2015-10-12 7:51 ` Linus Walleij
2015-10-23 8:05 ` Linus Walleij
2015-10-23 8:46 ` Russell King - ARM Linux
2015-10-27 17:11 ` Will Deacon
2015-08-25 16:37 ` [PATCH v2 11/10] ARM: fix swp-emulate Russell King
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=55DCA0DB.7000103@freebox.fr \
--to=nschichan@freebox.fr \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).