diff mbox

selftests: memfd_test: Revised STACK_SIZE to make it 16-byte aligned

Message ID 1443684782-10898-1-git-send-email-zhang.chunyan@linaro.org
State Accepted
Commit 1f78dda2cf5e4eeb00aee2a01c9515e2e704b4c0
Headers show

Commit Message

Chunyan Zhang Oct. 1, 2015, 7:33 a.m. UTC
There is a mandate of 16-byte aligned stack on AArch64 [1], so the
STACK_SIZE here should also be 16-byte aligned, otherwise we would
get an error when calling clone().

[1] http://lxr.free-electrons.com/source/arch/arm64/kernel/process.c#L265

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
 tools/testing/selftests/memfd/memfd_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chunyan Zhang Oct. 15, 2015, 3:22 a.m. UTC | #1
Hello Shuah,

Can this patch be allowed to merge into next realse?

Thanks,
Chunyan

On Thu, Oct 1, 2015 at 3:33 PM, Chunyan Zhang <zhang.chunyan@linaro.org> wrote:
> There is a mandate of 16-byte aligned stack on AArch64 [1], so the
> STACK_SIZE here should also be 16-byte aligned, otherwise we would
> get an error when calling clone().
>
> [1] http://lxr.free-electrons.com/source/arch/arm64/kernel/process.c#L265
>
> Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
> ---
>  tools/testing/selftests/memfd/memfd_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
> index 0b9eafb..aa5d3eb 100644
> --- a/tools/testing/selftests/memfd/memfd_test.c
> +++ b/tools/testing/selftests/memfd/memfd_test.c
> @@ -18,7 +18,7 @@
>  #include <unistd.h>
>
>  #define MFD_DEF_SIZE 8192
> -#define STACK_SIZE 65535
> +#define STACK_SIZE 65536
>
>  static int sys_memfd_create(const char *name,
>                             unsigned int flags)
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Arnd Bergmann Oct. 15, 2015, 8:44 a.m. UTC | #2
On Thursday 01 October 2015 15:33:02 Chunyan Zhang wrote:
> There is a mandate of 16-byte aligned stack on AArch64 [1], so the
> STACK_SIZE here should also be 16-byte aligned, otherwise we would
> get an error when calling clone().
> 
> [1] http://lxr.free-electrons.com/source/arch/arm64/kernel/process.c#L265
> 
> Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

This should probably also be marked

Cc: stable@vger.kernel.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Shuah Khan Oct. 15, 2015, 1:50 p.m. UTC | #3
On 10/15/2015 02:44 AM, Arnd Bergmann wrote:
> On Thursday 01 October 2015 15:33:02 Chunyan Zhang wrote:
>> There is a mandate of 16-byte aligned stack on AArch64 [1], so the
>> STACK_SIZE here should also be 16-byte aligned, otherwise we would
>> get an error when calling clone().
>>
>> [1] http://lxr.free-electrons.com/source/arch/arm64/kernel/process.c#L265
>>
>> Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
>>
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> This should probably also be marked
> 
> Cc: stable@vger.kernel.org
> 

Thank you both. Now applied to linux-kselftest next for 4.4

-- Shuah
diff mbox

Patch

diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index 0b9eafb..aa5d3eb 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -18,7 +18,7 @@ 
 #include <unistd.h>
 
 #define MFD_DEF_SIZE 8192
-#define STACK_SIZE 65535
+#define STACK_SIZE 65536
 
 static int sys_memfd_create(const char *name,
 			    unsigned int flags)