Commit 2889e61
committed
feat: use i686 layout for non-init-paging guests on x86_64
When the init-paging feature is disabled (e.g., 32-bit guests that
manage their own paging), select the i686 layout module instead of
amd64 on x86_64 hosts. This ensures MAX_GPA/MAX_GVA use 32-bit
address space limits, and the scratch region is placed correctly
at the top of 4 GiB physical memory.
Key changes:
- Set MAX_GVA = MAX_GPA (0xffff_ffff) in i686 layout so that
identity-mapped guests get correct virtual addresses
- Remove SNAPSHOT_PT_GVA_* from i686 layout (no page tables)
- Gate SNAPSHOT_PT_GVA_* exports/usage behind init-paging feature
- Propagate init-paging feature from hyperlight-host to
hyperlight-common via Cargo feature forwarding
- Make snapshot region writable for non-init-paging guests (no CoW
page tables means the hardware needs direct write access)
- Fix min_scratch_size signature to match amd64 layout
Signed-off-by: danbugs <danilochiarlone@gmail.com>1 parent 64aa448 commit 2889e61
5 files changed
Lines changed: 33 additions & 10 deletions
File tree
- src
- hyperlight_common/src
- arch/i686
- hyperlight_host
- src
- mem
- sandbox
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
27 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
683 | 698 | | |
684 | 699 | | |
685 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| |||
0 commit comments