
--
You received this message because you are subscribed to the Google Groups "RISC-V Firmware Exchange" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fw-exchange...@riscv.org.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/fw-exchange/bb2fd803-3ea9-4b58-8fec-652cfad39bf9n%40riscv.org.




If you modified the code, from what I can tell is your change doesn’t detect if satp mode set is successfully or not.
In your case, SV57, SV48 is falling but you still let it continue then the actual satp mode is still bare mode and no MMU is enabled. So the code is doing as same as before without MMU.
In the case SV39, set satp mode successfully, MMU enabled. But it is getting fault exception due to the following reason
- The memory range has not been added to GCD. In other words, no memory hob is set up during HOB phase.
OR
- The IO range has not been added to GCD, in this case it is your UART. If you look at the OvmfPkg/RiscVVirt/Sec/Platform.c, the PopulateIoResources (Base, "ns16550a") line is used to add UART range to GCD for DXE phase. You need to do the same thing for all IOs that you will access. Normally DXE driver will add IO range to GCD using EDk2 API, but UART normally accessed directly.



You need to check whether AMOArithmetic PMA enabled for the failing region(0x7FFFF3D10). Refer to section 3.6.3 in riscv-privileged
From:
yuqing...@gmail.com <yuqing...@gmail.com>
Date: Tuesday, August 15, 2023 at 8:15 PM
To: RISC-V Firmware Exchange <fw-ex...@riscv.org>
Cc: RISC-V Firmware Exchange <fw-ex...@riscv.org>
Subject: Re: Questions about configuring RISC-V MMU
Hi everyone,
After MMU is enabled, I get store access fault (not page fault) when executing AMO instructions (AMOADD.W) in SG2042 (Xuantie C920). But replacing AMOADD.W with regular ADD instruction fixes access fault problem.
../MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c:2861
../MdePkg/Library/BaseSynchronizationLib/Synchronization.S:63
We queried the relevant technical manual, the following is the setting method of SATP
So why would it be like this? Please help me analyze it, thank you.
Project repository:
edk2-platform:
Thanks!
--
You received this message because you are subscribed to the Google Groups "RISC-V Firmware Exchange" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fw-exchange...@riscv.org.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/fw-exchange/bb2fd803-3ea9-4b58-8fec-652cfad39bf9n%40riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V Firmware Exchange" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
fw-exchange...@riscv.org.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/fw-exchange/32c8da33-aedc-4e56-9be3-83b91c6da6cen%40riscv.org.