Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V: Move mhartid to own assembly macro+function #6050

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

pussuw
Copy link
Contributor

@pussuw pussuw commented Apr 12, 2022

Hartid and cpuindex are not the same thing. Hartid is needed regardless
of SMP, for external interrupt handling etc.

SMP needs cpuindex which might not be index == hartid, so both are
needed. IMO it is clearer to provide separate API for both.

Currently the implementation of up_cpu_index is done a bit lazily,
because it assumes hartid == cpu index, but this is not 100% accurate,
so it is still missing some logic.

Summary

Separates SMP cpuindex and mhartid

Impact

De-couples two unrelated things from each other

Testing

MPFS icicle:knsh

Copy link
Contributor Author

@pussuw pussuw left a comment

Choose a reason for hiding this comment

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

1 bug, will fix asap

arch/risc-v/src/common/riscv_macros.S Outdated Show resolved Hide resolved
@pussuw
Copy link
Contributor Author

pussuw commented Apr 12, 2022

Hmm, tried to fix it via the webui and made a mess. I'll try to fix it and if it's not possible I'll fix it tomorrow properly.

EDIT: Will fixup the extra commit tomorrow. My bad..

Hartid and cpuindex are not the same thing. Hartid is needed regardless
of SMP, for external interrupt handling etc.

SMP needs cpuindex which might not be index == hartid, so both are
needed. IMO it is clearer to provide separate API for both.

Currently the implementation of up_cpu_index is done a bit lazily,
because it assumes hartid == cpu index, but this is not 100% accurate,
so it is still missing some logic.
@jerpelea jerpelea merged commit 370152f into apache:master Apr 13, 2022
@pussuw pussuw deleted the mhartid_asmfunc branch April 13, 2022 10:02
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.

4 participants