Commit 178748b6 authored by Satheesh Rajendran's avatar Satheesh Rajendran Committed by Michael Ellerman

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

Argument "align" in alloc_shared_lppaca() was unused inside the
function. Let's drop it and update code comment for page alignment.
Signed-off-by: default avatarSatheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Reviewed-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
Reviewed-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
[mpe: Massage comment wording/formatting]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200612142953.135408-1-sathnaga@linux.vnet.ibm.com
parent 7c466b08
...@@ -57,8 +57,8 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align, ...@@ -57,8 +57,8 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align,
#define LPPACA_SIZE 0x400 #define LPPACA_SIZE 0x400
static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align, static void *__init alloc_shared_lppaca(unsigned long size, unsigned long limit,
unsigned long limit, int cpu) int cpu)
{ {
size_t shared_lppaca_total_size = PAGE_ALIGN(nr_cpu_ids * LPPACA_SIZE); size_t shared_lppaca_total_size = PAGE_ALIGN(nr_cpu_ids * LPPACA_SIZE);
static unsigned long shared_lppaca_size; static unsigned long shared_lppaca_size;
...@@ -68,6 +68,13 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align, ...@@ -68,6 +68,13 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
if (!shared_lppaca) { if (!shared_lppaca) {
memblock_set_bottom_up(true); memblock_set_bottom_up(true);
/*
* See Documentation/powerpc/ultravisor.rst for more details.
*
* UV/HV data sharing is in PAGE_SIZE granularity. In order to
* minimize the number of pages shared, align the allocation to
* PAGE_SIZE.
*/
shared_lppaca = shared_lppaca =
memblock_alloc_try_nid(shared_lppaca_total_size, memblock_alloc_try_nid(shared_lppaca_total_size,
PAGE_SIZE, MEMBLOCK_LOW_LIMIT, PAGE_SIZE, MEMBLOCK_LOW_LIMIT,
...@@ -122,7 +129,7 @@ static struct lppaca * __init new_lppaca(int cpu, unsigned long limit) ...@@ -122,7 +129,7 @@ static struct lppaca * __init new_lppaca(int cpu, unsigned long limit)
return NULL; return NULL;
if (is_secure_guest()) if (is_secure_guest())
lp = alloc_shared_lppaca(LPPACA_SIZE, 0x400, limit, cpu); lp = alloc_shared_lppaca(LPPACA_SIZE, limit, cpu);
else else
lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu); lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment