pussuw commented on code in PR #14865:
URL: https://github.com/apache/nuttx/pull/14865#discussion_r1849934784


##########
arch/arm/src/arm/arm_dataabort.c:
##########
@@ -70,15 +70,16 @@ void arm_dataabort(uint32_t *regs, uint32_t far, uint32_t 
fsr)
 {
   struct tcb_s *tcb = this_task();
 #ifdef CONFIG_LEGACY_PAGING
-  uint32_t *savestate;
+  bool savestate;
 
   /* Save the saved processor context in current_regs where it can be
    * accessed for register dumps and possibly context switching.
    */
 
-  savestate = up_current_regs();
+  savestate = arm_get_irq_flag();
 #endif
-  up_set_current_regs(regs);
+  tcb->xcp.regs = regs;

Review Comment:
   Can't a page fault exception occur in the kernel when e.g. trying to access 
a user page that has been swapped? This would invoke the page fault exception 
when running the interrupt handler in kernel.
   
   I don't know if this can happen right now in practice, but it is 
theoretically possible.



##########
arch/arm/src/arm/arm_dataabort.c:
##########
@@ -70,15 +70,16 @@ void arm_dataabort(uint32_t *regs, uint32_t far, uint32_t 
fsr)
 {
   struct tcb_s *tcb = this_task();
 #ifdef CONFIG_LEGACY_PAGING
-  uint32_t *savestate;
+  bool savestate;
 
   /* Save the saved processor context in current_regs where it can be
    * accessed for register dumps and possibly context switching.
    */
 
-  savestate = up_current_regs();
+  savestate = arm_get_irq_flag();
 #endif
-  up_set_current_regs(regs);
+  tcb->xcp.regs = regs;

Review Comment:
   Can't a page fault occur in the kernel when e.g. trying to access a user 
page that has been swapped? This would invoke the page fault exception when 
running the interrupt handler in kernel.
   
   I don't know if this can happen right now in practice, but it is 
theoretically possible.



-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to