linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: steve.capper@linaro.org (Steve Capper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Define PTE_TYPE_HUGEPAGE
Date: Tue, 18 Jun 2013 10:37:37 +0100	[thread overview]
Message-ID: <20130618093736.GB28428@linaro.org> (raw)
In-Reply-To: <1371519455-64998-1-git-send-email-christoffer.dall@linaro.org>

On Mon, Jun 17, 2013 at 06:37:35PM -0700, Christoffer Dall wrote:
> PTE_TYPE_HUGEPAGE is referenced by pte_huge, but because nobody uses
> this macro it doesn't fail yet.  KVM will be using this when 32-bit
> support for huge pages is added so add it.
> 
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> ---
>  arch/arm64/include/asm/pgtable-hwdef.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
> index 66367c6..0219523 100644
> --- a/arch/arm64/include/asm/pgtable-hwdef.h
> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
> @@ -54,6 +54,7 @@
>  #define PTE_TYPE_MASK		(_AT(pteval_t, 3) << 0)
>  #define PTE_TYPE_FAULT		(_AT(pteval_t, 0) << 0)
>  #define PTE_TYPE_PAGE		(_AT(pteval_t, 3) << 0)
> +#define PTE_TYPE_HUGEPAGE	(_AT(pteval_t, 1) << 0)
>  #define PTE_USER		(_AT(pteval_t, 1) << 6)		/* AP[1] */
>  #define PTE_RDONLY		(_AT(pteval_t, 1) << 7)		/* AP[2] */
>  #define PTE_SHARED		(_AT(pteval_t, 3) << 8)		/* SH[1:0], inner shareable */
> -- 
> 1.8.1.2
> 

Hi Christoffer,
We can have PROT_NONE protected huge pages in ARM64 and the descriptors for
these will end in 00b. They are faulting descriptors, so any reads or writes by
user or kernel space will fault.

I have the following in my huge page patches:
#define pte_huge(pte)          (!(pte_val(pte) & PTE_TABLE_BIT))

i.e. check for bit 1 clear.

Please let me know if I've missed a PTE_TYPE_HUGEPAGE somewhere and I'll fix
it.

Thanks,
-- 
Steve

  reply	other threads:[~2013-06-18  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  1:37 [PATCH] arm64: Define PTE_TYPE_HUGEPAGE Christoffer Dall
2013-06-18  9:37 ` Steve Capper [this message]
2013-06-18 15:49   ` Christoffer Dall

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=20130618093736.GB28428@linaro.org \
    --to=steve.capper@linaro.org \
    --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).