You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/12/19 15:30:07 UTC

[GitHub] [nuttx] GUIDINGLI opened a new pull request, #7928: SIM: take timer irq as real timer with WALL_SIGNAL

GUIDINGLI opened a new pull request, #7928:
URL: https://github.com/apache/nuttx/pull/7928

   ## Summary
   
   SIM: take timer irq as real timer with WALL_SIGNAL
   
   ## Impact
   
   ALL sim
   
   ## Testing
   
   VELA
   


-- 
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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7928: SIM: take timer irq as real timer with WALL_SIGNAL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7928:
URL: https://github.com/apache/nuttx/pull/7928#discussion_r1052402031


##########
arch/sim/src/sim/sim_initialize.c:
##########
@@ -162,6 +162,8 @@ static int sim_loop_task(int argc, char **argv)
 {
   while (1)
     {
+      irqstate_t flags = up_irq_save();

Review Comment:
   should we use enter_critical_section and sched_lock here to simulate the irq context



-- 
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


[GitHub] [nuttx] GUIDINGLI commented on pull request #7928: SIM: take timer irq as real timer with WALL_SIGNAL

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on PR #7928:
URL: https://github.com/apache/nuttx/pull/7928#issuecomment-1359069586

   > 
   
   @masayuki2009 
   Thanks for the reviewing & testing.
   
   I think it is a testcase error.
   
   Here is the resolve:
   https://github.com/apache/nuttx-apps/pull/1463


-- 
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


[GitHub] [nuttx] masayuki2009 commented on pull request #7928: SIM: take timer irq as real timer with WALL_SIGNAL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #7928:
URL: https://github.com/apache/nuttx/pull/7928#issuecomment-1358796975

   I noticed that ostest with 'sim:smp' failed.
   
   ```
   nsh> uname -a
   NuttX 3.6.1 e34578a3d0 Dec 20 2022 12:37:26 sim sim
   nsh> mount
     /proc type procfs
   nsh> ps
     PID GROUP CPU PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   USED  FILLED COMMAND
       0     0   0   0 FIFO     Kthread N-- Running            00000000 066512 004776   7.1%  CPU0 IDLE
       1     1   1   0 FIFO     Kthread N-- Assigned           00000000 066512 007160  10.7%  CPU1 IDLE
       2     2   2   0 FIFO     Kthread N-- Running            00000000 066512 004720   7.0%  CPU2 IDLE
       3     3   3   0 FIFO     Kthread N-- Running            00000000 066512 004720   7.0%  CPU3 IDLE
       4     4 --- 255 FIFO     Kthread --- Waiting  Signal    00000000 067504 001048   1.5%  loop_task
       5     5   1 100 FIFO     Task    --- Running            00000000 067504 003160   4.6%  nsh_main
   nsh> free
                      total       used       free    largest  nused  nfree
           Umem:   67108304     348464   66759840   66759840     60      1
   ...
   nsh> ostest
   stdio_test: write fd=1
   stdio_test: Standard I/O Check: printf
   stdio_test: write fd=2
   ...
   user_main: signal handler test
   sighand_test: Initializing semaphore to 0
   sighand_test: Unmasking SIGCHLD
   sighand_test: Registering SIGCHLD handler
   sighand_test: Starting waiter task
   waiter_main: Waiter started
   sighand_test: Started waiter_main pid=107
   waiter_main: Unmasking signal 17
   waiter_main: Registering signal handler
   waiter_main: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
   waiter_main: Waiting on semaphore
   sighand_test: Signaling pid=107 with signo=17 sigvalue=42
   wakeup_action: Received signal 17
   wakeup_action: sival_int=42
   wakeup_action: si_code=1
   poster_main: Poster started
   sighand_test: Started poster_main pid=108
   [CPU1] _assert: Assertion failed CPU1 at file:assert/lib_stackchk.c line: 57 task: waiter 0x55d87be7914a
   [CPU1] showtasks:    PID    PRI   CPU     STACK      USED   FILLED    COMMAND
   [CPU1] dump_task:      0      0     0     66512      4776     7.1%    CPU0 IDLE
   [CPU1] dump_task:      1      0     1     66512     12248    18.4%    CPU1 IDLE
   [CPU1] dump_task:      2      0     2     66512      7160    10.7%    CPU2 IDLE
   [CPU1] dump_task:      3      0     3     66512      7160    10.7%    CPU3 IDLE
   [CPU1] dump_task:      4    255     0     67504      1048     1.5%    loop_task
   [CPU1] dump_task:      5    100     1     67504      3160     4.6%    nsh_main
   [CPU1] dump_task:    107    100     1     73648      1944     2.6%    waiter
   [CPU1] dump_task:    108    100     2     73648      1224     1.6%    poster
   [CPU1] dump_task:     29    100     0     67504      2008     2.9%    ostest
   [CPU1] dump_task:     30    100     0     73600      2152     2.9%    ostest Arg1 Arg2 Arg3 Arg4
   *** stack smashing detected ***: <unknown> terminated
   ```


-- 
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


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #7928: SIM: take timer irq as real timer with WALL_SIGNAL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7928:
URL: https://github.com/apache/nuttx/pull/7928#discussion_r1053837430


##########
arch/sim/src/sim/sim_internal.h:
##########
@@ -84,6 +84,16 @@
 
 #define sim_savestate(regs) sim_copyfullstate(regs, (xcpt_reg_t *)CURRENT_REGS)
 #define sim_restorestate(regs) (CURRENT_REGS = regs)
+#define sim_fullcontextrestore(restoreregs)                     \
+    do                                                          \
+    {                                                           \
+        xcpt_reg_t *env = restoreregs;                          \
+        uint32_t *flags = (uint32_t *)&env[JB_FLAG];            \
+                                                                \
+        up_irq_restore(((uint64_t)flags[1] << 32) | flags[0]);  \
+        longjmp(env, 1);                                        \
+    }                                                           \
+    while (0)

Review Comment:
   ```suggestion
       do                                                          \
         {                                                         \
           xcpt_reg_t *env = restoreregs;                          \
           uint32_t *flags = (uint32_t *)&env[JB_FLAG];            \
                                                                   \
           up_irq_restore(((uint64_t)flags[1] << 32) | flags[0]);  \
           longjmp(env, 1);                                        \
         }                                                         \
       while (0)
   ```



-- 
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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7928: SIM: take timer irq as real timer with WALL_SIGNAL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7928:
URL: https://github.com/apache/nuttx/pull/7928#discussion_r1054078111


##########
arch/sim/src/sim/sim_internal.h:
##########
@@ -85,6 +85,29 @@
 #define sim_savestate(regs) sim_copyfullstate(regs, (xcpt_reg_t *)CURRENT_REGS)
 #define sim_restorestate(regs) (CURRENT_REGS = regs)
 
+#define sim_saveusercontext(saveregs)                           \
+    ({                                                          \
+       irqstate_t flags = up_irq_flags();                       \
+       uint32_t *env = (uint32_t *)saveregs + JB_FLAG;          \
+       int ret;                                                 \
+                                                                \
+       env[0] = flags & UINT32_MAX;                             \
+       env[1] = (flags >> 32) & UINT32_MAX;                     \
+                                                                \
+       ret = setjmp(saveregs);                                  \

Review Comment:
   remove ret



-- 
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


[GitHub] [nuttx] masayuki2009 merged pull request #7928: SIM: take timer irq as real timer with WALL_SIGNAL

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged PR #7928:
URL: https://github.com/apache/nuttx/pull/7928


-- 
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