SVA support for FreeBSD 9.3#36
Conversation
1. added two members 'fsbase', and 'state_flags' in structure sva_integer_state_t 2. updated system call entry: SVAsyscall in handler.S: reset state_flags to 0 before enter syscall; after syscall returns, check state_flags to determine wheter to restore FSBASE MSR 3. updated context switch (sva_swap_integer): set state_flags to 1 for old thread. 4. added a hack function sva_init_fsbase. This is used for Kernel to update 'fsbase' in SVA. This is a hack since 'fsbase' should not be exposed to Kernel. A better solution could be allowing the application to issue a hypercall directly to SVA to initializae 'fsbase'.
|
Update, new tests: Note: On coleman: 1) need to disable usb 3.0 in BIOS setup and disable fusefs in /etc/rc.conf; 2) ssh server daemon occasionally crash at boot. |
|
Update-02: new tests:
Note: the patched system booted on SSD drive, which seems to have a more 'official' installation of FreeBSD 9.3 and allows the system to boot normally as expected. The 'official' installation on the other HDD disk cannot boot with single user mode, nor the sva-patched 9.3 kernel can boot on it. Problem is unclear, probably related to some kernel configurations by which an unsupported driver is triggered. |
2. sva_init_stack: copy the fsbase from the old thread; 3. remove state_flags in integer state struct, remove macro STATE_FULL_IRET. Instead, use 3rd lowest bit in IC->valid for full_iret flag, use IC_FULL_IRET as the constant value of the flag (def in offsets.h)
|
This branch is force pushed. To checkout please use git rebase and select drop to the conflicting commits.
|
With TLS enabled, now FreeBSD 9.3 can run on SVA. Compared to the SVA version for FreeBSD 9.0, the main changes in SVA code are the offsets of members in the CPUState structure.
The Ported FreeBSD 9.3 Kernel: https://github.com/tupipa/sva_freebsd93.
Tests: