From: Anup Patel <anup@brainfault.org>
To: Zong Li <zong.li@sifive.com>
Cc: "linux-kernel@vger.kernel.org List"
<linux-kernel@vger.kernel.org>,
linux-riscv <linux-riscv@lists.infradead.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@sifive.com>,
Anup Patel <Anup.Patel@wdc.com>
Subject: Re: [PATCH v2] riscv: Use PMD_SIZE to repalce PTE_PARENT_SIZE
Date: Tue, 5 Nov 2019 08:51:29 +0530 [thread overview]
Message-ID: <CAAhSdy2FkTqbYzP9naeUeOR+pW5-GphCR118D63Oy5C8UyQwhA@mail.gmail.com> (raw)
In-Reply-To: <1572920412-15661-1-git-send-email-zong.li@sifive.com>
On Tue, Nov 5, 2019 at 7:50 AM Zong Li <zong.li@sifive.com> wrote:
>
> The PMD_SIZE is equal to PGDIR_SIZE when __PAGETABLE_PMD_FOLDED is
> defined.
>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
> arch/riscv/mm/init.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 573463d..642b330 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -273,7 +273,6 @@ static void __init create_pmd_mapping(pmd_t *pmdp,
> #define get_pgd_next_virt(__pa) get_pmd_virt(__pa)
> #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \
> create_pmd_mapping(__nextp, __va, __pa, __sz, __prot)
> -#define PTE_PARENT_SIZE PMD_SIZE
> #define fixmap_pgd_next fixmap_pmd
> #else
> #define pgd_next_t pte_t
> @@ -281,7 +280,6 @@ static void __init create_pmd_mapping(pmd_t *pmdp,
> #define get_pgd_next_virt(__pa) get_pte_virt(__pa)
> #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \
> create_pte_mapping(__nextp, __va, __pa, __sz, __prot)
> -#define PTE_PARENT_SIZE PGDIR_SIZE
> #define fixmap_pgd_next fixmap_pte
> #endif
>
> @@ -316,10 +314,10 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size)
> {
> uintptr_t map_size = PAGE_SIZE;
>
> - /* Upgrade to PMD/PGDIR mappings whenever possible */
> - if (!(base & (PTE_PARENT_SIZE - 1)) &&
> - !(size & (PTE_PARENT_SIZE - 1)))
> - map_size = PTE_PARENT_SIZE;
> + /* Upgrade to PMD_SIZE mappings whenever possible */
> + if (!(base & (PMD_SIZE - 1)) &&
> + !(size & (PMD_SIZE - 1)))
> + map_size = PMD_SIZE;
>
> return map_size;
> }
> --
> 2.7.4
>
LGTM.
Reviewed-by: Anup Patel <anup@brainfault.org>
Regards,
Anup
WARNING: multiple messages have this Message-ID (diff)
From: Anup Patel <anup@brainfault.org>
To: Zong Li <zong.li@sifive.com>
Cc: Anup Patel <Anup.Patel@wdc.com>,
linux-riscv <linux-riscv@lists.infradead.org>,
Palmer Dabbelt <palmer@sifive.com>,
"linux-kernel@vger.kernel.org List"
<linux-kernel@vger.kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>
Subject: Re: [PATCH v2] riscv: Use PMD_SIZE to repalce PTE_PARENT_SIZE
Date: Tue, 5 Nov 2019 08:51:29 +0530 [thread overview]
Message-ID: <CAAhSdy2FkTqbYzP9naeUeOR+pW5-GphCR118D63Oy5C8UyQwhA@mail.gmail.com> (raw)
In-Reply-To: <1572920412-15661-1-git-send-email-zong.li@sifive.com>
On Tue, Nov 5, 2019 at 7:50 AM Zong Li <zong.li@sifive.com> wrote:
>
> The PMD_SIZE is equal to PGDIR_SIZE when __PAGETABLE_PMD_FOLDED is
> defined.
>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
> arch/riscv/mm/init.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 573463d..642b330 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -273,7 +273,6 @@ static void __init create_pmd_mapping(pmd_t *pmdp,
> #define get_pgd_next_virt(__pa) get_pmd_virt(__pa)
> #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \
> create_pmd_mapping(__nextp, __va, __pa, __sz, __prot)
> -#define PTE_PARENT_SIZE PMD_SIZE
> #define fixmap_pgd_next fixmap_pmd
> #else
> #define pgd_next_t pte_t
> @@ -281,7 +280,6 @@ static void __init create_pmd_mapping(pmd_t *pmdp,
> #define get_pgd_next_virt(__pa) get_pte_virt(__pa)
> #define create_pgd_next_mapping(__nextp, __va, __pa, __sz, __prot) \
> create_pte_mapping(__nextp, __va, __pa, __sz, __prot)
> -#define PTE_PARENT_SIZE PGDIR_SIZE
> #define fixmap_pgd_next fixmap_pte
> #endif
>
> @@ -316,10 +314,10 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size)
> {
> uintptr_t map_size = PAGE_SIZE;
>
> - /* Upgrade to PMD/PGDIR mappings whenever possible */
> - if (!(base & (PTE_PARENT_SIZE - 1)) &&
> - !(size & (PTE_PARENT_SIZE - 1)))
> - map_size = PTE_PARENT_SIZE;
> + /* Upgrade to PMD_SIZE mappings whenever possible */
> + if (!(base & (PMD_SIZE - 1)) &&
> + !(size & (PMD_SIZE - 1)))
> + map_size = PMD_SIZE;
>
> return map_size;
> }
> --
> 2.7.4
>
LGTM.
Reviewed-by: Anup Patel <anup@brainfault.org>
Regards,
Anup
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2019-11-05 3:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 2:20 [PATCH v2] riscv: Use PMD_SIZE to repalce PTE_PARENT_SIZE Zong Li
2019-11-05 2:20 ` Zong Li
2019-11-05 3:21 ` Anup Patel [this message]
2019-11-05 3:21 ` Anup Patel
2019-11-06 19:00 ` Paul Walmsley
2019-11-06 19:00 ` Paul Walmsley
2019-11-08 7:25 ` Christoph Hellwig
2019-11-08 7:25 ` Christoph Hellwig
2019-11-08 8:50 ` Zong Li
2019-11-08 8:50 ` Zong Li
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=CAAhSdy2FkTqbYzP9naeUeOR+pW5-GphCR118D63Oy5C8UyQwhA@mail.gmail.com \
--to=anup@brainfault.org \
--cc=Anup.Patel@wdc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=zong.li@sifive.com \
/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.