From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Laurent Dufour <ldufour@linux.ibm.com>,
mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org,
npiggin@gmail.com
Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] powerpc/mm: Initialize the HPTE encoding values
Date: Thu, 12 Sep 2019 19:02:40 +0530 [thread overview]
Message-ID: <87v9txzll3.fsf@linux.ibm.com> (raw)
In-Reply-To: <20190830120712.22971-2-ldufour@linux.ibm.com>
Laurent Dufour <ldufour@linux.ibm.com> writes:
> Before reading the HPTE encoding values we initialize all of them to -1 (an
> invalid value) to later being able to detect the initialized ones.
>
> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
We already do this in mmu_psize_set_default_penc() ?
> ---
> arch/powerpc/mm/book3s64/hash_utils.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c
> index c3bfef08dcf8..2039bc315459 100644
> --- a/arch/powerpc/mm/book3s64/hash_utils.c
> +++ b/arch/powerpc/mm/book3s64/hash_utils.c
> @@ -408,7 +408,7 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
> {
> const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
> const __be32 *prop;
> - int size = 0;
> + int size = 0, idx, base_idx;
>
> /* We are scanning "cpu" nodes only */
> if (type == NULL || strcmp(type, "cpu") != 0)
> @@ -418,6 +418,11 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
> if (!prop)
> return 0;
>
> + /* Set all the penc values to invalid */
> + for (base_idx = 0; base_idx < MMU_PAGE_COUNT; base_idx++)
> + for (idx = 0; idx < MMU_PAGE_COUNT; idx++)
> + mmu_psize_defs[base_idx].penc[idx] = -1;
> +
> pr_info("Page sizes from device-tree:\n");
> size /= 4;
> cur_cpu_spec->mmu_features &= ~(MMU_FTR_16M_PAGE);
> @@ -426,7 +431,6 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
> unsigned int slbenc = be32_to_cpu(prop[1]);
> unsigned int lpnum = be32_to_cpu(prop[2]);
> struct mmu_psize_def *def;
> - int idx, base_idx;
>
> size -= 3; prop += 3;
> base_idx = get_idx_from_shift(base_shift);
> --
> 2.23.0
WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Laurent Dufour <ldufour@linux.ibm.com>,
mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org,
npiggin@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] powerpc/mm: Initialize the HPTE encoding values
Date: Thu, 12 Sep 2019 19:02:40 +0530 [thread overview]
Message-ID: <87v9txzll3.fsf@linux.ibm.com> (raw)
In-Reply-To: <20190830120712.22971-2-ldufour@linux.ibm.com>
Laurent Dufour <ldufour@linux.ibm.com> writes:
> Before reading the HPTE encoding values we initialize all of them to -1 (an
> invalid value) to later being able to detect the initialized ones.
>
> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
We already do this in mmu_psize_set_default_penc() ?
> ---
> arch/powerpc/mm/book3s64/hash_utils.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c
> index c3bfef08dcf8..2039bc315459 100644
> --- a/arch/powerpc/mm/book3s64/hash_utils.c
> +++ b/arch/powerpc/mm/book3s64/hash_utils.c
> @@ -408,7 +408,7 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
> {
> const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
> const __be32 *prop;
> - int size = 0;
> + int size = 0, idx, base_idx;
>
> /* We are scanning "cpu" nodes only */
> if (type == NULL || strcmp(type, "cpu") != 0)
> @@ -418,6 +418,11 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
> if (!prop)
> return 0;
>
> + /* Set all the penc values to invalid */
> + for (base_idx = 0; base_idx < MMU_PAGE_COUNT; base_idx++)
> + for (idx = 0; idx < MMU_PAGE_COUNT; idx++)
> + mmu_psize_defs[base_idx].penc[idx] = -1;
> +
> pr_info("Page sizes from device-tree:\n");
> size /= 4;
> cur_cpu_spec->mmu_features &= ~(MMU_FTR_16M_PAGE);
> @@ -426,7 +431,6 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
> unsigned int slbenc = be32_to_cpu(prop[1]);
> unsigned int lpnum = be32_to_cpu(prop[2]);
> struct mmu_psize_def *def;
> - int idx, base_idx;
>
> size -= 3; prop += 3;
> base_idx = get_idx_from_shift(base_shift);
> --
> 2.23.0
next prev parent reply other threads:[~2019-11-11 11:42 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-30 12:07 [PATCH 0/3] powerpc/mm: Conditionally call H_BLOCK_REMOVE Laurent Dufour
2019-08-30 12:07 ` Laurent Dufour
2019-08-30 12:07 ` [PATCH 1/3] powerpc/mm: Initialize the HPTE encoding values Laurent Dufour
2019-08-30 12:07 ` Laurent Dufour
2019-09-12 13:32 ` Aneesh Kumar K.V [this message]
2019-09-12 13:32 ` Aneesh Kumar K.V
2019-09-12 13:37 ` Aneesh Kumar K.V
2019-09-12 13:37 ` Aneesh Kumar K.V
2019-09-13 10:56 ` Laurent Dufour
2019-09-13 10:56 ` Laurent Dufour
2019-08-30 12:07 ` [PATCH 2/3] powperc/mm: read TLB Block Invalidate Characteristics Laurent Dufour
2019-08-30 12:07 ` Laurent Dufour
2019-09-12 14:16 ` Aneesh Kumar K.V
2019-09-12 14:16 ` Aneesh Kumar K.V
2019-09-13 13:55 ` Laurent Dufour
2019-09-13 13:55 ` Laurent Dufour
2019-09-12 14:44 ` Aneesh Kumar K.V
2019-09-12 14:44 ` Aneesh Kumar K.V
2019-09-12 19:26 ` Laurent Dufour
2019-09-12 19:26 ` Laurent Dufour
2019-09-13 2:00 ` Aneesh Kumar K.V
2019-09-13 2:00 ` Aneesh Kumar K.V
2019-09-13 9:10 ` Laurent Dufour
2019-09-13 9:10 ` Laurent Dufour
2019-08-30 12:07 ` [PATCH 3/3] powerpc/mm: call H_BLOCK_REMOVE when supported Laurent Dufour
2019-08-30 12:07 ` Laurent Dufour
2019-09-12 14:20 ` Aneesh Kumar K.V
2019-09-12 14:20 ` Aneesh Kumar K.V
2019-09-13 13:16 ` Laurent Dufour
2019-09-13 13:16 ` Laurent Dufour
2019-09-12 13:44 ` [PATCH 0/3] powerpc/mm: Conditionally call H_BLOCK_REMOVE Aneesh Kumar K.V
2019-09-12 13:44 ` Aneesh Kumar K.V
2019-09-13 11:09 ` Laurent Dufour
2019-09-13 11:09 ` Laurent Dufour
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=87v9txzll3.fsf@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=ldufour@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=paulus@samba.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.