From 3d6d555d99727a4f8da6994b9b71afc787da46b3 Mon Sep 17 00:00:00 2001 From: japabu Date: Tue, 29 Sep 2026 08:49:04 +0200 Subject: [PATCH 1/2] S0: the T14's one-time Linux capture, and its reader S0 of issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md, shared with #568's LLVM bar so the T14 is captured once. toyos-t14linux/capture.sh runs on the T14 under its stock Ubuntu through sudo. It refuses to run unless /proc/version names 6.8.0-142-generic, both packages are 6.8.0-142.142 and the config's sha256 is the pinned one. It installs nothing and asks no network: CPUID and the MSRs are read through the kernel's /dev/cpu/*/cpuid and /dev/cpu/*/msr with dd and od, in place of the track's apt-get of cpuid and msr-tools. It writes the evidence directory and, apart from it, the TCG model's kit (the kernel and the track's busybox initramfs), which is never committed. toyos-t14linux/tcg.sh is the TCG half, run on the development host: the track's QEMU command line over that kit. src/lib.rs reads both directories. T14::read refuses a directory missing any file capture.sh writes, a kernel, package or config other than the pinned ones, a CPUID leaf or MSR it needs, an MSR not read on every CPU, a CPUID.1 decoding cpuinfo disagrees with, and a microcode revision 0x8B and cpuinfo disagree on. It yields Facts, the inputs S1 names, with the two extended leaves read only where CPUID.0x80000000:EAX reaches them and ARCH_CAPABILITIES only where CPUID.(7,0):EDX bit 29 enumerates it. Tcg::read holds the console to the T14's /proc/version and vulnerability set and to .github/qemu-version's QEMU. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 4 + Cargo.toml | 1 + toyos-t14linux/Cargo.toml | 13 + toyos-t14linux/capture.sh | 78 ++++++ toyos-t14linux/src/lib.rs | 468 ++++++++++++++++++++++++++++++++++++ toyos-t14linux/src/tests.rs | 346 ++++++++++++++++++++++++++ toyos-t14linux/tcg.sh | 9 + 7 files changed, 919 insertions(+) create mode 100644 toyos-t14linux/Cargo.toml create mode 100755 toyos-t14linux/capture.sh create mode 100644 toyos-t14linux/src/lib.rs create mode 100644 toyos-t14linux/src/tests.rs create mode 100755 toyos-t14linux/tcg.sh diff --git a/Cargo.lock b/Cargo.lock index 1e18b1d023b..a580472b938 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1198,6 +1198,10 @@ dependencies = [ "toyos-elide", ] +[[package]] +name = "toyos-t14linux" +version = "0.1.0" + [[package]] name = "toyos-tco" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 661c2ad735b..4763fdf1167 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,7 @@ members = [ "toyos-sched/sim", "toyos-swap", "toyos-symbols", + "toyos-t14linux", "toyos-tco", "toyos-tmpdir", "toyos-transport", diff --git a/toyos-t14linux/Cargo.toml b/toyos-t14linux/Cargo.toml new file mode 100644 index 00000000000..8ed4d8369d9 --- /dev/null +++ b/toyos-t14linux/Cargo.toml @@ -0,0 +1,13 @@ +# A member of the host workspace (root `Cargo.toml`): the T14 under Linux, +# captured once, and the reader of what the capture wrote. + +[package] +name = "toyos-t14linux" +description = "The T14 under its pinned Ubuntu and that kernel on the TCG model, captured once: the scripts that capture them and the reader of what they write." +version = "0.1.0" +edition = "2021" +license = "MIT OR Apache-2.0" +publish = false + +[lints.rust] +warnings = "deny" diff --git a/toyos-t14linux/capture.sh b/toyos-t14linux/capture.sh new file mode 100755 index 00000000000..100a78eba41 --- /dev/null +++ b/toyos-t14linux/capture.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# S0 of issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md: on the T14 under +# its stock Ubuntu, through sudo, `capture.sh `. is the evidence src/lib.rs +# reads; is the kernel and initramfs tcg.sh boots, never committed. It installs nothing, +# asks no network, and writes nothing but the two directories it creates. +set -euo pipefail +trap 'echo "capture.sh:$LINENO: failed" >&2' ERR +k=6.8.0-142-generic +refuse() { echo "capture.sh: refused: $1" >&2; exit 1; } +: "${SUDO_UID:?run capture.sh through sudo}" +case $(cat /proc/version) in "Linux version $k "*) ;; *) refuse "the running kernel is not $k";; esac +[ "$(dpkg-query -W -f '${Version} ' linux-image-$k linux-modules-$k)" = "6.8.0-142.142 6.8.0-142.142 " ] || + refuse "the packages are not 6.8.0-142.142" +echo "3b8533dd9d235ca634ac58f82c5ce1ee35f12ef620693e17033184d2c9ca5890 /boot/config-$k" | + sha256sum -c --status || refuse "/boot/config-$k is not the pinned config" +modprobe -a cpuid msr +mkdir "$1" "$2" +out=$(cd "$1" && pwd) kit=$(cd "$2" && pwd) +cd "$out" + +cat /proc/version > version.txt +uname -a > uname.txt +cat /proc/cmdline > cmdline.txt +dpkg-query -W linux-image-$k linux-modules-$k > packages.txt +sha256sum /boot/config-$k > config-sha256.txt +# The track's hardening table and the CPU_MITIGATIONS menu, with the config's line numbers. +opts='RANDOMIZE_BASE|RANDOMIZE_MEMORY|ARCH_MMAP_RND_BITS|STACKPROTECTOR_STRONG|SLS|X86_USER_SHADOW_STACK' +opts+='|RESET_ATTACK_MITIGATION|RANDOMIZE_KSTACK_OFFSET_DEFAULT|ZERO_CALL_USED_REGS|VMAP_STACK' +opts+='|STRICT_KERNEL_RWX|DEBUG_WX|SLAB_FREELIST_RANDOM|SLAB_FREELIST_HARDENED|RANDOM_KMALLOC_CACHES' +opts+='|X86_INTEL_TSX_MODE_OFF|INTEL_IOMMU_DEFAULT_ON|INIT_ON_ALLOC_DEFAULT_ON|SCHED_STACK_END_CHECK' +opts+='|HARDENED_USERCOPY|X86_UMIP|INIT_STACK_ALL_ZERO|FORTIFY_SOURCE|UBSAN_(BOUNDS|SHIFT|BOOL|ENUM)' +opts+='|STRICT_MODULE_RWX|LEGACY_VSYSCALL_XONLY|SHUFFLE_PAGE_ALLOCATOR|BPF_JIT_ALWAYS_ON|MODULE_SIG' +opts+='|KEXEC_SIG|CPU_MITIGATIONS|MITIGATION_[A-Z0-9_]+' +grep -nE "^(# )?CONFIG_($opts)(=| is not set)" /boot/config-$k > config-hardening.txt +sysctl vm.mmap_rnd_bits > mmap_rnd_bits.txt +grep . /sys/devices/system/cpu/vulnerabilities/* > vulnerabilities.txt +cat /proc/cpuinfo > cpuinfo.txt +# dmesg's lines, from the journal's copy of this boot so a wrapped ring loses none. +journalctl -k -b 0 -o cat | grep -iE 'mitigat|vulnerab|not affected|spectre|microcode|x86/bugs|tsx' \ + > kernel-log.txt +shopt -s nullglob +grep . /sys/class/dmi/id/{bios_*,ec_*,sys_vendor,product_name,product_version} > dmi.txt + +# CPU 0's leaves as `leaf subleaf eax ebx ecx edx`; the device reads subleaf:leaf at its offset. +cpuid() { dd if=/dev/cpu/0/cpuid bs=16 count=1 skip=$(($1 | $2 << 32)) iflag=skip_bytes status=none | od -An -tx4; } +for l in 0:0 1:0 6:0 7:0 7:1 7:2 0xd:0 0xd:1 0x14:0 0x80000000:0 0x80000008:0 0x80000021:0; do + r=$(cpuid ${l%:*} ${l#*:}) + printf '%08x %08x%s\n' ${l%:*} ${l#*:} "$r" +done > cpuid.txt + +# Every CPU's MSRs as `msr cpu value`. 0x122 exists where ARCH_CAPABILITIES bit 7 +# (TSX_CTRL_MSR) is set, 0x10F where CPUID.(7,0):EDX bits 11 and 13 both are. +rdmsr() { dd if=/dev/cpu/$1/msr bs=8 count=1 skip=$(($2)) iflag=skip_bytes status=none | od -An -tx8 | tr -d ' '; } +msrs=(0x8b 0x48 0x10a 0x123) +arch=$(rdmsr 0 0x10a) +r=$(cpuid 7 0) +read -r _ _ _ edx <<< "$r" +(( 0x$arch >> 7 & 1 )) && msrs+=(0x122) +(( 0x$edx >> 11 & 1 && 0x$edx >> 13 & 1 )) && msrs+=(0x10f) +for m in "${msrs[@]}"; do + for c in /dev/cpu/[0-9]*; do + v=$(rdmsr ${c##*/} $m) + printf '%08x %s %s\n' $m ${c##*/} $v + done +done > msr.txt + +# The TCG model's kit: the track's initramfs around this machine's busybox and, where +# it is dynamic, what it links. +cp /boot/vmlinuz-$k "$kit" +bb=$(command -v busybox) +mkdir -p "$kit"/rd/bin "$kit"/rd/sys "$kit"/rd/proc +cp "$bb" "$kit"/rd/bin/busybox +if ldd "$bb" > /dev/null 2>&1; then cp --parents $(ldd "$bb" | grep -o '/[^ ]*') "$kit"/rd; fi +printf '#!/bin/busybox sh\n/bin/busybox mount -t sysfs s /sys\n/bin/busybox mount -t proc p /proc\n/bin/busybox cat /proc/version\n/bin/busybox grep . /sys/devices/system/cpu/vulnerabilities/*\n/bin/busybox poweroff -f\n' > "$kit"/rd/init +chmod +x "$kit"/rd/init +(cd "$kit"/rd && find . | cpio -o -H newc --quiet) > "$kit"/s0.cpio +chown -R "$SUDO_UID:$SUDO_GID" "$out" "$kit" +echo "capture.sh: wrote $out and $kit" diff --git a/toyos-t14linux/src/lib.rs b/toyos-t14linux/src/lib.rs new file mode 100644 index 00000000000..f598a028fcf --- /dev/null +++ b/toyos-t14linux/src/lib.rs @@ -0,0 +1,468 @@ +//! S0 of `issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md`: +//! the T14 under its pinned Ubuntu, captured once, and that kernel on the TCG +//! model. +//! +//! `capture.sh` writes the T14's directory and `tcg.sh` the TCG model's. +//! [`T14::read`] and [`Tcg::read`] refuse a directory that lacks a file they +//! require, that is not the pinned kernel's, or whose sources disagree. + +use std::collections::{BTreeMap, BTreeSet}; +use std::path::Path; + +/// The kernel the track pins, as `/proc/version` names it. +pub const KERNEL: &str = "6.8.0-142-generic"; +/// The version of both of that kernel's packages. +pub const PACKAGES: &str = "6.8.0-142.142"; +/// The sha256 of `/boot/config-6.8.0-142-generic`. +pub const CONFIG_SHA256: &str = "3b8533dd9d235ca634ac58f82c5ce1ee35f12ef620693e17033184d2c9ca5890"; + +/// Every file `capture.sh` writes. +pub const T14_FILES: &[&str] = &[ + "version.txt", + "uname.txt", + "cmdline.txt", + "packages.txt", + "config-sha256.txt", + "config-hardening.txt", + "mmap_rnd_bits.txt", + "vulnerabilities.txt", + "cpuinfo.txt", + "kernel-log.txt", + "dmi.txt", + "cpuid.txt", + "msr.txt", +]; + +/// Every file `tcg.sh` writes. +pub const TCG_FILES: &[&str] = &["qemu-version.txt", "console.txt"]; + +/// The `(leaf, subleaf)` pairs `capture.sh` reads on CPU 0. +pub const LEAVES: &[(u32, u32)] = &[ + (0, 0), + (1, 0), + (6, 0), + (7, 0), + (7, 1), + (7, 2), + (0xd, 0), + (0xd, 1), + (0x14, 0), + (0x8000_0000, 0), + (0x8000_0008, 0), + (0x8000_0021, 0), +]; + +pub const IA32_SPEC_CTRL: u32 = 0x48; +pub const IA32_BIOS_SIGN_ID: u32 = 0x8b; +pub const IA32_ARCH_CAPABILITIES: u32 = 0x10a; +pub const IA32_TSX_FORCE_ABORT: u32 = 0x10f; +pub const IA32_TSX_CTRL: u32 = 0x122; +pub const IA32_MCU_OPT_CTRL: u32 = 0x123; + +/// The MSRs `capture.sh` reads on every CPU whatever the CPU enumerates. +pub const MSRS: &[u32] = &[ + IA32_BIOS_SIGN_ID, + IA32_SPEC_CTRL, + IA32_ARCH_CAPABILITIES, + IA32_MCU_OPT_CTRL, +]; + +/// `ARCH_CAPABILITIES` bit 7, TSX_CTRL_MSR: `IA32_TSX_CTRL` exists. +const ARCH_CAP_TSX_CTRL_MSR: u64 = 1 << 7; +/// CPUID.(7,0):EDX bits 11 and 13, RTM_ALWAYS_ABORT and TSX_FORCE_ABORT, both +/// of which Linux requires before it touches `IA32_TSX_FORCE_ABORT`. +const TSX_FORCE_ABORT_MSR: u32 = 1 << 11 | 1 << 13; +/// CPUID.(7,0):EDX bit 29: `IA32_ARCH_CAPABILITIES` exists. +const ARCH_CAPABILITIES_BIT: u32 = 1 << 29; + +const VULNERABILITY: &str = "/sys/devices/system/cpu/vulnerabilities/"; + +/// One CPUID answer. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +pub struct Regs { + pub eax: u32, + pub ebx: u32, + pub ecx: u32, + pub edx: u32, +} + +/// What S1 decides a CPU's vulnerabilities from, as Linux reads it. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Facts { + /// CPUID.0's EBX, EDX, ECX. + pub vendor: [u8; 12], + pub family: u32, + pub model: u32, + pub stepping: u32, + /// `IA32_BIOS_SIGN_ID` bits 63:32, the revision `/proc/cpuinfo` shows. + pub microcode: u32, + pub leaf_1: Regs, + pub leaf_7_0: Regs, + pub leaf_7_2: Regs, + /// CPUID.0x80000008:EBX where CPUID.0x80000000:EAX reaches it, else 0. + pub leaf_8000_0008_ebx: u32, + /// CPUID.0x80000021:EAX where CPUID.0x80000000:EAX reaches it, else 0. + pub leaf_8000_0021_eax: u32, + /// `IA32_ARCH_CAPABILITIES` where CPUID.(7,0):EDX enumerates it, else 0. + pub arch_capabilities: u64, +} + +/// The T14's capture. +#[derive(Debug)] +pub struct T14 { + pub facts: Facts, + /// `/proc/version`. + pub version: String, + /// Each vulnerabilities file's name and line. + pub lines: BTreeMap, + /// Each MSR `capture.sh` read, by CPU number. + pub msrs: BTreeMap>, + pub mmap_rnd_bits: u32, +} + +/// The TCG model's capture: the T14's kernel under `.github/qemu-version`'s QEMU. +#[derive(Debug)] +pub struct Tcg { + pub lines: BTreeMap, +} + +/// A directory's files, `None` for one that is not there. +fn from_dir(dir: &Path) -> impl Fn(&str) -> Option + '_ { + move |name| match std::fs::read_to_string(dir.join(name)) { + Ok(text) => Some(text), + Err(e) if e.kind() == std::io::ErrorKind::NotFound => None, + Err(e) => panic!("read {}: {e}", dir.join(name).display()), + } +} + +/// Every file of `names`, or a refusal naming the first that is missing. +fn files( + read: &dyn Fn(&str) -> Option, + names: &[&'static str], +) -> Result, String> { + names + .iter() + .map(|&n| read(n).map(|t| (n, t)).ok_or(format!("{n} is missing"))) + .collect() +} + +fn hex>(word: &str, what: &str) -> Result { + let bad = || format!("{what}: {word:?} is not hex"); + let digits = word.strip_prefix("0x").unwrap_or(word); + let v = u64::from_str_radix(digits, 16).map_err(|_| bad())?; + T::try_from(v).map_err(|_| bad()) +} + +/// `grep . /*`'s lines among others, each name once. +fn vulnerabilities<'a>( + lines: impl Iterator, +) -> Result, String> { + let mut out = BTreeMap::new(); + for l in lines { + let Some(rest) = l.strip_prefix(VULNERABILITY) else { + continue; + }; + let (name, line) = rest + .split_once(':') + .ok_or(format!("{l:?} is not a vulnerabilities line"))?; + if out.insert(name.to_string(), line.to_string()).is_some() { + return Err(format!("vulnerability {name} twice")); + } + } + if out.is_empty() { + return Err("no vulnerabilities line".into()); + } + Ok(out) +} + +/// `file`, which must read exactly `want`. +fn is(f: &BTreeMap<&str, String>, file: &str, want: &str) -> Result<(), String> { + match f[file] == want { + true => Ok(()), + false => Err(format!("{file} is {:?}, not {want:?}", f[file])), + } +} + +/// `/proc/cpuinfo`'s blocks by processor, each as `key\t: value`. +fn cpuinfo(text: &str) -> Result>, String> { + let mut cpus = BTreeMap::new(); + for block in text.split("\n\n").filter(|b| !b.trim().is_empty()) { + let fields: BTreeMap<&str, &str> = block + .lines() + .filter_map(|l| l.split_once(':')) + .map(|(k, v)| (k.trim(), v.trim())) + .collect(); + let n = fields + .get("processor") + .and_then(|p| p.parse().ok()) + .ok_or("a cpuinfo block names no processor")?; + if cpus.insert(n, fields).is_some() { + return Err(format!("cpuinfo: processor {n} twice")); + } + } + Ok(cpus) +} + +/// The one value every CPU's `key` holds. +fn same( + per_cpu: impl Iterator, + what: &str, +) -> Result { + let mut first: Option = None; + for (cpu, v) in per_cpu { + match first { + None => first = Some(v), + Some(f) if f == v => {} + Some(f) => return Err(format!("{what}: CPU {cpu} reads {v:?}, not {f:?}")), + } + } + first.ok_or(format!("{what}: no CPU")) +} + +fn cpuid(text: &str) -> Result, String> { + let mut leaves = BTreeMap::new(); + for l in text.lines() { + let w: Vec<&str> = l.split_whitespace().collect(); + let [leaf, sub, a, b, c, d] = w[..] else { + return Err(format!("cpuid.txt: {l:?} is not six words")); + }; + let what = "cpuid.txt"; + let regs = Regs { + eax: hex(a, what)?, + ebx: hex(b, what)?, + ecx: hex(c, what)?, + edx: hex(d, what)?, + }; + let key = (hex(leaf, what)?, hex(sub, what)?); + if leaves.insert(key, regs).is_some() { + return Err(format!("cpuid.txt: leaf {:#x}.{} twice", key.0, key.1)); + } + } + Ok(leaves) +} + +fn msrs(text: &str) -> Result>, String> { + let mut msrs: BTreeMap> = BTreeMap::new(); + for l in text.lines() { + let [msr, cpu, value] = l.split_whitespace().collect::>()[..] else { + return Err(format!("msr.txt: {l:?} is not three words")); + }; + let msr = hex(msr, "msr.txt")?; + let cpu = cpu + .parse() + .map_err(|_| format!("msr.txt: {cpu:?} is not a CPU"))?; + if msrs + .entry(msr) + .or_default() + .insert(cpu, hex(value, "msr.txt")?) + .is_some() + { + return Err(format!("msr.txt: MSR {msr:#x} on CPU {cpu} twice")); + } + } + Ok(msrs) +} + +impl T14 { + pub fn read(dir: &Path) -> Result { + T14::parse(&from_dir(dir)) + } + + /// The capture `read` answers for, file by file. + pub fn parse(read: &dyn Fn(&str) -> Option) -> Result { + let f = files(read, T14_FILES)?; + let version = f["version.txt"].trim_end().to_string(); + if !version.starts_with(&format!("Linux version {KERNEL} ")) || version.contains('\n') { + return Err(format!("version.txt is {version:?}, not {KERNEL}'s")); + } + is( + &f, + "packages.txt", + &format!("linux-image-{KERNEL}\t{PACKAGES}\nlinux-modules-{KERNEL}\t{PACKAGES}\n"), + )?; + is( + &f, + "config-sha256.txt", + &format!("{CONFIG_SHA256} /boot/config-{KERNEL}\n"), + )?; + let mmap_rnd_bits = f["mmap_rnd_bits.txt"] + .trim_end() + .strip_prefix("vm.mmap_rnd_bits = ") + .and_then(|n| n.parse().ok()) + .ok_or(format!("mmap_rnd_bits.txt is {:?}", f["mmap_rnd_bits.txt"]))?; + let lines = vulnerabilities(f["vulnerabilities.txt"].lines())?; + + let info = cpuinfo(&f["cpuinfo.txt"])?; + let field = |key: &'static str| { + same( + info.iter().map(|(&c, b)| (c, b.get(key).copied())), + &format!("cpuinfo {key}"), + ) + .and_then(|v| v.ok_or(format!("cpuinfo names no {key}"))) + }; + let cpus: BTreeSet = info.keys().copied().collect(); + + let leaves = cpuid(&f["cpuid.txt"])?; + let leaf = |l: u32, s: u32| { + leaves + .get(&(l, s)) + .copied() + .ok_or(format!("cpuid.txt holds no leaf {l:#x}.{s}")) + }; + for &(l, s) in LEAVES { + leaf(l, s)?; + } + + let msrs = msrs(&f["msr.txt"])?; + let msr = |m: u32| -> Result { + let per_cpu = msrs.get(&m).ok_or(format!("msr.txt holds no MSR {m:#x}"))?; + same( + per_cpu.iter().map(|(&c, &v)| (c, v)), + &format!("MSR {m:#x}"), + ) + }; + for &m in MSRS { + msrs.get(&m).ok_or(format!("msr.txt holds no MSR {m:#x}"))?; + } + for (m, per_cpu) in &msrs { + let read_on: BTreeSet = per_cpu.keys().copied().collect(); + if read_on != cpus { + return Err(format!("MSR {m:#x} read on CPUs {read_on:?}, not {cpus:?}")); + } + } + + let l0 = leaf(0, 0)?; + let mut vendor = [0; 12]; + for (i, r) in [l0.ebx, l0.edx, l0.ecx].into_iter().enumerate() { + vendor[i * 4..][..4].copy_from_slice(&r.to_le_bytes()); + } + let leaf_1 = leaf(1, 0)?; + let base = leaf_1.eax >> 8 & 0xf; + let family = match base { + 0xf => base + (leaf_1.eax >> 20 & 0xff), + _ => base, + }; + let model = match family >= 6 { + true => (leaf_1.eax >> 4 & 0xf) | (leaf_1.eax >> 16 & 0xf) << 4, + false => leaf_1.eax >> 4 & 0xf, + }; + let stepping = leaf_1.eax & 0xf; + let decimal = |key: &'static str| -> Result { + field(key)? + .parse() + .map_err(|_| format!("cpuinfo {key} is not a number")) + }; + for (key, cpuid, linux) in [ + ("cpu family", family, decimal("cpu family")?), + ("model", model, decimal("model")?), + ("stepping", stepping, decimal("stepping")?), + ] { + if cpuid != linux { + return Err(format!( + "CPUID.1 decodes {key} {cpuid}, and cpuinfo reads {linux}" + )); + } + } + if field("vendor_id")?.as_bytes() != vendor { + return Err(format!( + "CPUID.0 names {:?}, and cpuinfo reads {:?}", + String::from_utf8_lossy(&vendor), + field("vendor_id")? + )); + } + let microcode: u32 = hex(field("microcode")?, "cpuinfo microcode")?; + let sign_id = (msr(IA32_BIOS_SIGN_ID)? >> 32) as u32; + if sign_id != microcode { + return Err(format!( + "IA32_BIOS_SIGN_ID reads revision {sign_id:#x}, and cpuinfo {microcode:#x}" + )); + } + + let leaf_7_0 = leaf(7, 0)?; + let arch = msr(IA32_ARCH_CAPABILITIES)?; + if arch & ARCH_CAP_TSX_CTRL_MSR != 0 { + msr(IA32_TSX_CTRL)?; + } + if leaf_7_0.edx & TSX_FORCE_ABORT_MSR == TSX_FORCE_ABORT_MSR { + msr(IA32_TSX_FORCE_ABORT)?; + } + let max_ext = leaf(0x8000_0000, 0)?.eax; + let ext = |l: u32| -> Result, String> { + match max_ext >= l { + true => leaf(l, 0).map(Some), + false => Ok(None), + } + }; + let facts = Facts { + vendor, + family, + model, + stepping, + microcode, + leaf_1, + leaf_7_0, + leaf_7_2: leaf(7, 2)?, + leaf_8000_0008_ebx: ext(0x8000_0008)?.map_or(0, |r| r.ebx), + leaf_8000_0021_eax: ext(0x8000_0021)?.map_or(0, |r| r.eax), + arch_capabilities: match leaf_7_0.edx & ARCH_CAPABILITIES_BIT { + 0 => 0, + _ => arch, + }, + }; + Ok(T14 { + facts, + version, + lines, + msrs, + mmap_rnd_bits, + }) + } +} + +/// `.github/qemu-version`'s version. +pub fn qemu_pin() -> &'static str { + include_str!("../../.github/qemu-version") + .lines() + .rfind(|l| !l.starts_with('#')) + .expect(".github/qemu-version names a version") +} + +impl Tcg { + pub fn read(dir: &Path, t14: &T14) -> Result { + Tcg::parse(&from_dir(dir), t14) + } + + /// The TCG model's capture `read` answers for, held to the T14's kernel. + pub fn parse(read: &dyn Fn(&str) -> Option, t14: &T14) -> Result { + let f = files(read, TCG_FILES)?; + let qemu = format!("QEMU emulator version {}", qemu_pin()); + if f["qemu-version.txt"].lines().next() != Some(&qemu) { + return Err(format!("qemu-version.txt does not open with {qemu:?}")); + } + let console: Vec<&str> = f["console.txt"] + .lines() + .map(|l| l.trim_end_matches('\r')) + .collect(); + let versions: Vec<&&str> = console + .iter() + .filter(|l| l.starts_with("Linux version ")) + .collect(); + if versions[..] != [&t14.version.as_str()] { + return Err(format!( + "console.txt's /proc/version is {versions:?}, not the T14's" + )); + } + let lines = vulnerabilities(console.into_iter())?; + if !lines.keys().eq(t14.lines.keys()) { + return Err(format!( + "console.txt reads vulnerabilities {:?}, and the T14 {:?}", + lines.keys().collect::>(), + t14.lines.keys().collect::>() + )); + } + Ok(Tcg { lines }) + } +} + +#[cfg(test)] +mod tests; diff --git a/toyos-t14linux/src/tests.rs b/toyos-t14linux/src/tests.rs new file mode 100644 index 00000000000..5ad006b737d --- /dev/null +++ b/toyos-t14linux/src/tests.rs @@ -0,0 +1,346 @@ +//! Every value here is synthetic: the shape `capture.sh` and `tcg.sh` write, +//! never a reading of the T14. + +use super::*; + +const VERSION: &str = "Linux version 6.8.0-142-generic (fixture) #142-Ubuntu SMP PREEMPT_DYNAMIC"; +const CPUS: u32 = 2; + +/// A capture as its parts, rendered into files by [`Fixture::files`]. +struct Fixture { + version: String, + /// `cpu family`, `model`, `stepping` as cpuinfo reads them. + cpuinfo: (u32, u32, u32), + vendor_id: &'static str, + microcode: &'static str, + leaves: BTreeMap<(u32, u32), Regs>, + /// Each MSR's value on each CPU. + msrs: BTreeMap>, +} + +fn regs(eax: u32, ebx: u32, ecx: u32, edx: u32) -> Regs { + Regs { eax, ebx, ecx, edx } +} + +impl Fixture { + /// A Tiger Lake: family 6, model 0x8c, stepping 1, microcode 0xbe. + fn t14() -> Fixture { + let mut leaves: BTreeMap<(u32, u32), Regs> = + LEAVES.iter().map(|&k| (k, Regs::default())).collect(); + // "Genu" "ntel" "ineI" in EBX, ECX, EDX. + leaves.insert((0, 0), regs(0x1b, 0x756e_6547, 0x6c65_746e, 0x4965_6e69)); + leaves.insert((1, 0), regs(0x0008_06c1, 0x11, 0x22, 0x33)); + leaves.insert((7, 0), regs(0, 0x44, 0x55, ARCH_CAPABILITIES_BIT | 1 << 26)); + leaves.insert((7, 2), regs(0, 0, 0, 0x66)); + leaves.insert((0x8000_0000, 0), regs(0x8000_0008, 0, 0, 0)); + leaves.insert((0x8000_0008, 0), regs(0x77, 0x88, 0x99, 0xaa)); + leaves.insert((0x8000_0021, 0), regs(0xbb, 0, 0, 0)); + let each = |v: u64| vec![v; CPUS as usize]; + let msrs = BTreeMap::from([ + (IA32_BIOS_SIGN_ID, each(0xbe_0000_0000)), + (IA32_SPEC_CTRL, vec![0x400, 0x480]), + (IA32_ARCH_CAPABILITIES, each(0x0c00_0000)), + (IA32_MCU_OPT_CTRL, each(0)), + ]); + Fixture { + version: VERSION.into(), + cpuinfo: (6, 140, 1), + vendor_id: "GenuineIntel", + microcode: "0xbe", + leaves, + msrs, + } + } + + fn files(&self) -> BTreeMap<&'static str, String> { + let vulnerabilities = [ + "gather_data_sampling:Mitigation: fixture", + "meltdown:Not affected", + ] + .map(|l| format!("{VULNERABILITY}{l}\n")) + .concat(); + let (family, model, stepping) = self.cpuinfo; + let cpuinfo: String = (0..CPUS) + .map(|c| { + format!( + "processor\t: {c}\nvendor_id\t: {}\ncpu family\t: {family}\nmodel\t\t: {model}\n\ + model name\t: fixture\nstepping\t: {stepping}\nmicrocode\t: {}\nflags\t\t: fpu\n\n", + self.vendor_id, self.microcode + ) + }) + .collect(); + let cpuid: String = self + .leaves + .iter() + .map(|(&(l, s), r)| { + format!( + "{l:08x} {s:08x} {:08x} {:08x} {:08x} {:08x}\n", + r.eax, r.ebx, r.ecx, r.edx + ) + }) + .collect(); + let msr: String = self + .msrs + .iter() + .flat_map(|(m, per_cpu)| { + per_cpu + .iter() + .enumerate() + .map(move |(c, v)| format!("{m:08x} {c} {v:016x}\n")) + }) + .collect(); + BTreeMap::from([ + ("version.txt", format!("{}\n", self.version)), + ( + "uname.txt", + format!("Linux t14 {KERNEL} #142-Ubuntu x86_64 GNU/Linux\n"), + ), + ( + "cmdline.txt", + format!("BOOT_IMAGE=/vmlinuz-{KERNEL} ro quiet splash\n"), + ), + ( + "packages.txt", + format!("linux-image-{KERNEL}\t{PACKAGES}\nlinux-modules-{KERNEL}\t{PACKAGES}\n"), + ), + ( + "config-sha256.txt", + format!("{CONFIG_SHA256} /boot/config-{KERNEL}\n"), + ), + ( + "config-hardening.txt", + "528:CONFIG_RANDOMIZE_BASE=y\n".into(), + ), + ("mmap_rnd_bits.txt", "vm.mmap_rnd_bits = 32\n".into()), + ("vulnerabilities.txt", vulnerabilities), + ("cpuinfo.txt", cpuinfo), + ( + "kernel-log.txt", + "Spectre V1 : Mitigation: fixture\n".into(), + ), + ("dmi.txt", "/sys/class/dmi/id/bios_version:fixture\n".into()), + ("cpuid.txt", cpuid), + ("msr.txt", msr), + ]) + } + + fn parse(&self) -> Result { + parse(&self.files()) + } +} + +fn parse(files: &BTreeMap<&'static str, String>) -> Result { + T14::parse(&|n| files.get(n).cloned()) +} + +fn refused(r: Result, naming: &str) { + match r { + Ok(t) => panic!("a capture that should be refused for {naming:?} reads: {t:?}"), + Err(why) => assert!(why.contains(naming), "refused for {why:?}, not {naming:?}"), + } +} + +#[test] +fn a_capture_reads_into_the_facts_s1_takes() { + let t = Fixture::t14().parse().unwrap(); + assert_eq!( + t.facts, + Facts { + vendor: *b"GenuineIntel", + family: 6, + model: 0x8c, + stepping: 1, + microcode: 0xbe, + leaf_1: regs(0x0008_06c1, 0x11, 0x22, 0x33), + leaf_7_0: regs(0, 0x44, 0x55, ARCH_CAPABILITIES_BIT | 1 << 26), + leaf_7_2: regs(0, 0, 0, 0x66), + leaf_8000_0008_ebx: 0x88, + leaf_8000_0021_eax: 0, + arch_capabilities: 0x0c00_0000, + } + ); + assert_eq!(t.version, VERSION); + assert_eq!(t.mmap_rnd_bits, 32); + assert_eq!(t.lines["gather_data_sampling"], "Mitigation: fixture"); + assert_eq!(t.lines["meltdown"], "Not affected"); + assert_eq!( + t.msrs[&IA32_SPEC_CTRL], + BTreeMap::from([(0, 0x400), (1, 0x480)]) + ); +} + +#[test] +fn a_capture_missing_any_file_is_refused_by_its_name() { + for name in T14_FILES { + let mut files = Fixture::t14().files(); + files.remove(name); + refused(parse(&files), name); + } +} + +#[test] +fn a_capture_of_another_kernel_package_or_config_is_refused() { + let mut fx = Fixture::t14(); + fx.version = VERSION.replace("142", "141"); + refused(fx.parse(), "version.txt"); + for (file, from, to) in [ + ("packages.txt", "142.142\n", "142.141\n"), + ("config-sha256.txt", "3b85", "3b86"), + ] { + let mut files = Fixture::t14().files(); + let text = files[file].replacen(from, to, 1); + files.insert(file, text); + refused(parse(&files), file); + } +} + +#[test] +fn an_extended_leaf_reads_as_zero_beyond_the_highest_and_as_itself_within_it() { + let mut fx = Fixture::t14(); + fx.leaves + .insert((0x8000_0000, 0), regs(0x8000_0007, 0, 0, 0)); + let f = fx.parse().unwrap().facts; + assert_eq!((f.leaf_8000_0008_ebx, f.leaf_8000_0021_eax), (0, 0)); + fx.leaves + .insert((0x8000_0000, 0), regs(0x8000_0021, 0, 0, 0)); + let f = fx.parse().unwrap().facts; + assert_eq!((f.leaf_8000_0008_ebx, f.leaf_8000_0021_eax), (0x88, 0xbb)); +} + +#[test] +fn arch_capabilities_is_read_only_where_cpuid_enumerates_it() { + let mut fx = Fixture::t14(); + fx.leaves.insert((7, 0), regs(0, 0x44, 0x55, 1 << 26)); + assert_eq!(fx.parse().unwrap().facts.arch_capabilities, 0); +} + +#[test] +fn an_msr_the_cpu_enumerates_and_the_capture_lacks_is_refused() { + let mut fx = Fixture::t14(); + fx.msrs + .insert(IA32_ARCH_CAPABILITIES, vec![0x0c00_0080; CPUS as usize]); + refused(fx.parse(), "0x122"); + fx.msrs.insert(IA32_TSX_CTRL, vec![3; CPUS as usize]); + fx.parse().unwrap(); + + let mut fx = Fixture::t14(); + fx.leaves.insert( + (7, 0), + regs(0, 0, 0, ARCH_CAPABILITIES_BIT | 1 << 11 | 1 << 13), + ); + refused(fx.parse(), "0x10f"); + fx.leaves + .insert((7, 0), regs(0, 0, 0, ARCH_CAPABILITIES_BIT | 1 << 11)); + fx.parse().unwrap(); +} + +#[test] +fn an_msr_read_on_too_few_cpus_or_disagreeing_where_it_is_one_value_is_refused() { + let mut fx = Fixture::t14(); + fx.msrs.insert(IA32_MCU_OPT_CTRL, vec![0]); + refused(fx.parse(), "0x123 read on CPUs {0}"); + let mut fx = Fixture::t14(); + fx.msrs + .insert(IA32_ARCH_CAPABILITIES, vec![0x0c00_0000, 0x0d00_0000]); + refused(fx.parse(), "MSR 0x10a: CPU 1"); +} + +#[test] +fn a_microcode_revision_the_msr_and_cpuinfo_disagree_on_is_refused() { + let mut fx = Fixture::t14(); + fx.microcode = "0xbf"; + refused(fx.parse(), "IA32_BIOS_SIGN_ID"); +} + +#[test] +fn a_cpuid_decoding_linux_disagrees_with_is_refused() { + let mut fx = Fixture::t14(); + fx.cpuinfo = (6, 141, 1); + refused(fx.parse(), "model"); + let mut fx = Fixture::t14(); + fx.vendor_id = "AuthenticAMD"; + refused(fx.parse(), "CPUID.0"); +} + +#[test] +fn an_extended_family_and_model_decode_as_linux_decodes_them() { + let mut fx = Fixture::t14(); + // "Auth" "cAMD" "enti" in EBX, ECX, EDX; base family 0xf, extended model 6. + fx.leaves + .insert((0, 0), regs(0xd, 0x6874_7541, 0x444d_4163, 0x6974_6e65)); + fx.leaves.insert((1, 0), regs(0x0006_0fb1, 0, 0, 0)); + fx.vendor_id = "AuthenticAMD"; + fx.cpuinfo = (15, 107, 1); + let f = fx.parse().unwrap().facts; + assert_eq!( + (&f.vendor, f.family, f.model, f.stepping), + (b"AuthenticAMD", 15, 107, 1) + ); + fx.leaves.insert((1, 0), regs(0x00a5_0f00, 0, 0, 0)); + fx.cpuinfo = (25, 80, 0); + fx.parse().unwrap(); +} + +fn tcg(console: &str, qemu: &str) -> BTreeMap<&'static str, String> { + BTreeMap::from([ + ( + "qemu-version.txt", + format!("{qemu}\nCopyright (c) the QEMU Project developers\n"), + ), + ("console.txt", console.to_string()), + ]) +} + +fn console(version: &str, names: &[&str]) -> String { + let mut c = format!( + "[ 0.000000] {VERSION}\r\n[ 1.000000] Run /init as init process\r\n{version}\r\n" + ); + for n in names { + c += &format!("{VULNERABILITY}{n}:Vulnerable\r\n"); + } + c + "[ 2.000000] reboot: Power down\r\n" +} + +fn parse_tcg(files: &BTreeMap<&'static str, String>) -> Result { + Tcg::parse(&|n| files.get(n).cloned(), &Fixture::t14().parse().unwrap()) +} + +#[test] +fn a_tcg_console_reads_the_lines_its_init_printed() { + let qemu = format!("QEMU emulator version {}", qemu_pin()); + let t = parse_tcg(&tcg( + &console(VERSION, &["gather_data_sampling", "meltdown"]), + &qemu, + )) + .unwrap(); + assert_eq!(t.lines["meltdown"], "Vulnerable"); + assert_eq!(t.lines.len(), 2); +} + +#[test] +fn a_tcg_capture_of_another_kernel_qemu_or_file_set_is_refused() { + let qemu = format!("QEMU emulator version {}", qemu_pin()); + let both = ["gather_data_sampling", "meltdown"]; + let other = VERSION.replace("fixture", "another build"); + for (files, naming) in [ + (tcg(&console(&other, &both), &qemu), "/proc/version"), + ( + tcg(&console(VERSION, &both), "QEMU emulator version 8.2.2"), + "qemu-version.txt", + ), + ( + tcg(&console(VERSION, &["meltdown"]), &qemu), + "vulnerabilities", + ), + ] { + match parse_tcg(&files) { + Ok(t) => panic!("read {t:?}, which should be refused for {naming:?}"), + Err(why) => assert!(why.contains(naming), "refused for {why:?}, not {naming:?}"), + } + } + for name in TCG_FILES { + let mut files = tcg(&console(VERSION, &both), &qemu); + files.remove(name); + assert!(parse_tcg(&files).unwrap_err().contains(name)); + } +} diff --git a/toyos-t14linux/tcg.sh b/toyos-t14linux/tcg.sh new file mode 100755 index 00000000000..817e818265f --- /dev/null +++ b/toyos-t14linux/tcg.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# The TCG model's half of S0, on the development host and never on the T14: `tcg.sh ` +# boots capture.sh's under the track's QEMU command line and writes what src/lib.rs reads. +set -euo pipefail +mkdir "$2" +qemu-system-x86_64 --version > "$2"/qemu-version.txt +qemu-system-x86_64 -nodefaults -machine q35 -cpu qemu64,+rdrand,+smap,+fsgsbase,+x2apic,+smep \ + -smp 2 -m 4G -kernel "$1"/vmlinuz-6.8.0-142-generic -initrd "$1"/s0.cpio \ + -append "console=ttyS0 panic=-1" -serial stdio -display none -no-reboot < /dev/null > "$2"/console.txt From 44eb3c2e769691e2fbd0ff5e1551143e669cb854 Mon Sep 17 00:00:00 2001 From: japabu Date: Tue, 29 Sep 2026 08:58:16 +0200 Subject: [PATCH 2/2] S0: commit the T14's and the TCG model's captures, and read them over toyos-t14linux/s0/t14/ is capture.sh run on the T14 through sudo under its pinned Ubuntu (6.8.0-142-generic, packages 6.8.0-142.142, config sha256 3b8533dd...ca5890); toyos-t14linux/s0/tcg/ is tcg.sh run on the development host under QEMU 11.1.1, the version .github/qemu-version pins. Both exited 0. Every file was checked for a name, a serial number or another identifying value beyond the T14/t14 host and user names the track already allows; none carries one. src/tests.rs gains the_committed_capture_reads_and_its_lines_are_s0s, which reads both directories through T14::read and Tcg::read and checks the T14's spectre_v2, gather_data_sampling and indirect_target_selection lines and the TCG model's spectre_v2 line against the capture verbatim. Deleting vulnerabilities.txt from the committed t14/ directory (checked patch, reverted) reds it with "vulnerabilities.txt is missing"; parse's per-file refusal is what a deleted file trips. The track issue's S0 exit now names the two committed paths and that the Ubuntu wipe still waits on #568's LLVM-bar capture on the T14; nothing else in the issue disagrees with what this capture reads. Co-Authored-By: Claude Opus 5.5 --- ...tigates-what-linux-mitigates-on-the-t14.md | 7 +- toyos-t14linux/s0/t14/cmdline.txt | 1 + toyos-t14linux/s0/t14/config-hardening.txt | 41 ++ toyos-t14linux/s0/t14/config-sha256.txt | 1 + toyos-t14linux/s0/t14/cpuid.txt | 12 + toyos-t14linux/s0/t14/cpuinfo.txt | 224 ++++++++++ toyos-t14linux/s0/t14/dmi.txt | 8 + toyos-t14linux/s0/t14/kernel-log.txt | 10 + toyos-t14linux/s0/t14/mmap_rnd_bits.txt | 1 + toyos-t14linux/s0/t14/msr.txt | 32 ++ toyos-t14linux/s0/t14/packages.txt | 2 + toyos-t14linux/s0/t14/uname.txt | 1 + toyos-t14linux/s0/t14/version.txt | 1 + toyos-t14linux/s0/t14/vulnerabilities.txt | 17 + toyos-t14linux/s0/tcg/console.txt | 397 ++++++++++++++++++ toyos-t14linux/s0/tcg/qemu-version.txt | 2 + toyos-t14linux/src/tests.rs | 33 +- 17 files changed, 786 insertions(+), 4 deletions(-) create mode 100644 toyos-t14linux/s0/t14/cmdline.txt create mode 100644 toyos-t14linux/s0/t14/config-hardening.txt create mode 100644 toyos-t14linux/s0/t14/config-sha256.txt create mode 100644 toyos-t14linux/s0/t14/cpuid.txt create mode 100644 toyos-t14linux/s0/t14/cpuinfo.txt create mode 100644 toyos-t14linux/s0/t14/dmi.txt create mode 100644 toyos-t14linux/s0/t14/kernel-log.txt create mode 100644 toyos-t14linux/s0/t14/mmap_rnd_bits.txt create mode 100644 toyos-t14linux/s0/t14/msr.txt create mode 100644 toyos-t14linux/s0/t14/packages.txt create mode 100644 toyos-t14linux/s0/t14/uname.txt create mode 100644 toyos-t14linux/s0/t14/version.txt create mode 100644 toyos-t14linux/s0/t14/vulnerabilities.txt create mode 100644 toyos-t14linux/s0/tcg/console.txt create mode 100644 toyos-t14linux/s0/tcg/qemu-version.txt diff --git a/issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md b/issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md index 4b7b655bae2..24b929ce6f6 100644 --- a/issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md +++ b/issues/kernel/the-kernel-mitigates-what-linux-mitigates-on-the-t14.md @@ -131,8 +131,11 @@ comes from S1's T14 fixture and the T14 run, never from KVM. names 6.8.0-142, both packages are 6.8.0-142.142 and the config's sha256 is the one above. The capture is one-time: the kernel image, `s0.cpio` and busybox are never committed and no build or test boots - them. **Exit**: the captured text outputs committed as S1's fixtures. Ubuntu - is wiped from the T14 only after that commit. + them. **Exit**: the captured text outputs committed as S1's fixtures — done, + at `toyos-t14linux/s0/t14/` (the T14, `capture.sh` through sudo) and + `toyos-t14linux/s0/tcg/` (the TCG model, `tcg.sh` on QEMU 11.1.1). Ubuntu is + wiped from the T14 only after that commit and #568's LLVM-bar capture, which + still waits on the T14. - **S1 — The decision, a host-tested function.** A pure function, in a crate the kernel and a host test both build, maps (vendor, family, model, stepping, microcode revision, CPUID.1, CPUID.(7,0), CPUID.(7,2), diff --git a/toyos-t14linux/s0/t14/cmdline.txt b/toyos-t14linux/s0/t14/cmdline.txt new file mode 100644 index 00000000000..52137704fca --- /dev/null +++ b/toyos-t14linux/s0/t14/cmdline.txt @@ -0,0 +1 @@ +BOOT_IMAGE=/vmlinuz-6.8.0-142-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro diff --git a/toyos-t14linux/s0/t14/config-hardening.txt b/toyos-t14linux/s0/t14/config-hardening.txt new file mode 100644 index 00000000000..8c1cfb44cf6 --- /dev/null +++ b/toyos-t14linux/s0/t14/config-hardening.txt @@ -0,0 +1,41 @@ +124:CONFIG_BPF_JIT_ALWAYS_ON=y +318:CONFIG_KEXEC_SIG=y +493:CONFIG_X86_UMIP=y +498:CONFIG_X86_INTEL_TSX_MODE_OFF=y +502:CONFIG_X86_USER_SHADOW_STACK=y +528:CONFIG_RANDOMIZE_BASE=y +532:CONFIG_RANDOMIZE_MEMORY=y +536:CONFIG_LEGACY_VSYSCALL_XONLY=y +554:CONFIG_CPU_MITIGATIONS=y +556:CONFIG_MITIGATION_RETPOLINE=y +557:CONFIG_MITIGATION_RETHUNK=y +564:CONFIG_SLS=y +566:CONFIG_MITIGATION_RFDS=y +567:CONFIG_MITIGATION_SPECTRE_BHI=y +568:CONFIG_MITIGATION_ITS=y +569:CONFIG_MITIGATION_TSA=y +570:CONFIG_MITIGATION_VMSCAPE=y +882:CONFIG_STACKPROTECTOR_STRONG=y +909:CONFIG_ARCH_MMAP_RND_BITS=32 +930:CONFIG_VMAP_STACK=y +933:CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y +935:CONFIG_STRICT_KERNEL_RWX=y +937:CONFIG_STRICT_MODULE_RWX=y +982:CONFIG_MODULE_SIG=y +1132:CONFIG_SLAB_FREELIST_RANDOM=y +1133:CONFIG_SLAB_FREELIST_HARDENED=y +1136:CONFIG_RANDOM_KMALLOC_CACHES=y +1139:CONFIG_SHUFFLE_PAGE_ALLOCATOR=y +2457:CONFIG_RESET_ATTACK_MITIGATION=y +9892:CONFIG_INTEL_IOMMU_DEFAULT_ON=y +11376:CONFIG_HARDENED_USERCOPY=y +11377:CONFIG_FORTIFY_SOURCE=y +11473:CONFIG_INIT_STACK_ALL_ZERO=y +11474:CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y +11477:CONFIG_ZERO_CALL_USED_REGS=y +12040:CONFIG_UBSAN_BOUNDS=y +12042:CONFIG_UBSAN_SHIFT=y +12044:CONFIG_UBSAN_BOOL=y +12045:CONFIG_UBSAN_ENUM=y +12074:CONFIG_DEBUG_WX=y +12084:CONFIG_SCHED_STACK_END_CHECK=y diff --git a/toyos-t14linux/s0/t14/config-sha256.txt b/toyos-t14linux/s0/t14/config-sha256.txt new file mode 100644 index 00000000000..0b5f4afd73b --- /dev/null +++ b/toyos-t14linux/s0/t14/config-sha256.txt @@ -0,0 +1 @@ +3b8533dd9d235ca634ac58f82c5ce1ee35f12ef620693e17033184d2c9ca5890 /boot/config-6.8.0-142-generic diff --git a/toyos-t14linux/s0/t14/cpuid.txt b/toyos-t14linux/s0/t14/cpuid.txt new file mode 100644 index 00000000000..b4e53c2bb94 --- /dev/null +++ b/toyos-t14linux/s0/t14/cpuid.txt @@ -0,0 +1,12 @@ +00000000 00000000 0000001b 756e6547 6c65746e 49656e69 +00000001 00000000 000806c1 00100800 7ffafbbf bfebfbff +00000006 00000000 0017eff7 00000002 00000009 00000000 +00000007 00000000 00000002 f3bfa7eb 18c05fde fc100710 +00000007 00000001 00000000 00000000 00000000 00040000 +00000007 00000002 00000000 00000000 00000000 00000001 +0000000d 00000000 000002e7 00000a88 00000a88 00000000 +0000000d 00000001 0000000f 00000998 00003900 00000000 +00000014 00000000 00000001 0000004f 00000007 00000000 +80000000 00000000 80000008 00000000 00000000 00000000 +80000008 00000000 00003027 00000000 00000000 00000000 +80000021 00000000 00000000 00000000 00000000 00000000 diff --git a/toyos-t14linux/s0/t14/cpuinfo.txt b/toyos-t14linux/s0/t14/cpuinfo.txt new file mode 100644 index 00000000000..15a6d57f5f3 --- /dev/null +++ b/toyos-t14linux/s0/t14/cpuinfo.txt @@ -0,0 +1,224 @@ +processor : 0 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 627.581 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 0 +cpu cores : 4 +apicid : 0 +initial apicid : 0 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 1 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 855.097 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 1 +cpu cores : 4 +apicid : 2 +initial apicid : 2 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 2 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 3282.151 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 2 +cpu cores : 4 +apicid : 4 +initial apicid : 4 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 3 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 615.767 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 3 +cpu cores : 4 +apicid : 6 +initial apicid : 6 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 4 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 399.863 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 0 +cpu cores : 4 +apicid : 1 +initial apicid : 1 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 5 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 3673.333 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 1 +cpu cores : 4 +apicid : 3 +initial apicid : 3 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 6 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 3800.000 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 2 +cpu cores : 4 +apicid : 5 +initial apicid : 5 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 7 +vendor_id : GenuineIntel +cpu family : 6 +model : 140 +model name : 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz +stepping : 1 +microcode : 0xbe +cpu MHz : 3162.755 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 3 +cpu cores : 4 +apicid : 7 +initial apicid : 7 +fpu : yes +fpu_exception : yes +cpuid level : 27 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities +vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling +bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi its its_native_only +bogomips : 4838.40 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + diff --git a/toyos-t14linux/s0/t14/dmi.txt b/toyos-t14linux/s0/t14/dmi.txt new file mode 100644 index 00000000000..8f2ed5f08dd --- /dev/null +++ b/toyos-t14linux/s0/t14/dmi.txt @@ -0,0 +1,8 @@ +/sys/class/dmi/id/bios_date:05/09/2026 +/sys/class/dmi/id/bios_release:1.71 +/sys/class/dmi/id/bios_vendor:LENOVO +/sys/class/dmi/id/bios_version:N34ET71W (1.71 ) +/sys/class/dmi/id/ec_firmware_release:1.46 +/sys/class/dmi/id/sys_vendor:LENOVO +/sys/class/dmi/id/product_name:20W0003AMZ +/sys/class/dmi/id/product_version:ThinkPad T14 Gen 2i diff --git a/toyos-t14linux/s0/t14/kernel-log.txt b/toyos-t14linux/s0/t14/kernel-log.txt new file mode 100644 index 00000000000..8214d7a89ab --- /dev/null +++ b/toyos-t14linux/s0/t14/kernel-log.txt @@ -0,0 +1,10 @@ +Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization +Spectre V2 : Spectre BHI mitigation: SW BHB clearing on vm exit +Spectre V2 : Spectre BHI mitigation: SW BHB clearing on syscall +Spectre V2 : Mitigation: Enhanced / Automatic IBRS +Spectre V2 : Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT +Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier +Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl +GDS: Mitigation: Microcode +ITS: Mitigation: Aligned branch/return thunks +microcode: Current revision: 0x000000be diff --git a/toyos-t14linux/s0/t14/mmap_rnd_bits.txt b/toyos-t14linux/s0/t14/mmap_rnd_bits.txt new file mode 100644 index 00000000000..11a4111dcd8 --- /dev/null +++ b/toyos-t14linux/s0/t14/mmap_rnd_bits.txt @@ -0,0 +1 @@ +vm.mmap_rnd_bits = 32 diff --git a/toyos-t14linux/s0/t14/msr.txt b/toyos-t14linux/s0/t14/msr.txt new file mode 100644 index 00000000000..3fb193cb6b1 --- /dev/null +++ b/toyos-t14linux/s0/t14/msr.txt @@ -0,0 +1,32 @@ +0000008b 0 000000be00000000 +0000008b 1 000000be00000000 +0000008b 2 000000be00000000 +0000008b 3 000000be00000000 +0000008b 4 000000be00000000 +0000008b 5 000000be00000000 +0000008b 6 000000be00000000 +0000008b 7 000000be00000000 +00000048 0 0000000000000001 +00000048 1 0000000000000001 +00000048 2 0000000000000001 +00000048 3 0000000000000001 +00000048 4 0000000000000001 +00000048 5 0000000000000001 +00000048 6 0000000000000001 +00000048 7 0000000000000001 +0000010a 0 000000000a005c6b +0000010a 1 000000000a005c6b +0000010a 2 000000000a005c6b +0000010a 3 000000000a005c6b +0000010a 4 000000000a005c6b +0000010a 5 000000000a005c6b +0000010a 6 000000000a005c6b +0000010a 7 000000000a005c6b +00000123 0 0000000000000000 +00000123 1 0000000000000000 +00000123 2 0000000000000000 +00000123 3 0000000000000000 +00000123 4 0000000000000000 +00000123 5 0000000000000000 +00000123 6 0000000000000000 +00000123 7 0000000000000000 diff --git a/toyos-t14linux/s0/t14/packages.txt b/toyos-t14linux/s0/t14/packages.txt new file mode 100644 index 00000000000..94d1f206ef8 --- /dev/null +++ b/toyos-t14linux/s0/t14/packages.txt @@ -0,0 +1,2 @@ +linux-image-6.8.0-142-generic 6.8.0-142.142 +linux-modules-6.8.0-142-generic 6.8.0-142.142 diff --git a/toyos-t14linux/s0/t14/uname.txt b/toyos-t14linux/s0/t14/uname.txt new file mode 100644 index 00000000000..f57a77638b8 --- /dev/null +++ b/toyos-t14linux/s0/t14/uname.txt @@ -0,0 +1 @@ +Linux t14 6.8.0-142-generic #142-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 2 14:24:27 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux diff --git a/toyos-t14linux/s0/t14/version.txt b/toyos-t14linux/s0/t14/version.txt new file mode 100644 index 00000000000..2ea613b2747 --- /dev/null +++ b/toyos-t14linux/s0/t14/version.txt @@ -0,0 +1 @@ +Linux version 6.8.0-142-generic (buildd@lcy02-amd64-049) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #142-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 2 14:24:27 UTC 2026 diff --git a/toyos-t14linux/s0/t14/vulnerabilities.txt b/toyos-t14linux/s0/t14/vulnerabilities.txt new file mode 100644 index 00000000000..15ba1120f37 --- /dev/null +++ b/toyos-t14linux/s0/t14/vulnerabilities.txt @@ -0,0 +1,17 @@ +/sys/devices/system/cpu/vulnerabilities/gather_data_sampling:Mitigation: Microcode +/sys/devices/system/cpu/vulnerabilities/indirect_target_selection:Mitigation: Aligned branch/return thunks +/sys/devices/system/cpu/vulnerabilities/itlb_multihit:Not affected +/sys/devices/system/cpu/vulnerabilities/l1tf:Not affected +/sys/devices/system/cpu/vulnerabilities/mds:Not affected +/sys/devices/system/cpu/vulnerabilities/meltdown:Not affected +/sys/devices/system/cpu/vulnerabilities/mmio_stale_data:Not affected +/sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling:Not affected +/sys/devices/system/cpu/vulnerabilities/retbleed:Not affected +/sys/devices/system/cpu/vulnerabilities/spec_rstack_overflow:Not affected +/sys/devices/system/cpu/vulnerabilities/spec_store_bypass:Mitigation: Speculative Store Bypass disabled via prctl +/sys/devices/system/cpu/vulnerabilities/spectre_v1:Mitigation: usercopy/swapgs barriers and __user pointer sanitization +/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Enhanced / Automatic IBRS; IBPB: conditional; PBRSB-eIBRS: SW sequence; BHI: SW loop, KVM: SW loop +/sys/devices/system/cpu/vulnerabilities/srbds:Not affected +/sys/devices/system/cpu/vulnerabilities/tsa:Not affected +/sys/devices/system/cpu/vulnerabilities/tsx_async_abort:Not affected +/sys/devices/system/cpu/vulnerabilities/vmscape:Not affected diff --git a/toyos-t14linux/s0/tcg/console.txt b/toyos-t14linux/s0/tcg/console.txt new file mode 100644 index 00000000000..937d5c44eed --- /dev/null +++ b/toyos-t14linux/s0/tcg/console.txt @@ -0,0 +1,397 @@ +[ 0.000000] Linux version 6.8.0-142-generic (buildd@lcy02-amd64-049) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #142-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 2 14:24:27 UTC 2026 (Ubuntu 6.8.0-142.142-generic 6.8.12) +[ 0.000000] Command line: console=ttyS0 panic=-1 +[ 0.000000] KERNEL supported cpus: +[ 0.000000] Intel GenuineIntel +[ 0.000000] AMD AuthenticAMD +[ 0.000000] Hygon HygonGenuine +[ 0.000000] Centaur CentaurHauls +[ 0.000000] zhaoxin Shanghai +[ 0.000000] BIOS-provided physical RAM map: +[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable +[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved +[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved +[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffdffff] usable +[ 0.000000] BIOS-e820: [mem 0x000000007ffe0000-0x000000007fffffff] reserved +[ 0.000000] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] reserved +[ 0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved +[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved +[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000017fffffff] usable +[ 0.000000] BIOS-e820: [mem 0x000000fd00000000-0x000000ffffffffff] reserved +[ 0.000000] NX (Execute Disable) protection: active +[ 0.000000] APIC: Static calls initialized +[ 0.000000] SMBIOS 2.8 present. +[ 0.000000] DMI: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014 +[ 0.000000] tsc: Fast TSC calibration using PIT +[ 0.000000] tsc: Detected 999.836 MHz processor +[ 0.004886] AGP: No AGP bridge found +[ 0.005065] last_pfn = 0x180000 max_arch_pfn = 0x400000000 +[ 0.005607] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs +[ 0.005782] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT +[ 0.006657] last_pfn = 0x7ffe0 max_arch_pfn = 0x400000000 +[ 0.024253] found SMP MP-table at [mem 0x000f54c0-0x000f54cf] +[ 0.028424] RAMDISK: [mem 0x7fdd9000-0x7ffdffff] +[ 0.028890] ACPI: Early table checksum verification disabled +[ 0.029267] ACPI: RSDP 0x00000000000F52C0 000014 (v00 BOCHS ) +[ 0.029509] ACPI: RSDT 0x000000007FFE232F 000038 (v01 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030048] ACPI: FACP 0x000000007FFE211F 0000F4 (v03 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030562] ACPI: DSDT 0x000000007FFE0040 0020DF (v01 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030642] ACPI: FACS 0x000000007FFE0000 000040 +[ 0.030685] ACPI: APIC 0x000000007FFE2213 000080 (v03 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030709] ACPI: HPET 0x000000007FFE2293 000038 (v01 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030732] ACPI: MCFG 0x000000007FFE22CB 00003C (v01 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030753] ACPI: WAET 0x000000007FFE2307 000028 (v01 BOCHS BXPC 00000001 BXPC 00000001) +[ 0.030827] ACPI: Reserving FACP table memory at [mem 0x7ffe211f-0x7ffe2212] +[ 0.030849] ACPI: Reserving DSDT table memory at [mem 0x7ffe0040-0x7ffe211e] +[ 0.030858] ACPI: Reserving FACS table memory at [mem 0x7ffe0000-0x7ffe003f] +[ 0.030865] ACPI: Reserving APIC table memory at [mem 0x7ffe2213-0x7ffe2292] +[ 0.030871] ACPI: Reserving HPET table memory at [mem 0x7ffe2293-0x7ffe22ca] +[ 0.030877] ACPI: Reserving MCFG table memory at [mem 0x7ffe22cb-0x7ffe2306] +[ 0.030884] ACPI: Reserving WAET table memory at [mem 0x7ffe2307-0x7ffe232e] +[ 0.154458] No NUMA configuration found +[ 0.154525] Faking a node at [mem 0x0000000000000000-0x000000017fffffff] +[ 0.155066] NODE_DATA(0) allocated [mem 0x17ffd3000-0x17fffdfff] +[ 0.174522] Zone ranges: +[ 0.174584] DMA [mem 0x0000000000001000-0x0000000000ffffff] +[ 0.174670] DMA32 [mem 0x0000000001000000-0x00000000ffffffff] +[ 0.174683] Normal [mem 0x0000000100000000-0x000000017fffffff] +[ 0.174694] Device empty +[ 0.174715] Movable zone start for each node +[ 0.174741] Early memory node ranges +[ 0.174767] node 0: [mem 0x0000000000001000-0x000000000009efff] +[ 0.174881] node 0: [mem 0x0000000000100000-0x000000007ffdffff] +[ 0.174912] node 0: [mem 0x0000000100000000-0x000000017fffffff] +[ 0.175044] Initmem setup node 0 [mem 0x0000000000001000-0x000000017fffffff] +[ 0.214952] On node 0, zone DMA: 1 pages in unavailable ranges +[ 0.259966] On node 0, zone DMA: 97 pages in unavailable ranges +[ 0.306778] On node 0, zone Normal: 32 pages in unavailable ranges +[ 0.307281] ACPI: PM-Timer IO Port: 0x608 +[ 0.307692] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1]) +[ 0.308416] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23 +[ 0.308662] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) +[ 0.309271] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level) +[ 0.309442] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) +[ 0.309654] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level) +[ 0.309704] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level) +[ 0.310323] ACPI: Using ACPI (MADT) for SMP configuration information +[ 0.310428] ACPI: HPET id: 0x8086a201 base: 0xfed00000 +[ 0.310980] smpboot: Allowing 2 CPUs, 0 hotplug CPUs +[ 0.316917] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff] +[ 0.317049] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x000fffff] +[ 0.317077] PM: hibernation: Registered nosave memory: [mem 0x7ffe0000-0xffffffff] +[ 0.317271] [mem 0xc0000000-0xfed1bfff] available for PCI devices +[ 0.317395] Booting paravirtualized kernel on bare hardware +[ 0.317906] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns +[ 0.319350] setup_percpu: NR_CPUS:8192 nr_cpumask_bits:2 nr_cpu_ids:2 nr_node_ids:1 +[ 0.320845] percpu: Embedded 86 pages/cpu s229376 r8192 d114688 u1048576 +[ 0.322058] Kernel command line: console=ttyS0 panic=-1 +[ 0.323259] random: crng init done +[ 0.324244] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) +[ 0.324711] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) +[ 0.326959] Fallback order for Node 0: 0 +[ 0.327327] Built 1 zonelists, mobility grouping on. Total pages: 1031904 +[ 0.327359] Policy zone: Normal +[ 0.327762] mem auto-init: stack:all(zero), heap alloc:on, heap free:off +[ 0.327875] AGP: Checking aperture... +[ 0.328781] AGP: No AGP bridge found +[ 0.329278] software IO TLB: area num 2. +[ 0.422990] Memory: 3998584K/4193784K available (22528K kernel code, 4441K rwdata, 14428K rodata, 4932K init, 4776K bss, 194940K reserved, 0K cma-reserved) +[ 0.431908] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 +[ 0.433784] ftrace: allocating 58336 entries in 228 pages +[ 0.483521] ftrace: allocated 228 pages with 4 groups +[ 0.501299] Dynamic Preempt: voluntary +[ 0.504172] rcu: Preemptible hierarchical RCU implementation. +[ 0.504225] rcu: RCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=2. +[ 0.504308] Trampoline variant of Tasks RCU enabled. +[ 0.504316] Rude variant of Tasks RCU enabled. +[ 0.504322] Tracing variant of Tasks RCU enabled. +[ 0.504424] rcu: RCU calculated value of scheduler-enlistment delay is 100 jiffies. +[ 0.504447] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 +[ 0.505387] RCU Tasks: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=2. +[ 0.505417] RCU Tasks Rude: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=2. +[ 0.505429] RCU Tasks Trace: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=2. +[ 0.526178] NR_IRQS: 524544, nr_irqs: 440, preallocated irqs: 16 +[ 0.572828] rcu: srcu_init: Setting srcu_struct sizes based on contention. +[ 0.605074] Console: colour *CGA 80x25 +[ 0.607687] printk: legacy console [ttyS0] enabled +[ 0.646169] ACPI: Core revision 20230628 +[ 0.666704] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns +[ 0.672419] APIC: Switch to symmetric I/O mode setup +[ 0.673423] x2apic: IRQ remapping doesn't support X2APIC mode +[ 0.677245] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1 +[ 0.689734] tsc: Marking TSC unstable due to TSCs unsynchronized +[ 0.690356] Calibrating delay loop (skipped), value calculated using timer frequency.. 1999.67 BogoMIPS (lpj=999836) +[ 0.702762] process: using AMD E400 aware idle routine +[ 0.707552] Last level iTLB entries: 4KB 512, 2MB 255, 4MB 127 +[ 0.707908] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0 +[ 0.710931] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization +[ 0.711667] Spectre V2 : Mitigation: Retpolines +[ 0.712220] Spectre V2 : Spectre v2 / SpectreRSB: Filling RSB on context switch and VMEXIT +[ 0.718397] x86/fpu: x87 FPU will use FXSAVE +[ 0.952113] Freeing SMP alternatives memory: 48K +[ 0.952776] pid_max: default: 32768 minimum: 301 +[ 0.959230] LSM: initializing lsm=lockdown,capability,landlock,yama,apparmor,integrity +[ 0.960113] landlock: Up and running. +[ 0.960113] Yama: becoming mindful. +[ 0.960113] AppArmor: AppArmor initialized +[ 0.967373] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) +[ 0.968113] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) +[ 1.071113] smpboot: CPU0: AMD QEMU Virtual CPU version 2.5+ (family: 0xf, model: 0x6b, stepping: 0x1) +[ 1.085052] Performance Events: PMU not available due to virtualization, using software events only. +[ 1.086330] signal: max sigframe size: 1440 +[ 1.091252] rcu: Hierarchical SRCU implementation. +[ 1.092554] rcu: Max phase no-delay instances is 400. +[ 1.106550] NMI watchdog: Perf NMI watchdog permanently disabled +[ 1.113447] smp: Bringing up secondary CPUs ... +[ 1.137181] smpboot: x86: Booting SMP configuration: +[ 1.137440] .... node #0, CPUs: #1 +[ 0.098321] calibrate_delay_direct() dropping max bogoMips estimate 3 = 15448800 +[ 0.098321] calibrate_delay_direct() dropping max bogoMips estimate 2 = 4961900 +[ 1.250933] smp: Brought up 1 node, 2 CPUs +[ 1.251113] smpboot: Max logical packages: 1 +[ 1.251194] smpboot: Total of 2 processors activated (4621.07 BogoMIPS) +[ 1.276697] devtmpfs: initialized +[ 1.281448] x86/mm: Memory block size: 128MB +[ 1.287820] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns +[ 1.290317] futex hash table entries: 512 (order: 3, 32768 bytes, linear) +[ 1.296225] pinctrl core: initialized pinctrl subsystem +[ 1.308211] PM: RTC time: 06:50:37, date: 2026-09-29 +[ 1.319113] NET: Registered PF_NETLINK/PF_ROUTE protocol family +[ 1.323443] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations +[ 1.324281] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations +[ 1.324845] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations +[ 1.325113] audit: initializing netlink subsys (disabled) +[ 1.327450] audit: type=2000 audit(1790664635.646:1): state=initialized audit_enabled=0 res=1 +[ 1.335113] thermal_sys: Registered thermal governor 'fair_share' +[ 1.335241] thermal_sys: Registered thermal governor 'bang_bang' +[ 1.335824] thermal_sys: Registered thermal governor 'step_wise' +[ 1.335824] thermal_sys: Registered thermal governor 'user_space' +[ 1.335824] thermal_sys: Registered thermal governor 'power_allocator' +[ 1.339267] cpuidle: using governor ladder +[ 1.340410] cpuidle: using governor menu +[ 1.343467] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5 +[ 1.348317] PCI: ECAM [mem 0xb0000000-0xbfffffff] (base 0xb0000000) for domain 0000 [bus 00-ff] +[ 1.349113] PCI: ECAM [mem 0xb0000000-0xbfffffff] reserved as E820 entry +[ 1.351520] PCI: Using configuration type 1 for base access +[ 1.352292] mtrr: your CPUs had inconsistent fixed MTRR settings +[ 1.353704] mtrr: your CPUs had inconsistent variable MTRR settings +[ 1.354044] mtrr: your CPUs had inconsistent MTRRdefType settings +[ 1.354113] mtrr: probably your BIOS does not setup all CPUs. +[ 1.354183] mtrr: corrected configuration. +[ 1.357589] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible. +[ 1.478215] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages +[ 1.478518] HugeTLB: 28 KiB vmemmap can be freed for a 2.00 MiB page +[ 1.497179] ACPI: Added _OSI(Module Device) +[ 1.497686] ACPI: Added _OSI(Processor Device) +[ 1.498056] ACPI: Added _OSI(Processor Aggregator Device) +[ 1.597862] ACPI: 1 ACPI AML tables successfully acquired and loaded +[ 1.657113] ACPI: _OSC evaluation for CPUs failed, trying _PDC +[ 1.661394] ACPI: Interpreter enabled +[ 1.663331] ACPI: PM: (supports S0 S3 S4 S5) +[ 1.663820] ACPI: Using IOAPIC for interrupt routing +[ 1.667486] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug +[ 1.667884] PCI: Using E820 reservations for host bridge windows +[ 1.670542] ACPI: Enabled 2 GPEs in block 00 to 3F +[ 1.725455] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) +[ 1.726102] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3] +[ 1.729113] acpi PNP0A08:00: _OSC: platform does not support [PCIeHotplug LTR DPC] +[ 1.732475] acpi PNP0A08:00: _OSC: OS now controls [SHPCHotplug PME AER PCIeCapability] +[ 1.742113] PCI host bridge to bus 0000:00 +[ 1.743041] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] +[ 1.743378] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] +[ 1.743576] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] +[ 1.743776] pci_bus 0000:00: root bus resource [mem 0x80000000-0xafffffff window] +[ 1.744020] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfffff window] +[ 1.744113] pci_bus 0000:00: root bus resource [mem 0x180000000-0x97fffffff window] +[ 1.744481] pci_bus 0000:00: root bus resource [bus 00-ff] +[ 1.749241] pci 0000:00:00.0: [8086:29c0] type 00 class 0x060000 conventional PCI endpoint +[ 1.760477] pci 0000:00:1f.0: [8086:2918] type 00 class 0x060100 conventional PCI endpoint +[ 1.761319] pci 0000:00:1f.0: quirk: [io 0x0600-0x067f] claimed by ICH6 ACPI/GPIO/TCO +[ 1.762113] pci 0000:00:1f.2: [8086:2922] type 00 class 0x010601 conventional PCI endpoint +[ 1.763113] pci 0000:00:1f.2: BAR 4 [io 0xc040-0xc05f] +[ 1.764132] pci 0000:00:1f.2: BAR 5 [mem 0xfebff000-0xfebfffff] +[ 1.765151] pci 0000:00:1f.3: [8086:2930] type 00 class 0x0c0500 conventional PCI endpoint +[ 1.765581] pci 0000:00:1f.3: BAR 4 [io 0x0700-0x073f] +[ 1.772603] ACPI: PCI: Interrupt link LNKA configured for IRQ 10 +[ 1.776494] ACPI: PCI: Interrupt link LNKB configured for IRQ 10 +[ 1.782917] ACPI: PCI: Interrupt link LNKC configured for IRQ 11 +[ 1.785790] ACPI: PCI: Interrupt link LNKD configured for IRQ 11 +[ 1.786912] ACPI: PCI: Interrupt link LNKE configured for IRQ 10 +[ 1.788846] ACPI: PCI: Interrupt link LNKF configured for IRQ 10 +[ 1.789550] ACPI: PCI: Interrupt link LNKG configured for IRQ 11 +[ 1.790150] ACPI: PCI: Interrupt link LNKH configured for IRQ 11 +[ 1.790440] ACPI: PCI: Interrupt link GSIA configured for IRQ 16 +[ 1.790655] ACPI: PCI: Interrupt link GSIB configured for IRQ 17 +[ 1.790858] ACPI: PCI: Interrupt link GSIC configured for IRQ 18 +[ 1.791057] ACPI: PCI: Interrupt link GSID configured for IRQ 19 +[ 1.791113] ACPI: PCI: Interrupt link GSIE configured for IRQ 20 +[ 1.791432] ACPI: PCI: Interrupt link GSIF configured for IRQ 21 +[ 1.792439] ACPI: PCI: Interrupt link GSIG configured for IRQ 22 +[ 1.793113] ACPI: PCI: Interrupt link GSIH configured for IRQ 23 +[ 1.801405] iommu: Default domain type: Translated +[ 1.801491] iommu: DMA domain TLB invalidation policy: lazy mode +[ 1.805653] SCSI subsystem initialized +[ 1.809113] ACPI: bus type USB registered +[ 1.809113] usbcore: registered new interface driver usbfs +[ 1.809113] usbcore: registered new interface driver hub +[ 1.809468] usbcore: registered new device driver usb +[ 1.810952] pps_core: LinuxPPS API ver. 1 registered +[ 1.811196] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti +[ 1.812113] PTP clock support registered +[ 1.813556] EDAC MC: Ver: 3.0.0 +[ 1.837252] NetLabel: Initializing +[ 1.837698] NetLabel: domain hash size = 128 +[ 1.838113] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO +[ 1.839682] NetLabel: unlabeled traffic allowed by default +[ 1.846847] mctp: management component transport protocol core +[ 1.847113] NET: Registered PF_MCTP protocol family +[ 1.847113] PCI: Using ACPI for IRQ routing +[ 1.857442] vgaarb: loaded +[ 1.861113] hpet: 3 channels of 0 reserved for per-cpu timers +[ 1.861397] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 +[ 1.861645] hpet0: 3 comparators, 64-bit 100.000000 MHz counter +[ 1.868045] clocksource: Switched to clocksource hpet +[ 1.906810] VFS: Disk quotas dquot_6.6.0 +[ 1.908728] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) +[ 1.936455] AppArmor: AppArmor Filesystem Enabled +[ 1.939968] pnp: PnP ACPI init +[ 1.968926] ACPI: IRQ 4 override to edge(!), high(!) +[ 1.969401] system 00:04: [mem 0xb0000000-0xbfffffff window] has been reserved +[ 1.974719] pnp: PnP ACPI: found 5 devices +[ 2.130079] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns +[ 2.132247] NET: Registered PF_INET protocol family +[ 2.134093] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear) +[ 2.619084] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) +[ 2.625541] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) +[ 2.635134] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) +[ 2.635134] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear) +[ 2.637626] TCP: Hash tables configured (established 32768 bind 32768) +[ 2.640016] MPTCP token hash table entries: 4096 (order: 5, 98304 bytes, linear) +[ 2.640953] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) +[ 2.642151] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) +[ 2.643612] NET: Registered PF_UNIX/PF_LOCAL protocol family +[ 2.644098] NET: Registered PF_XDP protocol family +[ 2.644369] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window] +[ 2.644369] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window] +[ 2.644369] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window] +[ 2.644369] pci_bus 0000:00: resource 7 [mem 0x80000000-0xafffffff window] +[ 2.645825] pci_bus 0000:00: resource 8 [mem 0xc0000000-0xfebfffff window] +[ 2.646023] pci_bus 0000:00: resource 9 [mem 0x180000000-0x97fffffff window] +[ 2.646788] PCI: CLS 0 bytes, default 64 +[ 2.647844] PCI-DMA: Using software bounce buffering for IO (SWIOTLB) +[ 2.648047] software IO TLB: mapped [mem 0x000000007bdd9000-0x000000007fdd9000] (64MB) +[ 2.680966] Trying to unpack rootfs image as initramfs... +[ 2.694566] Initialise system trusted keyrings +[ 2.694566] Key type blacklist registered +[ 2.736580] workingset: timestamp_bits=36 max_order=20 bucket_order=0 +[ 2.737023] zbud: loaded +[ 2.772643] Freeing initrd memory: 2076K +[ 2.837656] squashfs: version 4.0 (2009/01/31) Phillip Lougher +[ 2.895486] fuse: init (API version 7.39) +[ 2.973686] integrity: Platform Keyring initialized +[ 2.974628] integrity: Machine keyring initialized +[ 3.295040] Key type asymmetric registered +[ 3.295411] Asymmetric key parser 'x509' registered +[ 3.296694] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243) +[ 3.307340] io scheduler mq-deadline registered +[ 3.378207] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4 +[ 3.387681] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0 +[ 3.391290] ACPI: button: Power Button [PWRF] +[ 3.412658] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled +[ 3.447742] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A +[ 3.830776] Linux agpgart interface v0.103 +[ 3.991184] loop: module loaded +[ 3.998015] ACPI: bus type drm_connector registered +[ 4.003909] tun: Universal TUN/TAP device driver, 1.6 +[ 4.012172] PPP generic driver version 2.4.2 +[ 4.022220] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12 +[ 4.193670] serio: i8042 KBD port at 0x60,0x64 irq 1 +[ 4.195110] serio: i8042 AUX port at 0x60,0x64 irq 12 +[ 4.200640] mousedev: PS/2 mouse device common for all mice +[ 4.207620] rtc_cmos 00:03: RTC can wake from S4 +[ 4.212902] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1 +[ 4.213935] rtc_cmos 00:03: registered as rtc0 +[ 4.215489] rtc_cmos 00:03: setting system clock to 2026-09-29T06:50:40 UTC (1790664640) +[ 4.223983] rtc_cmos 00:03: alarms up to one day, y3k, 242 bytes nvram, hpet irqs +[ 4.282706] i2c_dev: i2c /dev entries driver +[ 4.287693] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA log. +[ 4.333982] device-mapper: uevent: version 1.0.3 +[ 4.406419] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com +[ 4.410672] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled +[ 4.414474] ledtrig-cpu: registered to indicate activity on CPUs +[ 4.423670] drop_monitor: Initializing network drop monitor service +[ 4.424916] NET: Registered PF_INET6 protocol family +[ 4.520917] Segment Routing with IPv6 +[ 4.522232] In-situ OAM (IOAM) with IPv6 +[ 4.524806] NET: Registered PF_PACKET protocol family +[ 4.526814] Key type dns_resolver registered +[ 4.531227] IPI shorthand broadcast: enabled +[ 4.744574] registered taskstats version 1 +[ 4.752959] Loading compiled-in X.509 certificates +[ 4.839158] Loaded X.509 cert 'Build time autogenerated kernel key: aaf6cface807121d2b25f83f2288de5f0eb7acff' +[ 4.864624] Loaded X.509 cert 'Canonical Ltd. Live Patch Signing 2025 Kmod: d541cef61dc7e793b7eb7e899970a2eef0b5dc8c' +[ 4.871401] Loaded X.509 cert 'Canonical Ltd. Live Patch Signing: 14df34d1a87cf37625abec039ef2bf521249b969' +[ 4.901832] Loaded X.509 cert 'Canonical Ltd. Kernel Module Signing 2025 Kmod: 4627603d2357a2a3f81006370894c221175893e9' +[ 4.907559] Loaded X.509 cert 'Canonical Ltd. Kernel Module Signing: 88f752e560a1e0737e31163a466ad7b70a850c19' +[ 4.908180] blacklist: Loading compiled-in revocation X.509 certificates +[ 4.910125] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing: 61482aa2830d0ab2ad5af10b7250da9033ddcef0' +[ 4.910375] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2017): 242ade75ac4a15e50d50c84b0d45ff3eae707a03' +[ 4.910375] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (ESM 2018): 365188c1d374d6b07c3c8f240f8ef722433d6a8b' +[ 4.911584] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2019): c0746fd6c5da3ae827864651ad66ae47fe24b3e8' +[ 4.912009] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2021 v1): a8d54bbb3825cfb94fa13c9f8a594a195c107b8d' +[ 4.912362] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2021 v2): 4cf046892d6fd3c9a5b03f98d845f90851dc6a8c' +[ 4.912467] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2021 v3): 100437bb6de6e469b581e61cd66bce3ef4ed53af' +[ 4.930151] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (Ubuntu Core 2019): c1d57b8f6b743f23ee41f4f7ee292f06eecadfb9' +[ 5.212326] Key type .fscrypt registered +[ 5.212563] Key type fscrypt-provisioning registered +[ 5.245722] Key type encrypted registered +[ 5.246576] AppArmor: AppArmor sha256 policy hashing enabled +[ 5.247257] ima: No TPM chip found, activating TPM-bypass! +[ 5.247442] Loading compiled-in module X.509 certificates +[ 5.248860] Loaded X.509 cert 'Build time autogenerated kernel key: aaf6cface807121d2b25f83f2288de5f0eb7acff' +[ 5.248860] ima: Allocated hash algorithm: sha256 +[ 5.250754] ima: No architecture policies found +[ 5.253597] evm: Initialising EVM extended attributes: +[ 5.254134] evm: security.selinux +[ 5.254666] evm: security.SMACK64 +[ 5.254780] evm: security.SMACK64EXEC +[ 5.254875] evm: security.SMACK64TRANSMUTE +[ 5.254977] evm: security.SMACK64MMAP +[ 5.255066] evm: security.apparmor +[ 5.255149] evm: security.ima +[ 5.255225] evm: security.capability +[ 5.303128] evm: HMAC attrs: 0x1 +[ 5.363667] PM: Magic number: 10:620:823 +[ 5.368500] powernow_k8: Power state transitions not supported +[ 5.374692] powernow_k8: Power state transitions not supported +[ 5.638671] RAS: Correctable Errors collector initialized. +[ 5.644733] Unstable clock detected, switching default tracing clock to "global" +[ 5.644733] If you want to keep using the local clock, then add: +[ 5.644733] "trace_clock=local" +[ 5.644733] on the kernel command line +[ 5.732529] clk: Disabling unused clocks +[ 5.901153] Freeing unused decrypted memory: 2028K +[ 6.196336] Freeing unused kernel image (initmem) memory: 4932K +[ 6.196681] Write protecting the kernel read-only data: 38912k +[ 6.257481] Freeing unused kernel image (rodata/data gap) memory: 1956K +[ 6.992659] x86/mm: Checked W+X mappings: passed, no W+X pages found. +[ 6.996439] Run /init as init process +Linux version 6.8.0-142-generic (buildd@lcy02-amd64-049) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #142-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 2 14:24:27 UTC 2026 +/sys/devices/system/cpu/vulnerabilities/gather_data_sampling:Not affected +/sys/devices/system/cpu/vulnerabilities/indirect_target_selection:Not affected +/sys/devices/system/cpu/vulnerabilities/itlb_multihit:Not affected +/sys/devices/system/cpu/vulnerabilities/l1tf:Not affected +/sys/devices/system/cpu/vulnerabilities/mds:Not affected +/sys/devices/system/cpu/vulnerabilities/meltdown:Not affected +/sys/devices/system/cpu/vulnerabilities/mmio_stale_data:Not affected +/sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling:Not affected +/sys/devices/system/cpu/vulnerabilities/retbleed:Not affected +/sys/devices/system/cpu/vulnerabilities/spec_rstack_overflow:Not affected +/sys/devices/system/cpu/vulnerabilities/spec_store_bypass:Not affected +/sys/devices/system/cpu/vulnerabilities/spectre_v1:Mitigation: usercopy/swapgs barriers and __user pointer sanitization +/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Retpolines; STIBP: disabled; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected +/sys/devices/system/cpu/vulnerabilities/srbds:Not affected +/sys/devices/system/cpu/vulnerabilities/tsa:Not affected +/sys/devices/system/cpu/vulnerabilities/tsx_async_abort:Not affected +/sys/devices/system/cpu/vulnerabilities/vmscape:Not affected +[ 7.516080] ACPI: PM: Preparing to enter system sleep state S5 +[ 7.521893] reboot: Power down diff --git a/toyos-t14linux/s0/tcg/qemu-version.txt b/toyos-t14linux/s0/tcg/qemu-version.txt new file mode 100644 index 00000000000..6b0ae6180b7 --- /dev/null +++ b/toyos-t14linux/s0/tcg/qemu-version.txt @@ -0,0 +1,2 @@ +QEMU emulator version 11.1.1 +Copyright (c) 2003-2026 Fabrice Bellard and the QEMU Project developers diff --git a/toyos-t14linux/src/tests.rs b/toyos-t14linux/src/tests.rs index 5ad006b737d..3014253868a 100644 --- a/toyos-t14linux/src/tests.rs +++ b/toyos-t14linux/src/tests.rs @@ -1,5 +1,6 @@ -//! Every value here is synthetic: the shape `capture.sh` and `tcg.sh` write, -//! never a reading of the T14. +//! Every value here but [`the_committed_capture_reads_and_its_lines_are_s0s`] +//! is synthetic: the shape `capture.sh` and `tcg.sh` write, never a reading of +//! the T14. use super::*; @@ -344,3 +345,31 @@ fn a_tcg_capture_of_another_kernel_qemu_or_file_set_is_refused() { assert!(parse_tcg(&files).unwrap_err().contains(name)); } } + +/// `s0/t14` and `s0/tcg` are S0's committed capture, not the fixture above: +/// this is the one test that reads the T14 itself. +fn s0(leaf: &str) -> std::path::PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("s0").join(leaf) +} + +#[test] +fn the_committed_capture_reads_and_its_lines_are_s0s() { + let t14 = T14::read(&s0("t14")).unwrap(); + let tcg = Tcg::read(&s0("tcg"), &t14).unwrap(); + assert_eq!(t14.mmap_rnd_bits, 32); + assert_eq!( + t14.lines["spectre_v2"], + "Mitigation: Enhanced / Automatic IBRS; IBPB: conditional; \ + PBRSB-eIBRS: SW sequence; BHI: SW loop, KVM: SW loop" + ); + assert_eq!(t14.lines["gather_data_sampling"], "Mitigation: Microcode"); + assert_eq!( + t14.lines["indirect_target_selection"], + "Mitigation: Aligned branch/return thunks" + ); + assert_eq!( + tcg.lines["spectre_v2"], + "Mitigation: Retpolines; STIBP: disabled; RSB filling; \ + PBRSB-eIBRS: Not affected; BHI: Not affected" + ); +}