You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ARCv2 documentation contains the following: "The ILINK register is not accessible in user mode. Illegal accesses from user mode to ILINK raise a Privilege Violation exception". But QEMU allows ILINK access form user mode.
Examples are based on Zephyr.
The following is executed in userspace:
uint32_t rd_ilink = 0;
__asm__ volatile("mov %%[ilink], 0xaaaaaaaa\n"::);
__asm__ volatile("mov %0, %%[ilink]\n": "=r"(rd_ilink) : );
printf("Ilink was set in %s to 0x%x but we got no crashes\n",
k_is_user_context() ? "UserSpace!" : "privileged mode." , rd_ilink);
*** Booting Zephyr OS build v3.3.0-rc3-59-gf1b662ae17b5 ***
Hello World from UserSpace! (qemu_arc)
Ilink was set in UserSpace! to 0xaaaaaaaa but we got no crashes
How to reproduce
Download example and run it on recent version of qemu
For what it's worth, auxiliary registers suffer the same. I re-iterate what has been submitted on a now-private repo:
At the moment, in user mode, most auxiliary registers are readable/writable; while
according to PRM (section 4.2.3.2 Privileged Registers), only these should be accessible:
PC
STATS32
LP_START
LP_END
I consider this ...
ilink is a GPR. In case of a GPR, every instructions that uses it, should take care of it. This requires adaptation to the decoder to insert the checking routine in place if one of the operands is ilink. By "checking routine" I mean the tcg code to check against status32.u, and raise an exception if indeed it is set. Something like seti and clri do.
Hi,
ARCv2 documentation contains the following: "The ILINK register is not accessible in user mode. Illegal accesses from user mode to ILINK raise a Privilege Violation exception". But QEMU allows ILINK access form user mode.
Examples are based on Zephyr.
The following is executed in userspace:
Expected behavior - raising exception
Current behavior - continuing execution
How to reproduce
Download example and run it on recent version of qemu
Routine that contains example code with ILINK access is
user_function()
zephyr_user_ilink.zip
The text was updated successfully, but these errors were encountered: