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

ARM Cortex A-53 / 72 errata mitigations #189

Closed
wants to merge 1 commit into from

Conversation

shermand100
Copy link

Applicable to all ARM A-53 single board computers but primarily targeted at Raspberry Pi 3&4 users as those will be the most numerous:

There are known faults at the chip level with ARM Cortex A-53, as per the Arm Developer errata notice developer.arm.com/documentation where:

835769: AArch64 multiply-accumulate instruction might produce incorrect result (page 20 of that document)
and
843419: A load or store might access an incorrect address (page 22)

To mitigate for this gcc has additional build flags:

https://gcc.gnu.org/onlinedocs/gcc.pdf (Page 315)

-mfix-cortex-a53-835769
-mno-fix-cortex-a53-835769
Enable or disable the workaround for the ARM Cortex-A53 erratum number
835769. This involves inserting a NOP instruction between memory instructions
and 64-bit integer multiply-accumulate instructions.

-mfix-cortex-a53-843419
-mno-fix-cortex-a53-843419
Enable or disable the workaround for the ARM Cortex-A53 erratum number
843419. This erratum workaround is made at link time and this will only pass
the corresponding flag to the linker.

Which Monero implemented:

monero-project/monero/commit/cf10e05cc6a0ed495dbdd44ec3a76b964b14edba

And can be seen working/triggered as during build.

Is this applicable through any of the pools verification functions?

This targeted are Raspberry Pi 3&4 users:
There are known faults at the chip level with ARM Cortex A-53, as per the Arm Developer errata notice https://developer.arm.com/documentation/epm048406/2100/ where:

835769: AArch64 multiply-accumulate instruction might produce incorrect result (page 20 of that document)
and
843419: A load or store might access an incorrect address (page 22)

To mitigate for this gcc has additional build flags:

https://gcc.gnu.org/onlinedocs/gcc.pdf (Page 315)

-mfix-cortex-a53-835769
-mno-fix-cortex-a53-835769
Enable or disable the workaround for the ARM Cortex-A53 erratum number
835769. This involves inserting a NOP instruction between memory instructions
and 64-bit integer multiply-accumulate instructions.

-mfix-cortex-a53-843419
-mno-fix-cortex-a53-843419
Enable or disable the workaround for the ARM Cortex-A53 erratum number
843419. This erratum workaround is made at link time and this will only pass
the corresponding flag to the linker.

Which Monero implemented:

monero-project/monero/commit/cf10e05cc6a0ed495dbdd44ec3a76b964b14edba

And can be seen working/triggered as during build.

Is this applicable through any of the pools verification functions?
@shermand100
Copy link
Author

Draft Pull Request as not sure how applicable.
I'm assuming P2Pool performs verification checks on miners submissions, possibly triggering this error?

@SChernykh
Copy link
Owner

I have Raspberry Pi 3b+ and P2Pool runs just fine there.

@SChernykh
Copy link
Owner

Actually... The mystery is solved now :D tevador/RandomX@457c0e4

@SChernykh SChernykh force-pushed the master branch 12 times, most recently from a604b47 to d8b23cd Compare August 26, 2023 19:00
@SChernykh SChernykh force-pushed the master branch 2 times, most recently from 3e458b2 to 7986321 Compare August 31, 2023 15:50
SChernykh added a commit that referenced this pull request Sep 6, 2023
SChernykh added a commit that referenced this pull request Sep 6, 2023
SChernykh added a commit that referenced this pull request Sep 6, 2023
SChernykh added a commit that referenced this pull request Sep 6, 2023
SChernykh added a commit that referenced this pull request Sep 6, 2023
SChernykh added a commit that referenced this pull request Sep 6, 2023
SChernykh added a commit that referenced this pull request Sep 6, 2023
@SChernykh
Copy link
Owner

I've added these command line flags to build scripts: 8d9b9e5

@shermand100
Copy link
Author

Glad to see this has been useful, even as an awareness piece for RandomX hardware issues.

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.

None yet

2 participants