Commit Graph

204 Commits

Author SHA1 Message Date
wangjinjing1 e2ffbbf287 net/devif: fix devif_loopback check logic
add dlltype check to prevent loopback triggering from non-ipv4/ipv6 packet

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2026-04-21 01:34:57 +08:00
Alin Jerpelea 063372e896 net: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-04-21 01:01:23 +08:00
openvela-robot e44133cd68 rptun: minor nxstyle fix, sync with community
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-04-21 01:01:21 +08:00
openvela-robot 0d22531d60 misc/dev_mem: fix compile error in aarch64
misc/dev_mem.c:203:24: error: comparison between two arrays [-Werror=array-compare]
  203 |   bool merge = (_edata == _sbss);
      |                        ^~
misc/dev_mem.c:203:24: note: use '&_edata[0] == &_sbss[0]' to compare the addresses

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-04-21 01:01:13 +08:00
openvela-robot 200b48bf35 procfs/cpuinfo: Zero copylen in cpuinfo_read
to avoid return the negative number

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-21 01:01:06 +08:00
openvela-robot 1b12410f95 mq: correct inode release in mq_inode_release()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 01:01:01 +08:00
openvela-robot 923523ecec tools/gdb: support string type in offset_of
1. Support any type of value as pointer address in container_of
2. Support string as type in offset_of
3. Make sure type is a pointer in container_of, and not a pointer in
   offset_of

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 01:00:55 +08:00
openvela-robot bba9037914 usensor.c:fix container_of member error.
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-04-21 01:00:47 +08:00
openvela-robot 793cd570f8 tools/gdb: decode backtrace of crashlog
Now crash log can be directly pass to addr2line tool to get all backtraces.

E.g.
(gdb) addr2line -f crash.log -p 485
Address              Symbol                           Source

Backtrace of 485
0x402cc0ac           <up_switch_context+84>           /home/work/ssd1/workspace/MiRTOS-specific product-Stable-Build/nuttx/include/arch/syscall.h:179
0x40291276           <nxsig_timedwait+386>            signal/sig_timedwait.c:365
0x4028fc7e           <nxsig_nanosleep+106>            signal/sig_nanosleep.c:141
0x4028fdba           <clock_nanosleep+26>             signal/sig_nanosleep.c:333
0x402c3736           <usleep+62>                      unistd/lib_usleep.c:108
0x415018c0           <cs2p2p_mSecSleep+24>            Src/PPPP_Common.c:1139
0x414fabde           <cs2p2p_Run_send_DRW+258>        Src/PPPP_API.c:5577
0x414fac62           <cs2p2p_PPPP_thread_send_DRW+18> Src/PPPP_API.c:5616
0x40446f62           <pthread_startup+10>             pthread/pthread_create.c:59
0x41094f4a           <pthread_start+106>              pthread/pthread_create.c:139

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 01:00:41 +08:00
openvela-robot 61f982bb25 fs/semaphore: fix a minor issue with goto label
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2026-04-21 01:00:29 +08:00
openvela-robot 0dc07fb6b1 tools/gdb: imporve nxgcore speed
Let GDB to read from ELF for readonly data.
Disable this feature by nxgcore --no-trust-readonly.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 01:00:18 +08:00
openvela-robot d2ce98f28b fs_open:Adjust the definition of the open path
Summary:
  Reference https://man7.org/linux/man-pages/man2/open.2.html
       EISDIR pathname refers to a directory and the access requested
              involved writing (that is, O_WRONLY or O_RDWR is set).

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2026-04-21 01:00:11 +08:00
openvela-robot b09d89a476 risc-v: Support customize idle loop
Support customize idle loop by CONFIG_ARCH_IDLE_CUSTOM
as other architectures.

Then user can provide their own `up_idle()` function
with CONFIG_ARCH_IDLE_CUSTOM enabled.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-21 01:00:05 +08:00
openvela-robot 8d3b73559f timers: add goldfish timer support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 00:59:57 +08:00
openvela-robot f506bd34c8 sched: synchronize with community code and use nxsched_remove_self.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:59:51 +08:00
openvela-robot 5bb8c15749 arch: fix the sched parameter update when exiting
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:59:45 +08:00
openvela-robot b566da436e sim:support sim elf and dynamic libs package in post build
use the dynamic library .so of the binding compilation environment,
and then modify the dynamic loader of elf at runtime to run sim elf across system versions

1.add post-build for sim build
2.collect dynamic .so and dynamic interpreter
3.add execution script for the entire package sim elf

change text-segment to 0x50000000
because patchelf will modify the .dynamic section in elf,
the upward alignment of elf will be less than 0x3fffffff,
which will cause asan shadow memory overlap error

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-04-21 00:59:38 +08:00
openvela-robot 57e00d628f arch/arm64/src/imx9/imx9_usbdev.c: Clean up cache operations, add DEBUGASSERTS
Correct some of the cache operations:

