-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for WFI virtual instructions (#39)
* Running confidential Linux VM with virtio-*-pci devices because they support DMA API * add minimal support for wfi virtual instruction * Cleaning unused references and unnecessary features declarations in Rust code. Simplifying the build scripts. Pass on the documentation --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com>
- Loading branch information
1 parent
50c8272
commit e9658a1
Showing
25 changed files
with
156 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule opensbi
updated
15 files
+4 −18 | Makefile | |
+12 −6 | firmware/fw_base.S | |
+0 −5 | firmware/fw_base.ldS | |
+0 −249 | include/sbi/riscv_dbtr.h | |
+0 −1 | include/sbi/riscv_encoding.h | |
+0 −10 | include/sbi/sbi_byteorder.h | |
+0 −125 | include/sbi/sbi_dbtr.h | |
+0 −11 | include/sbi/sbi_ecall_interface.h | |
+0 −2 | include/sbi/sbi_hart.h | |
+0 −4 | lib/sbi/Kconfig | |
+0 −4 | lib/sbi/objects.mk | |
+0 −728 | lib/sbi/sbi_dbtr.c | |
+0 −73 | lib/sbi/sbi_ecall_dbtr.c | |
+0 −4 | lib/sbi/sbi_hart.c | |
+0 −11 | lib/sbi/sbi_init.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
//CONFIG_FDT_GPIO=y | ||
//CONFIG_FDT_I2C=y | ||
# CONFIG_FDT_GPIO=y | ||
# CONFIG_FDT_I2C=y | ||
CONFIG_FDT_IPI=y | ||
//CONFIG_FDT_IRQCHIP=y | ||
//CONFIG_FDT_IRQCHIP_APLIC=y | ||
# CONFIG_FDT_IRQCHIP=y | ||
# CONFIG_FDT_IRQCHIP_APLIC=y | ||
CONFIG_FDT_IRQCHIP_PLIC=y | ||
//CONFIG_FDT_REGMAP=y | ||
//CONFIG_FDT_REGMAP_SYSCON=y | ||
# CONFIG_FDT_REGMAP=y | ||
# CONFIG_FDT_REGMAP_SYSCON=y | ||
CONFIG_FDT_RESET=y | ||
//CONFIG_FDT_RESET_GPIO=y | ||
//CONFIG_FDT_RESET_SYSCON=y | ||
# CONFIG_FDT_RESET_GPIO=y | ||
# CONFIG_FDT_RESET_SYSCON=y | ||
CONFIG_FDT_SERIAL=y | ||
CONFIG_FDT_SERIAL_UART8250=y | ||
CONFIG_FDT_TIMER=y | ||
CONFIG_FDT_TIMER_MTIMER=y | ||
//CONFIG_FDT_TIMER_PLMT=y | ||
# CONFIG_FDT_TIMER_PLMT=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
security-monitor/src/confidential_flow/handlers/virtual_instruction_request.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-FileCopyrightText: 2023 IBM Corporation | ||
// SPDX-FileContributor: Wojciech Ozga <woz@zurich.ibm.com>, IBM Research - Zurich | ||
// SPDX-License-Identifier: Apache-2.0 | ||
use crate::confidential_flow::ConfidentialFlow; | ||
use crate::core::transformations::{ExposeToConfidentialVm, VirtualInstructionRequest, VirtualInstructionResult}; | ||
|
||
const WFI_INSTRUCTION: usize = 0x10500073; | ||
|
||
pub fn handle(request: VirtualInstructionRequest, confidential_flow: ConfidentialFlow) -> ! { | ||
let transformation = if request.instruction == WFI_INSTRUCTION { | ||
ExposeToConfidentialVm::VirtualInstructionResult(VirtualInstructionResult::new(request.instruction_length)) | ||
} else { | ||
// TODO: add support for some CSR manipulation | ||
// TODO: for not supported instructions, inject illegal instruction exception to the guest | ||
panic!("Not supported virtual instruction: {:x}", request.instruction); | ||
}; | ||
confidential_flow.exit_to_confidential_hart(transformation) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.