linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: mm: Create gigabyte kernel logical mappings where possible
Date: Fri, 2 May 2014 09:51:21 +0100	[thread overview]
Message-ID: <20140502085119.GA456@arm.com> (raw)
In-Reply-To: <1398857782-1525-1-git-send-email-steve.capper@linaro.org>

On Wed, Apr 30, 2014 at 12:36:22PM +0100, Steve Capper wrote:
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index 4d29332..867e979 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -234,7 +234,20 @@ static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr,
>  	pud = pud_offset(pgd, addr);
>  	do {
>  		next = pud_addr_end(addr, end);
> -		alloc_init_pmd(pud, addr, next, phys);
> +
> +		/*
> +		 * For 4K granule only, attempt to put down a 1GB block
> +		 */
> +		if ((PAGE_SHIFT == 12) &&
> +			((addr | next | phys) & ~PUD_MASK) == 0) {
> +			pud_t old_pud = *pud;
> +			set_pud(pud, __pud(phys | prot_sect_kernel));
> +
> +			if (!pud_none(old_pud))
> +				flush_tlb_all();

We could even free the original pmd here. I think a
memblock_free(pud_pfn(old_pud) << PAGE_SHIFT, PAGE_SIZE) should do
(untested, and you need to define pud_pfn).

-- 
Catalin

  parent reply	other threads:[~2014-05-02  8:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 11:36 [PATCH] arm64: mm: Create gigabyte kernel logical mappings where possible Steve Capper
2014-04-30 18:11 ` Arnd Bergmann
2014-05-01  8:54   ` Steve Capper
2014-05-01 13:36     ` Arnd Bergmann
2014-05-01 16:20       ` Steve Capper
2014-05-02  1:03 ` Jungseok Lee
2014-05-02  9:11   ` Steve Capper
2014-05-02  8:51 ` Catalin Marinas [this message]
2014-05-02  9:21   ` Steve Capper

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=20140502085119.GA456@arm.com \
    --to=catalin.marinas@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 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).