- EP0 request length was handled incorrectly
- Received data cache invalidate was exceeding the received buffer
- writedtd is also called with no data (EP0 ACK/NACK). Don't touch cache in that case.

Fix trip wire handling to conform with the IMX93 reference manual

Also add DEBUGASSERTS for future to check the validity of pointers and sizes

Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2026-04-21 00:59:15 +08:00
openvela-robot 2f6c45cb01 arch/intel64: optimise context switch
We save interrupted TCB state on tcb->xcp.regs not interrupt stack now
which allows us to remove x86_64_savestate() from up_switch_context()
and other places.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-04-21 00:59:09 +08:00
openvela-robot 3d928157d7 build.yml: Undo debug print
Undo the unintended changes for debug printing. I edited the wrong repo, I am deeply sorry about this.
2026-04-21 00:59:01 +08:00
openvela-robot f2d0966e9b arch/intel64/intel64_head.S: align XCP region
align XCP region to match regs allocation in up_initial_state()

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-04-21 00:58:55 +08:00
openvela-robot bcd70711f4 pm: pm_idle add support for SMP
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:58:46 +08:00
openvela-robot 3c370f84e4 xtensa/Kconfig: Fix dependency for backtrace dump on Xtensas
`CONFIG_XTENSA_INTBACKTRACE` is necessary to enable backtrace dump
for the tasks because exceptions are treated like interrupts (even
when an exception occurs during a normal task execution). It's now
automatically selected when `CONFIG_SCHED_BACKTRACE` is enabled.
This commit also removes outdated Kconfig options.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2026-04-21 00:58:41 +08:00
openvela-robot b8d0af587f pci ep support msi/msi-x test
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-04-21 00:58:28 +08:00
openvela-robot e32220e3b2 tools/gdb: add utils.get_tid(tcb)
Signed-off-by: huangyin5 <huangyin5@xiaomi.com>
2026-04-21 00:58:22 +08:00
openvela-robot b56c30d859 clock: correct compile failed
LD: nuttx.elf
ld: /home/ligd/platform/mainline/nuttx/staging/libsched.a(mq_sndinternal.o): in function `wd_start_realtime':
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274: undefined reference to `clock_realtime2absticks'
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274:(.text+0xad): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `clock_realtime2absticks'
ld: /home/ligd/platform/mainline/nuttx/staging/libsched.a(mq_rcvinternal.o): in function `wd_start_realtime':
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274: undefined reference to `clock_realtime2absticks'
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274:(.text+0xad): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `clock_realtime2absticks'
make[1]: *** [Makefile:128: nuttx.elf] Error 1
make: *** [tools/Unix.mk:551: nuttx.elf] Error 2

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 00:58:16 +08:00
openvela-robot 6710e90b11 misc/rpmsgdev: The private data should be freed only when endpoint is released
A use-after-free problem occurs when there are multiple remotes in the list `g_rpmsg` and the matching remote is not the last item in the list.

Log
  # Export the device "/dev/LOCAL_DEV" to remote "REMOTE_CPU"
  ap> testdev -d 2 -c "REMOTE_CPU" -l "/dev/LOCAL_DEV"
  [ap] kasan_report: kasan detected a read access error, address at 0x3c3d4740,size is 4, return address: 0x2c33620f
  [ap] kasan_show_memory: Shadow bytes around the buggy address:
  [ap] kasan_show_memory:   0x3c3d46f0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4700: aa aa aa aa cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4710: 40 47 3d 3c ed 61 33 2c 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x3c3d4720: 00 00 00 00 00 00 00 00 00 00 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4730: 55 55 55 55 38 00 00 00 02 2c 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4740:[00 00 00 00]66 e0 42 3c cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4750: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4760: aa aa aa aa 38 00 00 00 01 2c 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4770: 50 57 44 3d 2f 00 cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4780: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] dump_assert_info: Current Version: NuttX ****** ***** *** 12.3.0 **********-***** *** ** 2024 **:**:** arm
  [ap] dump_assert_info: Assertion failed panic: at file: kasan/hook.c:187 task: testdev process: testdev 0x2ca20495

  $ addr2line -fe nuttx/nuttx 0x2c33620f
  rpmsgdev_server_created
  /workspace/nuttx/drivers/misc/rpmsgdev_server.c:529
  # Line 529 => strcmp()

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-21 00:58:11 +08:00
openvela-robot 7d0ed7199c binfmt/modlib: support loading each sections to different memory for Relocate object
The feature depends on ARCH_USE_SEPARATED_SECTION
the different memory area has different access speed and cache
capability, so the arch can custom allocate them based on
section names to achieve performance optimization

