Skip to content

Commit c3061df

Browse files
gaojiaqi7jyao1
authored andcommitted
Update rust toolchain version to nightly-2022-04-07
Changes: - global_asm and asm macro are already stable features and can be used by import core::arch::global_asm and core::arch::asm - Update crate x86, x86_64, bootloader and uart to latest version. - Add #![feature(asm_sym)] to resolve compilation error. - Update rust toolchain version used by CI. Signed-off-by: Jiaqi Gao <[email protected]>
1 parent a7742f5 commit c3061df

File tree

30 files changed

+47
-41
lines changed

30 files changed

+47
-41
lines changed

.github/workflows/devtools.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
AR_x86_64_unknown_uefi: llvm-ar
1515
CC_x86_64_unknown_uefi: clang
1616
STABLE_RUST_TOOLCHAIN: 1.58.1
17-
NIGHTLY_RUST_TOOLCHAIN: nightly-2021-08-20
17+
NIGHTLY_RUST_TOOLCHAIN: nightly-2022-04-07
1818
TOOLCHAIN_PROFILE: minimal
1919

2020
jobs:

.github/workflows/format.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions-rs/toolchain@v1
3030
with:
3131
profile: minimal
32-
toolchain: nightly-2021-08-20
32+
toolchain: nightly-2022-04-07
3333
override: true
3434
components: clippy
3535

@@ -58,7 +58,7 @@ jobs:
5858
uses: actions-rs/toolchain@v1
5959
with:
6060
profile: minimal
61-
toolchain: nightly-2021-08-20
61+
toolchain: nightly-2022-04-07
6262
override: true
6363
components: rustfmt
6464

.github/workflows/integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
AS: nasm
1414
AR_x86_64_unknown_uefi: llvm-ar
1515
CC_x86_64_unknown_uefi: clang
16-
RUST_TOOLCHAIN: nightly-2021-08-20
16+
RUST_TOOLCHAIN: nightly-2022-04-07
1717
TOOLCHAIN_PROFILE: minimal
1818

1919
jobs:

.github/workflows/library.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
AR_x86_64_unknown_uefi: llvm-ar
1515
CC_x86_64_unknown_uefi: clang
1616
STABLE_RUST_TOOLCHAIN: 1.58.1
17-
NIGHTLY_RUST_TOOLCHAIN: nightly-2021-08-20
17+
NIGHTLY_RUST_TOOLCHAIN: nightly-2022-04-07
1818
TOOLCHAIN_PROFILE: minimal
1919

2020
jobs:

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
AS: nasm
1414
AR_x86_64_unknown_uefi: llvm-ar
1515
CC_x86_64_unknown_uefi: clang
16-
RUST_TOOLCHAIN: nightly-2021-08-20
16+
RUST_TOOLCHAIN: nightly-2022-04-07
1717
TOOLCHAIN_PROFILE: minimal
1818

1919
jobs:

Cargo.lock

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

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export CARGO=cargo
22
export STABLE_TOOLCHAIN:=1.58.1
3-
export NIGHTLY_TOOLCHAIN:=nightly-2021-08-20
3+
export NIGHTLY_TOOLCHAIN:=nightly-2022-04-07
44
export BUILD_TYPE:=release
55
export PREFIX:=/usr/local
66

