Skip to content

Conversation

@wenyongh
Copy link
Collaborator

@wenyongh wenyongh commented Nov 4, 2022

Add new options to control the native stack hw bound check feature:

  • Besides the original option cmake -DWAMR_DISABLE_HW_BOUND_CHECK=1/0,
    add a new option cmake -DWAMR_DISABLE_STACK_HW_BOUND_CHECK=1/0
  • When the linear memory hw bound check is disabled, the stack hw bound check
    will be disabled automatically, no matter what the input option is
  • When the linear memory hw bound check is enabled, the stack hw bound check
    is enabled/disabled according to the value of input option
  • Besides the original option --bounds-checks=1/0, add a new option
    --stack-bounds-checks=1/0 for wamrc

@wenyongh wenyongh changed the title [WIP] Add control for the native stack check with hardware trap Add control for the native stack check with hardware trap Nov 4, 2022
CFLAGS += -DWASM_DISABLE_STACK_HW_BOUND_CHECK=1
else
CFLAGS += -DWASM_DISABLE_HW_BOUND_CHECK=0
ifeq ($(CONFIG_INTERPRETERS_WAMR_DISABLE_STACK_HW_BOUND_CHECK),y)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No such option in NuttX now,we can disable it if CONFIG_INTERPRETERS_WAMR_DISABLE_HW_BOUND_CHECK disabled.
BTW, even CONFIG_INTERPRETERS_WAMR_DISABLE_HW_BOUND_CHECK exists but it doesn't works actually since most NuttX supported platform don't have MMU.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, just add CFLAGS += -DWASM_DISABLE_STACK_HW_BOUND_CHECK=0 when CONFIG_INTERPRETERS_WAMR_DISABLE_HW_BOUND_CHECK is disabled.

@wenyongh wenyongh merged commit 7fd3719 into bytecodealliance:main Nov 7, 2022
@wenyongh wenyongh deleted the stack_hw_bound_check branch November 11, 2022 07:11
NingW101 pushed a commit to NingW101/wasm-micro-runtime that referenced this pull request Dec 1, 2022
…liance#1682)

Add a new options to control the native stack hw bound check feature:
- Besides the original option `cmake -DWAMR_DISABLE_HW_BOUND_CHECK=1/0`,
  add a new option `cmake -DWAMR_DISABLE_STACK_HW_BOUND_CHECK=1/0`
- When the linear memory hw bound check is disabled, the stack hw bound check
   will be disabled automatically, no matter what the input option is
- When the linear memory hw bound check is enabled, the stack hw bound check
  is enabled/disabled according to the value of input option
- Besides the original option `--bounds-checks=1/0`, add a new option
  `--stack-bounds-checks=1/0` for wamrc

Refer to: bytecodealliance#1677
wenyongh added a commit that referenced this pull request Dec 6, 2022
Add a new options to control the native stack hw bound check feature:
- Besides the original option `cmake -DWAMR_DISABLE_HW_BOUND_CHECK=1/0`,
  add a new option `cmake -DWAMR_DISABLE_STACK_HW_BOUND_CHECK=1/0`
- When the linear memory hw bound check is disabled, the stack hw bound check
   will be disabled automatically, no matter what the input option is
- When the linear memory hw bound check is enabled, the stack hw bound check
  is enabled/disabled according to the value of input option
- Besides the original option `--bounds-checks=1/0`, add a new option
  `--stack-bounds-checks=1/0` for wamrc

Refer to: #1677
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…liance#1682)

Add a new options to control the native stack hw bound check feature:
- Besides the original option `cmake -DWAMR_DISABLE_HW_BOUND_CHECK=1/0`,
  add a new option `cmake -DWAMR_DISABLE_STACK_HW_BOUND_CHECK=1/0`
- When the linear memory hw bound check is disabled, the stack hw bound check
   will be disabled automatically, no matter what the input option is
- When the linear memory hw bound check is enabled, the stack hw bound check
  is enabled/disabled according to the value of input option
- Besides the original option `--bounds-checks=1/0`, add a new option
  `--stack-bounds-checks=1/0` for wamrc

Refer to: bytecodealliance#1677
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants