diff mbox series

powerpc/pseries/svm: Fixup align argument in alloc_shared_lppaca() function

Message ID 20200609113909.17236-1-sathnaga@linux.vnet.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series powerpc/pseries/svm: Fixup align argument in alloc_shared_lppaca() function | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (ec7b8eb9bc7a519047485c95f7292b48f5b73fe6)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Satheesh Rajendran June 9, 2020, 11:39 a.m. UTC
Argument "align" in alloc_shared_lppaca() function was unused inside the
function. Let's fix it and update code comment.

Cc: linux-kernel@vger.kernel.org
Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Cc: Ram Pai <linuxram@us.ibm.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/paca.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Thiago Jung Bauermann June 10, 2020, 4:19 a.m. UTC | #1
Satheesh Rajendran <sathnaga@linux.vnet.ibm.com> writes:

> Argument "align" in alloc_shared_lppaca() function was unused inside the
> function. Let's fix it and update code comment.
>
> Cc: linux-kernel@vger.kernel.org
> Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> Cc: Ram Pai <linuxram@us.ibm.com>
> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
> Cc: Laurent Dufour <ldufour@linux.ibm.com>
> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/paca.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)

Nice. I agree it's a good code cleanup.

Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Michael Ellerman June 10, 2020, 11:21 a.m. UTC | #2
Satheesh Rajendran <sathnaga@linux.vnet.ibm.com> writes:
> Argument "align" in alloc_shared_lppaca() function was unused inside the
> function. Let's fix it and update code comment.

I think it would be better to drop the align argument entirely and keep
that logic, and the comment, internal to alloc_shared_lppaca().

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 8d96169c597e..9088e107fb43 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -70,7 +70,7 @@  static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
 
 		shared_lppaca =
 			memblock_alloc_try_nid(shared_lppaca_total_size,
-					       PAGE_SIZE, MEMBLOCK_LOW_LIMIT,
+					       align, MEMBLOCK_LOW_LIMIT,
 					       limit, NUMA_NO_NODE);
 		if (!shared_lppaca)
 			panic("cannot allocate shared data");
@@ -122,7 +122,14 @@  static struct lppaca * __init new_lppaca(int cpu, unsigned long limit)
 		return NULL;
 
 	if (is_secure_guest())
-		lp = alloc_shared_lppaca(LPPACA_SIZE, 0x400, limit, cpu);
+		/*
+		 * See Documentation/powerpc/ultravisor.rst for mode details
+		 *
+		 * UV/HV data share is in PAGE granularity, In order to minimize
+		 * the number of pages shared and maximize the use of a page,
+		 * let's use page align.
+		 */
+		lp = alloc_shared_lppaca(LPPACA_SIZE, PAGE_SIZE, limit, cpu);
 	else
 		lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);