You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "hujun260 (via GitHub)" <gi...@apache.org> on 2024/05/20 03:42:17 UTC
[PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
hujun260 opened a new pull request, #12379:
URL: https://github.com/apache/nuttx/pull/12379
## Summary
when changing the stack pointer, software must use an ISB instruction immediately after the MSR instruction. This ensures that instructions after the ISB instruction execute using the new stack pointer.
## Impact
ostest
## Testing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2147481139
> > @hujun260 As long as I investigated the Zephyr OS code, isb instruction is issued just after changing the CONTROL register, not changing MSP or PSP. So, I think we don't need these changes.
>
> @masayuki2009 but FreeRTOS add: https://github.com/search?q=repo%3AFreeRTOS%2FFreeRTOS-Kernel%20psp&type=code
@xiaoxiang781216 @hujun260
Hmm, as long as I read "ARM Cortex-M Programming Guide to Memory Barrier Instructions
Application Note 321" (https://developer.arm.com/documentation/dai0321/latest/), I could not find the use-cases implemented in FreeRTOS.
Please tell us which document did you referred to.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "hujun260 (via GitHub)" <gi...@apache.org>.
hujun260 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2149889921
> > > @hujun260 As long as I investigated the Zephyr OS code, isb instruction is issued just after changing the CONTROL register, not changing MSP or PSP. So, I think we don't need these changes.
> >
> >
> > @masayuki2009 but FreeRTOS add: https://github.com/search?q=repo%3AFreeRTOS%2FFreeRTOS-Kernel%20psp&type=code
>
> @xiaoxiang781216 @hujun260 Hmm, as long as I read "ARM Cortex-M Programming Guide to Memory Barrier Instructions Application Note 321" (https://developer.arm.com/documentation/dai0321/latest/), I could not find the use-cases implemented in FreeRTOS.
>
> Please tell us which document did you referred to.
I'm sorry to say that our modifications were not made with reference to the official code, but rather based on the corresponding descriptions in the documentation.
https://developer.arm.com/documentation/101928/0101/The-Cortex-M85-Processor--Reference-Material/Programmer-s-model/Core-registers/CONTROL-register?lang=en
" When changing the stack pointer, software must use an ISB instruction immediately after the MSR instruction. This ensures that instructions after the ISB instruction execute using the new stack pointer."
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2120487758
while searching for this instruction I found this strange issue: https://stackoverflow.com/questions/77434321/arm-m33-undefined-instruction-fault
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2137674679
> @hujun260 As long as I investigated the Zephyr OS code, isb instruction is issued just after changing the CONTROL register, not changing MSP or PSP. So, I think we don't need these changes.
but FreeRTOS add:
https://github.com/search?q=repo%3AFreeRTOS%2FFreeRTOS-Kernel%20psp&type=code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2121346637
@hujun260
As long as I investigated the Zephyr OS code, isb instruction is issued just after changing the CONTROL register, not changing MSP or PSP.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2151136663
> > > > @hujun260 As long as I investigated the Zephyr OS code, isb instruction is issued just after changing the CONTROL register, not changing MSP or PSP. So, I think we don't need these changes.
> > >
> > >
> > > @masayuki2009 but FreeRTOS add: https://github.com/search?q=repo%3AFreeRTOS%2FFreeRTOS-Kernel%20psp&type=code
> >
> >
> > @xiaoxiang781216 @hujun260 Hmm, as long as I read "ARM Cortex-M Programming Guide to Memory Barrier Instructions Application Note 321" (https://developer.arm.com/documentation/dai0321/latest/), I could not find the use-cases implemented in FreeRTOS.
> > Please tell us which document did you referred to.
>
> I'm sorry to say that our modifications were not made with reference to the official code, but rather based on the corresponding descriptions in the documentation.
>
> https://developer.arm.com/documentation/101928/0101/The-Cortex-M85-Processor--Reference-Material/Programmer-s-model/Core-registers/CONTROL-register?lang=en
>
> " When changing the stack pointer, software must use an ISB instruction immediately after the MSR instruction. This ensures that instructions after the ISB instruction execute using the new stack pointer."
@hujun260
I think not all the MSR instructions but MSR instructions to the *CONTROL* register.
Please see 'CONTROL updates' on page 12.
<img width="929" alt="image" src="https://github.com/apache/nuttx/assets/25843920/8ef3fb70-33b4-4666-ac38-6c65dbc473cb">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2119892115
@hujun260
Do you have any references on the change? (e.g. ARM technical reference manuals or application notes).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #12379:
URL: https://github.com/apache/nuttx/pull/12379
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "hujun260 (via GitHub)" <gi...@apache.org>.
hujun260 commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2120294626
> @hujun260 Do you have any references on the change? (e.g. ARM technical reference manuals or application notes).
https://developer.arm.com/documentation/101928/0101/The-Cortex-M85-Processor--Reference-Material/Programmer-s-model/Core-registers/CONTROL-register?lang=en
" When changing the stack pointer, software must use an ISB instruction immediately after the MSR instruction. This ensures that instructions after the ISB instruction execute using the new stack pointer."
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] armv6/7/8-m: use ISB instruction immediately after the MSR instruction [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12379:
URL: https://github.com/apache/nuttx/pull/12379#issuecomment-2120489789
> > @hujun260 Do you have any references on the change? (e.g. ARM technical reference manuals or application notes).
>
> https://developer.arm.com/documentation/101928/0101/The-Cortex-M85-Processor--Reference-Material/Programmer-s-model/Core-registers/CONTROL-register?lang=en
>
> " When changing the stack pointer, software must use an ISB instruction immediately after the MSR instruction. This ensures that instructions after the ISB instruction execute using the new stack pointer."
Please include it in the commit message for easy access!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org