From commits-return-9784-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Mon May 18 13:27:24 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2B01818062B for ; Mon, 18 May 2020 15:27:24 +0200 (CEST) Received: (qmail 4949 invoked by uid 500); 18 May 2020 13:27:23 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 4940 invoked by uid 99); 18 May 2020 13:27:23 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2020 13:27:23 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 533B385E29; Mon, 18 May 2020 13:27:23 +0000 (UTC) Date: Mon, 18 May 2020 13:27:23 +0000 To: "commits@nuttx.apache.org" Subject: [incubator-nuttx] branch master updated: arch/stack: fix check stack breakage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <158980844322.4090.11774344403226344524@gitbox.apache.org> From: gnutt@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-nuttx X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: cddd64fd30987a1dde018d0e80ec8af137d9e27e X-Git-Newrev: 86a412d65a52d51fa561b34fa9c70047a1656cb5 X-Git-Rev: 86a412d65a52d51fa561b34fa9c70047a1656cb5 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. gnutt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git The following commit(s) were added to refs/heads/master by this push: new 86a412d arch/stack: fix check stack breakage 86a412d is described below commit 86a412d65a52d51fa561b34fa9c70047a1656cb5 Author: chao.an AuthorDate: Mon May 18 15:41:59 2020 +0800 arch/stack: fix check stack breakage remove the TLS alignment check Regression by: -------------------------------------------------------- commit a6da3c2cb6a214b642fa09c48638f1442fdf9117 Author: Ouss4 Date: Thu May 7 18:50:07 2020 +0100 arch/*/*_checkstack.c: Get aligned address only when CONFIG_TLS_ALIGNED is enabled. -------------------------------------------------------- commit c2244a2382cf9c62937cc558cc947fae9f211b81 Author: Gregory Nutt Date: Thu May 7 09:46:47 2020 -0600 Remove CONFIG_TLS A first step in implementing the user-space error is force TLS to be enabled at all times. It is no longer optional Signed-off-by: chao.an --- arch/arm/src/common/arm_checkstack.c | 7 ++----- arch/or1k/src/common/up_checkstack.c | 7 ++----- arch/risc-v/src/common/riscv_checkstack.c | 7 ++----- arch/sim/src/sim/up_checkstack.c | 8 +++----- arch/xtensa/src/common/xtensa_checkstack.c | 12 ++++-------- 5 files changed, 13 insertions(+), 28 deletions(-) diff --git a/arch/arm/src/common/arm_checkstack.c b/arch/arm/src/common/arm_checkstack.c index ebdab95..61faad4 100644 --- a/arch/arm/src/common/arm_checkstack.c +++ b/arch/arm/src/common/arm_checkstack.c @@ -92,22 +92,19 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) /* Get aligned addresses of the top and bottom of the stack */ -#ifdef CONFIG_TLS_ALIGNED if (!int_stack) { /* Skip over the TLS data structure at the bottom of the stack */ +#ifdef CONFIG_TLS_ALIGNED DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); +#endif start = alloc + sizeof(struct tls_info_s); } else { start = alloc & ~3; } -#else - UNUSED(int_stack); - start = alloc & ~3; -#endif end = (alloc + size + 3) & ~3; diff --git a/arch/or1k/src/common/up_checkstack.c b/arch/or1k/src/common/up_checkstack.c index e6f4cd9..aa499a8 100644 --- a/arch/or1k/src/common/up_checkstack.c +++ b/arch/or1k/src/common/up_checkstack.c @@ -97,22 +97,19 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) /* Get aligned addresses of the top and bottom of the stack */ -#ifdef CONFIG_TLS_ALIGNED if (!int_stack) { /* Skip over the TLS data structure at the bottom of the stack */ +#ifdef CONFIG_TLS_ALIGNED DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); +#endif start = alloc + sizeof(struct tls_info_s); } else { start = alloc & ~3; } -#else - UNUSED(int_stack); - start = alloc & ~3; -#endif end = (alloc + size + 3) & ~3; diff --git a/arch/risc-v/src/common/riscv_checkstack.c b/arch/risc-v/src/common/riscv_checkstack.c index a8f28fa..dcc50d5 100644 --- a/arch/risc-v/src/common/riscv_checkstack.c +++ b/arch/risc-v/src/common/riscv_checkstack.c @@ -91,22 +91,19 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) /* Get aligned addresses of the top and bottom of the stack */ -#ifdef CONFIG_TLS_ALIGNED if (!int_stack) { /* Skip over the TLS data structure at the bottom of the stack */ +#ifdef CONFIG_TLS_ALIGNED DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); +#endif start = alloc + sizeof(struct tls_info_s); } else { start = alloc & ~3; } -#else - UNUSED(int_stack); - start = alloc & ~3; -#endif end = (alloc + size + 3) & ~3; diff --git a/arch/sim/src/sim/up_checkstack.c b/arch/sim/src/sim/up_checkstack.c index 955ea6b..8d276e9 100644 --- a/arch/sim/src/sim/up_checkstack.c +++ b/arch/sim/src/sim/up_checkstack.c @@ -89,22 +89,20 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) /* Get aligned addresses of the top and bottom of the stack */ -#ifdef CONFIG_TLS_ALIGNED if (!int_stack) { /* Skip over the TLS data structure at the bottom of the stack */ +#ifdef CONFIG_TLS_ALIGNED DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); +#endif start = alloc + sizeof(struct tls_info_s); } else { start = alloc & ~3; } -#else - UNUSED(int_stack); - start = alloc & ~3; -#endif + end = (alloc + size + 3) & ~3; /* Get the adjusted size based on the top and bottom of the stack */ diff --git a/arch/xtensa/src/common/xtensa_checkstack.c b/arch/xtensa/src/common/xtensa_checkstack.c index cbac16a..8a177cc 100644 --- a/arch/xtensa/src/common/xtensa_checkstack.c +++ b/arch/xtensa/src/common/xtensa_checkstack.c @@ -89,18 +89,14 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size) return 0; } - /* Get aligned addresses of the top and bottom of the stack */ + /* Get aligned addresses of the top and bottom of the stack + * Skip over the TLS data structure at the bottom of the stack + */ #ifdef CONFIG_TLS_ALIGNED - - /* Skip over the TLS data structure at the bottom of the stack */ - DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); - start = alloc + sizeof(struct tls_info_s); -#else - start = alloc & ~3; #endif - + start = alloc + sizeof(struct tls_info_s); end = (alloc + size + 3) & ~3; /* Get the adjusted size based on the top and bottom of the stack */