Commit graph

1432 commits

Author SHA1 Message Date
Rian Quinn
91886c75d9 Adds an example extension written in Rust and fixes a number of bugs
This patch:
- Adds a complete extension written in Rust, with all of the build
  system logic to support Rust development as well.
- Fixes an issues on Intel systems where the MSR bitmaps were not
  set up properly.
- Fixes a number of issues with UEFI.
- Fixes a number of issues with Windows, including a BSOD issue
  with narrow contracts.
2021-10-21 08:53:22 -06:00
Christopher Pelloux
44e6f4f19f
Merge pull request #975 from chp-io/loader-fix-hang
Loader: Fix machine hang when loading the hypervisor
2021-10-18 11:03:40 -04:00
Christopher Pelloux
d2030b602d Loader: Build the arch target defined by CMake
This patch fixes an issue that could arise if the following conditions
are met:
- set HYPERVISOR_TARGET_ARCH to Intel in CMake
- build the loader for Linux on an AMD machine
- On AMD, `make driver_quick`, then `make start` -> computer hangs

This occurs because the loader is built using the architecture of the
build machine while the hypervisor is built using the target arch set
during cmake configuration which can be different. The cpu checks are
done inside the Linux driver which will succeed and load the hypervisor
which is using Intel specific instructions causing the machine to hang
when it tries to start on AMD.

We now use the cmake HYPERVISOR_TARGET_ARCH variable in Makefile which
will keep the hypervisor and the Linux driver in sync.
2021-10-17 23:23:04 -04:00
Christopher Pelloux
f548617a99 loader: Add *.dwo to .gitignore 2021-10-17 21:38:02 -04:00
Christopher Pelloux
2e374dd3e5 CI: Trigger CI on any branch on push
and don't trigger the CI when markdown files only have been updated
2021-10-17 13:45:57 -04:00
Christopher Pelloux
1ebd892ac1 CMake: Warn if the BSL isn't the expected version
CMake will warn if the BSL dependency isn't at the expected
version locally. This is useful when using a local copy with
-DFETCHCONTENT_SOURCE_DIR_BSL=<path_to_bsl> that needs to
be updated.
2021-10-17 13:45:57 -04:00
Rian Quinn
8ad8e34270
Merge pull request #974 from rianquinn/master
Adds missing unit tests for the loader
2021-10-15 08:08:38 -06:00
Rian Quinn
dcbe19368c Adds missing unit tests for the loader
This patch:
- Completes the unit tests for the loader
- Fixes issues with Clang Tidy
2021-10-15 08:07:34 -06:00
Rian Quinn
1728c306a9
Merge pull request #973 from rianquinn/master
Adds additional unit tests to the Microkernel
2021-10-12 06:56:33 -06:00
Rian Quinn
6daaff26e5 Completes all of the unit tests for the VMM
This patch:
- Completes all of the unit tests for the VMM
- Completes all of the unit tests for the syscall library
- Compleses all of the unit tests for the runtime library
- Completes all of the unit tests for the lib library
- Fixes a number of bugs identified during testing.
2021-10-11 15:45:29 -06:00
Rian Quinn
1eb665da52
Merge pull request #972 from rianquinn/master
Fix fail handler logic, TLB flushing, Windows support
2021-10-05 17:23:01 -06:00
Rian Quinn
fd7e6bee3c Fix fail handler logic, TLB flushing, Windows support
This patch:
- Fixes some bugs with Windows. It is working again
- Fixes a long-time issue with Linux on some Intel CPUs that
  would cause any attempt to load the driver to crash due to
  the GDT being marked as read only, and the Linux APIs
  for this will triple fault your system if these APIs are
  not used very quickly (a bug that probably should be
  reported to Linux).
- Fixes issues with how the fail logic worked. You can not
  fail inside the fail handler. New integration tests were
  added to ensure that this case works as expected. In
  general, the hypervisor has less assembly, and should be
  more robust as a result.
- Fixes how TLB flushing is done, and adds TLB flushing APIs.
  A future PR will use this code to implement free_page and
  free_huge.
- Continued work on removing the heap logic that is no longer
  supported.
2021-10-05 16:43:10 -06:00
Rian Quinn
ace605a80b
Merge pull request #970 from rianquinn/master
Fix issues with the fast fail logic
2021-09-30 15:44:04 -06:00
Rian Quinn
db05a902d5 Fix issues with the fast fail logic 2021-09-30 14:52:28 -06:00
Rian Quinn
326d731fc9
Merge pull request #969 from rianquinn/master
Add missing registers and fixes bug with alloc_page/alloc_huge
2021-09-28 08:21:20 -06:00
Rian Quinn
77c38d9ec7 Add missing registers and fixes bug with alloc_page/alloc_huge
This patch:
- Adds the missing registers CR8, DR0, DR1, DR2, DR3 and XCR0
  to the microkernel. These registers are now managed by the
  microkernel for all extensions.
- Fixes an issue with alloc_page and alloc_huge where allocations
  were not reflected to all of the direct maps.
- Fixes an issue with fail() not sending the correct arguments.
  Further testing and debugging is needed for this.
2021-09-28 08:11:48 -06:00
Rian Quinn
34994ec1ad
Merge pull request #968 from rianquinn/master
FIx bug with Clang Tidy
2021-09-24 08:46:51 -06:00
Rian Quinn
b36948fd51 FIx bug with Clang Tidy 2021-09-24 08:38:38 -06:00
Rian Quinn
0e767ad355
Merge pull request #967 from rianquinn/master
Add clear() to init on Intel
2021-09-24 08:23:55 -06:00
Rian Quinn
112f2bed57 Add clear() to init on Intel
This patch clears the VMCS on init for Intel, which is needed because
the memory that is given to the the VMCS might have come from an old
VMCS that was still cached in hardware.
2021-09-24 08:23:26 -06:00
Rian Quinn
df09a4434d
Merge pull request #966 from rianquinn/master
Syscall/ABI changes to support the execution of Guest VMs.
2021-09-24 07:03:16 -06:00
Rian Quinn
e6ab83751b Syscall/ABI changes to support the execution of Guest VMs.
This patch provides
- A change to the way advance IP worked. It now also runs the
  the VS.
