mode in RISC-V

At any time, the RISC-V processor is operating in exactly one of the following “modes”: 
* U-Mode (User Mode) Lowest privilege 
* S-Mode (Supervisor Mode) 
* M-Mode (Machine Mode) Highest privilege 

Typically, user-level applications will execute in User Mode. Whenever the application wants an OS service, it will make a system call. The OS code that handles this call will execute in Supervisor Mode, i.e., at a higher privilege level. Upon return to the application, the mode will be lowered back to User Mode. 
Most instructions can be executed in any mode, but some instructions are privileged and can only be executed in a higher mode. 
The privilege levels are strictly ordered. Anything that can be done at a lower privilege level can be done in any one of the higher levels. For example, anything that can be done in User Mode can be done in Supervisor Mode.
Machine Mode is the highest privilege level; all instructions are legal at this level and nothing is protected. When the processor begins operation after powering up or after a reset, it is placed in Machine Mode. 
The remaining modes (User and Supervisor modes) are pretty much the same as each other. In other words, there is little to distinguish them, except their relationship to each other. If you understand User Mode, then you will also understand most of Supervisor Mode. 
There is one exception to the uniformity and this regards virtual memory and page tables. This functionality is located in Supervisor Mode. 
It appears that the current mode is not available in any user-visible register. In other words, it is difficult for code to determine the current mode. It cannot simply be read from a register; instead the current mode is implicit in the functionality that is available. 
The RISC-V specification does not require all modes to be implemented. Some processors may not have all modes. 
The most basic processor will have only Machine Mode. In a sense, there is no privilege system in such a simple processor since all operations can be performed at any time. An implementation like this would be suitable for an embedded microcontroller.
With option 2, there are two privilege levels: User and Machine. This might be appropriate for a simple OS with some protected security monitor running in Machine Mode and one or more applications running in User Mode. 
Option 3 is intended for more elaborate systems that will be running a traditional OS like Unix/Linux.