Skip to content

Conversation

@txy-21
Copy link
Contributor

@txy-21 txy-21 commented Jan 26, 2026

Summary
This PR contains 12 miscellaneous fixes and improvements for NuttX, covering various subsystems including networking, memory management, power management, and system utilities. All changes are targeted bug fixes and compatibility improvements with no breaking changes.

Changes Overview:

Network & Communication (4 commits)
VSOCK improvements: Set host_cid and guest_cid for proper endpoint configuration
Header optimization: Remove pthread.h inclusion from nuttx/userspace.h to reduce dependencies
netdb/rexec: Add missing rexec helpers for legacy remote exec compatibility
VirtIO drivers: Invalidate cache for vq_ring descriptors to ensure cache coherency

Memory & Resource Management (2 commits)
ARM64 timer: Add missing kmalloc.h include to fix build warnings
Coredump: Validate memory range accessibility before dumping to prevent crashes

Power Management (4 commits)
PM/SMP: Fix stay_timeout inconsistency in SMP environments
Power supplies: Remove critical_section usage from powerled.c, smps.c, and update regulator.c for better locking strategy

System & API Improvements (2 commits)
AIO: Add proper file descriptor validation in aio_cancel function
fpathconf: Return -1 for _PC_PRIO_IO to indicate unsupported feature

Impact

Stability: Fixes several SMP-related race conditions and memory access issues
Compatibility: Improves POSIX compliance and legacy tool compatibility
Performance: Reduces IRQ-off time in power management paths
Build Quality: Eliminates build warnings and reduces unnecessary dependencies
No Breaking Changes: All changes maintain backward compatibility

Testing:
nsh> user_main: Exiting
nsh> ostest_main: Exiting with status 0

txy-21 and others added 12 commits January 26, 2026 15:49
pse52 test error:fpathconf failed, errno = 38 (ENOSYS)

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Validate the file descriptor before attempting cancellation.
Return EBADF for invalid descriptors as required by POSIX.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Probe the start/end of each configured range before dumping.
Fails early on misconfigured ranges to ease diagnosis.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Invalidate descriptor entries before following NEXT links.
Ensures CPU sees updated vring descriptors from the device.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Use critical_section for regulator state updates.
Reduces IRQ-off time while preserving atomic updates.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Drop critical_section usage from SMPS paths.
Keeps locking consistent with the updated regulator flow.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Remove critical_section usage from powerled control.
Aligns power LED handling with the updated regulator flow.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Handle stay_timeout updates consistently across CPUs.
Avoids mismatched state when SMP scheduling is enabled.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Include kmalloc.h to satisfy allocator declarations.
Prevents implicit declaration warnings on arm64 builds.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Add netdb helpers needed by rexec support.
Improves compatibility with legacy remote exec tooling.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Don't include pthread.h in nuttx/userspace.h and
move main_t to sys/types.h to avoid including the
unnecessary header file.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Populate VSOCK host/guest CIDs in the IVSHMEM resource.
Ensures endpoints are configured before bring-up.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

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

Please split the contribution in several PRs each one containing one contribution topic

@txy-21
Copy link
Contributor Author

txy-21 commented Jan 26, 2026

Please split the contribution in several PRs each one containing one contribution topic

@jerpelea OK

@github-actions github-actions bot added Arch: arm64 Issues related to ARM64 (64-bit) architecture Area: Drivers Drivers issues Area: File System File System issues Area: OS Components OS Components issues Size: M The size of the change in this PR is medium labels Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm64 Issues related to ARM64 (64-bit) architecture Area: Drivers Drivers issues Area: File System File System issues Area: OS Components OS Components issues Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants