Skip to content

Conversation

@masayuki2009
Copy link
Contributor

Summary

  • This PR fixes interrupt stack handling for ARM SMP
  • This PR consists of following 4 commits
  • commit 1: arch: imx6: Fix style warnings in chip.h
  • commit 2: arch: arm: Fix interrupt stack handlings for SMP
    • Modify arm_intstack_base() to return "top" of the IRQ stack for the current CPU
    • This change fixes IRQ stack dump information for ARM SMP
    • Add arm_intstack_alloc() to return "bottom" of the IRQ stack for the current CPU
    • Also, these functions are now implemented in xxx_irq.c (imx/cxd56/lc823450)
    • up_color_intstack() and up_check_intstack() now call arm_intstack_alloc()
    • These semantics are now consistent with non-SMP case
    • up_color_intstack() now initializes whole IRQ stack region for SMP
    • Adjust IRQ stack top address for each CPU (e.g. -8)
    • Fix setintstack to handle in case of NCPUS=1 (cxd56, lc823450)
    • Adjust INTSTACK_SIZE to 8 bytes alignment (cxd56, lc823450)
    • Refactor setintstack for lc823450
    • Remove old IRQ stack coloring code from up_irqinitialize() (lc823450)
    • Introduce g_cpu_intstack_top for lc823450
    • Refactor header files
  • commit 3: boards: lc823450-xgevk: Update rndis/defconfig
  • commit 4: boards: sabre-6quad: Update smp/defconfig

Impact

  • Affects imx6/cxd56xx/lc823450 SMP with interrupt stack enabled

Testing

  • Tested with sabre-6quad:smp (with QEMU, NCPUS=1 and 4)
  • Tested with spresense:wifi_smp (NCPUS=1 and 2)
  • Tested with lc823450-xgevk:rndis (NCPUS=1 and 2)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- Modify arm_intstack_base() to return "top" of the IRQ stack for the current CPU
- This change fixes IRQ stack dump information for ARM SMP
- Add arm_intstack_alloc() to return "bottom" of the IRQ stack for the current CPU
- Also, these functions are now implemented in xxx_irq.c (imx/cxd56/lc823450)
- up_color_intstack() and up_check_intstack() now call arm_intstack_alloc()
- These semantics are now consistent with non-SMP case
- up_color_intstack() now initializes whole IRQ stack region for SMP
- Adjust IRQ stack top address for each CPU (e.g. -8)
- Fix setintstack to handle in case of NCPUS=1 (cxd56, lc823450)
- Adjust INTSTACK_SIZE to 8 bytes alignment (cxd56, lc823450)
- Refactor setintstack for lc823450
- Remove old IRQ stack coloring code from up_irqinitialize() (lc823450)
- Introduce g_cpu_intstack_top for lc823450
- Refactor header files

Impact:
- Affects imx6/cxd56xx/lc823450 SMP with interrupt stack enabled

Testing:
- Tested with sabre-6quad:smp (with QEMU, NCPUS=1 and 4)
- Tested with spresense:wifi_smp (NCPUS=1 and 2)
- Tested with lc823450-xgevk:rndis (NCPUS=1 and 2)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- Add CONFIG_ARCH_STACKDUMP=y
- Add CONFIG_STACK_COLORATION=y
- Remove CONFIG_NSH_DISABLE_MB=y
- Remove CONFIG_NSH_DISABLE_MH=y

Impact:
- Affects lc823450-xgevk:rndis only

Testing:
- Tested with smp, ostest.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- Remove CONFIG_HOST_WINDOWS=y
- Add CONFIG_READLINE_CMD_HISTORY=y
- Add CONFIG_STACK_COLORATION=y

Impact:
- Affects sabre-6quad:smp only

Testing:
- Tested with smp, ostest with QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
@masayuki2009
Copy link
Contributor Author

Please see the discussion at #2014 as well.

@masayuki2009
Copy link
Contributor Author

@Ouss4
Please review this PR.

@xiaoxiang781216
Perhaps, you are also interested in this PR.

@xiaoxiang781216 xiaoxiang781216 merged commit 19f7a24 into apache:master Oct 21, 2020
@masayuki2009
Copy link
Contributor Author

@xiaoxiang781216
Thanks for merging.

@masayuki2009 masayuki2009 deleted the fix_arm_intstack_for_smp branch October 22, 2020 03:57
@masayuki2009
Copy link
Contributor Author

@btashton
Could you please backport this PR and PR #2061 to the 10.0 branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants