From 30f58c7f8c86482d22f441953807624adb3ca872 Mon Sep 17 00:00:00 2001 From: Juliette Pretot Date: Mon, 13 Jun 2022 14:49:51 +0000 Subject: [PATCH] remove UEFI app --- Cargo.toml | 1 - experimental/uefi/README.md | 1 - experimental/uefi/app/.cargo/config.toml | 9 - experimental/uefi/app/Cargo.lock | 761 ------------------ experimental/uefi/app/Cargo.toml | 27 - experimental/uefi/app/runner | 35 - experimental/uefi/app/src/main.rs | 94 --- experimental/uefi/app/src/serial.rs | 106 --- experimental/uefi/app/src/tests/mod.rs | 20 - .../uefi/app/src/tests/remote_attestation.rs | 110 --- xtask/src/vm.rs | 6 - 11 files changed, 1170 deletions(-) delete mode 100644 experimental/uefi/app/.cargo/config.toml delete mode 100644 experimental/uefi/app/Cargo.lock delete mode 100644 experimental/uefi/app/Cargo.toml delete mode 100755 experimental/uefi/app/runner delete mode 100644 experimental/uefi/app/src/main.rs delete mode 100644 experimental/uefi/app/src/serial.rs delete mode 100644 experimental/uefi/app/src/tests/mod.rs delete mode 100644 experimental/uefi/app/src/tests/remote_attestation.rs diff --git a/Cargo.toml b/Cargo.toml index 2ff1c6cd2fb..3e3b75d8506 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,6 @@ members = [ "xtask", ] exclude = [ - "experimental/uefi/app", "experimental/uefi/baremetal", "experimental/uefi/baremetal-crosvm", "oak_functions/loader/fuzz", diff --git a/experimental/uefi/README.md b/experimental/uefi/README.md index 5dd61042f96..6fb5359200e 100644 --- a/experimental/uefi/README.md +++ b/experimental/uefi/README.md @@ -3,7 +3,6 @@ This directory contains the following: - `runtime`: common business logic that should run in a VM -- `app`: UEFI application that wraps `runtime` for execution under UEFI - `baremetal`: a minimal kernel that wraps `runtime` for execution on bare metal - `loader`: wrapper around `qemu` that loads one of the two above and exposes a gRPC server for communicating with the runtime diff --git a/experimental/uefi/app/.cargo/config.toml b/experimental/uefi/app/.cargo/config.toml deleted file mode 100644 index 0bb001dca52..00000000000 --- a/experimental/uefi/app/.cargo/config.toml +++ /dev/null @@ -1,9 +0,0 @@ -[build] -target = "x86_64-unknown-uefi" - -[target.x86_64-unknown-uefi] -runner = "./runner" - -[unstable] -build-std = ["core", "alloc"] -build-std-features = ["compiler-builtins-mem"] diff --git a/experimental/uefi/app/Cargo.lock b/experimental/uefi/app/Cargo.lock deleted file mode 100644 index 74ec7c050aa..00000000000 --- a/experimental/uefi/app/Cargo.lock +++ /dev/null @@ -1,761 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "anyhow" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bit_field" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "channel" -version = "0.1.0" -dependencies = [ - "anyhow", - "ciborium-io", - "flatbuffers", - "oak_idl", - "oak_idl_gen_services", - "oak_idl_gen_structs", - "static_assertions", -] - -[[package]] -name = "ciborium-io" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" - -[[package]] -name = "cmake" -version = "0.1.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" -dependencies = [ - "cc", -] - -[[package]] -name = "convert_case" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "fastrand" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] - -[[package]] -name = "fixedbitset" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" - -[[package]] -name = "flatbuffers" -version = "2.1.2" -source = "git+https://github.com/jul-sh/flatbuffers.git?rev=a07ddee936737da89aeb5a496f9742a805537188#a07ddee936737da89aeb5a496f9742a805537188" -dependencies = [ - "bitflags", - "core2", - "smallvec", - "thiserror_core2", -] - -[[package]] -name = "getrandom" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" -dependencies = [ - "ahash", -] - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "indexmap" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" -dependencies = [ - "autocfg", - "hashbrown 0.11.2", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.125" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" - -[[package]] -name = "libm" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "lru" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32613e41de4c47ab04970c348ca7ae7382cf116625755af070b008a15516a889" -dependencies = [ - "hashbrown 0.11.2", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memory_units" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "oak_functions_abi" -version = "0.1.0" -dependencies = [ - "prost", - "prost-build", - "serde", -] - -[[package]] -name = "oak_functions_extension" -version = "0.1.0" -dependencies = [ - "anyhow", - "oak_functions_abi", - "oak_logger", -] - -[[package]] -name = "oak_functions_wasm" -version = "0.1.0" -dependencies = [ - "anyhow", - "byteorder", - "hashbrown 0.12.1", - "log", - "oak_functions_abi", - "oak_functions_extension", - "oak_logger", - "wasmi", -] - -[[package]] -name = "oak_functions_workload_logging" -version = "0.1.0" -dependencies = [ - "anyhow", - "log", - "oak_functions_abi", - "oak_functions_extension", - "oak_logger", -] - -[[package]] -name = "oak_idl" -version = "0.1.0" -dependencies = [ - "flatbuffers", -] - -[[package]] -name = "oak_idl_gen_services" -version = "0.1.0" -dependencies = [ - "anyhow", - "convert_case", - "flatbuffers", - "oak_idl_gen_structs", -] - -[[package]] -name = "oak_idl_gen_structs" -version = "0.1.0" - -[[package]] -name = "oak_logger" -version = "0.1.0" -dependencies = [ - "log", -] - -[[package]] -name = "oak_remote_attestation" -version = "0.1.0" -dependencies = [ - "anyhow", - "bytes", - "ring", -] - -[[package]] -name = "oak_remote_attestation_sessions" -version = "0.1.0" -dependencies = [ - "anyhow", - "lru", - "oak_remote_attestation", -] - -[[package]] -name = "once_cell" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" - -[[package]] -name = "parity-wasm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" - -[[package]] -name = "petgraph" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "proc-macro2" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "prost" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc03e116981ff7d8da8e5c220e374587b98d294af7ba7dd7fda761158f00086f" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a1118354442de7feb8a2a76f3d80ef01426bd45542c8c1fdffca41a758f846" -dependencies = [ - "bytes", - "cfg-if", - "cmake", - "heck", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "regex", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "prost-types" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" -dependencies = [ - "bytes", - "prost", -] - -[[package]] -name = "qemu-exit" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff023245bfcc73fb890e1f8d5383825b3131cc920020a5c487d6f113dfc428a" - -[[package]] -name = "quote" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "ring" -version = "0.17.0-not-released-yet" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "winapi", -] - -[[package]] -name = "runtime" -version = "0.1.0" -dependencies = [ - "anyhow", - "channel", - "ciborium-io", - "flatbuffers", - "log", - "oak_functions_wasm", - "oak_functions_workload_logging", - "oak_idl", - "oak_logger", - "oak_remote_attestation", - "oak_remote_attestation_sessions", -] - -[[package]] -name = "serde" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "smallvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" - -[[package]] -name = "spin" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530c2b0d0bf8b69304b39fe2001993e267461948b890cd037d8ad4293fa1a0d" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "syn" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04066589568b72ec65f42d65a1a52436e954b168773148893c020269563decf2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "thiserror_core2" -version = "2.0.0" -source = "git+https://github.com/jul-sh/thiserror-core2.git?rev=b99e1a0106623cbbd12cbb5562d01df7a3fdc22e#b99e1a0106623cbbd12cbb5562d01df7a3fdc22e" -dependencies = [ - "core2", - "thiserror_core2-impl", -] - -[[package]] -name = "thiserror_core2-impl" -version = "2.0.0" -source = "git+https://github.com/jul-sh/thiserror-core2.git?rev=b99e1a0106623cbbd12cbb5562d01df7a3fdc22e#b99e1a0106623cbbd12cbb5562d01df7a3fdc22e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ucs2" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad643914094137d475641b6bab89462505316ec2ce70907ad20102d28a79ab8" -dependencies = [ - "bit_field", -] - -[[package]] -name = "uefi" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2043be244ce96de3ca04cdb64b29993928c2327121a8314e2a6f50379580cd7d" -dependencies = [ - "bitflags", - "log", - "ucs2", - "uefi-macros", -] - -[[package]] -name = "uefi-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9271b66bf83671563773e54b178f1022ac2dab87dc197f80be51885a5e1a2f4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "uefi-services" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184cf782871dde6efd6335c0ed0dd7c48a7070f6ba73e1d148fc580a548dfe3d" -dependencies = [ - "cfg-if", - "log", - "qemu-exit", - "uefi", -] - -[[package]] -name = "uefi-simple" -version = "0.1.0" -dependencies = [ - "anyhow", - "ciborium-io", - "oak_remote_attestation", - "runtime", - "uefi", - "uefi-services", -] - -[[package]] -name = "unicode-xid" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasmi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" -dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", - "parity-wasm", - "wasmi-validation", -] - -[[package]] -name = "wasmi-validation" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "which" -version = "4.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" -dependencies = [ - "either", - "lazy_static", - "libc", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/experimental/uefi/app/Cargo.toml b/experimental/uefi/app/Cargo.toml deleted file mode 100644 index ae3e6f0d940..00000000000 --- a/experimental/uefi/app/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "uefi-simple" -version = "0.1.0" -authors = ["Andri Saar "] -edition = "2021" -license = "Apache-2.0" - -[features] -default = ["support_emulated_runner"] -support_emulated_runner = [] - -[dependencies] -anyhow = { version = "*", default-features = false } -oak_remote_attestation = { path = "../../../remote_attestation/rust" } -runtime = { path = "../runtime" } -uefi = { version = "*", features = ["exts"] } -uefi-services = "*" -ciborium-io = { version = "*", default-features = false } - -[dev-dependencies] -uefi-services = { version = "*", features = ["qemu"] } - -[patch.crates-io] -# Ensure no_std compatibility. TODO(#2920): remove once https://github.com/google/flatbuffers/pull/7338 is merged. -flatbuffers = { git = "https://github.com/jul-sh/flatbuffers.git", rev = "a07ddee936737da89aeb5a496f9742a805537188" } -# Ensure no_std compatibility. Dependency of flatbuffers. TODO(#2920): remove once https://github.com/bbqsrc/thiserror-core2/pull/3 is merged. -thiserror_core2 = { git = "https://github.com/jul-sh/thiserror-core2.git", rev = "b99e1a0106623cbbd12cbb5562d01df7a3fdc22e" } diff --git a/experimental/uefi/app/runner b/experimental/uefi/app/runner deleted file mode 100755 index 946ea3aa890..00000000000 --- a/experimental/uefi/app/runner +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# Thin shell script invoked as a cargo runner to run the compiled efi firmware -# in QEMU. Detects if kvm is supported, and sets qemu flags based on that. -# Instead of this single runner script it would be preferable to use a different -# runner based on whether the kvm feature is set. However, cargo does not -# currently allow this. Ref: https://github.com/rust-lang/cargo/issues/8170 - -readonly TARGET=$1 - -qemu_flags=( - '-nodefaults' - '-nographic' - '-bios' '/usr/share/OVMF/OVMF_CODE.fd' - '-serial' 'file:target/console.log' - '-serial' 'stdio' - '-machine' 'q35' - '-device' 'isa-debug-exit,iobase=0xf4,iosize=0x04' -) - -# Use kvm if supported, as it is required for certain features. Note -# that hosts that support kvm still need to disable the default -# `support_emulated_runner` feature in cargo to include code that requires kvm -# in the compiled firmware. Ideally this check would rely on the cargo -# flag itself, enabling kvm if it is disabled. However cargo does not expose -# which flags are set to the runner. Ref: https://doc.rust-lang.org/cargo/reference/environment-variables.html -if [[ -e "/dev/kvm" ]]; then - qemu_flags+=( - '-enable-kvm' - '-cpu' 'IvyBridge-IBRS,enforce' - ) -fi - -qemu-system-x86_64 "${qemu_flags[@]}" -kernel "${TARGET}" - diff --git a/experimental/uefi/app/src/main.rs b/experimental/uefi/app/src/main.rs deleted file mode 100644 index 8c674a10e7b..00000000000 --- a/experimental/uefi/app/src/main.rs +++ /dev/null @@ -1,94 +0,0 @@ -// -// Copyright 2022 The Project Oak Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#![no_main] -#![no_std] -#![feature(abi_efiapi)] -#![feature(never_type)] -#![feature(custom_test_frameworks)] -// As we're in a `no_std` environment, testing requires special handling. This -// approach was inspired by https://os.phil-opp.com/testing/. -#![test_runner(crate::test_runner)] -#![reexport_test_harness_main = "test_main"] - -use oak_remote_attestation::handshaker::{ - AttestationBehavior, EmptyAttestationGenerator, EmptyAttestationVerifier, -}; -use runtime::framing; -use uefi::{prelude::*, table::runtime::ResetType}; - -mod serial; - -// The main entry point of the UEFI application. -// -// The choice of name (`_start`) is entirely arbitrary; what matters is that -// there's exactly one function with the `#[entry]` attribute in the -// dependency graph. -#[entry] -fn _start(handle: Handle, mut system_table: SystemTable) -> Status { - uefi_services::init(&mut system_table).unwrap(); - - // As we're not relying on the normal Rust test harness, we need to call - // the tests ourselves if necessary. - let status = if cfg!(test) { - #[cfg(test)] - test_main(); - Status::SUCCESS - } else { - main(handle, &mut system_table) - }; - - // After we're done running our code, we also tell the UEFI runtime to shut - // down the machine, otherwise we'd go back to the UEFI shell. - system_table - .runtime_services() - .reset(ResetType::Shutdown, status, None); -} - -// Run the echo on the first serial port in the system (the UEFI console will -// use the first serial port in the system) -const ECHO_SERIAL_PORT_INDEX: usize = 1; - -fn main(handle: Handle, system_table: &mut SystemTable) -> Status { - use core::fmt::Write; - - writeln!(system_table.stdout(), "Hello World!").unwrap(); - - let serial = - serial::Serial::get(handle, system_table.boot_services(), ECHO_SERIAL_PORT_INDEX).unwrap(); - framing::handle_frames( - serial, - AttestationBehavior::create(EmptyAttestationGenerator, EmptyAttestationVerifier), - ) - .unwrap(); -} - -#[cfg(test)] -fn test_runner(tests: &[&dyn Fn()]) { - for test in tests { - test(); - } -} - -// Simple silly test just to prove that the test infrastructure works. -#[test_case] -fn test_simple() { - let x = 1; - assert_eq!(x, 1); -} - -#[cfg(test)] -mod tests; diff --git a/experimental/uefi/app/src/serial.rs b/experimental/uefi/app/src/serial.rs deleted file mode 100644 index 9d1aa3ac1d1..00000000000 --- a/experimental/uefi/app/src/serial.rs +++ /dev/null @@ -1,106 +0,0 @@ -// -// Copyright 2022 The Project Oak Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -use uefi::{ - prelude::*, - proto::console::serial, - table::boot::{OpenProtocolAttributes, OpenProtocolParams}, - Error, Handle, ResultExt, Status, -}; - -pub struct Serial<'boot> { - serial: &'boot mut serial::Serial<'boot>, -} - -// qemu emulates the 16550A UART controller, which has a maximum FIFO depth of 16 bytes. -const SERIAL_RECEIVE_FIFO_DEPTH: u32 = 16; - -impl<'boot> Serial<'boot> { - pub fn get(handle: Handle, bt: &BootServices, index: usize) -> Result> { - // Expect (at least) two serial ports on the system; the first will be used - // for stdio, and we can use the second one for our echo example. If we don't - // seem to have a second serial port, err out with the (arbitrarily chosen) - // NO_MAPPING error. - let serial_handles = bt.find_handles::()?; - let serial_handle = serial_handles.get(index).ok_or(Status::NO_MAPPING)?; - let serial = bt.open_protocol::( - OpenProtocolParams { - handle: *serial_handle, - agent: handle, - controller: None, - }, - OpenProtocolAttributes::Exclusive, - )?; - // Dereference the raw pointer (*mut Serial) we get to the serial interface. - // This is safe as according to the UEFI spec for the OpenProtocol call to succeed the - // interface must not be null (see Section 7.3 in the UEFI Specification, Version 2.9). - let serial = unsafe { &mut *serial.interface.get() }; - - // Increase the FIFO size from the default 1 byte to something bigger. - let mut io_mode = *serial.io_mode(); - io_mode.receive_fifo_depth = SERIAL_RECEIVE_FIFO_DEPTH; - serial.set_attributes(&io_mode)?; - Ok(Serial { serial }) - } - - fn read(&mut self, buf: &mut [u8]) -> Result { - // read() returns Ok if it managed to fill the whole buffer, or the error will contain - // the number of bytes read. The only error we're fine with is TIMEOUT, as we can simply - // retry that (and we'll keep getting TIMEOUTs when nobody is talking to us). In case of - // any other error, bail out. - self.serial.read(buf).map(|_| buf.len()).or_else(|err| { - if err.status() == Status::TIMEOUT { - Ok(*err.data()) - } else { - Err(err.status()) - } - }) - } -} - -impl<'boot> ciborium_io::Write for Serial<'boot> { - type Error = anyhow::Error; - - fn write_all(&mut self, data: &[u8]) -> Result<(), Self::Error> { - self.serial - .write(data) - .discard_errdata() - .map_err(|status| anyhow::anyhow!("serial write failed with status {:?}", status)) - } - - fn flush(&mut self) -> Result<(), Self::Error> { - Ok(()) - } -} - -impl<'boot> ciborium_io::Read for Serial<'boot> { - type Error = anyhow::Error; - - // Try to fill the buffer, ignoring any timeout errors. Any other errors - // are propagated upward. - fn read_exact(&mut self, data: &mut [u8]) -> Result<(), Self::Error> { - let mut bytes_read = 0; - while bytes_read < data.len() { - let len = self.read(&mut data[bytes_read..]).map_err(|status| { - anyhow::anyhow!("serial write failed with status {:?}", status) - })?; - if len > 0 { - bytes_read += len; - } - } - Ok(()) - } -} diff --git a/experimental/uefi/app/src/tests/mod.rs b/experimental/uefi/app/src/tests/mod.rs deleted file mode 100644 index 5000bc72246..00000000000 --- a/experimental/uefi/app/src/tests/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright 2022 The Project Oak Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Uses advanced CPU features not available when using running tests in qemu -// with CPU emulation. -#[cfg(not(feature = "support_emulated_runner"))] -mod remote_attestation; diff --git a/experimental/uefi/app/src/tests/remote_attestation.rs b/experimental/uefi/app/src/tests/remote_attestation.rs deleted file mode 100644 index 63bc1e473dd..00000000000 --- a/experimental/uefi/app/src/tests/remote_attestation.rs +++ /dev/null @@ -1,110 +0,0 @@ -// -// Copyright 2022 The Project Oak Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -//! Integration Test of Remote Attestation in UEFI. -//! -//! This tests that remote attestion works inside the UEFI app. While the test -//! code is identical to (a subset of) the tests in the remote attestation crate -//! they here utilize the qemu runner configured in the UEFI app. This means -//! that test code actually compiled to a UEFI target, which changes the -//! underlying implementation of the remote attestation crate. -//! TODO(#2654): It would be preferable to remove the test here, and instead -//! run the tests in the oak_remote_attestation crate itself for both standard -//! and UEFI targets. Due to concerns related to the workspace this is presently -//! not possible. Ref: https://github.com/project-oak/oak/issues/2654 - -extern crate alloc; - -use alloc::{boxed::Box, sync::Arc}; -use oak_remote_attestation::handshaker::{AttestationBehavior, ClientHandshaker, ServerHandshaker}; - -const TEE_MEASUREMENT: &str = "Test TEE measurement"; -const DATA: [u8; 10] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - -fn create_handshakers() -> (ClientHandshaker, ServerHandshaker) { - let bidirectional_attestation = - AttestationBehavior::create_bidirectional_attestation(&[], TEE_MEASUREMENT.as_bytes()) - .unwrap(); - let client_handshaker = ClientHandshaker::new( - bidirectional_attestation, - Box::new(|server_identity| { - if !server_identity.additional_info.is_empty() { - Ok(()) - } else { - anyhow::bail!("No additional info provided.") - } - }), - ); - - let bidirectional_attestation = - AttestationBehavior::create_bidirectional_attestation(&[], TEE_MEASUREMENT.as_bytes()) - .unwrap(); - - let additional_info = br"Additional Info".to_vec(); - let server_handshaker = - ServerHandshaker::new(bidirectional_attestation, Arc::new(additional_info)); - - (client_handshaker, server_handshaker) -} - -#[test_case] -fn test_handshake() { - let (mut client_handshaker, mut server_handshaker) = create_handshakers(); - - let client_hello = client_handshaker - .create_client_hello() - .expect("Couldn't create client hello message"); - - let server_identity = server_handshaker - .next_step(&client_hello) - .expect("Couldn't process client hello message") - .expect("Empty server identity message"); - - let client_identity = client_handshaker - .next_step(&server_identity) - .expect("Couldn't process server identity message") - .expect("Empty client identity message"); - assert!(client_handshaker.is_completed()); - - let result = server_handshaker - .next_step(&client_identity) - .expect("Couldn't process client identity message"); - assert_eq!(result, None); - assert!(server_handshaker.is_completed()); - - let mut client_encryptor = client_handshaker - .get_encryptor() - .expect("Couldn't get client encryptor"); - let mut server_encryptor = server_handshaker - .get_encryptor() - .expect("Couldn't get server encryptor"); - - let encrypted_client_data = client_encryptor - .encrypt(&DATA) - .expect("Couldn't encrypt client data"); - let decrypted_client_data = server_encryptor - .decrypt(&encrypted_client_data) - .expect("Couldn't decrypt client data"); - assert_eq!(decrypted_client_data, DATA); - - let encrypted_server_data = server_encryptor - .encrypt(&DATA) - .expect("Couldn't encrypt server data"); - let decrypted_server_data = client_encryptor - .decrypt(&encrypted_server_data) - .expect("Couldn't decrypt server data"); - assert_eq!(decrypted_server_data, DATA); -} diff --git a/xtask/src/vm.rs b/xtask/src/vm.rs index fbb92b8ffef..a184022acd5 100644 --- a/xtask/src/vm.rs +++ b/xtask/src/vm.rs @@ -23,7 +23,6 @@ use crate::internal::*; #[derive(Debug, Display, Clone, PartialEq, EnumIter)] enum Variant { - Uefi, Baremetal, Crosvm, } @@ -31,7 +30,6 @@ enum Variant { impl Variant { pub fn payload_crate_path(&self) -> &'static str { match self { - Variant::Uefi => "./experimental/uefi/app", Variant::Baremetal => "./experimental/uefi/baremetal", Variant::Crosvm => "./experimental/uefi/baremetal-crosvm", } @@ -39,7 +37,6 @@ impl Variant { pub fn loader_mode(&self) -> &'static str { match self { - Variant::Uefi => "uefi", Variant::Baremetal => "bios", Variant::Crosvm => "crosvm", } @@ -47,9 +44,6 @@ impl Variant { pub fn binary_path(&self) -> &'static str { match self { - Variant::Uefi => { - "./experimental/uefi/app/target/x86_64-unknown-uefi/debug/uefi-simple.efi" - } Variant::Baremetal => "./experimental/uefi/baremetal/target/target/debug/baremetal", Variant::Crosvm => { "./experimental/uefi/baremetal-crosvm/target/target/debug/baremetal-crosvm"