Skip to content

lib: cppc: fix fast channel region overlap detection - #126

Merged
pathakraul merged 1 commit into
riscv-software-src:mainfrom
Justin-Nickel-Wu:main
Nov 5, 2026
Merged

pathakraul merged 1 commit into
riscv-software-src:mainfrom
Justin-Nickel-Wu:main

Conversation

@Justin-Nickel-Wu

Copy link
Copy Markdown
Contributor

Summary

Fix the overlap check between performance request and feedback regions by comparing their relative offsets against the corresponding region sizes.

Problem

The previous implementation compared absolute offsets directly against region sizes, which could fail to detect overlapping regions when their offsets were non-zero.

Fix

Use relative offset comparisons to correctly detect overlapping regions, including regions with identical starting offsets.

Use subtraction instead of addition to avoid potential integer overflow.

Tests

  • make
  • make LIBRPMI_TEST=y
  • make check

Fix the overlap check between performance request and feedback
regions by comparing their relative offsets against the
corresponding region sizes.

Use subtraction instead of addition to avoid integer overflow
when checking region boundaries.

Signed-off-by: wuliwen <liwen.wu@spacemit.com>
@pathakraul

Copy link
Copy Markdown
Collaborator

Looks good to me

@pathakraul
pathakraul merged commit e5e6dfb into riscv-software-src:main Nov 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants