pussuw opened a new pull request, #14329:
URL: https://github.com/apache/nuttx/pull/14329
## Summary
Implement hartid<->cpuid mapping for RISC-V. This is necessary for some
platforms which cannot use 1:1 mapping between logical and physical CPU /
core IDs. One example is MPFS where hart0 cannot be used for NuttX SMP as
it is a less capable "monitor" core (E51) compared to the application
cores hart1...3 (E54).
Why not just use a generic offset then? We also need the physical hart ID
for many things:
- Communication between harts (IPI)
- External interrupt acknowledgment (interrupt claim for specific CPU)
- Communication to SBI
Thus, create procedures that can do this translation:
- The default mapping is still logical=physical.
- Another flavor is to use the existing CONFIG_ARCH_RV_HARTID_BASE config
variable, which is just a simple offset
- The final flavor is to overload hartid<->cpuid on a per chip basis (no
example for this is provided yet)
To achieve this, a generic "up_this_cpu()" macro is introduced to the common
architecture layer. This macro
is activated by setting ARCH_HAVE_CPUID_MAPPING=y after which the arch/chip
must implement the CPUID mapping
function.
By default, the CPUID mapping is still logical=physical.
## Impact
Decouples physical and logical CPU ids from each other. Only the RISC-V
platform is affected.
## Testing
- rv-virt:knsh64
- rv-virt:ksmp64
- rv-virt:nsh64
- rv-virt:smp64
ostest pass
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]