- Added two new ABIs to support changing the active VM. This
  allows exit handlers to determine which VM they want to
  work with, without having to run the VM to make this change
  occur
- Adds some sanity checks to some of the registers to ensure
  they are configured properly by extensions.
2021-09-24 06:43:39 -06:00
Rian Quinn
58418ae1da
Merge pull request #964 from rianquinn/master
Fixes bugs with paging, and removes IA32 to make Intel/AMD consistent
2021-09-18 19:45:34 -06:00
Rian Quinn
cb16e8eafc Fixes bugs with paging, and removes IA32 to make Intel/AMD consistent 2021-09-18 18:54:08 -06:00
Rian Quinn
83f8335558
Merge pull request #963 from rianquinn/master
Fix issues with the IOCTL interface and the page table logic
2021-09-17 15:42:29 -06:00
Rian Quinn
9058f793cf Fix issues with the IOCTL interface and the page table logic 2021-09-17 15:35:21 -06:00
Rian Quinn
134a24cbe0
Merge pull request #962 from rianquinn/master
Widen the page fault handler's virtual address contract
2021-09-15 17:02:10 -06:00
Rian Quinn
5149638800 Widen the page fault handler's virtual address contract 2021-09-15 16:57:25 -06:00
Rian Quinn
006cdae168
Merge pull request #961 from rianquinn/master
Small bugs with the dispatch logic, and update BSL
2021-09-14 20:24:39 -06:00
Rian Quinn
5413756ea7 Small bugs with the dispatch logic, and update BSL 2021-09-14 20:24:13 -06:00
Rian Quinn
4e42d5e26b
Merge pull request #960 from rianquinn/master
Fix issue with IOCTL interfaces
2021-09-13 13:34:41 -06:00
Rian Quinn
137b29b7ec Fix issue with IOCTL interfaces 2021-09-13 13:21:25 -06:00
Rian Quinn
2472495b61
Merge pull request #959 from rianquinn/master
Move the IOCTL logic to Lib so that it can be used by MicroV
2021-09-12 19:26:50 -06:00
Rian Quinn
76fabc5f47 Move the IOCTL logic to Lib so that it can be used by MicroV 2021-09-12 19:20:59 -06:00
Rian Quinn
e4eea8ceea
Merge pull request #958 from rianquinn/master
Small bug fixes to support MicroV
2021-09-10 20:20:17 -06:00
Rian Quinn
06cddd8f50 Small bug fixes to support MicroV 2021-09-10 19:49:09 -06:00
Rian Quinn
92f8ee185f
Merge pull request #957 from rianquinn/master
Updates to match the changes to the BSL
2021-09-08 16:03:25 -06:00
Rian Quinn
6850437bb9 Updates to match the changes to the BSL
This patch addresses the following:
- Adds a number of addition hypercall that are needed for MicroV
- Updates the code to support the changes made to the BSL including
  better checking of safe integrals and narrow contracts
- Adds a lib folder to contain code shared between the kernel and
  extensions where possible.
- Minor initial additions for Rust. Still lots of work to do here
2021-09-08 15:47:38 -06:00
Rian Quinn
95848672b1
Merge pull request #953 from rianquinn/master
Minor bug fixes
2021-07-29 16:58:32 -06:00
Rian Quinn
b828c763a0 Minor bug fixes 2021-07-29 16:57:48 -06:00
Rian Quinn
14724d45c7
Merge pull request #952 from rianquinn/master
Minor bug fixes
2021-07-26 14:32:20 -06:00
Rian Quinn
23a8627ab7 Minor bug fixes 2021-07-26 14:31:58 -06:00
Rian Quinn
abfea7ff60
Merge pull request #951 from rianquinn/master
Fixes bugs with Clang Tidy and adds some more unit tests
2021-07-15 15:45:08 -06:00
Rian Quinn
0c1fe2ce80 Fixes bugs with Clang Tidy and adds some more unit tests 2021-07-15 15:18:01 -06:00
Rian Quinn
ac983d4c6c
Merge pull request #950 from tkchia/tkchia/devel
UEFI: use EFI_LOADED_IMAGE_PROTOCOL to locate boot volume
2021-07-15 12:53:13 -06:00
Tee-Kiah Chia
fec39b5544 UEFI: use EFI_LOADED_IMAGE_PROTOCOL to locate boot volume
Some UEFI environments lack EFI_SHELL_PROTOCOL, but still
implement EFI_LOADED_IMAGE_PROTOCOL.
2021-07-15 13:15:55 +00:00
Rian Quinn
8591a6193b
Merge pull request #947 from rianquinn/master
Unit/Integration Test and ARM support changes
2021-06-29 20:57:43 -06:00
Rian Quinn
f5f39193e5 Unit/Integration Test and ARM support changes
This patch contains a massive number of changes that are the
result of finally adding unit/integration tests and ARM
support. ARM support moved a number of files that were duplicates
while the unit and integration tests identified a massive number
of structural issues. The cost of waiting so long to finally
add tests.
2021-06-29 20:30:53 -06:00
Rian Quinn
d8876dd605
Update README.md 2021-04-08 06:02:16 -06:00
Rian Quinn
f880edf7b9
Update README.md 2021-03-30 08:03:08 -06:00