All of lore.kernel.org
 help / color / mirror / Atom feed
From: james.morse@arm.com (James Morse)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm64: mm: Support Common Not Private translations
Date: Tue, 10 Oct 2017 16:19:46 +0100	[thread overview]
Message-ID: <59DCE512.8010106@arm.com> (raw)
In-Reply-To: <1507553734-27854-2-git-send-email-vladimir.murzin@arm.com>

Hi Vladimir,

On 09/10/17 13:55, Vladimir Murzin wrote:
> Common Not Private (CNP) is a feature of ARMv8.2 extension which
> allows translation table entries to be shared between different PEs in
> the same inner shareable domain, so the hardware can use this fact to
> optimise the caching of such entries in the TLB.

> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 21e2c95..8d098a1 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1211,6 +1224,14 @@ cpufeature_pan_not_uao(const struct arm64_cpu_capabilities *entry, int __unused)
>  	return (cpus_have_const_cap(ARM64_HAS_PAN) && !cpus_have_const_cap(ARM64_HAS_UAO));
>  }
>  
> +#ifdef CONFIG_ARM64_CNP
> +static int cpu_enable_cnp(void *__unused)
> +{
> +	cpu_replace_ttbr1(swapper_pg_dir);

All the other callers of cpu_replace_ttbr1() wrap swapper_pg_dir in lm_alias().
I'm pretty sure this is so that virt_to_phys() works when swapper_pg_dir's
address is in the vmalloc range.

CONFIG_DEBUG_VIRTUAL should catch problems like this.


(Nit: you shouldn't need the #ifdeffery, the only caller of this function is in
the same file, so the compiler should do the right thing)


> +	return 0;
> +}
> +#endif /* CONFIG_ARM64_CNP */
> +
>  /*
>   * We emulate only the following system register space.
>   * Op0 = 0x3, CRn = 0x0, Op1 = 0x0, CRm = [0, 4 - 7]

  parent reply	other threads:[~2017-10-10 15:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 12:55 [PATCH 0/3] Support Common Not Private translations Vladimir Murzin
2017-10-09 12:55 ` [PATCH 1/3] arm64: mm: " Vladimir Murzin
2017-10-09 15:23   ` Catalin Marinas
2017-10-09 16:48     ` James Morse
2017-10-10 12:50       ` Vladimir Murzin
2017-10-10 15:19         ` James Morse
2017-10-10 12:50     ` Vladimir Murzin
2017-10-10 15:19   ` James Morse [this message]
2017-10-11  8:49     ` Vladimir Murzin
2017-10-09 12:55 ` [PATCH 2/3] arm64: KVM: " Vladimir Murzin
2017-10-09 12:55 ` [PATCH 3/3] arm64: Introduce command line parameter to disable CNP Vladimir Murzin
2017-10-10 14:36   ` Julien Thierry
2017-10-11  8:47     ` Vladimir Murzin

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=59DCE512.8010106@arm.com \
    --to=james.morse@arm.com \
    --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 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.