Re: Boot code awareness of the Hypervisor extension
andrew@...
On Tue, Jun 23, 2020 at 12:40 PM Greg Favor <gfavor@...> wrote:
FWIW, I think supervisor mode already follows answer "B", inasmuch as the satp and medeleg registers are not reset. Consider M-mode software written to run on a system with only M and U modes, but executed on a system with M/S/U. The software might not zero medeleg/mideleg, meaning a trap in U-mode might unintentionally transfer control to S-mode; or it might not zero satp, meaning paging might inadvertently be enabled while executing in U-mode. (It's of course possible to write this software to work on either an M/U or an M/S/U system, but it takes extra care to check for the presence of S-mode and conditionally initialize the relevant state.)
|
|