Skip to content

Commit abc1056

Browse files
committed
Merge branch 'master' into mael.51_use_asm_macro
2 parents ed4c654 + 9ed8d0a commit abc1056

31 files changed

+1277
-926
lines changed

.github/workflows/rust.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
fmt:
77
runs-on: ubuntu-18.04
88
container:
9-
image: adamschwalm/hypervisor-build:14
9+
image: adamschwalm/hypervisor-build:16
1010
options: "-u 0:0"
1111
steps:
1212
- uses: actions/checkout@v1
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-18.04
1818
needs: fmt
1919
container:
20-
image: adamschwalm/hypervisor-build:14
20+
image: adamschwalm/hypervisor-build:16
2121
options: "-u 0:0"
2222
steps:
2323
- uses: actions/checkout@v1
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-18.04
3131
needs: fmt
3232
container:
33-
image: adamschwalm/hypervisor-build:14
33+
image: adamschwalm/hypervisor-build:16
3434
options: "-u 0:0"
3535
steps:
3636
- uses: actions/checkout@v1

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CARGO?=cargo
22
BUILD_TYPE?=release
3-
BUILD_REPO_TAG=14
3+
BUILD_REPO_TAG=16
44
DOCKER_IMAGE=adamschwalm/hypervisor-build:$(BUILD_REPO_TAG)
55

66
TEST_IMAGE_REPO=https://github.com/mythril-hypervisor/build

mythril/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mythril/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bitflags = "1.2.0"
1717
byteorder = { version = "1", default-features = false }
1818
num_enum = { version = "0.5.0", default-features = false }
1919
x86 = "0.34.0"
20-
linked_list_allocator = "0.8.1"
20+
linked_list_allocator = "0.8.6"
2121
log = { version = "0.4.8", default-features = false }
2222
multiboot = "0.3.0"
2323
multiboot2 = "0.9.0"

mythril/src/ap_startup.S

+3-6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ ap_startup_32:
5656
mov ds, ax
5757
mov ss, ax
5858
mov es, ax
59+
60+
; Ensure FS/GS are zeroed
61+
xor ax, ax
5962
mov fs, ax
6063
mov gs, ax
6164

@@ -88,12 +91,6 @@ ap_startup_64:
8891
; Load the stack provided by the bsp
8992
mov rsp, [AP_STACK_ADDR]
9093

91-
; Initialize FS with our per-core index, this will be used for the
92-
; fast per-core access later
93-
mov rdx, [AP_IDX]
94-
shl rdx, 3 ; Shift the AP_IDX to allow the RPL and TI bits to be 0
95-
mov fs, rdx
96-
9794
; See ap::ApData
9895
push qword [AP_IDX]
9996

mythril/src/apic.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use crate::error::{Error, Result};
44
use crate::time;
55
use crate::{declare_per_core, get_per_core, get_per_core_mut};
6+
use num_enum::TryFromPrimitive;
67
use raw_cpuid::CpuId;
78
use x86::msr;
89

@@ -17,21 +18,21 @@ const IA32_APIC_BASE_EXD: u64 = 1 << 10;
1718
/// BSP mask
1819
const IA32_APIC_BASE_BSP: u64 = 1 << 8;
1920

20-
#[derive(Debug)]
21+
#[derive(Debug, TryFromPrimitive)]
2122
#[repr(u8)]
2223
/// ICR destination shorthand values
2324
pub enum DstShorthand {
2425
/// No shorthand used
2526
NoShorthand = 0x00,
26-
// TODO(dlrobertson): Is there any reason to include self? AFAIK
27-
// SELF_IPI negates the need for it.
27+
/// Send only to myself
28+
MySelf = 0x01,
2829
/// Broadcast including myself
2930
AllIncludingSelf = 0x02,
3031
/// Broadcast excluding myself
3132
AllExcludingSelf = 0x03,
3233
}
3334

34-
#[derive(Debug)]
35+
#[derive(Debug, TryFromPrimitive)]
3536
#[repr(u8)]
3637
/// INIT IPI Level
3738
pub enum Level {
@@ -41,7 +42,7 @@ pub enum Level {
4142
Assert = 0x01,
4243
}
4344

44-
#[derive(Debug)]
45+
#[derive(Debug, TryFromPrimitive)]
4546
#[repr(u8)]
4647
/// ICR trigger modes
4748
pub enum TriggerMode {
@@ -51,7 +52,7 @@ pub enum TriggerMode {
5152
Level = 0x01,
5253
}
5354

54-
#[derive(Debug)]
55+
#[derive(Debug, TryFromPrimitive)]
5556
#[repr(u8)]
5657
/// ICR mode of the Destination field
5758
pub enum DstMode {
@@ -61,7 +62,7 @@ pub enum DstMode {
6162
Logical = 0x01,
6263
}
6364

64-
#[derive(Debug)]
65+
#[derive(Debug, TryFromPrimitive)]
6566
#[repr(u8)]
6667
/// ICR delivery mode
6768
pub enum DeliveryMode {

mythril/src/boot.S

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ trampoline:
227227
mov eax, GDT64.data
228228
mov ds, eax
229229
mov es, eax
230-
mov gs, eax
231230
mov ss, eax
232231

233-
; FS stores the per-core index, which is always 0 for the BSP
234-
mov edx, 0
232+
; Ensure GS/FS are zeroed
233+
xor edx, edx
234+
mov gs, edx
235235
mov fs, edx
236236

237237
jmp kmain_early

0 commit comments

Comments
 (0)