test:
sim:elf
sim:sotest

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-21 00:58:06 +08:00
openvela-robot 1c3ffd2fb6 arm64:svc call use task stack
kernel build if svc call use irq stack the irq maybe touch
svc stack, svc call use task stack can avoid this case

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-04-21 00:58:00 +08:00
openvela-robot e076a236fe arm64 fork: FORK_REG_LR,FORK_REG_SP should save the func local stack
not the last func stack

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-04-21 00:57:55 +08:00
openvela-robot f138669485 Revert "irq: add [enter|leave]_critical_section_nonirq"
This reverts commit 62d3fe9fccc8d5b056f5bc0c7fd715beddfed405.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:57:50 +08:00
openvela-robot 70ad088045 lib_fdopendir.c:Fix crash in fdopendir caused by fdsan
Summary:
  Add fdsan check in fdopendir, fdsan can work normally when using fdopendir

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2026-04-21 00:57:44 +08:00
openvela-robot fbd0b2baf6 nuttx/libcxx: Fix clang compilation cannot recognize compilation options error.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-21 00:57:39 +08:00
openvela-robot 490ccb9dd1 arm64/smp: changing the startup of arm64 SMP from serial to parallel
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:57:34 +08:00
openvela-robot c2e7969add add dependencies for nuttx_post
nuttx_post depends systemmap and usermap(in protected build mode)

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-04-21 00:57:28 +08:00
openvela-robot 682ac77818 regualtor:adjust the critical area protected
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:57:16 +08:00
openvela-robot 34d5aaa92c tools/gdb: register commands gracefully
Report any error and continue to try to register next command.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 00:57:10 +08:00
openvela-robot dca2f989f0 drivers/pci/pci.c: fix warning when CONFIG_PCI_ASSIGN_ALL_BUSES=n
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
  415 |       FAR struct pci_resource_s *res;
      |                                  ^~~
pci/pci.c: In function ‘pci_scan_bus’:
pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable]
  663 |   FAR struct pci_controller_s *ctrl = bus->ctrl;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-04-21 00:57:03 +08:00
openvela-robot 5dae010f40 gdbstub: add RLE compression
Refer to
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Overview.html

w/o compression, nxgcore command took 41seconds.
w compression, 28second.

If we enable `set trust-readonly-sections on` to read from elf whenever
possible, it furture reduces to 14.9seconds.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 00:56:57 +08:00
openvela-robot 527af374e4 add adc_fifo_size when it over 300
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2026-04-21 00:56:51 +08:00
openvela-robot d65ef952b6 sched: fix hightpc calculation error in sched_profil
In profile_monitor, the scale is calculated using 65536.
There is an inconsistency between the two, which leads to hightpc calculation errors.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-21 00:56:46 +08:00
openvela-robot 7df924b71d greenhills: fix the data type align build error
"/home/guoshichao/work_profile/vela_os/vela_car_5/nuttx/include/nuttx/crypto/blake2s.h", line 91: error #2118-D:
          this attribute reduces the alignment of the typedef, and while that
          will be respected for struct/field layout, the compiler will not
          generate code to handle misaligned accesses for objects of this type
  typedef uint32_t uint32_alias_t __attribute__((may_alias)) aligned_data(1);
                                                             ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-21 00:56:35 +08:00
openvela-robot aca49cb24b Revert "Revert "Add reference count configuration""
This reverts commit 7f903ba21462ec2d6aa0e998c3202f29786f9361.

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2026-04-21 00:56:29 +08:00
openvela-robot 00133c50fc ci/platforms: linux.sh ubuntu.sh switch Wget to cURL tool
Switch wget to cURL tool for:
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()
wasi_sdk()

Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:
kconfig_frontends()
2026-04-21 00:56:23 +08:00
openvela-robot 4a9d48436f nuttxgdb: sq_check no normal print when sq_count
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:56:17 +08:00
openvela-robot f546cb68e4 mpfs_mpucfg.h: Add missing MPUCFG registers
Now all registers are defined
2026-04-21 00:56:11 +08:00
openvela-robot 4d38ce5552 mm/mempool: Fix mempool tag kasan error
The address needs to be reset only when comparing addition, subtraction, multiplication and division addresses. Otherwise, the original address is always returned or saved.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-21 00:55:56 +08:00
openvela-robot 403f0c7781 drivers/mmcsd/mmcsd_sdio.c: Fix setting SDIO_WIDEBUS for SD cards
This corrects the setting widebus for SD cards, which was recently broken in 4f7f751d2adaa2911d8822fbeee87662257d5a36.

The if checking the priv->caps, priv->buswidth and IS_MMC has been wrong for
some time. The proper logic is that for MMC only the priv->caps is checked.
For SD card, both priv->caps and priv->buswidth need to be checked.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2026-04-21 00:55:46 +08:00
openvela-robot 3bd2da5e6e libc: Modify the check length
We should not check the length of both strings at the same time.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-21 00:55:40 +08:00
openvela-robot dcfc04ee43 CMake/preprocess: fix typo PREPROCES -> PREPROCESS
correct the marco define from PREPROCES to PREPROCESS

Signed-off-by: chao an <anchao@lixiang.com>
2026-04-21 00:55:34 +08:00