Change to von Neumann architecture #10

Closed
opened 2023-07-29 23:00:47 +00:00 by Ghost · 0 comments

Currently HBVM is a Harvard-architecture virtual machine. Instructions are kept in separate flat memory and other data are stored in 5-level paged memory.

Flatness

Current state

The instruction memory flatness has benefit of not having to go through the whole process of 5-level page table lookup (this can be partially mitigated by having some cache though).

Solution

Still keep instruction memory in flat array, which would be mapped to the top of address space.

Variants

  1. Outside the regular paged address range (which is I believe 40 bits?), being recognised by top-most bit(s) and would receive special treatment (no-paged area).
  2. Just map the instruction slice as regular data with executable-only protection

Validation

Current state

Also executing instructions only from immutable memory allows to perform code validation and be sure program don't jump to code which could trigger undefined behaviour.

Solution

Consider loaded program as validated and for making a page executable, require validation (this could be left to the host environment, tbh, with warning as mapping functions are unsafe anyways).

Anyways, this is an open proposal and there is sure lot of solutions I haven't thought about so, go ahead :)

Currently HBVM is a Harvard-architecture virtual machine. Instructions are kept in separate flat memory and other data are stored in 5-level paged memory. # Flatness ## Current state The instruction memory flatness has benefit of not having to go through the whole process of 5-level page table lookup (this can be partially mitigated by having some cache though). ## Solution Still keep instruction memory in flat array, which would be mapped to the top of address space. ### Variants 1. Outside the regular paged address range (which is I believe 40 bits?), being recognised by top-most bit(s) and would receive special treatment (no-paged area). 2. Just map the instruction slice as regular data with executable-only protection # Validation ## Current state Also executing instructions only from immutable memory allows to perform code validation and be sure program don't jump to code which could trigger undefined behaviour. ## Solution Consider loaded program as validated and for making a page executable, require validation (this could be left to the host environment, tbh, with warning as mapping functions are unsafe anyways). Anyways, this is an open proposal and there is sure lot of solutions I haven't thought about so, go ahead :)
Ghost added the
I-enhancement
bikeshedding
labels 2023-07-29 23:00:47 +00:00
Ghost closed this issue 2023-09-01 16:15:46 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AbleOS/holey-bytes#10
There is no content yet.