devtools/dev_container/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN apt-get update && \
1717
&& apt-get clean && rm -rf /var/lib/apt/lists/*
1818

1919
# Install rustup and a fixed version of Rust.
20-
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-08-20
20+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2022-04-07
2121
RUN rustup toolchain install 1.58.1
2222
RUN rustup component add rust-src
2323
RUN rustup component add llvm-tools-preview

devtools/td-benchmark/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ linked_list_allocator = "0.9.0"
1212
log = "0.4.13"
1313
scroll = { version = "0.10", default-features = false, features = ["derive"]}
1414
td-layout = { path = "../../td-layout" }
15-
# Lock down to 0.44, otherwise it depends on inline asm
16-
x86 = "0.44.0"
15+
x86 = "0.47.0"

devtools/td-benchmark/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
44

55
#![no_std]
6-
#![feature(asm)]
76
#![allow(unused)]
87

98
#[macro_use]
109
extern crate alloc;
11-
1210
use core::alloc::GlobalAlloc;
1311
use core::alloc::Layout;
12+
use core::arch::asm;
1413
use linked_list_allocator::LockedHeap;
1514
use scroll::Pread;
1615
use td_layout::RuntimeMemoryLayout;

devtools/test-runner-client/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ edition = "2018"
1010
[dependencies]
1111
linked_list_allocator = "0.9.0"
1212
spin = { version = "0.9.2", features = ["lazy"]}
13-
uart_16550 = "=0.2.14"
14-
x86_64 = "=0.14.6"
13+
uart_16550 = "0.2.17"
14+
x86_64 = "0.14.9"

doc/test_in_no_std.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
6262
```toml
6363
[dependencies]
6464
# add bootloader
65-
bootloader = "0.10.9"
65+
bootloader = "0.10.12"
6666

6767
[package.metadata.bootloader]
6868
# To map the complete physical memory starting at virtual address.

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2021-08-20
1+
nightly-2022-04-07

td-exception/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bitflags = "1.2.1"
1212
lazy_static = { version = "1.0", features = ["spin_no_std"] }
1313
log = "0.4.13"
1414
tdx-tdcall = { path = "../tdx-tdcall", optional = true }
15-
x86_64 = "=0.14.6"
15+
x86_64 = "0.14.9"
1616

1717
[features]
1818
tdx = ["tdx-tdcall"]

td-exception/src/asm/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) 2021 Intel Corporation
22
//
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
4+
use core::arch::global_asm;
45

56
global_asm!(include_str!("idt.asm"));

td-exception/src/interrupt.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
44

5+
use core::arch::asm;
56
#[cfg(feature = "tdx")]
67
use tdx_tdcall::tdx;
78

td-exception/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
44

55
#![no_std]
6-
#![feature(asm)]
76
#![feature(naked_functions)]
8-
#![feature(global_asm)]
7+
#![feature(asm_sym)]
98

109
pub mod asm;
1110
pub mod idt;

td-logger/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ log = "0.4.13"
1313
spin = "0.9.2"
1414
tdx-tdcall = { path = "../tdx-tdcall", optional = true }
1515
# Lock down to 0.44, otherwise it depends on inline asm
16-
x86 = { version = "0.44.0", optional = true }
16+
x86 = { version = "0.47.0", optional = true }
1717

1818
[features]
1919
tdx = ["tdx-tdcall"]

td-paging/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ log = "0.4.13"
1313
spin = "0.9.2"
1414
td-layout = { path = "../td-layout" }
1515
# Lock down to 0.44, otherwise it depends on inline asm
16-
x86 = "0.44.0"
17-
x86_64 = "=0.14.6"
16+
x86 = "0.47.0"
17+
x86_64 = "0.14.9"

td-payload/src/asm/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2021 Intel Corporation
22
//
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
4+
use core::arch::global_asm;
45

56
global_asm!(include_str!("stack_guard_test.asm"));
67
#[cfg(feature = "cet-ss")]

td-payload/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#![no_std]
1717
#![cfg_attr(not(test), no_main)]
18-
#![feature(global_asm)]
19-
#![feature(asm)]
2018
#![allow(unused)]
2119

2220
#[macro_use]

td-shim/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ spin = { version = "0.9.2", optional = true }
3333
td-exception = { path = "../td-exception", features = ["tdx"], optional = true }
3434
td-logger = { path = "../td-logger", optional = true }
3535
td-paging = { path = "../td-paging", optional = true }
36-
x86 = { version ="0.44.0", optional = true }
36+
x86 = { version ="0.47.0", optional = true }
3737
# Lock down to 0.44, otherwise it depends on inline asm
38-
x86_64 = { version = "=0.14.6", optional = true }
38+
x86_64 = { version = "0.14.9", optional = true }
3939

4040
# secure boot
4141
der = {version = "0.4.5", features = ["derive", "alloc"], optional = true}

td-shim/src/bin/td-shim/asm/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) 2020-2022 Intel Corporation
22
//
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
4+
use core::arch::global_asm;
5+
46
global_asm!(include_str!("switch_stack.asm"));
57
global_asm!(include_str!("msr64.asm"));
68
global_asm!(include_str!("ap_loop.asm"));

td-shim/src/bin/td-shim/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
44

55
#![allow(unused)]
6-
#![feature(global_asm)]
7-
#![feature(asm)]
86
#![feature(alloc_error_handler)]
97
#![cfg_attr(not(test), no_std)]
108
#![cfg_attr(not(test), no_main)]

td-shim/src/bin/td-shim/td/tdx_mailbox.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
extern crate alloc;
66

77
use alloc::vec::Vec;
8+
use core::arch::asm;
89
use core::cmp::min;
910
use core::ops::RangeInclusive;
1011
use td_layout::memslice::{get_dynamic_mem_slice_mut, get_mem_slice_mut, SliceType};

tdx-tdcall/src/asm/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
4+
use core::arch::global_asm;
45

56
#[cfg(feature = "use_tdx_emulation")]
67
global_asm!(include_str!("tdcall_emu.asm"));

tdx-tdcall/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// SPDX-License-Identifier: BSD-2-Clause-Patent
44

55
#![no_std]
6-
#![feature(global_asm)]
76

87
#[cfg(feature = "use_tdx_emulation")]
98
pub const USE_TDX_EMULATION: bool = true;

tests/test-td-exception/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2018"
99

1010
[dependencies]
1111
# Keep it as `dependencies` to satisfy bootloader-locator's requirement, though it should be `dev-dependencies`
12-
bootloader = "=0.10.9"
12+
bootloader = "0.10.12"
1313

1414
[dev-dependencies]
1515
td-exception = { path = "../../td-exception", features = ["integration-test"] }

tests/test-td-paging/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ edition = "2018"
99

1010
[dependencies]
1111
# Keep it as `dependencies` to satisfy bootloader-locator's requirement, though it should be `dev-dependencies`
12-
bootloader = "=0.10.9"
12+
bootloader = "0.10.12"
1313

1414
[dev-dependencies]
1515
td-paging = { path = "../../td-paging" }
1616
td-layout = { path = "../../td-layout" }
1717
test-runner-client = { path = "../../devtools/test-runner-client" }
18-
x86_64 = "=0.14.6"
18+
x86_64 = "0.14.9"
1919

2020
[package.metadata.bootloader]
2121
map-physical-memory = true

tests/test-td-payload/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ td-layout = { path = "../../td-layout" }
2020
scroll = { version = "0.10.0", default-features = false, features = ["derive"]}
2121
serde = { version = "1.0", default-features = false, features = ["derive"]}
2222
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
23-
x86 = { version = "0.44.0" }
23+
x86 = { version = "0.47.0" }
2424
td-shim = { path = "../../td-shim" }
2525
zerocopy = "0.6.0"
2626

0 commit comments

Comments
 (0)