From f3f2a5d7324dd890fbbb0badf18e0fccb16c7fbb Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Wed, 24 Nov 2021 17:46:02 +0800 Subject: [PATCH 01/44] chore: modify conf to compile --- .gitignore | 1 + Makefile | 2 +- zCore/Makefile | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ebf176ba..7c42649f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ stdout-zcore scripts/script.sh stdout-baremetal-test-rv64 stdout-rv64 +zCore/generic_fw_jump.bin diff --git a/Makefile b/Makefile index 0d9207c8..23b18f38 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ROOTFS_URL := http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/$(ROOTF RISCV64_ROOTFS_TAR := prebuild.tar.xz RISCV64_ROOTFS_URL := https://github.com/rcore-os/libc-test-prebuilt/releases/download/0.1/$(RISCV64_ROOTFS_TAR) -ARCH ?= x86_64 +ARCH ?= riscv64 rcore_fs_fuse_revision := 7f5eeac OUT_IMG := zCore/$(ARCH).img TMP_ROOTFS := /tmp/rootfs diff --git a/zCore/Makefile b/zCore/Makefile index 30783580..15aa69e4 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -1,10 +1,10 @@ ################ Arguments ################ -ARCH ?= x86_64 +ARCH ?= riscv64 PLATFORM ?= qemu -MODE ?= debug +MODE ?= release LOG ?= warn -LINUX ?= +LINUX ?= 1 LIBOS ?= GRAPHIC ?= HYPERVISOR ?= @@ -137,7 +137,7 @@ ifeq ($(ARCH), x86_64) else ifeq ($(ARCH), riscv64) qemu_opts += \ -machine virt \ - -bios default \ + -bios generic_fw_jump.bin \ -m 512M \ -no-reboot \ -no-shutdown \ From b0795b007dfc4eb34b57214c47ce90c43254e9de Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Thu, 25 Nov 2021 21:16:25 +0800 Subject: [PATCH 02/44] to: debug riscv muticore --- .gitignore | 1 + drivers/src/builder/devicetree.rs | 1 + drivers/src/irq/riscv_intc.rs | 2 + drivers/src/irq/riscv_plic.rs | 47 +++++++++++++++++++-- drivers/src/scheme/irq.rs | 6 +++ kernel-hal/src/bare/arch/riscv/cpu.rs | 8 ++++ kernel-hal/src/bare/arch/riscv/drivers.rs | 2 + kernel-hal/src/bare/arch/riscv/interrupt.rs | 14 +++++- kernel-hal/src/bare/arch/riscv/mod.rs | 13 +++++- kernel-hal/src/bare/arch/riscv/trap.rs | 3 ++ kernel-hal/src/bare/mod.rs | 2 +- loader/src/linux.rs | 1 + zCore/Makefile | 2 +- zCore/src/main.rs | 9 ++++ zCore/src/platform/riscv/boot/entry64.asm | 5 ++- zCore/src/platform/riscv/entry.rs | 5 +++ 16 files changed, 111 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 7c42649f..6ccafb83 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ scripts/script.sh stdout-baremetal-test-rv64 stdout-rv64 zCore/generic_fw_jump.bin +zCore/fw_jump.bin diff --git a/drivers/src/builder/devicetree.rs b/drivers/src/builder/devicetree.rs index 03616e22..1e117fca 100644 --- a/drivers/src/builder/devicetree.rs +++ b/drivers/src/builder/devicetree.rs @@ -231,6 +231,7 @@ fn register_interrupt( "device-tree: register interrupts for {:?}: {:?}, irq_num={:#x}", intc.dev, dev.dev, irq_num ); + log::warn!("register device: irq={} dev={:?}", irq_num, dev.dev); irq.register_device(irq_num, dev.dev.inner())?; // enable the interrupt after registration irq.unmask(irq_num)?; diff --git a/drivers/src/irq/riscv_intc.rs b/drivers/src/irq/riscv_intc.rs index 926286a7..6575b91e 100644 --- a/drivers/src/irq/riscv_intc.rs +++ b/drivers/src/irq/riscv_intc.rs @@ -59,6 +59,7 @@ impl Scheme for Intc { } fn handle_irq(&self, cause: usize) { + // log::warn!("intc: handle_irq"); self.with_handler(cause, |opt| { if let Some(h) = opt { h(); @@ -101,6 +102,7 @@ impl IrqScheme for Intc { } fn register_handler(&self, cause: usize, handler: IrqHandler) -> DeviceResult { + log::warn!("riscv-intc cause={}", cause); self.with_handler(cause, |opt| { if opt.is_some() { Err(DeviceError::AlreadyExists) diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index 7da5cbee..ec089ae4 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -16,6 +16,10 @@ const PLIC_CONTEXT_BASE: usize = 0x20_1000; const PLIC_CONTEXT_THRESHOLD: usize = 0x0; const PLIC_CONTEXT_CLAIM: usize = 0x4 / core::mem::size_of::(); +const PLIC_ENABLE_HART_OFFSET: usize = 0x100; +const PLIC_PRIORITY_HART_OFFSET: usize = 0x2000; +const PLIC_CONTEXT_CLAIM_HART_OFFSET: usize = 0x2000; + struct PlicUnlocked { priority_base: &'static mut Mmio, enable_base: &'static mut Mmio, @@ -28,9 +32,15 @@ pub struct Plic { } impl PlicUnlocked { + /// Toggle irq enable on the current hart. fn toggle(&mut self, irq_num: usize, enable: bool) { debug_assert!(IRQ_RANGE.contains(&irq_num)); - let mmio = self.enable_base.add(irq_num / 32); + let hart_id = cpu_id() as usize; + let mmio = self + .enable_base + .add(PLIC_ENABLE_HART_OFFSET * hart_id) + .add(irq_num / 32); + let mask = 1 << (irq_num % 32); if enable { mmio.write(mmio.read() | mask); @@ -39,8 +49,15 @@ impl PlicUnlocked { } } + /// Ask the PLIC what type of interrupt is occurred on the current hart. fn pending_irq(&mut self) -> Option { - let irq_num = self.context_base.add(PLIC_CONTEXT_CLAIM).read() as usize; + let hart_id = cpu_id() as usize; + log::warn!("PLIC_CONTEXT_CLAIM={:x}", PLIC_CONTEXT_CLAIM); + let irq_num = self + .context_base + .add(PLIC_CONTEXT_CLAIM_HART_OFFSET * hart_id) + .add(PLIC_CONTEXT_CLAIM) + .read() as usize; if irq_num == 0 { None } else { @@ -48,38 +65,47 @@ impl PlicUnlocked { } } + /// Tell the PLIC we've served this IRQ. fn eoi(&mut self, irq_num: usize) { debug_assert!(IRQ_RANGE.contains(&irq_num)); + let hart_id = cpu_id() as usize; self.context_base .add(PLIC_CONTEXT_CLAIM) + .add(PLIC_CONTEXT_CLAIM_HART_OFFSET * hart_id) .write(irq_num as _); } + /// Set the priority for the irq_num. fn set_priority(&mut self, irq_num: usize, priority: u8) { debug_assert!(IRQ_RANGE.contains(&irq_num)); self.priority_base.add(irq_num).write(priority as _); } + /// Set current hart's priority threshold to 0. fn set_threshold(&mut self, threshold: u8) { + let hart_id = cpu_id() as usize; + log::warn!("hart id ={}", hart_id); self.context_base + .add(PLIC_PRIORITY_HART_OFFSET * hart_id) .add(PLIC_CONTEXT_THRESHOLD) .write(threshold as _); } - fn init(&mut self) { + fn init_hart(&mut self) { self.set_threshold(0); } } impl Plic { pub fn new(base: usize) -> Self { + log::warn!("plic base {:x}", base); let mut inner = PlicUnlocked { priority_base: unsafe { Mmio::::from_base(base + PLIC_PRIORITY_BASE) }, enable_base: unsafe { Mmio::::from_base(base + PLIC_ENABLE_BASE) }, context_base: unsafe { Mmio::::from_base(base + PLIC_CONTEXT_BASE) }, manager: IrqManager::new(IRQ_RANGE), }; - inner.init(); + inner.init_hart(); Self { inner: Mutex::new(inner), } @@ -126,6 +152,7 @@ impl IrqScheme for Plic { } fn register_handler(&self, irq_num: usize, handler: IrqHandler) -> DeviceResult { + log::warn!("riscv-plic irq_num={}", irq_num); let mut inner = self.inner.lock(); inner.manager.register_handler(irq_num, handler).map(|_| { inner.set_priority(irq_num, 7); @@ -135,4 +162,16 @@ impl IrqScheme for Plic { fn unregister(&self, irq_num: usize) -> DeviceResult { self.inner.lock().manager.unregister_handler(irq_num) } + + fn init_hart(&self) { + self.inner.lock().init_hart(); + } +} + +fn cpu_id() -> u8 { + let mut cpu_id = 0; + unsafe { + asm!("mv {0}, tp", out(reg) cpu_id); + } + cpu_id } diff --git a/drivers/src/scheme/irq.rs b/drivers/src/scheme/irq.rs index 5f1a70ed..9e913f51 100644 --- a/drivers/src/scheme/irq.rs +++ b/drivers/src/scheme/irq.rs @@ -69,4 +69,10 @@ pub trait IrqScheme: Scheme { ) -> DeviceResult { unimplemented!() } + + /// Init irq for current cpu. + /// Some IRQ hardware requires per-CPU initialization. + fn init_hart(&self) { + unimplemented!() + } } diff --git a/kernel-hal/src/bare/arch/riscv/cpu.rs b/kernel-hal/src/bare/arch/riscv/cpu.rs index ae28d564..06d5a6df 100644 --- a/kernel-hal/src/bare/arch/riscv/cpu.rs +++ b/kernel-hal/src/bare/arch/riscv/cpu.rs @@ -6,5 +6,13 @@ hal_fn_impl! { const DEFAULT: u16 = 2600; DEFAULT } + + fn cpu_id() -> u8 { + let mut cpu_id; + unsafe { + asm!("mv {0}, tp", out(reg) cpu_id); + } + cpu_id + } } } diff --git a/kernel-hal/src/bare/arch/riscv/drivers.rs b/kernel-hal/src/bare/arch/riscv/drivers.rs index 040dd241..98c69577 100644 --- a/kernel-hal/src/bare/arch/riscv/drivers.rs +++ b/kernel-hal/src/bare/arch/riscv/drivers.rs @@ -48,6 +48,7 @@ impl IoMapper for IoMapperImpl { /// Initialize device drivers. pub(super) fn init() -> DeviceResult { + log::warn!("enter dev init"); // prase DTB and probe devices let dev_list = DevicetreeDriverBuilder::new(phys_to_virt(crate::KCONFIG.dtb_paddr), IoMapperImpl)? @@ -61,6 +62,7 @@ pub(super) fn init() -> DeviceResult { } } + log::warn!("find irq"); let irq = drivers::all_irq() .find("riscv-intc") .expect("IRQ device 'riscv-intc' not initialized!"); diff --git a/kernel-hal/src/bare/arch/riscv/interrupt.rs b/kernel-hal/src/bare/arch/riscv/interrupt.rs index 0ebd72b2..8443e4ff 100644 --- a/kernel-hal/src/bare/arch/riscv/interrupt.rs +++ b/kernel-hal/src/bare/arch/riscv/interrupt.rs @@ -14,7 +14,19 @@ hal_fn_impl! { } fn handle_irq(cause: usize) { - crate::drivers::all_irq().first_unwrap().handle_irq(cause) + // supervisor software interrupt and + // supervisor timer interrupt + if cause == 1 || cause == 5 { + crate::drivers::all_irq(). + find("riscv-intc"). + expect("IRQ device 'riscv-intc' not initialized!") + .handle_irq(cause); + } else { + crate::drivers::all_irq(). + find("riscv-plic"). + expect("IRQ device 'riscv-intc' not initialized!") + .handle_irq(cause); + } } } } diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index 15017a74..18104719 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -1,5 +1,5 @@ mod drivers; -mod sbi; +pub mod sbi; mod trap; pub mod config; @@ -12,6 +12,7 @@ pub mod vm; use alloc::{string::String, vec::Vec}; use core::ops::Range; use zcore_drivers::utils::devicetree::Devicetree; +use zcore_drivers::irq::riscv::ScauseIntCode; use crate::{mem::phys_to_virt, utils::init_once::InitOnce, PhysAddr}; @@ -48,4 +49,12 @@ pub fn primary_init() { timer::init(); } -pub fn secondary_init() {} +pub fn secondary_init() { + vm::init(); + let irq = crate::drivers::all_irq() + .find("riscv-intc") + .expect("IRQ device 'riscv-intc' not initialized!"); + irq.unmask(ScauseIntCode::SupervisorSoft as usize).unwrap(); + irq.unmask(ScauseIntCode::SupervisorTimer as usize).unwrap(); + irq.init_hart(); +} diff --git a/kernel-hal/src/bare/arch/riscv/trap.rs b/kernel-hal/src/bare/arch/riscv/trap.rs index 211f60ec..d14bf6b4 100644 --- a/kernel-hal/src/bare/arch/riscv/trap.rs +++ b/kernel-hal/src/bare/arch/riscv/trap.rs @@ -26,6 +26,9 @@ pub(super) fn super_soft() { #[no_mangle] pub extern "C" fn trap_handler(tf: &mut TrapFrame) { let scause = scause::read(); + if scause.code() != 5 { + log::warn!("super_soft code={}", scause.code()); + } match TrapReason::from(scause) { TrapReason::SoftwareBreakpoint => breakpoint(&mut tf.sepc), TrapReason::PageFault(vaddr, flags) => crate::KHANDLER.handle_page_fault(vaddr, flags), diff --git a/kernel-hal/src/bare/mod.rs b/kernel-hal/src/bare/mod.rs index 94a8457c..a4808d1f 100644 --- a/kernel-hal/src/bare/mod.rs +++ b/kernel-hal/src/bare/mod.rs @@ -5,7 +5,7 @@ cfg_if! { pub use self::arch::special as x86_64; } else if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] { #[path = "arch/riscv/mod.rs"] - mod arch; + pub mod arch; } } diff --git a/loader/src/linux.rs b/loader/src/linux.rs index fcf5f370..042bb9f8 100644 --- a/loader/src/linux.rs +++ b/loader/src/linux.rs @@ -92,6 +92,7 @@ async fn handle_user_trap(thread: &CurrentThread, mut ctx: Box) -> thread.put_context(ctx); match reason { TrapReason::Interrupt(vector) => { + log::warn!("irq={}", vector); kernel_hal::interrupt::handle_irq(vector); kernel_hal::thread::yield_now().await; Ok(()) diff --git a/zCore/Makefile b/zCore/Makefile index 15aa69e4..786b0437 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -14,7 +14,7 @@ USER ?= ZBI ?= bringup CMDLINE ?= -SMP ?= 1 +SMP ?= 2 ACCEL ?= OBJDUMP ?= rust-objdump --print-imm-hex --x86-asm-syntax=intel diff --git a/zCore/src/main.rs b/zCore/src/main.rs index d7b155cf..835a2727 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -2,6 +2,7 @@ #![cfg_attr(not(feature = "libos"), no_std)] #![feature(global_asm)] #![feature(lang_items)] +#![feature(asm)] #![deny(warnings)] // comment this on develop extern crate alloc; @@ -34,6 +35,14 @@ fn primary_main(config: kernel_hal::KernelConfig) { memory::init_frame_allocator(&kernel_hal::mem::free_pmem_regions()); kernel_hal::primary_init(); + // for i in 0..=1 { + // if i != kernel_hal::cpu::cpu_id() { + // let ipi_mask = 1usize << i; + // warn!("send ipi to {}, mask={}", i, ipi_mask); + // kernel_hal::arch::sbi::send_ipi(&ipi_mask as *const usize as usize); + // warn!("send ipi to {}, finish", i); + // } + // } cfg_if! { if #[cfg(all(feature = "linux", feature = "zircon"))] { panic!("Feature `linux` and `zircon` cannot be enabled at the same time!"); diff --git a/zCore/src/platform/riscv/boot/entry64.asm b/zCore/src/platform/riscv/boot/entry64.asm index 9e4be29f..13c63c89 100644 --- a/zCore/src/platform/riscv/boot/entry64.asm +++ b/zCore/src/platform/riscv/boot/entry64.asm @@ -42,9 +42,12 @@ _start: #刷新TLB sfence.vma - + # li t0, 4096 * 8 + # mul t0, t0, a0 #此时在虚拟内存空间,设置sp为虚拟地址 lui sp, %hi(bootstacktop) + # sub sp, sp, t0 + lui t0, %hi(rust_main) addi t0, t0, %lo(rust_main) jr t0 diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index 7762ec4d..bc4f9e33 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -10,6 +10,10 @@ use kernel_hal::KernelConfig; #[no_mangle] pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! { + unsafe { + asm!("mv tp, {0}", in(reg) hartid); + }; + println!( "zCore rust_main(hartid: {}, device_tree_paddr: {:#x})", hartid, device_tree_paddr @@ -18,6 +22,7 @@ pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! { phys_to_virt_offset: PHYSICAL_MEMORY_OFFSET, dtb_paddr: device_tree_paddr, }; + crate::primary_main(config); unreachable!() } From ca6472c987f9d1e9a809257da846cd02811ff327 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 26 Nov 2021 13:00:42 +0800 Subject: [PATCH 03/44] fix: change offset between cpus in riscv plic --- drivers/src/builder/devicetree.rs | 9 +++++++-- drivers/src/irq/riscv_intc.rs | 5 ++++- drivers/src/irq/riscv_plic.rs | 10 ++++++---- kernel-hal/src/bare/arch/riscv/interrupt.rs | 14 +------------- zCore/Makefile | 2 +- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/src/builder/devicetree.rs b/drivers/src/builder/devicetree.rs index 1e117fca..0c5e09b2 100644 --- a/drivers/src/builder/devicetree.rs +++ b/drivers/src/builder/devicetree.rs @@ -123,7 +123,7 @@ impl DevicetreeDriverBuilder { .query_or_map(paddr as usize, size as usize) .ok_or(DeviceError::NoResources) }); - + log::warn!("parse_intc={:?}", comp); use crate::irq::*; let dev = Device::Irq(match comp { #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] @@ -231,7 +231,12 @@ fn register_interrupt( "device-tree: register interrupts for {:?}: {:?}, irq_num={:#x}", intc.dev, dev.dev, irq_num ); - log::warn!("register device: irq={} dev={:?}", irq_num, dev.dev); + log::warn! ( + "register device: irq_dev_addr={:x} irq={} dev={:?}", + irq as *const _ as usize, + irq_num, + dev.dev + ); irq.register_device(irq_num, dev.dev.inner())?; // enable the interrupt after registration irq.unmask(irq_num)?; diff --git a/drivers/src/irq/riscv_intc.rs b/drivers/src/irq/riscv_intc.rs index 6575b91e..7c5e219e 100644 --- a/drivers/src/irq/riscv_intc.rs +++ b/drivers/src/irq/riscv_intc.rs @@ -24,6 +24,7 @@ pub struct Intc { impl Intc { pub fn new() -> Self { + log::warn!("riscv intc new()"); Self { soft_handler: Mutex::new(None), timer_handler: Mutex::new(None), @@ -59,7 +60,9 @@ impl Scheme for Intc { } fn handle_irq(&self, cause: usize) { - // log::warn!("intc: handle_irq"); + if cause == 9 { + log::warn!("intc handle_irq, supervisor "); + } self.with_handler(cause, |opt| { if let Some(h) = opt { h(); diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index ec089ae4..14c32b35 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -16,9 +16,9 @@ const PLIC_CONTEXT_BASE: usize = 0x20_1000; const PLIC_CONTEXT_THRESHOLD: usize = 0x0; const PLIC_CONTEXT_CLAIM: usize = 0x4 / core::mem::size_of::(); -const PLIC_ENABLE_HART_OFFSET: usize = 0x100; -const PLIC_PRIORITY_HART_OFFSET: usize = 0x2000; -const PLIC_CONTEXT_CLAIM_HART_OFFSET: usize = 0x2000; +const PLIC_ENABLE_HART_OFFSET: usize = 0x100 / core::mem::size_of::(); +const PLIC_PRIORITY_HART_OFFSET: usize = 0x2000 / core::mem::size_of::(); +const PLIC_CONTEXT_CLAIM_HART_OFFSET: usize = 0x2000 / core::mem::size_of::(); struct PlicUnlocked { priority_base: &'static mut Mmio, @@ -52,7 +52,6 @@ impl PlicUnlocked { /// Ask the PLIC what type of interrupt is occurred on the current hart. fn pending_irq(&mut self) -> Option { let hart_id = cpu_id() as usize; - log::warn!("PLIC_CONTEXT_CLAIM={:x}", PLIC_CONTEXT_CLAIM); let irq_num = self .context_base .add(PLIC_CONTEXT_CLAIM_HART_OFFSET * hart_id) @@ -118,6 +117,7 @@ impl Scheme for Plic { } fn handle_irq(&self, _unused: usize) { + log::warn!("riscv plic: handle irq"); let mut inner = self.inner.lock(); while let Some(irq_num) = inner.pending_irq() { if inner.manager.handle(irq_num).is_err() { @@ -134,6 +134,7 @@ impl IrqScheme for Plic { } fn mask(&self, irq_num: usize) -> DeviceResult { + log::warn!("riscv-plic mask irq={}, cpu={}", irq_num, cpu_id()); if self.is_valid_irq(irq_num) { self.inner.lock().toggle(irq_num, false); Ok(()) @@ -143,6 +144,7 @@ impl IrqScheme for Plic { } fn unmask(&self, irq_num: usize) -> DeviceResult { + log::warn!("riscv-plic umask irq={}, cpu={}", irq_num, cpu_id()); if self.is_valid_irq(irq_num) { self.inner.lock().toggle(irq_num, true); Ok(()) diff --git a/kernel-hal/src/bare/arch/riscv/interrupt.rs b/kernel-hal/src/bare/arch/riscv/interrupt.rs index 8443e4ff..0ebd72b2 100644 --- a/kernel-hal/src/bare/arch/riscv/interrupt.rs +++ b/kernel-hal/src/bare/arch/riscv/interrupt.rs @@ -14,19 +14,7 @@ hal_fn_impl! { } fn handle_irq(cause: usize) { - // supervisor software interrupt and - // supervisor timer interrupt - if cause == 1 || cause == 5 { - crate::drivers::all_irq(). - find("riscv-intc"). - expect("IRQ device 'riscv-intc' not initialized!") - .handle_irq(cause); - } else { - crate::drivers::all_irq(). - find("riscv-plic"). - expect("IRQ device 'riscv-intc' not initialized!") - .handle_irq(cause); - } + crate::drivers::all_irq().first_unwrap().handle_irq(cause) } } } diff --git a/zCore/Makefile b/zCore/Makefile index 786b0437..f6bc74a7 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -14,7 +14,7 @@ USER ?= ZBI ?= bringup CMDLINE ?= -SMP ?= 2 +SMP ?= 5 ACCEL ?= OBJDUMP ?= rust-objdump --print-imm-hex --x86-asm-syntax=intel From 28859d252fe2636d96f203e0d58a6d7a36da1370 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 26 Nov 2021 13:10:05 +0800 Subject: [PATCH 04/44] style: clean debug log --- drivers/src/builder/devicetree.rs | 8 +------- drivers/src/irq/riscv_intc.rs | 5 ----- drivers/src/irq/riscv_plic.rs | 6 ------ kernel-hal/src/bare/arch/riscv/drivers.rs | 2 -- kernel-hal/src/bare/arch/riscv/trap.rs | 3 --- loader/src/linux.rs | 1 - 6 files changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/src/builder/devicetree.rs b/drivers/src/builder/devicetree.rs index 0c5e09b2..4738b429 100644 --- a/drivers/src/builder/devicetree.rs +++ b/drivers/src/builder/devicetree.rs @@ -123,7 +123,6 @@ impl DevicetreeDriverBuilder { .query_or_map(paddr as usize, size as usize) .ok_or(DeviceError::NoResources) }); - log::warn!("parse_intc={:?}", comp); use crate::irq::*; let dev = Device::Irq(match comp { #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] @@ -231,12 +230,7 @@ fn register_interrupt( "device-tree: register interrupts for {:?}: {:?}, irq_num={:#x}", intc.dev, dev.dev, irq_num ); - log::warn! ( - "register device: irq_dev_addr={:x} irq={} dev={:?}", - irq as *const _ as usize, - irq_num, - dev.dev - ); + irq.register_device(irq_num, dev.dev.inner())?; // enable the interrupt after registration irq.unmask(irq_num)?; diff --git a/drivers/src/irq/riscv_intc.rs b/drivers/src/irq/riscv_intc.rs index 7c5e219e..926286a7 100644 --- a/drivers/src/irq/riscv_intc.rs +++ b/drivers/src/irq/riscv_intc.rs @@ -24,7 +24,6 @@ pub struct Intc { impl Intc { pub fn new() -> Self { - log::warn!("riscv intc new()"); Self { soft_handler: Mutex::new(None), timer_handler: Mutex::new(None), @@ -60,9 +59,6 @@ impl Scheme for Intc { } fn handle_irq(&self, cause: usize) { - if cause == 9 { - log::warn!("intc handle_irq, supervisor "); - } self.with_handler(cause, |opt| { if let Some(h) = opt { h(); @@ -105,7 +101,6 @@ impl IrqScheme for Intc { } fn register_handler(&self, cause: usize, handler: IrqHandler) -> DeviceResult { - log::warn!("riscv-intc cause={}", cause); self.with_handler(cause, |opt| { if opt.is_some() { Err(DeviceError::AlreadyExists) diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index 14c32b35..8751b52a 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -83,7 +83,6 @@ impl PlicUnlocked { /// Set current hart's priority threshold to 0. fn set_threshold(&mut self, threshold: u8) { let hart_id = cpu_id() as usize; - log::warn!("hart id ={}", hart_id); self.context_base .add(PLIC_PRIORITY_HART_OFFSET * hart_id) .add(PLIC_CONTEXT_THRESHOLD) @@ -97,7 +96,6 @@ impl PlicUnlocked { impl Plic { pub fn new(base: usize) -> Self { - log::warn!("plic base {:x}", base); let mut inner = PlicUnlocked { priority_base: unsafe { Mmio::::from_base(base + PLIC_PRIORITY_BASE) }, enable_base: unsafe { Mmio::::from_base(base + PLIC_ENABLE_BASE) }, @@ -117,7 +115,6 @@ impl Scheme for Plic { } fn handle_irq(&self, _unused: usize) { - log::warn!("riscv plic: handle irq"); let mut inner = self.inner.lock(); while let Some(irq_num) = inner.pending_irq() { if inner.manager.handle(irq_num).is_err() { @@ -134,7 +131,6 @@ impl IrqScheme for Plic { } fn mask(&self, irq_num: usize) -> DeviceResult { - log::warn!("riscv-plic mask irq={}, cpu={}", irq_num, cpu_id()); if self.is_valid_irq(irq_num) { self.inner.lock().toggle(irq_num, false); Ok(()) @@ -144,7 +140,6 @@ impl IrqScheme for Plic { } fn unmask(&self, irq_num: usize) -> DeviceResult { - log::warn!("riscv-plic umask irq={}, cpu={}", irq_num, cpu_id()); if self.is_valid_irq(irq_num) { self.inner.lock().toggle(irq_num, true); Ok(()) @@ -154,7 +149,6 @@ impl IrqScheme for Plic { } fn register_handler(&self, irq_num: usize, handler: IrqHandler) -> DeviceResult { - log::warn!("riscv-plic irq_num={}", irq_num); let mut inner = self.inner.lock(); inner.manager.register_handler(irq_num, handler).map(|_| { inner.set_priority(irq_num, 7); diff --git a/kernel-hal/src/bare/arch/riscv/drivers.rs b/kernel-hal/src/bare/arch/riscv/drivers.rs index 98c69577..040dd241 100644 --- a/kernel-hal/src/bare/arch/riscv/drivers.rs +++ b/kernel-hal/src/bare/arch/riscv/drivers.rs @@ -48,7 +48,6 @@ impl IoMapper for IoMapperImpl { /// Initialize device drivers. pub(super) fn init() -> DeviceResult { - log::warn!("enter dev init"); // prase DTB and probe devices let dev_list = DevicetreeDriverBuilder::new(phys_to_virt(crate::KCONFIG.dtb_paddr), IoMapperImpl)? @@ -62,7 +61,6 @@ pub(super) fn init() -> DeviceResult { } } - log::warn!("find irq"); let irq = drivers::all_irq() .find("riscv-intc") .expect("IRQ device 'riscv-intc' not initialized!"); diff --git a/kernel-hal/src/bare/arch/riscv/trap.rs b/kernel-hal/src/bare/arch/riscv/trap.rs index d14bf6b4..211f60ec 100644 --- a/kernel-hal/src/bare/arch/riscv/trap.rs +++ b/kernel-hal/src/bare/arch/riscv/trap.rs @@ -26,9 +26,6 @@ pub(super) fn super_soft() { #[no_mangle] pub extern "C" fn trap_handler(tf: &mut TrapFrame) { let scause = scause::read(); - if scause.code() != 5 { - log::warn!("super_soft code={}", scause.code()); - } match TrapReason::from(scause) { TrapReason::SoftwareBreakpoint => breakpoint(&mut tf.sepc), TrapReason::PageFault(vaddr, flags) => crate::KHANDLER.handle_page_fault(vaddr, flags), diff --git a/loader/src/linux.rs b/loader/src/linux.rs index 042bb9f8..fcf5f370 100644 --- a/loader/src/linux.rs +++ b/loader/src/linux.rs @@ -92,7 +92,6 @@ async fn handle_user_trap(thread: &CurrentThread, mut ctx: Box) -> thread.put_context(ctx); match reason { TrapReason::Interrupt(vector) => { - log::warn!("irq={}", vector); kernel_hal::interrupt::handle_irq(vector); kernel_hal::thread::yield_now().await; Ok(()) From aab20a2fbd50ab3015fc0221b7f3a80f1b9735a5 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sun, 28 Nov 2021 18:54:48 +0800 Subject: [PATCH 05/44] to: muticore boot failed --- drivers/src/irq/riscv_plic.rs | 2 +- kernel-hal/src/bare/arch/riscv/mod.rs | 5 +-- kernel-hal/src/bare/arch/riscv/trap.rs | 7 ++++- kernel-hal/src/bare/mem.rs | 4 +++ kernel-hal/src/hal_fn.rs | 3 ++ zCore/Cargo.toml | 1 + zCore/Makefile | 6 ++-- zCore/src/main.rs | 37 +++++++++++++++-------- zCore/src/platform/riscv/boot/entry64.asm | 6 ++-- zCore/src/platform/riscv/entry.rs | 11 ++++--- 10 files changed, 55 insertions(+), 27 deletions(-) diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index 8751b52a..26756670 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -165,7 +165,7 @@ impl IrqScheme for Plic { } fn cpu_id() -> u8 { - let mut cpu_id = 0; + let mut cpu_id ; unsafe { asm!("mv {0}, tp", out(reg) cpu_id); } diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index 18104719..5dce3060 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -50,10 +50,11 @@ pub fn primary_init() { } pub fn secondary_init() { + log::warn!("secondary init"); vm::init(); let irq = crate::drivers::all_irq() - .find("riscv-intc") - .expect("IRQ device 'riscv-intc' not initialized!"); + .find("riscv-plic") + .expect("IRQ device 'riscv-plic' not initialized!"); irq.unmask(ScauseIntCode::SupervisorSoft as usize).unwrap(); irq.unmask(ScauseIntCode::SupervisorTimer as usize).unwrap(); irq.init_hart(); diff --git a/kernel-hal/src/bare/arch/riscv/trap.rs b/kernel-hal/src/bare/arch/riscv/trap.rs index 211f60ec..00855d59 100644 --- a/kernel-hal/src/bare/arch/riscv/trap.rs +++ b/kernel-hal/src/bare/arch/riscv/trap.rs @@ -25,10 +25,15 @@ pub(super) fn super_soft() { #[no_mangle] pub extern "C" fn trap_handler(tf: &mut TrapFrame) { + log::warn!("in trap handler"); let scause = scause::read(); match TrapReason::from(scause) { TrapReason::SoftwareBreakpoint => breakpoint(&mut tf.sepc), - TrapReason::PageFault(vaddr, flags) => crate::KHANDLER.handle_page_fault(vaddr, flags), + TrapReason::PageFault(vaddr, flags) => { + // log::warn!("sepc={:x}", riscv::register::sepc::read()); + // log::warn!("sstatus.spp={:?}", riscv::register::sstatus::read().spp()); + crate::KHANDLER.handle_page_fault(vaddr, flags) + }, TrapReason::Interrupt(vector) => crate::interrupt::handle_irq(vector), other => panic!("Undefined trap: {:x?} {:#x?}", other, tf), } diff --git a/kernel-hal/src/bare/mem.rs b/kernel-hal/src/bare/mem.rs index 23966ca4..391fe2fe 100644 --- a/kernel-hal/src/bare/mem.rs +++ b/kernel-hal/src/bare/mem.rs @@ -11,6 +11,10 @@ hal_fn_impl! { KCONFIG.phys_to_virt_offset + paddr } + fn virt_to_phys(vaddr: VirtAddr) -> PhysAddr { + vaddr - KCONFIG.phys_to_virt_offset + } + fn free_pmem_regions() -> Vec> { super::arch::mem::free_pmem_regions() } diff --git a/kernel-hal/src/hal_fn.rs b/kernel-hal/src/hal_fn.rs index cbfbf13c..1adb46e2 100644 --- a/kernel-hal/src/hal_fn.rs +++ b/kernel-hal/src/hal_fn.rs @@ -44,6 +44,9 @@ hal_fn_def! { /// Convert physical address to virtual address. pub(crate) fn phys_to_virt(paddr: PhysAddr) -> VirtAddr; + /// Convert virtual address to physical address. + pub fn virt_to_phys(vaddr: VirtAddr) -> PhysAddr; + /// Returns all free physical memory regions. pub fn free_pmem_regions() -> Vec>; diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index db182741..300bd5c9 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -39,6 +39,7 @@ zircon-object = { path = "../zircon-object" } linux-object = { path = "../linux-object", optional = true } rcore-fs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec", optional = true } rcore-fs-sfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec", optional = true } +riscv = { version = "0.7", features = ["inline-asm"] } # LibOS mode [target.'cfg(not(target_os = "none"))'.dependencies] diff --git a/zCore/Makefile b/zCore/Makefile index f6bc74a7..79fa42c1 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -2,7 +2,7 @@ ARCH ?= riscv64 PLATFORM ?= qemu -MODE ?= release +MODE ?= debug LOG ?= warn LINUX ?= 1 LIBOS ?= @@ -14,7 +14,7 @@ USER ?= ZBI ?= bringup CMDLINE ?= -SMP ?= 5 +SMP ?= 2 ACCEL ?= OBJDUMP ?= rust-objdump --print-imm-hex --x86-asm-syntax=intel @@ -137,7 +137,7 @@ ifeq ($(ARCH), x86_64) else ifeq ($(ARCH), riscv64) qemu_opts += \ -machine virt \ - -bios generic_fw_jump.bin \ + -bios fw_jump.bin \ -m 512M \ -no-reboot \ -no-shutdown \ diff --git a/zCore/src/main.rs b/zCore/src/main.rs index 835a2727..837b99fd 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -2,8 +2,12 @@ #![cfg_attr(not(feature = "libos"), no_std)] #![feature(global_asm)] #![feature(lang_items)] +#![feature(core_intrinsics)] #![feature(asm)] -#![deny(warnings)] // comment this on develop +// #![deny(warnings)] // comment this on develop + +use core::sync::atomic::{AtomicBool, Ordering}; +use lazy_static::*; extern crate alloc; #[macro_use] @@ -23,6 +27,8 @@ mod memory; mod platform; mod utils; +static STARTED: AtomicBool = AtomicBool::new(false); + fn primary_main(config: kernel_hal::KernelConfig) { logging::init(); memory::init_heap(); @@ -31,22 +37,15 @@ fn primary_main(config: kernel_hal::KernelConfig) { let options = utils::boot_options(); logging::set_max_level(&options.log_level); info!("Boot options: {:#?}", options); - memory::init_frame_allocator(&kernel_hal::mem::free_pmem_regions()); kernel_hal::primary_init(); - - // for i in 0..=1 { - // if i != kernel_hal::cpu::cpu_id() { - // let ipi_mask = 1usize << i; - // warn!("send ipi to {}, mask={}", i, ipi_mask); - // kernel_hal::arch::sbi::send_ipi(&ipi_mask as *const usize as usize); - // warn!("send ipi to {}, finish", i); - // } - // } + STARTED.store(true, Ordering::SeqCst); + log::warn!("PRIMARY_INITED"); cfg_if! { if #[cfg(all(feature = "linux", feature = "zircon"))] { panic!("Feature `linux` and `zircon` cannot be enabled at the same time!"); } else if #[cfg(feature = "linux")] { + log::info!("run prog"); let args = options.root_proc.split('?').map(Into::into).collect(); // parse "arg0?arg1?arg2" let envs = alloc::vec!["PATH=/usr/sbin:/usr/bin:/sbin:/bin".into()]; let rootfs = fs::rootfs(); @@ -62,8 +61,20 @@ fn primary_main(config: kernel_hal::KernelConfig) { } } -#[allow(dead_code)] -fn secondary_main() -> ! { +// #[allow(dead_code)] +fn secondary_main() { + let sp: usize; + unsafe { + riscv::register::sstatus::clear_sie(); + asm!("mv {0}, sp", out(reg) sp); + } + + println!("secondary_main sp={:x}", sp); + // loop { + while !STARTED.load(Ordering::SeqCst) {} + println!("secondary_main1"); + // } + // loop {} kernel_hal::secondary_init(); utils::wait_for_exit(None) } diff --git a/zCore/src/platform/riscv/boot/entry64.asm b/zCore/src/platform/riscv/boot/entry64.asm index 13c63c89..cb06e28f 100644 --- a/zCore/src/platform/riscv/boot/entry64.asm +++ b/zCore/src/platform/riscv/boot/entry64.asm @@ -42,11 +42,11 @@ _start: #刷新TLB sfence.vma - # li t0, 4096 * 8 - # mul t0, t0, a0 + li t0, 4096 * 16 + mul t0, t0, a0 #此时在虚拟内存空间,设置sp为虚拟地址 lui sp, %hi(bootstacktop) - # sub sp, sp, t0 + sub sp, sp, t0 lui t0, %hi(rust_main) addi t0, t0, %lo(rust_main) diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index bc4f9e33..f30db25d 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -7,22 +7,25 @@ global_asm!(include_str!("boot/entry64.asm")); use super::consts::*; use kernel_hal::KernelConfig; +const BOOT_HART_ID: usize = 0; #[no_mangle] pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! { unsafe { asm!("mv tp, {0}", in(reg) hartid); }; - println!( - "zCore rust_main(hartid: {}, device_tree_paddr: {:#x})", + "boot hart: zCore rust_main(hartid: {}, device_tree_paddr: {:#x})", hartid, device_tree_paddr ); let config = KernelConfig { phys_to_virt_offset: PHYSICAL_MEMORY_OFFSET, dtb_paddr: device_tree_paddr, }; - - crate::primary_main(config); + if hartid == BOOT_HART_ID { + crate::primary_main(config); + } else { + crate::secondary_main(); + } unreachable!() } From 29a3fd171d862295f08efc41813334655c64e140 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Wed, 1 Dec 2021 12:53:21 +0800 Subject: [PATCH 06/44] fix: riscv muticore oom panic --- kernel-hal/src/bare/arch/riscv/mod.rs | 1 - kernel-hal/src/bare/arch/riscv/trap.rs | 2 +- zCore/Makefile | 2 +- zCore/src/main.rs | 18 +++++------------- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index 5dce3060..bc7ad35f 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -50,7 +50,6 @@ pub fn primary_init() { } pub fn secondary_init() { - log::warn!("secondary init"); vm::init(); let irq = crate::drivers::all_irq() .find("riscv-plic") diff --git a/kernel-hal/src/bare/arch/riscv/trap.rs b/kernel-hal/src/bare/arch/riscv/trap.rs index 00855d59..e3aca650 100644 --- a/kernel-hal/src/bare/arch/riscv/trap.rs +++ b/kernel-hal/src/bare/arch/riscv/trap.rs @@ -25,7 +25,7 @@ pub(super) fn super_soft() { #[no_mangle] pub extern "C" fn trap_handler(tf: &mut TrapFrame) { - log::warn!("in trap handler"); + // log::warn!("in trap handler"); let scause = scause::read(); match TrapReason::from(scause) { TrapReason::SoftwareBreakpoint => breakpoint(&mut tf.sepc), diff --git a/zCore/Makefile b/zCore/Makefile index 79fa42c1..11f639ea 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -2,7 +2,7 @@ ARCH ?= riscv64 PLATFORM ?= qemu -MODE ?= debug +MODE ?= release LOG ?= warn LINUX ?= 1 LIBOS ?= diff --git a/zCore/src/main.rs b/zCore/src/main.rs index 837b99fd..fc71449e 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -40,7 +40,7 @@ fn primary_main(config: kernel_hal::KernelConfig) { memory::init_frame_allocator(&kernel_hal::mem::free_pmem_regions()); kernel_hal::primary_init(); STARTED.store(true, Ordering::SeqCst); - log::warn!("PRIMARY_INITED"); + cfg_if! { if #[cfg(all(feature = "linux", feature = "zircon"))] { panic!("Feature `linux` and `zircon` cannot be enabled at the same time!"); @@ -61,20 +61,12 @@ fn primary_main(config: kernel_hal::KernelConfig) { } } -// #[allow(dead_code)] +#[allow(dead_code)] fn secondary_main() { - let sp: usize; - unsafe { - riscv::register::sstatus::clear_sie(); - asm!("mv {0}, sp", out(reg) sp); - } - - println!("secondary_main sp={:x}", sp); - // loop { while !STARTED.load(Ordering::SeqCst) {} - println!("secondary_main1"); - // } - // loop {} + // Don't print anything between previous line and next line. + // boot hart already init uart, but others not maps uart mmio + // address. kernel_hal::secondary_init(); utils::wait_for_exit(None) } From 5d62288ae07337dc1afe224c1ac6e39704bc3a7e Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Tue, 7 Dec 2021 18:26:19 +0800 Subject: [PATCH 07/44] feature: support muticore scheduler --- kernel-hal/Cargo.toml | 3 ++- kernel-hal/src/bare/arch/riscv/mod.rs | 23 +++++++++++++++++++---- zCore/Cargo.toml | 3 ++- zCore/src/utils.rs | 8 +++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/kernel-hal/Cargo.toml b/kernel-hal/Cargo.toml index 80bb5488..fe2dc86e 100644 --- a/kernel-hal/Cargo.toml +++ b/kernel-hal/Cargo.toml @@ -33,7 +33,8 @@ bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator", rev = # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] -executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } +# executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } +executor = { path = "../../executor/executor"} naive-timer = "0.2.0" # All mode on x86_64 diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index bc7ad35f..d94aa5bf 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -51,10 +51,25 @@ pub fn primary_init() { pub fn secondary_init() { vm::init(); - let irq = crate::drivers::all_irq() + let intc = crate::drivers::all_irq() + .find("riscv-intc") + .expect("IRQ device 'riscv-intc' not initialized!"); + // register soft interrupts handler + // intc.register_handler( + // ScauseIntCode::SupervisorSoft as _, + // Box::new(trap::super_soft), + // ).unwrap(); + // // register timer interrupts handler + // intc.register_handler( + // ScauseIntCode::SupervisorTimer as _, + // Box::new(trap::super_timer), + // ).unwrap(); + intc.unmask(ScauseIntCode::SupervisorSoft as _).unwrap(); + intc.unmask(ScauseIntCode::SupervisorTimer as _).unwrap(); + + let plic = crate::drivers::all_irq() .find("riscv-plic") .expect("IRQ device 'riscv-plic' not initialized!"); - irq.unmask(ScauseIntCode::SupervisorSoft as usize).unwrap(); - irq.unmask(ScauseIntCode::SupervisorTimer as usize).unwrap(); - irq.init_hart(); + plic.init_hart(); + timer::init(); } diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index 300bd5c9..4afe3bc1 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -50,7 +50,8 @@ rcore-fs-hostfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] buddy_system_allocator = "0.7" -executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } +# executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } +executor = { path = "../../executor/executor"} # Bare-metal mode on x86_64 [target.'cfg(all(target_os = "none", target_arch = "x86_64"))'.dependencies] diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index 5f1cd00b..67e1dd84 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -96,9 +96,15 @@ pub fn wait_for_exit(proc: Option>) -> ! { let code = async_std::task::block_on(future); std::process::exit(code as i32); } + log::warn!("enter executor::run"); loop { #[cfg(not(feature = "libos"))] - executor::run_until_idle(); + executor::run(); kernel_hal::interrupt::wait_for_interrupt(); } } + +#[no_mangle] +fn wait_for_interrupt() { + kernel_hal::interrupt::wait_for_interrupt(); +} From d348277340f596a8028bd36563c146d202df55ab Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 31 Dec 2021 19:01:13 +0800 Subject: [PATCH 08/44] feat: riscv-intc support muticore --- drivers/src/irq/riscv_intc.rs | 9 ++++++++- kernel-hal/src/bare/arch/riscv/drivers.rs | 3 ++- kernel-hal/src/bare/arch/riscv/mod.rs | 23 ++++++++++++----------- zCore/src/main.rs | 1 - 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/src/irq/riscv_intc.rs b/drivers/src/irq/riscv_intc.rs index 926286a7..0100512e 100644 --- a/drivers/src/irq/riscv_intc.rs +++ b/drivers/src/irq/riscv_intc.rs @@ -4,11 +4,16 @@ use spin::Mutex; use crate::prelude::IrqHandler; use crate::scheme::{IrqScheme, Scheme}; use crate::{DeviceError, DeviceResult}; +use alloc::format; +use alloc::string::String; +use core::sync::atomic::{AtomicU8, Ordering}; const S_SOFT: usize = 1; const S_TIMER: usize = 5; const S_EXT: usize = 9; +static INTC_NUM: AtomicU8 = AtomicU8::new(0); + #[repr(usize)] pub enum ScauseIntCode { SupervisorSoft = S_SOFT, @@ -17,6 +22,7 @@ pub enum ScauseIntCode { } pub struct Intc { + name: String, soft_handler: Mutex>, timer_handler: Mutex>, ext_handler: Mutex>, @@ -25,6 +31,7 @@ pub struct Intc { impl Intc { pub fn new() -> Self { Self { + name: format!("riscv-intc-cpu{}", INTC_NUM.fetch_add(1, Ordering::Relaxed)), soft_handler: Mutex::new(None), timer_handler: Mutex::new(None), ext_handler: Mutex::new(None), @@ -55,7 +62,7 @@ impl Default for Intc { impl Scheme for Intc { fn name(&self) -> &str { - "riscv-intc" + self.name.as_str() } fn handle_irq(&self, cause: usize) { diff --git a/kernel-hal/src/bare/arch/riscv/drivers.rs b/kernel-hal/src/bare/arch/riscv/drivers.rs index 040dd241..7cd57867 100644 --- a/kernel-hal/src/bare/arch/riscv/drivers.rs +++ b/kernel-hal/src/bare/arch/riscv/drivers.rs @@ -1,4 +1,5 @@ use alloc::boxed::Box; +use alloc::format; use zcore_drivers::builder::{DevicetreeDriverBuilder, IoMapper}; use zcore_drivers::irq::riscv::ScauseIntCode; @@ -62,7 +63,7 @@ pub(super) fn init() -> DeviceResult { } let irq = drivers::all_irq() - .find("riscv-intc") + .find(format!("riscv-intc-cpu{}", crate::cpu::cpu_id()).as_str()) .expect("IRQ device 'riscv-intc' not initialized!"); // register soft interrupts handler irq.register_handler( diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index d94aa5bf..4b09532e 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -9,7 +9,7 @@ pub mod mem; pub mod timer; pub mod vm; -use alloc::{string::String, vec::Vec}; +use alloc::{format, boxed::Box, string::String, vec::Vec}; use core::ops::Range; use zcore_drivers::utils::devicetree::Devicetree; use zcore_drivers::irq::riscv::ScauseIntCode; @@ -52,18 +52,19 @@ pub fn primary_init() { pub fn secondary_init() { vm::init(); let intc = crate::drivers::all_irq() - .find("riscv-intc") + .find(format!("riscv-intc-cpu{}", crate::cpu::cpu_id()).as_str()) .expect("IRQ device 'riscv-intc' not initialized!"); + // register soft interrupts handler - // intc.register_handler( - // ScauseIntCode::SupervisorSoft as _, - // Box::new(trap::super_soft), - // ).unwrap(); - // // register timer interrupts handler - // intc.register_handler( - // ScauseIntCode::SupervisorTimer as _, - // Box::new(trap::super_timer), - // ).unwrap(); + intc.register_handler( + ScauseIntCode::SupervisorSoft as _, + Box::new(trap::super_soft), + ).unwrap(); + // register timer interrupts handler + intc.register_handler( + ScauseIntCode::SupervisorTimer as _, + Box::new(trap::super_timer), + ).unwrap(); intc.unmask(ScauseIntCode::SupervisorSoft as _).unwrap(); intc.unmask(ScauseIntCode::SupervisorTimer as _).unwrap(); diff --git a/zCore/src/main.rs b/zCore/src/main.rs index fc71449e..d62b073e 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -7,7 +7,6 @@ // #![deny(warnings)] // comment this on develop use core::sync::atomic::{AtomicBool, Ordering}; -use lazy_static::*; extern crate alloc; #[macro_use] From 96877b66f42678e40b956006a70990ba553430c9 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sun, 2 Jan 2022 16:08:28 +0800 Subject: [PATCH 09/44] fix: riscv occasionally produces oom errors --- zCore/Makefile | 2 +- zCore/src/platform/riscv/boot/entry64.asm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zCore/Makefile b/zCore/Makefile index 150d71d5..288219ad 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -14,7 +14,7 @@ USER ?= ZBI ?= bringup CMDLINE ?= -SMP ?= 2 +SMP ?= 5 ACCEL ?= OBJDUMP ?= rust-objdump --print-imm-hex --x86-asm-syntax=intel diff --git a/zCore/src/platform/riscv/boot/entry64.asm b/zCore/src/platform/riscv/boot/entry64.asm index cb06e28f..7f64cd4d 100644 --- a/zCore/src/platform/riscv/boot/entry64.asm +++ b/zCore/src/platform/riscv/boot/entry64.asm @@ -6,7 +6,7 @@ _start: #关闭mmu #csrw satp, zero - + bgtz a0, 2f #BSS节清零 la t0, sbss la t1, ebss @@ -56,7 +56,7 @@ _start: .align 12 .global bootstack bootstack: - .space 4096 * 32 + .space 4096 * 160 .global bootstacktop bootstacktop: From 4369dabcd7dcaf4d022062302f121810728861b2 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sun, 2 Jan 2022 16:18:51 +0800 Subject: [PATCH 10/44] fix: remove the code associated with print in secondary_init --- kernel-hal/src/bare/boot.rs | 3 ++- zCore/src/main.rs | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel-hal/src/bare/boot.rs b/kernel-hal/src/bare/boot.rs index 993437c0..16f1af5e 100644 --- a/kernel-hal/src/bare/boot.rs +++ b/kernel-hal/src/bare/boot.rs @@ -28,7 +28,8 @@ hal_fn_impl! { } fn secondary_init() { - info!("Secondary CPU {} init...", crate::cpu::cpu_id()); + // info!("Secondary CPU {} init...", crate::cpu::cpu_id()); + // we can't output anything here, see reason: zcore/main.rs::secondary_main() unsafe { trapframe::init() }; super::arch::secondary_init(); } diff --git a/zCore/src/main.rs b/zCore/src/main.rs index d62b073e..00f8f88f 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -64,8 +64,13 @@ fn primary_main(config: kernel_hal::KernelConfig) { fn secondary_main() { while !STARTED.load(Ordering::SeqCst) {} // Don't print anything between previous line and next line. - // boot hart already init uart, but others not maps uart mmio - // address. + // Boot hart has initialized the UART chip, so we will use + // UART for output instead of SBI, but the current HART is + // not mapped to UART MMIO, which means we can't output + // until secondary_init is complete. kernel_hal::secondary_init(); utils::wait_for_exit(None) } + +// Boot hart已经初始化UART芯片,所以后续我们将使用UART进行输出而不是SBI, +// 但是当前hart并映射UART MMIO,也就是说我们在secondary_init完成之前是不能够进行输出的 From 627eb34f103f2cba975f73fe3024c60c62e319c9 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Tue, 4 Jan 2022 12:42:43 +0800 Subject: [PATCH 11/44] panic print backtrace info --- .gitignore | 1 + zCore/src/lang.rs | 16 ++++++++++++++++ zCore/src/utils.rs | 14 ++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/.gitignore b/.gitignore index 487a8055..f105611a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ stdout-rv64 zCore/generic_fw_jump.bin zCore/fw_jump.bin zCore/src/platform/riscv/boot/kernel-vars.ld +zCore/bug.txt diff --git a/zCore/src/lang.rs b/zCore/src/lang.rs index 121da959..b54484f1 100644 --- a/zCore/src/lang.rs +++ b/zCore/src/lang.rs @@ -7,8 +7,10 @@ use log::*; #[panic_handler] fn panic(info: &PanicInfo) -> ! { + println!("\n\npanic cpu={}", kernel_hal::cpu::cpu_id()); println!("\n\n{}", info); error!("\n\n{}", info); + backtrace(); //error!("{:#?}", KCounterDescriptorArray::get()); loop { core::hint::spin_loop(); @@ -19,3 +21,17 @@ fn panic(info: &PanicInfo) -> ! { fn oom(_: Layout) -> ! { panic!("out of memory"); } + +fn backtrace() { + let s0: u64; + unsafe {asm!("mv {0}, fp", out(reg) s0);} + let mut fp = s0; + let x = 5; + println!("fp=0x{:x}", fp); + for _ in 0..5 { + unsafe { + println!("fn addr=0x{:x}", *((fp - 8) as *const u64)); + fp = *((fp - 16) as *const u64) + } + } +} diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index 67e1dd84..b14c9375 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -108,3 +108,17 @@ pub fn wait_for_exit(proc: Option>) -> ! { fn wait_for_interrupt() { kernel_hal::interrupt::wait_for_interrupt(); } + +async fn test_future(idx: usize) { + loop { + println!("my idx={}", idx); + use core::time::Duration; + kernel_hal::thread::sleep_until(Duration::from_secs(1)).await; + } +} + +fn spawn_test_future() { + for i in 0..10 { + executor::spawn(test_future(i)); + } +} From 05390dd7ba6e5e372f8486213c2e6939bd79d97f Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Tue, 11 Jan 2022 13:24:35 +0800 Subject: [PATCH 12/44] refactor: rewrite riscv muticode boot logic --- kernel-hal/src/bare/arch/riscv/mod.rs | 2 +- kernel-hal/src/bare/arch/riscv/sbi.rs | 67 ++++++++++++++++++----- kernel-hal/src/bare/mod.rs | 2 +- linux-user | 1 + zCore/Cargo.toml | 4 +- zCore/Makefile | 4 +- zCore/src/platform/riscv/boot/entry64.asm | 30 ++++++---- zCore/src/platform/riscv/entry.rs | 42 ++++++++++++-- 8 files changed, 118 insertions(+), 34 deletions(-) create mode 160000 linux-user diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index 1f1e0b09..94276853 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -1,5 +1,4 @@ mod drivers; -pub mod sbi; mod trap; pub mod config; @@ -8,6 +7,7 @@ pub mod interrupt; pub mod mem; pub mod timer; pub mod vm; +pub mod sbi; use alloc::{format, boxed::Box, string::String, vec::Vec}; use core::ops::Range; diff --git a/kernel-hal/src/bare/arch/riscv/sbi.rs b/kernel-hal/src/bare/arch/riscv/sbi.rs index 8c66f210..90e6cffc 100644 --- a/kernel-hal/src/bare/arch/riscv/sbi.rs +++ b/kernel-hal/src/bare/arch/riscv/sbi.rs @@ -1,5 +1,5 @@ #![allow(dead_code)] - +// Legacy Extensions (EIDs 0x00 - 0x0F) const SBI_SET_TIMER: usize = 0; const SBI_CONSOLE_PUTCHAR: usize = 1; const SBI_CONSOLE_GETCHAR: usize = 2; @@ -10,43 +10,84 @@ const SBI_REMOTE_SFENCE_VMA: usize = 6; const SBI_REMOTE_SFENCE_VMA_ASID: usize = 7; const SBI_SHUTDOWN: usize = 8; +// Hart State Management Extension +const HSM_EID: usize = 0x48534D; +const SBI_HART_START_FID: usize = 0; // SBI Verson=0.2 +const SBI_HART_STOP_FID: usize = 1; // SBI Verson=0.2 +const SBI_HART_GET_STATUS_FID: usize = 2; // SBI Verson=0.2 +const SBI_HART_SUSPEND_FID: usize = 3; // SBI Verson=0.3 + +// SBI Error Code +pub const SBI_SUCCESS: usize = 0; +pub const SBI_ERR_FAILED: usize = usize::MAX; // -1 +pub const SBI_ERR_NOT_SUPPORTED: usize = usize::MAX - 1; // -2 +pub const SBI_ERR_INVALID_PARAM: usize = usize::MAX - 2; // -3 +pub const SBI_ERR_DENIED: usize = usize::MAX - 3; // -4 +pub const SBI_ERR_INVALID_ADDRESS: usize = usize::MAX - 4; // -5 +pub const SBI_ERR_ALREADY_AVAILABLE: usize = usize::MAX - 5; // -6 +pub const SBI_ERR_ALREADY_STARTED: usize = usize::MAX - 6; // -7 +pub const SBI_ERR_ALREADY_STOPPED: usize = usize::MAX - 7; // -8 + #[inline(always)] -fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { +fn sbi_call(eid: usize, fid: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { let ret; unsafe { asm!("ecall", in("a0") arg0, in("a1") arg1, in("a2") arg2, - in("a7") which, + in("a6") fid, + in("a7") eid, lateout("a0") ret, ); } ret } -pub fn console_putchar(ch: usize) { - sbi_call(SBI_CONSOLE_PUTCHAR, ch, 0, 0); +pub fn console_putchar(ch: usize) -> usize { + return sbi_call(SBI_CONSOLE_PUTCHAR, 0, ch, 0, 0); } pub fn console_getchar() -> usize { - sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0) + return sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0, 0); } -pub fn set_timer(stime_value: u64) { +pub fn set_timer(stime_value: u64) -> usize { #[cfg(target_pointer_width = "32")] - sbi_call(SBI_SET_TIMER, stime_value as usize, (stime_value >> 32), 0); + return sbi_call( + SBI_SET_TIMER, + 0, + stime_value as usize, + (stime_value >> 32), + 0, + ); #[cfg(target_pointer_width = "64")] - sbi_call(SBI_SET_TIMER, stime_value as usize, 0, 0); + return sbi_call(SBI_SET_TIMER, 0, stime_value as usize, 0, 0); } -pub fn clear_ipi() { - sbi_call(SBI_CLEAR_IPI, 0, 0, 0); +pub fn clear_ipi() -> usize { + return sbi_call(SBI_CLEAR_IPI, 0, 0, 0, 0); } -pub fn send_ipi(sipi_value: usize) { - sbi_call(SBI_SEND_IPI, sipi_value, 0, 0); +pub fn send_ipi(sipi_value: usize) -> usize { + return sbi_call(SBI_SEND_IPI, 0, sipi_value, 0, 0); +} + +/// executing the target hart in supervisor-mode at address +/// specified by start_addr parameter +/// +/// The opaque parameter is a XLEN-bit value which will be +/// set in the a1 register when the hart starts executing +/// at start_addr. +pub fn hart_start(hartid: usize, start_addr: usize, opaque: usize) -> usize { + return sbi_call(HSM_EID, SBI_HART_START_FID, hartid, start_addr, opaque); +} + +/// stop executing the calling hart in supervisor-mode and return +/// it’s ownership to the SBI implementation. +pub fn hart_stop() -> usize { + return sbi_call(HSM_EID, SBI_HART_STOP_FID, 0, 0, 0); } hal_fn_impl! { diff --git a/kernel-hal/src/bare/mod.rs b/kernel-hal/src/bare/mod.rs index 29da5ed0..07caecd5 100644 --- a/kernel-hal/src/bare/mod.rs +++ b/kernel-hal/src/bare/mod.rs @@ -15,7 +15,7 @@ pub mod net; pub mod thread; pub mod timer; -pub use self::arch::{config, cpu, interrupt, vm}; +pub use self::arch::{config, cpu, interrupt, vm, sbi}; pub use super::hal_fn::{rand, vdso}; hal_fn_impl_default!(rand, vdso); diff --git a/linux-user b/linux-user new file mode 160000 index 00000000..2852c7ba --- /dev/null +++ b/linux-user @@ -0,0 +1 @@ +Subproject commit 2852c7ba04e9202ae0e87b0d02ecf76fb9e544a8 diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index 81422578..b9e5ad01 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -40,6 +40,8 @@ linux-object = { path = "../linux-object", optional = true } rcore-fs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec", optional = true } rcore-fs-sfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec", optional = true } riscv = { version = "0.7", features = ["inline-asm"] } +# const_env_impl = "0.1.3" + # LibOS mode [target.'cfg(not(target_os = "none"))'.dependencies] @@ -56,4 +58,4 @@ executor = { path = "../../executor/executor"} # Bare-metal mode on x86_64 [target.'cfg(all(target_os = "none", target_arch = "x86_64"))'.dependencies] rboot = { git = "https://github.com/rcore-os/rboot.git", rev = "39d6e24", default-features = false } -# rvm = { git = "https://github.com/rcore-os/RVM", rev = "e91d625", optional = true } +# rvm = { git = "https://github.com/rcore-os/RVM", rev = "e91d625", optional = true } \ No newline at end of file diff --git a/zCore/Makefile b/zCore/Makefile index 288219ad..f8e65318 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -137,7 +137,7 @@ ifeq ($(ARCH), x86_64) else ifeq ($(ARCH), riscv64) qemu_opts += \ -machine virt \ - -bios fw_jump.bin \ + -bios default \ -m 512M \ -no-reboot \ -no-shutdown \ @@ -204,7 +204,7 @@ debugrun: $(qemu_disk) .PHONY: kernel kernel: @echo Building zCore kenel - cargo build $(build_args) + SMP=$(SMP) cargo build $(build_args) .PHONY: disasm disasm: diff --git a/zCore/src/platform/riscv/boot/entry64.asm b/zCore/src/platform/riscv/boot/entry64.asm index 7f64cd4d..daed35de 100644 --- a/zCore/src/platform/riscv/boot/entry64.asm +++ b/zCore/src/platform/riscv/boot/entry64.asm @@ -6,20 +6,33 @@ _start: #关闭mmu #csrw satp, zero - bgtz a0, 2f #BSS节清零 la t0, sbss la t1, ebss - bgeu t0, t1, 2f + bgeu t0, t1, secondary_hart_start -1: +clear_bss_loop: # sd: store double word (64 bits) sd zero, (t0) addi t0, t0, 8 - bltu t0, t1, 1b - -2: + bltu t0, t1, clear_bss_loop +primary_hart: + call init_vm + lui t0, %hi(primary_rust_main) + addi t0, t0, %lo(primary_rust_main) + jr t0 + + +.globl secondary_hart_start +secondary_hart_start: + csrw sie, zero + call init_vm + lui t0, %hi(secondary_rust_main) + addi t0, t0, %lo(secondary_rust_main) + jr t0 + +init_vm: #la sp, bootstacktop #call rust_main @@ -47,10 +60,7 @@ _start: #此时在虚拟内存空间,设置sp为虚拟地址 lui sp, %hi(bootstacktop) sub sp, sp, t0 - - lui t0, %hi(rust_main) - addi t0, t0, %lo(rust_main) - jr t0 + ret .section .bss.stack .align 12 diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index f30db25d..b3f8f32d 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -6,11 +6,18 @@ global_asm!(include_str!("boot/boot_d1.asm")); global_asm!(include_str!("boot/entry64.asm")); use super::consts::*; +use kernel_hal::arch::sbi::{hart_start, send_ipi, SBI_SUCCESS}; use kernel_hal::KernelConfig; -const BOOT_HART_ID: usize = 0; +use core::str::FromStr; + +const SMP: &'static str = core::env!("SMP"); // Get HART number from the environment variable + +extern "C" { + fn secondary_hart_start(); +} #[no_mangle] -pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! { +pub extern "C" fn primary_rust_main(hartid: usize, device_tree_paddr: usize) -> ! { unsafe { asm!("mv tp, {0}", in(reg) hartid); }; @@ -22,10 +29,33 @@ pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! { phys_to_virt_offset: PHYSICAL_MEMORY_OFFSET, dtb_paddr: device_tree_paddr, }; - if hartid == BOOT_HART_ID { - crate::primary_main(config); - } else { - crate::secondary_main(); + for id in 0..usize::from_str(SMP).expect("can't parse SMP as usize.") { + if id != hartid { + let err_code = hart_start( + id, + secondary_hart_start as usize - PHYSICAL_MEMORY_OFFSET, // cal physical address + 0, + ); + if err_code != SBI_SUCCESS { + panic!("start hart{} failed. error code={}", id, err_code); + } + let hart_mask:usize = 1 << id; + let err_code = send_ipi(&hart_mask as *const _ as usize); + if err_code != SBI_SUCCESS { + panic!("send ipi to hart{} failed. error code={}", id, err_code); + } + } } + crate::primary_main(config); + unreachable!() +} + +#[no_mangle] +pub extern "C" fn secondary_rust_main(hartid: usize) -> ! { + unsafe { + asm!("mv tp, {0}", in(reg) hartid); + }; + println!("secondary hart: zCore rust_main(hartid: {})", hartid); + crate::secondary_main(); unreachable!() } From 4793db52aca19693151347e265c6f4868baebcd1 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Thu, 13 Jan 2022 13:36:48 +0800 Subject: [PATCH 13/44] fix: allows S-mode to access U-mode va(sstatus.SUM=1) --- kernel-hal/Cargo.toml | 3 +-- zCore/Cargo.toml | 3 +-- zCore/src/platform/riscv/entry.rs | 23 ++++++++++++++++------- zCore/src/utils.rs | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/kernel-hal/Cargo.toml b/kernel-hal/Cargo.toml index 03d9d018..c6264f95 100644 --- a/kernel-hal/Cargo.toml +++ b/kernel-hal/Cargo.toml @@ -35,8 +35,7 @@ bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator", rev = # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] -# executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } -executor = { path = "../../executor/executor"} +executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } naive-timer = "0.2.0" # All mode on x86_64 diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index b9e5ad01..bbdad75b 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -52,8 +52,7 @@ rcore-fs-hostfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] buddy_system_allocator = "0.7" -# executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } -executor = { path = "../../executor/executor"} +executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } # Bare-metal mode on x86_64 [target.'cfg(all(target_os = "none", target_arch = "x86_64"))'.dependencies] diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index b3f8f32d..9bae23e6 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -6,9 +6,9 @@ global_asm!(include_str!("boot/boot_d1.asm")); global_asm!(include_str!("boot/entry64.asm")); use super::consts::*; +use core::str::FromStr; use kernel_hal::arch::sbi::{hart_start, send_ipi, SBI_SUCCESS}; use kernel_hal::KernelConfig; -use core::str::FromStr; const SMP: &'static str = core::env!("SMP"); // Get HART number from the environment variable @@ -20,11 +20,16 @@ extern "C" { pub extern "C" fn primary_rust_main(hartid: usize, device_tree_paddr: usize) -> ! { unsafe { asm!("mv tp, {0}", in(reg) hartid); + let mut sstatus: usize; + asm!("csrr {0}, sstatus", out(reg) sstatus); + sstatus |= 1 << 18; + asm!("csrw sstatus, {0}", in(reg) sstatus); + println!( + "boot hart: zCore rust_main(hartid: {}, device_tree_paddr: {:#x}) sstatus={:x}", + hartid, device_tree_paddr, sstatus + ); }; - println!( - "boot hart: zCore rust_main(hartid: {}, device_tree_paddr: {:#x})", - hartid, device_tree_paddr - ); + let config = KernelConfig { phys_to_virt_offset: PHYSICAL_MEMORY_OFFSET, dtb_paddr: device_tree_paddr, @@ -39,7 +44,7 @@ pub extern "C" fn primary_rust_main(hartid: usize, device_tree_paddr: usize) -> if err_code != SBI_SUCCESS { panic!("start hart{} failed. error code={}", id, err_code); } - let hart_mask:usize = 1 << id; + let hart_mask: usize = 1 << id; let err_code = send_ipi(&hart_mask as *const _ as usize); if err_code != SBI_SUCCESS { panic!("send ipi to hart{} failed. error code={}", id, err_code); @@ -54,8 +59,12 @@ pub extern "C" fn primary_rust_main(hartid: usize, device_tree_paddr: usize) -> pub extern "C" fn secondary_rust_main(hartid: usize) -> ! { unsafe { asm!("mv tp, {0}", in(reg) hartid); + let mut sstatus: usize; + asm!("csrr {0}, sstatus", out(reg) sstatus); + sstatus |= 1 << 18; // 设置 + asm!("csrw sstatus, {0}", in(reg) sstatus); + println!("secondary hart: zCore rust_main(hartid: {:x}) sstatus={:x}", hartid, sstatus); }; - println!("secondary hart: zCore rust_main(hartid: {})", hartid); crate::secondary_main(); unreachable!() } diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index b14c9375..c57fd9d3 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -99,7 +99,7 @@ pub fn wait_for_exit(proc: Option>) -> ! { log::warn!("enter executor::run"); loop { #[cfg(not(feature = "libos"))] - executor::run(); + executor::run_until_idle(); kernel_hal::interrupt::wait_for_interrupt(); } } From 627616cc7292283b39b49a52bc327113e7022179 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Thu, 13 Jan 2022 13:42:21 +0800 Subject: [PATCH 14/44] style: cargo fmt --- drivers/src/irq/riscv_plic.rs | 2 +- kernel-hal/src/bare/arch/riscv/mod.rs | 12 +++++++----- kernel-hal/src/bare/arch/riscv/trap.rs | 2 +- kernel-hal/src/bare/mod.rs | 2 +- zCore/src/lang.rs | 4 +++- zCore/src/main.rs | 6 +++--- zCore/src/platform/riscv/entry.rs | 5 ++++- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index f551cde1..ab281ba8 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -166,7 +166,7 @@ impl IrqScheme for Plic { } fn cpu_id() -> u8 { - let mut cpu_id ; + let mut cpu_id; unsafe { asm!("mv {0}, tp", out(reg) cpu_id); } diff --git a/kernel-hal/src/bare/arch/riscv/mod.rs b/kernel-hal/src/bare/arch/riscv/mod.rs index 94276853..7892e878 100644 --- a/kernel-hal/src/bare/arch/riscv/mod.rs +++ b/kernel-hal/src/bare/arch/riscv/mod.rs @@ -5,14 +5,14 @@ pub mod config; pub mod cpu; pub mod interrupt; pub mod mem; +pub mod sbi; pub mod timer; pub mod vm; -pub mod sbi; -use alloc::{format, boxed::Box, string::String, vec::Vec}; +use alloc::{boxed::Box, format, string::String, vec::Vec}; use core::ops::Range; -use zcore_drivers::utils::devicetree::Devicetree; use zcore_drivers::irq::riscv::ScauseIntCode; +use zcore_drivers::utils::devicetree::Devicetree; use crate::{mem::phys_to_virt, utils::init_once::InitOnce, PhysAddr}; @@ -66,12 +66,14 @@ pub fn secondary_init() { intc.register_handler( ScauseIntCode::SupervisorSoft as _, Box::new(trap::super_soft), - ).unwrap(); + ) + .unwrap(); // register timer interrupts handler intc.register_handler( ScauseIntCode::SupervisorTimer as _, Box::new(trap::super_timer), - ).unwrap(); + ) + .unwrap(); intc.unmask(ScauseIntCode::SupervisorSoft as _).unwrap(); intc.unmask(ScauseIntCode::SupervisorTimer as _).unwrap(); diff --git a/kernel-hal/src/bare/arch/riscv/trap.rs b/kernel-hal/src/bare/arch/riscv/trap.rs index e3aca650..522b9f21 100644 --- a/kernel-hal/src/bare/arch/riscv/trap.rs +++ b/kernel-hal/src/bare/arch/riscv/trap.rs @@ -33,7 +33,7 @@ pub extern "C" fn trap_handler(tf: &mut TrapFrame) { // log::warn!("sepc={:x}", riscv::register::sepc::read()); // log::warn!("sstatus.spp={:?}", riscv::register::sstatus::read().spp()); crate::KHANDLER.handle_page_fault(vaddr, flags) - }, + } TrapReason::Interrupt(vector) => crate::interrupt::handle_irq(vector), other => panic!("Undefined trap: {:x?} {:#x?}", other, tf), } diff --git a/kernel-hal/src/bare/mod.rs b/kernel-hal/src/bare/mod.rs index 07caecd5..ba7ba7ba 100644 --- a/kernel-hal/src/bare/mod.rs +++ b/kernel-hal/src/bare/mod.rs @@ -15,7 +15,7 @@ pub mod net; pub mod thread; pub mod timer; -pub use self::arch::{config, cpu, interrupt, vm, sbi}; +pub use self::arch::{config, cpu, interrupt, sbi, vm}; pub use super::hal_fn::{rand, vdso}; hal_fn_impl_default!(rand, vdso); diff --git a/zCore/src/lang.rs b/zCore/src/lang.rs index b54484f1..fc0be295 100644 --- a/zCore/src/lang.rs +++ b/zCore/src/lang.rs @@ -24,7 +24,9 @@ fn oom(_: Layout) -> ! { fn backtrace() { let s0: u64; - unsafe {asm!("mv {0}, fp", out(reg) s0);} + unsafe { + asm!("mv {0}, fp", out(reg) s0); + } let mut fp = s0; let x = 5; println!("fp=0x{:x}", fp); diff --git a/zCore/src/main.rs b/zCore/src/main.rs index 00f8f88f..ec406756 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -64,9 +64,9 @@ fn primary_main(config: kernel_hal::KernelConfig) { fn secondary_main() { while !STARTED.load(Ordering::SeqCst) {} // Don't print anything between previous line and next line. - // Boot hart has initialized the UART chip, so we will use - // UART for output instead of SBI, but the current HART is - // not mapped to UART MMIO, which means we can't output + // Boot hart has initialized the UART chip, so we will use + // UART for output instead of SBI, but the current HART is + // not mapped to UART MMIO, which means we can't output // until secondary_init is complete. kernel_hal::secondary_init(); utils::wait_for_exit(None) diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index 9bae23e6..17749e27 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -63,7 +63,10 @@ pub extern "C" fn secondary_rust_main(hartid: usize) -> ! { asm!("csrr {0}, sstatus", out(reg) sstatus); sstatus |= 1 << 18; // 设置 asm!("csrw sstatus, {0}", in(reg) sstatus); - println!("secondary hart: zCore rust_main(hartid: {:x}) sstatus={:x}", hartid, sstatus); + println!( + "secondary hart: zCore rust_main(hartid: {:x}) sstatus={:x}", + hartid, sstatus + ); }; crate::secondary_main(); unreachable!() From 4d73e5213442703c037389d9174695396e07e703 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Thu, 13 Jan 2022 16:18:32 +0800 Subject: [PATCH 15/44] style: clean some codes --- linux-user | 1 - zCore/src/lang.rs | 17 ----------------- zCore/src/utils.rs | 22 +--------------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 160000 linux-user diff --git a/linux-user b/linux-user deleted file mode 160000 index 2852c7ba..00000000 --- a/linux-user +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2852c7ba04e9202ae0e87b0d02ecf76fb9e544a8 diff --git a/zCore/src/lang.rs b/zCore/src/lang.rs index fc0be295..f1769204 100644 --- a/zCore/src/lang.rs +++ b/zCore/src/lang.rs @@ -10,7 +10,6 @@ fn panic(info: &PanicInfo) -> ! { println!("\n\npanic cpu={}", kernel_hal::cpu::cpu_id()); println!("\n\n{}", info); error!("\n\n{}", info); - backtrace(); //error!("{:#?}", KCounterDescriptorArray::get()); loop { core::hint::spin_loop(); @@ -21,19 +20,3 @@ fn panic(info: &PanicInfo) -> ! { fn oom(_: Layout) -> ! { panic!("out of memory"); } - -fn backtrace() { - let s0: u64; - unsafe { - asm!("mv {0}, fp", out(reg) s0); - } - let mut fp = s0; - let x = 5; - println!("fp=0x{:x}", fp); - for _ in 0..5 { - unsafe { - println!("fn addr=0x{:x}", *((fp - 8) as *const u64)); - fp = *((fp - 16) as *const u64) - } - } -} diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index c57fd9d3..c4cb266f 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -96,29 +96,9 @@ pub fn wait_for_exit(proc: Option>) -> ! { let code = async_std::task::block_on(future); std::process::exit(code as i32); } - log::warn!("enter executor::run"); loop { #[cfg(not(feature = "libos"))] executor::run_until_idle(); kernel_hal::interrupt::wait_for_interrupt(); } -} - -#[no_mangle] -fn wait_for_interrupt() { - kernel_hal::interrupt::wait_for_interrupt(); -} - -async fn test_future(idx: usize) { - loop { - println!("my idx={}", idx); - use core::time::Duration; - kernel_hal::thread::sleep_until(Duration::from_secs(1)).await; - } -} - -fn spawn_test_future() { - for i in 0..10 { - executor::spawn(test_future(i)); - } -} +} \ No newline at end of file From a0ae38ed44ec747d60d946fb44feeff12ea578c5 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Thu, 13 Jan 2022 23:04:23 +0800 Subject: [PATCH 16/44] remove the print statement from secondary_rust_main --- kernel-hal/src/bare/boot.rs | 3 ++- kernel-hal/src/bare/mod.rs | 3 ++- kernel-hal/src/hal_fn.rs | 4 ++-- zCore/src/main.rs | 4 +--- zCore/src/platform/riscv/entry.rs | 8 ++------ zCore/src/utils.rs | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/kernel-hal/src/bare/boot.rs b/kernel-hal/src/bare/boot.rs index 16f1af5e..0aab1b03 100644 --- a/kernel-hal/src/bare/boot.rs +++ b/kernel-hal/src/bare/boot.rs @@ -29,9 +29,10 @@ hal_fn_impl! { fn secondary_init() { // info!("Secondary CPU {} init...", crate::cpu::cpu_id()); - // we can't output anything here, see reason: zcore/main.rs::secondary_main() + // we can't print anything here, see reason: zcore/main.rs::secondary_main() unsafe { trapframe::init() }; super::arch::secondary_init(); + // now can print } } } diff --git a/kernel-hal/src/bare/mod.rs b/kernel-hal/src/bare/mod.rs index ba7ba7ba..cdf6ced3 100644 --- a/kernel-hal/src/bare/mod.rs +++ b/kernel-hal/src/bare/mod.rs @@ -6,6 +6,7 @@ cfg_if! { } else if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] { #[path = "arch/riscv/mod.rs"] pub mod arch; + pub use self::arch::sbi; } } @@ -15,7 +16,7 @@ pub mod net; pub mod thread; pub mod timer; -pub use self::arch::{config, cpu, interrupt, sbi, vm}; +pub use self::arch::{config, cpu, interrupt, vm}; pub use super::hal_fn::{rand, vdso}; hal_fn_impl_default!(rand, vdso); diff --git a/kernel-hal/src/hal_fn.rs b/kernel-hal/src/hal_fn.rs index e9261a3b..228f50af 100644 --- a/kernel-hal/src/hal_fn.rs +++ b/kernel-hal/src/hal_fn.rs @@ -127,8 +127,8 @@ hal_fn_def! { pub fn msi_register_handler(block: Range, msi_id: usize, handler: IrqHandler) -> HalResult; } - pub(crate) mod console { - pub(crate) fn console_write_early(_s: &str) {} + pub mod console { + pub fn console_write_early(_s: &str) {} } /// Thread spawning. diff --git a/zCore/src/main.rs b/zCore/src/main.rs index ec406756..3b4a3cc2 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -69,8 +69,6 @@ fn secondary_main() { // not mapped to UART MMIO, which means we can't output // until secondary_init is complete. kernel_hal::secondary_init(); + log::info!("hart{} inited", kernel_hal::cpu::cpu_id()); utils::wait_for_exit(None) } - -// Boot hart已经初始化UART芯片,所以后续我们将使用UART进行输出而不是SBI, -// 但是当前hart并映射UART MMIO,也就是说我们在secondary_init完成之前是不能够进行输出的 diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index 17749e27..76997ace 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -9,7 +9,6 @@ use super::consts::*; use core::str::FromStr; use kernel_hal::arch::sbi::{hart_start, send_ipi, SBI_SUCCESS}; use kernel_hal::KernelConfig; - const SMP: &'static str = core::env!("SMP"); // Get HART number from the environment variable extern "C" { @@ -55,18 +54,15 @@ pub extern "C" fn primary_rust_main(hartid: usize, device_tree_paddr: usize) -> unreachable!() } +// Don't print in this function and use console_write_early if necessary #[no_mangle] pub extern "C" fn secondary_rust_main(hartid: usize) -> ! { unsafe { asm!("mv tp, {0}", in(reg) hartid); let mut sstatus: usize; asm!("csrr {0}, sstatus", out(reg) sstatus); - sstatus |= 1 << 18; // 设置 + sstatus |= 1 << 18; // set SUM=1 asm!("csrw sstatus, {0}", in(reg) sstatus); - println!( - "secondary hart: zCore rust_main(hartid: {:x}) sstatus={:x}", - hartid, sstatus - ); }; crate::secondary_main(); unreachable!() diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index c4cb266f..5f1cd00b 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -101,4 +101,4 @@ pub fn wait_for_exit(proc: Option>) -> ! { executor::run_until_idle(); kernel_hal::interrupt::wait_for_interrupt(); } -} \ No newline at end of file +} From 1638a78feed1c6c53bb8d36af48dc46a9aba45bd Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 14 Jan 2022 18:00:19 +0800 Subject: [PATCH 17/44] fix: modify secondary_main return type to ! --- zCore/Makefile | 2 +- zCore/src/main.rs | 2 +- zCore/src/platform/riscv/entry.rs | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/zCore/Makefile b/zCore/Makefile index f8e65318..db8f30e0 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -1,6 +1,6 @@ ################ Arguments ################ -ARCH ?= riscv64 +ARCH ?= x86_64 PLATFORM ?= qemu MODE ?= release LOG ?= warn diff --git a/zCore/src/main.rs b/zCore/src/main.rs index 3b4a3cc2..6b234468 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -61,7 +61,7 @@ fn primary_main(config: kernel_hal::KernelConfig) { } #[allow(dead_code)] -fn secondary_main() { +fn secondary_main() -> ! { while !STARTED.load(Ordering::SeqCst) {} // Don't print anything between previous line and next line. // Boot hart has initialized the UART chip, so we will use diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index 76997ace..c1657fa5 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -65,5 +65,4 @@ pub extern "C" fn secondary_rust_main(hartid: usize) -> ! { asm!("csrw sstatus, {0}", in(reg) sstatus); }; crate::secondary_main(); - unreachable!() } From 1c8f43ac74dcd7a0b7be6bc6b71ac8168d4e37ae Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 14 Jan 2022 19:26:52 +0800 Subject: [PATCH 18/44] style: modfiy for clippy --- drivers/src/net/realtek/rtl8211f.rs | 8 +++++--- drivers/src/net/rtlx.rs | 1 - drivers/src/scheme/display.rs | 1 + kernel-hal/src/bare/arch/riscv/sbi.rs | 14 +++++++------- zCore/Makefile | 4 ++-- zCore/src/platform/riscv/entry.rs | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/src/net/realtek/rtl8211f.rs b/drivers/src/net/realtek/rtl8211f.rs index 85be2f3c..31cc1dfe 100644 --- a/drivers/src/net/realtek/rtl8211f.rs +++ b/drivers/src/net/realtek/rtl8211f.rs @@ -214,6 +214,7 @@ impl

RTL8211F

where P: Provider, { + #[allow(clippy::clone_on_copy)] pub fn new(mac_addr: &[u8; 6]) -> Self { assert_eq!(size_of::(), 16); @@ -229,7 +230,7 @@ where (v_addr == 0x5fa) // mac addr is broadcast { - let tokens: Vec<&str> = MAC_ADDR.split(":").collect(); + let tokens: Vec<&str> = MAC_ADDR.split(':').collect(); for (i, s) in tokens.iter().enumerate() { mac[i] = u8::from_str_radix(s, 16).unwrap(); } @@ -1141,6 +1142,7 @@ where status = tx_dma_irq_status::tx_hard_error as i32; } + #[allow(clippy::collapsible_if)] /* 正常的 TX/RX NORMAL interrupts */ if (intr_status & (TX_INT | RX_INT | RX_EARLY_INT | TX_UA_INT)) != 0 { if (intr_status & (TX_INT | RX_INT)) != 0 { @@ -1200,7 +1202,7 @@ where (*desc).desc1 |= 0b11 << 27; desc = desc.add(1); } - count = count + 1; + count += 1; if count > end { break; @@ -1432,7 +1434,7 @@ where match speed { 1000 => ctrl &= !0x0C, - 100 | 10 | _ => { + /*100 | 10 |*/ _ => { ctrl |= 0x08; if (speed == 100) { ctrl |= 0x04; diff --git a/drivers/src/net/rtlx.rs b/drivers/src/net/rtlx.rs index 2bca6201..0f01b5d8 100644 --- a/drivers/src/net/rtlx.rs +++ b/drivers/src/net/rtlx.rs @@ -62,7 +62,6 @@ impl Scheme for RTLxInterface { } self.driver.0.lock().int_enable(); //return true; - return; } } } diff --git a/drivers/src/scheme/display.rs b/drivers/src/scheme/display.rs index aab9d237..12eadb7d 100644 --- a/drivers/src/scheme/display.rs +++ b/drivers/src/scheme/display.rs @@ -146,6 +146,7 @@ impl<'a> core::ops::Deref for FrameBuffer<'a> { } impl<'a> core::ops::DerefMut for FrameBuffer<'a> { + #[warn(clippy::needless_borrow)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.raw } diff --git a/kernel-hal/src/bare/arch/riscv/sbi.rs b/kernel-hal/src/bare/arch/riscv/sbi.rs index 90e6cffc..570a7500 100644 --- a/kernel-hal/src/bare/arch/riscv/sbi.rs +++ b/kernel-hal/src/bare/arch/riscv/sbi.rs @@ -45,11 +45,11 @@ fn sbi_call(eid: usize, fid: usize, arg0: usize, arg1: usize, arg2: usize) -> us } pub fn console_putchar(ch: usize) -> usize { - return sbi_call(SBI_CONSOLE_PUTCHAR, 0, ch, 0, 0); + sbi_call(SBI_CONSOLE_PUTCHAR, 0, ch, 0, 0) } pub fn console_getchar() -> usize { - return sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0, 0); + sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0, 0) } pub fn set_timer(stime_value: u64) -> usize { @@ -63,15 +63,15 @@ pub fn set_timer(stime_value: u64) -> usize { ); #[cfg(target_pointer_width = "64")] - return sbi_call(SBI_SET_TIMER, 0, stime_value as usize, 0, 0); + sbi_call(SBI_SET_TIMER, 0, stime_value as usize, 0, 0) } pub fn clear_ipi() -> usize { - return sbi_call(SBI_CLEAR_IPI, 0, 0, 0, 0); + sbi_call(SBI_CLEAR_IPI, 0, 0, 0, 0) } pub fn send_ipi(sipi_value: usize) -> usize { - return sbi_call(SBI_SEND_IPI, 0, sipi_value, 0, 0); + sbi_call(SBI_SEND_IPI, 0, sipi_value, 0, 0) } /// executing the target hart in supervisor-mode at address @@ -81,13 +81,13 @@ pub fn send_ipi(sipi_value: usize) -> usize { /// set in the a1 register when the hart starts executing /// at start_addr. pub fn hart_start(hartid: usize, start_addr: usize, opaque: usize) -> usize { - return sbi_call(HSM_EID, SBI_HART_START_FID, hartid, start_addr, opaque); + sbi_call(HSM_EID, SBI_HART_START_FID, hartid, start_addr, opaque) } /// stop executing the calling hart in supervisor-mode and return /// it’s ownership to the SBI implementation. pub fn hart_stop() -> usize { - return sbi_call(HSM_EID, SBI_HART_STOP_FID, 0, 0, 0); + sbi_call(HSM_EID, SBI_HART_STOP_FID, 0, 0, 0) } hal_fn_impl! { diff --git a/zCore/Makefile b/zCore/Makefile index db8f30e0..3940972e 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -1,6 +1,6 @@ ################ Arguments ################ -ARCH ?= x86_64 +ARCH ?= riscv64 PLATFORM ?= qemu MODE ?= release LOG ?= warn @@ -216,7 +216,7 @@ header: .PHONY: clippy clippy: - cargo clippy $(build_args) + SMP=$(SMP) cargo clippy $(build_args) .PHONY: clean clean: diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index c1657fa5..bb9f99d1 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -9,7 +9,7 @@ use super::consts::*; use core::str::FromStr; use kernel_hal::arch::sbi::{hart_start, send_ipi, SBI_SUCCESS}; use kernel_hal::KernelConfig; -const SMP: &'static str = core::env!("SMP"); // Get HART number from the environment variable +const SMP: &str = core::env!("SMP"); // Get HART number from the environment variable extern "C" { fn secondary_hart_start(); From 3c4b800df91197ca6f8f19ec7a9aed2c3f58be00 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 14 Jan 2022 21:27:35 +0800 Subject: [PATCH 19/44] change arch to x86_64 --- Makefile | 2 +- drivers/src/net/realtek/rtl8211f.rs | 3 ++- drivers/src/scheme/display.rs | 2 +- zCore/Makefile | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 23b18f38..0d9207c8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ROOTFS_URL := http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/$(ROOTF RISCV64_ROOTFS_TAR := prebuild.tar.xz RISCV64_ROOTFS_URL := https://github.com/rcore-os/libc-test-prebuilt/releases/download/0.1/$(RISCV64_ROOTFS_TAR) -ARCH ?= riscv64 +ARCH ?= x86_64 rcore_fs_fuse_revision := 7f5eeac OUT_IMG := zCore/$(ARCH).img TMP_ROOTFS := /tmp/rootfs diff --git a/drivers/src/net/realtek/rtl8211f.rs b/drivers/src/net/realtek/rtl8211f.rs index 31cc1dfe..fa0799bc 100644 --- a/drivers/src/net/realtek/rtl8211f.rs +++ b/drivers/src/net/realtek/rtl8211f.rs @@ -1434,7 +1434,8 @@ where match speed { 1000 => ctrl &= !0x0C, - /*100 | 10 |*/ _ => { + /*100 | 10 |*/ + _ => { ctrl |= 0x08; if (speed == 100) { ctrl |= 0x04; diff --git a/drivers/src/scheme/display.rs b/drivers/src/scheme/display.rs index 12eadb7d..e9a8499d 100644 --- a/drivers/src/scheme/display.rs +++ b/drivers/src/scheme/display.rs @@ -146,7 +146,7 @@ impl<'a> core::ops::Deref for FrameBuffer<'a> { } impl<'a> core::ops::DerefMut for FrameBuffer<'a> { - #[warn(clippy::needless_borrow)] + #[allow(clippy::needless_borrow)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.raw } diff --git a/zCore/Makefile b/zCore/Makefile index 3940972e..85ee6528 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -1,6 +1,6 @@ ################ Arguments ################ -ARCH ?= riscv64 +ARCH ?= x86_64 PLATFORM ?= qemu MODE ?= release LOG ?= warn From 4e58d0ee3e82d60bca9040004df6f7317ac5bc10 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Fri, 14 Jan 2022 22:12:14 +0800 Subject: [PATCH 20/44] generate image when make build --- zCore/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zCore/Makefile b/zCore/Makefile index 85ee6528..f9a2d6f1 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -178,7 +178,7 @@ all: build .PHONY: build run test debug ifeq ($(LIBOS), 1) -build: kernel +build: $(ARCH).img kernel run: cargo run $(build_args) -- $(ARGS) test: @@ -186,7 +186,7 @@ test: debug: build gdb --args $(kernel_elf) $(ARGS) else -build: $(kernel_img) +build: $(ARCH).img $(kernel_img) run: build justrun debug: build debugrun endif @@ -304,6 +304,14 @@ endif rm $(build_path)/esp.tar vboxmanage startvm zCoreVM +$(ARCH).img: + @echo make img +ifeq ($(ARCH), x86_64) + @cd .. && make baremetal-test-img +else + @cd .. && make riscv-image +endif + $(qemu_disk): ifeq ($(ARCH), riscv64) # FIXME: no longer need to create QCOW2 when use initrd for RISC-V From 5a079ad05483e9780ee6f92171add95aa171efbf Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 15 Jan 2022 11:10:21 +0800 Subject: [PATCH 21/44] modify ci conf: generate image when build --- .github/workflows/build-20211102.yml | 8 ++++++++ .github/workflows/test-20211102.yml | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-20211102.yml b/.github/workflows/build-20211102.yml index 5c8fc965..b9fa3c6a 100644 --- a/.github/workflows/build-20211102.yml +++ b/.github/workflows/build-20211102.yml @@ -44,6 +44,14 @@ jobs: with: crate: cargo-binutils version: latest + - name: Pull prebuilt images + run: git lfs pull -I prebuilt/linux/libc-libos.so + - name: Install musl toolchain + run: | + sudo apt-get update + sudo apt-get install musl-tools musl-dev -y + - name: Prepare rootfs and libc-test + run: make baremetal-test-img - name: Build all packages run: cargo build - name: Build linux LibOS diff --git a/.github/workflows/test-20211102.yml b/.github/workflows/test-20211102.yml index c0d500bf..d4ad50fe 100644 --- a/.github/workflows/test-20211102.yml +++ b/.github/workflows/test-20211102.yml @@ -56,10 +56,14 @@ jobs: profile: minimal toolchain: nightly-2021-11-02 components: rust-src - - name: Install QEMU + - name: Pull prebuilt images + run: git lfs pull -I prebuilt/linux/libc-libos.so + - name: Install musl toolchain qemu-system-x86 run: | - sudo apt update - sudo apt install qemu-system-x86 + sudo apt-get update + sudo apt-get install musl-tools musl-dev qemu-system-x86 -y + - name: Prepare rootfs and libc-test + run: make baremetal-test-img - name: Build zCore run: cd zCore && make build MODE=release - name: Run core-tests From 137c6daaf51e3dc3f88ef37212aa9b66fac85794 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 15 Jan 2022 12:56:56 +0800 Subject: [PATCH 22/44] change makefile to default args --- zCore/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zCore/Makefile b/zCore/Makefile index f9a2d6f1..c3f979d5 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -4,8 +4,8 @@ ARCH ?= x86_64 PLATFORM ?= qemu MODE ?= release LOG ?= warn -LINUX ?= 1 -LIBOS ?= +LINUX ?= +LIBOS ?= GRAPHIC ?= HYPERVISOR ?= V ?= @@ -14,7 +14,7 @@ USER ?= ZBI ?= bringup CMDLINE ?= -SMP ?= 5 +SMP ?= 1 ACCEL ?= OBJDUMP ?= rust-objdump --print-imm-hex --x86-asm-syntax=intel @@ -178,7 +178,7 @@ all: build .PHONY: build run test debug ifeq ($(LIBOS), 1) -build: $(ARCH).img kernel +build: kernel run: cargo run $(build_args) -- $(ARGS) test: @@ -186,7 +186,7 @@ test: debug: build gdb --args $(kernel_elf) $(ARGS) else -build: $(ARCH).img $(kernel_img) +build: $(kernel_img) run: build justrun debug: build debugrun endif @@ -228,7 +228,7 @@ ifeq ($(ARCH), x86_64) @cd ../rboot && make build endif -$(kernel_img): kernel bootloader +$(kernel_img): kernel bootloader $(user_img) ifeq ($(ARCH), x86_64) ifeq ($(USER), 1) make -C ../zircon-user From c2dae469bdc1f31c8a8dea928bdf95063a4f9cc8 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 15 Jan 2022 13:15:44 +0800 Subject: [PATCH 23/44] build ci use actions-rs/toolchain@v1 --- .github/workflows/build-20211102.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-20211102.yml b/.github/workflows/build-20211102.yml index b9fa3c6a..c544bbe7 100644 --- a/.github/workflows/build-20211102.yml +++ b/.github/workflows/build-20211102.yml @@ -40,10 +40,11 @@ jobs: profile: minimal toolchain: nightly-2021-11-02 components: rust-src, llvm-tools-preview - - uses: actions-rs/install@v0.1 + - uses: actions-rs/toolchain@v1 with: - crate: cargo-binutils - version: latest + profile: minimal + toolchain: nightly-2021-11-02 + components: rust-src - name: Pull prebuilt images run: git lfs pull -I prebuilt/linux/libc-libos.so - name: Install musl toolchain From 8084a4b8bca0e5945f7f8b78d8af03c4123fb4c9 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 15 Jan 2022 13:33:51 +0800 Subject: [PATCH 24/44] fix: build ci can't work --- .github/workflows/build-20211102.yml | 15 +++------------ zCore/Makefile | 10 +--------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-20211102.yml b/.github/workflows/build-20211102.yml index c544bbe7..5c8fc965 100644 --- a/.github/workflows/build-20211102.yml +++ b/.github/workflows/build-20211102.yml @@ -40,19 +40,10 @@ jobs: profile: minimal toolchain: nightly-2021-11-02 components: rust-src, llvm-tools-preview - - uses: actions-rs/toolchain@v1 + - uses: actions-rs/install@v0.1 with: - profile: minimal - toolchain: nightly-2021-11-02 - components: rust-src - - name: Pull prebuilt images - run: git lfs pull -I prebuilt/linux/libc-libos.so - - name: Install musl toolchain - run: | - sudo apt-get update - sudo apt-get install musl-tools musl-dev -y - - name: Prepare rootfs and libc-test - run: make baremetal-test-img + crate: cargo-binutils + version: latest - name: Build all packages run: cargo build - name: Build linux LibOS diff --git a/zCore/Makefile b/zCore/Makefile index c3f979d5..bff0bfe4 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -228,7 +228,7 @@ ifeq ($(ARCH), x86_64) @cd ../rboot && make build endif -$(kernel_img): kernel bootloader $(user_img) +$(kernel_img): kernel bootloader ifeq ($(ARCH), x86_64) ifeq ($(USER), 1) make -C ../zircon-user @@ -304,14 +304,6 @@ endif rm $(build_path)/esp.tar vboxmanage startvm zCoreVM -$(ARCH).img: - @echo make img -ifeq ($(ARCH), x86_64) - @cd .. && make baremetal-test-img -else - @cd .. && make riscv-image -endif - $(qemu_disk): ifeq ($(ARCH), riscv64) # FIXME: no longer need to create QCOW2 when use initrd for RISC-V From 83363de827ff8f9b4136e274add148941804f44c Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Mon, 17 Jan 2022 19:02:14 +0800 Subject: [PATCH 25/44] clean unmeaning code in test ci conf --- .github/workflows/test-20211102.yml | 10 +++------- linux-user | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) create mode 160000 linux-user diff --git a/.github/workflows/test-20211102.yml b/.github/workflows/test-20211102.yml index d4ad50fe..c0d500bf 100644 --- a/.github/workflows/test-20211102.yml +++ b/.github/workflows/test-20211102.yml @@ -56,14 +56,10 @@ jobs: profile: minimal toolchain: nightly-2021-11-02 components: rust-src - - name: Pull prebuilt images - run: git lfs pull -I prebuilt/linux/libc-libos.so - - name: Install musl toolchain qemu-system-x86 + - name: Install QEMU run: | - sudo apt-get update - sudo apt-get install musl-tools musl-dev qemu-system-x86 -y - - name: Prepare rootfs and libc-test - run: make baremetal-test-img + sudo apt update + sudo apt install qemu-system-x86 - name: Build zCore run: cd zCore && make build MODE=release - name: Run core-tests diff --git a/linux-user b/linux-user new file mode 160000 index 00000000..8d04b64e --- /dev/null +++ b/linux-user @@ -0,0 +1 @@ +Subproject commit 8d04b64ea119d3e552ad2e79797e023647a48268 From 4ba1cc8817f367374a9ae40a32f16252a27dfe40 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Mon, 17 Jan 2022 19:11:23 +0800 Subject: [PATCH 26/44] remove linux-user --- linux-user | 1 - 1 file changed, 1 deletion(-) delete mode 160000 linux-user diff --git a/linux-user b/linux-user deleted file mode 160000 index 8d04b64e..00000000 --- a/linux-user +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d04b64ea119d3e552ad2e79797e023647a48268 From c7851a58d6137425ba5905ab49b21dcb7ba877d1 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 19 Feb 2022 09:13:01 +0800 Subject: [PATCH 27/44] fix: check ptr from user map vaddr if necessary --- linux-syscall/src/lib.rs | 52 ++++++++++++++++++++++++++++++++++-- linux-user | 1 + zircon-object/src/vm/vmar.rs | 12 +++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 160000 linux-user diff --git a/linux-syscall/src/lib.rs b/linux-syscall/src/lib.rs index cfcbf2b0..f83384e6 100644 --- a/linux-syscall/src/lib.rs +++ b/linux-syscall/src/lib.rs @@ -28,12 +28,13 @@ use alloc::sync::Arc; use core::convert::TryFrom; use kernel_hal::user::{IoVecIn, IoVecOut, UserInOutPtr, UserInPtr, UserOutPtr}; +use kernel_hal::MMUFlags; use linux_object::error::{LxError, SysResult}; use linux_object::fs::FileDesc; use linux_object::process::{wait_child, wait_child_any, LinuxProcess, ProcessExt, RLimit}; use zircon_object::object::{KernelObject, KoID, Signal}; use zircon_object::task::{CurrentThread, Process, Thread, ThreadFn}; -use zircon_object::{vm::VirtAddr, ZxError}; +use zircon_object::{vm::VirtAddr, ZxError, ZxResult}; use self::consts::SyscallType as Sys; @@ -61,6 +62,47 @@ pub struct Syscall<'a> { } impl Syscall<'_> { + /// convert a usize num to in and out userptr + pub fn into_inout_userptr(&self, vaddr: usize) -> ZxResult> { + let vmar = self.thread.proc().vmar(); + let vaddr_flags = vmar.get_vaddr_flags(vaddr)?; + if !vaddr_flags.contains(MMUFlags::READ) { + if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::READ) { + panic!("into_out_userptr handle_page_fault: {:?}", err); + } + } + if !vaddr_flags.contains(MMUFlags::WRITE) { + if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::WRITE) { + panic!("into_out_userptr handle_page_fault: {:?}", err); + } + } + Ok(vaddr.into()) + } + + /// convert a usize num to in userptr + pub fn into_in_userptr(&self, vaddr: usize) -> ZxResult> { + let vmar = self.thread.proc().vmar(); + let vaddr_flags = vmar.get_vaddr_flags(vaddr)?; + if vaddr_flags.contains(MMUFlags::READ) { + if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::READ) { + panic!("into_out_userptr handle_page_fault: {:?}", err); + } + } + Ok(vaddr.into()) + } + + /// convert a usize num to out userptr + pub fn into_out_userptr(&self, vaddr: usize) -> ZxResult> { + let vmar = self.thread.proc().vmar(); + let vaddr_flags = vmar.get_vaddr_flags(vaddr)?; + if vaddr_flags.contains(MMUFlags::WRITE) { + if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::WRITE) { + panic!("into_out_userptr handle_page_fault: {:?}", err); + } + } + Ok(vaddr.into()) + } + /// syscall entry function pub async fn syscall(&mut self, num: u32, args: [usize; 6]) -> isize { debug!( @@ -77,6 +119,9 @@ impl Syscall<'_> { } }; let [a0, a1, a2, a3, a4, a5] = args; + // for reg in args { + // self.check_addr(reg); + // } let ret = match sys_type { Sys::READ => self.sys_read(a0.into(), a1.into(), a2).await, Sys::WRITE => self.sys_write(a0.into(), a1.into(), a2), @@ -186,7 +231,10 @@ impl Syscall<'_> { Sys::EXECVE => self.sys_execve(a0.into(), a1.into(), a2.into()), Sys::EXIT => self.sys_exit(a0 as _), Sys::EXIT_GROUP => self.sys_exit_group(a0 as _), - Sys::WAIT4 => self.sys_wait4(a0 as _, a1.into(), a2 as _).await, + Sys::WAIT4 => { + self.sys_wait4(a0 as _, self.into_out_userptr(a1).unwrap(), a2 as _) + .await + } Sys::SET_TID_ADDRESS => self.sys_set_tid_address(a0.into()), Sys::FUTEX => self.sys_futex(a0, a1 as _, a2 as _, a3.into()).await, Sys::TKILL => self.unimplemented("tkill", Ok(0)), diff --git a/linux-user b/linux-user new file mode 160000 index 00000000..8d04b64e --- /dev/null +++ b/linux-user @@ -0,0 +1 @@ +Subproject commit 8d04b64ea119d3e552ad2e79797e023647a48268 diff --git a/zircon-object/src/vm/vmar.rs b/zircon-object/src/vm/vmar.rs index f8873724..e90eb3ed 100644 --- a/zircon-object/src/vm/vmar.rs +++ b/zircon-object/src/vm/vmar.rs @@ -402,6 +402,18 @@ impl VmAddressRegion { !self.is_dead() } + /// get flags of vaddr + pub fn get_vaddr_flags(&self, vaddr: usize) -> ZxResult { + let mut guard = self.inner.lock(); + let inner = guard.as_mut().ok_or(ZxError::BAD_STATE)?; + for mapping in &inner.mappings { + if mapping.contains(vaddr) { + return mapping.get_flags(vaddr); + } + } + Err(ZxError::NO_MEMORY) + } + /// Determine final address with given input `offset` and `len`. fn determine_offset( &self, From 9b10549a535fb256450cec8c7dc9f27918873673 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 19 Feb 2022 20:54:26 +0800 Subject: [PATCH 28/44] fix: get vaddr flags from pagetable check whether the address passed by the user is valid --- linux-syscall/src/lib.rs | 356 ++++++++++++++++++++++++++++------- zircon-object/src/vm/vmar.rs | 27 ++- 2 files changed, 303 insertions(+), 80 deletions(-) diff --git a/linux-syscall/src/lib.rs b/linux-syscall/src/lib.rs index f83384e6..798c3a2c 100644 --- a/linux-syscall/src/lib.rs +++ b/linux-syscall/src/lib.rs @@ -64,14 +64,32 @@ pub struct Syscall<'a> { impl Syscall<'_> { /// convert a usize num to in and out userptr pub fn into_inout_userptr(&self, vaddr: usize) -> ZxResult> { + if 0 == vaddr { + return Ok(vaddr.into()); + } + let vmar = self.thread.proc().vmar(); - let vaddr_flags = vmar.get_vaddr_flags(vaddr)?; - if !vaddr_flags.contains(MMUFlags::READ) { + if !vmar.contains(vaddr) { + return Err(ZxError::NO_MEMORY); + } + + let is_handle_read_pagefault; + let is_handle_write_pagefault; + if let Ok(vaddr_flags) = vmar.get_vaddr_flags(vaddr) { + is_handle_read_pagefault = !vaddr_flags.contains(MMUFlags::READ); + is_handle_write_pagefault = !vaddr_flags.contains(MMUFlags::WRITE); + } else { + is_handle_read_pagefault = true; + is_handle_write_pagefault = true; + } + + if is_handle_read_pagefault { if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::READ) { panic!("into_out_userptr handle_page_fault: {:?}", err); } } - if !vaddr_flags.contains(MMUFlags::WRITE) { + + if is_handle_write_pagefault { if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::WRITE) { panic!("into_out_userptr handle_page_fault: {:?}", err); } @@ -80,10 +98,25 @@ impl Syscall<'_> { } /// convert a usize num to in userptr - pub fn into_in_userptr(&self, vaddr: usize) -> ZxResult> { + pub fn into_in_userptr(&self, vaddr: usize) -> ZxResult> { + if 0 == vaddr { + return Ok(vaddr.into()); + } + let vmar = self.thread.proc().vmar(); - let vaddr_flags = vmar.get_vaddr_flags(vaddr)?; - if vaddr_flags.contains(MMUFlags::READ) { + if !vmar.contains(vaddr) { + return Err(ZxError::NO_MEMORY); + } + + let is_handle_read_pagefault; + if let Ok(vaddr_flags) = vmar.get_vaddr_flags(vaddr) { + is_handle_read_pagefault = !vaddr_flags.contains(MMUFlags::READ); + } else { + is_handle_read_pagefault = true; + } + + if is_handle_read_pagefault { + error!("handle read pagefault"); if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::READ) { panic!("into_out_userptr handle_page_fault: {:?}", err); } @@ -93,19 +126,41 @@ impl Syscall<'_> { /// convert a usize num to out userptr pub fn into_out_userptr(&self, vaddr: usize) -> ZxResult> { + if 0 == vaddr { + return Ok(vaddr.into()); + } + let vmar = self.thread.proc().vmar(); - let vaddr_flags = vmar.get_vaddr_flags(vaddr)?; - if vaddr_flags.contains(MMUFlags::WRITE) { + if !vmar.contains(vaddr) { + return Err(ZxError::NO_MEMORY); + } + + let is_handle_write_pagefault; + if let Ok(vaddr_flags) = vmar.get_vaddr_flags(vaddr) { + is_handle_write_pagefault = !vaddr_flags.contains(MMUFlags::WRITE); + } else { + is_handle_write_pagefault = true; + } + + if is_handle_write_pagefault { if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::WRITE) { - panic!("into_out_userptr handle_page_fault: {:?}", err); + panic!( + "into_out_userptr handle_page_fault: {:?} vaddr={}", + err, vaddr + ); } } + let f = vmar.get_vaddr_flags(vaddr).unwrap(); + // warn!("vaddr={:x} flags={:?} before={:?}", vaddr, f, before_flags); + if !f.contains(MMUFlags::WRITE) { + panic!("handle pagefault error"); + } Ok(vaddr.into()) } /// syscall entry function pub async fn syscall(&mut self, num: u32, args: [usize; 6]) -> isize { - debug!( + trace!( "pid: {} syscall: num={}, args={:x?}", self.zircon_process().id(), num, @@ -123,54 +178,121 @@ impl Syscall<'_> { // self.check_addr(reg); // } let ret = match sys_type { - Sys::READ => self.sys_read(a0.into(), a1.into(), a2).await, - Sys::WRITE => self.sys_write(a0.into(), a1.into(), a2), - Sys::OPENAT => self.sys_openat(a0.into(), a1.into(), a2, a3), + Sys::READ => { + self.sys_read(a0.into(), self.into_out_userptr(a1).unwrap(), a2) + .await + } + Sys::WRITE => self.sys_write(a0.into(), self.into_in_userptr(a1).unwrap(), a2), + Sys::OPENAT => self.sys_openat(a0.into(), self.into_in_userptr(a1).unwrap(), a2, a3), Sys::CLOSE => self.sys_close(a0.into()), - Sys::FSTAT => self.sys_fstat(a0.into(), a1.into()), - Sys::NEWFSTATAT => self.sys_fstatat(a0.into(), a1.into(), a2.into(), a3), + Sys::FSTAT => self.sys_fstat(a0.into(), self.into_out_userptr(a1).unwrap()), + Sys::NEWFSTATAT => self.sys_fstatat( + a0.into(), + self.into_in_userptr(a1).unwrap(), + self.into_out_userptr(a2).unwrap(), + a3, + ), Sys::LSEEK => self.sys_lseek(a0.into(), a1 as i64, a2 as u8), Sys::IOCTL => self.sys_ioctl(a0.into(), a1, a2, a3, a4), - Sys::PREAD64 => self.sys_pread(a0.into(), a1.into(), a2, a3 as _).await, - Sys::PWRITE64 => self.sys_pwrite(a0.into(), a1.into(), a2, a3 as _), - Sys::READV => self.sys_readv(a0.into(), a1.into(), a2).await, - Sys::WRITEV => self.sys_writev(a0.into(), a1.into(), a2), - Sys::SENDFILE => self.sys_sendfile(a0.into(), a1.into(), a2.into(), a3).await, + Sys::PREAD64 => { + self.sys_pread(a0.into(), self.into_out_userptr(a1).unwrap(), a2, a3 as _) + .await + } + Sys::PWRITE64 => { + self.sys_pwrite(a0.into(), self.into_in_userptr(a1).unwrap(), a2, a3 as _) + } + Sys::READV => { + self.sys_readv(a0.into(), self.into_in_userptr(a1).unwrap(), a2) + .await + } + Sys::WRITEV => self.sys_writev(a0.into(), self.into_in_userptr(a1).unwrap(), a2), + Sys::SENDFILE => { + self.sys_sendfile( + a0.into(), + a1.into(), + self.into_inout_userptr(a2).unwrap(), + a3, + ) + .await + } Sys::FCNTL => self.sys_fcntl(a0.into(), a1, a2), Sys::FLOCK => self.sys_flock(a0.into(), a1), Sys::FSYNC => self.sys_fsync(a0.into()), Sys::FDATASYNC => self.sys_fdatasync(a0.into()), - Sys::TRUNCATE => self.sys_truncate(a0.into(), a1), + Sys::TRUNCATE => self.sys_truncate(self.into_in_userptr(a0).unwrap(), a1), Sys::FTRUNCATE => self.sys_ftruncate(a0.into(), a1), - Sys::GETDENTS64 => self.sys_getdents64(a0.into(), a1.into(), a2), - Sys::GETCWD => self.sys_getcwd(a0.into(), a1), - Sys::CHDIR => self.sys_chdir(a0.into()), - Sys::RENAMEAT => self.sys_renameat(a0.into(), a1.into(), a2.into(), a3.into()), - Sys::MKDIRAT => self.sys_mkdirat(a0.into(), a1.into(), a2), - Sys::LINKAT => self.sys_linkat(a0.into(), a1.into(), a2.into(), a3.into(), a4), - Sys::UNLINKAT => self.sys_unlinkat(a0.into(), a1.into(), a2), + Sys::GETDENTS64 => { + self.sys_getdents64(a0.into(), self.into_out_userptr(a1).unwrap(), a2) + } + Sys::GETCWD => self.sys_getcwd(self.into_out_userptr(a0).unwrap(), a1), + Sys::CHDIR => self.sys_chdir(self.into_in_userptr(a0).unwrap()), + Sys::RENAMEAT => self.sys_renameat( + a0.into(), + self.into_in_userptr(a1).unwrap(), + a2.into(), + self.into_in_userptr(a3).unwrap(), + ), + Sys::MKDIRAT => self.sys_mkdirat(a0.into(), self.into_in_userptr(a1).unwrap(), a2), + Sys::LINKAT => self.sys_linkat( + a0.into(), + self.into_in_userptr(a1).unwrap(), + a2.into(), + self.into_in_userptr(a3).unwrap(), + a4, + ), + Sys::UNLINKAT => self.sys_unlinkat(a0.into(), self.into_in_userptr(a1).unwrap(), a2), Sys::SYMLINKAT => self.unimplemented("symlinkat", Err(LxError::EACCES)), - Sys::READLINKAT => self.sys_readlinkat(a0.into(), a1.into(), a2.into(), a3), + Sys::READLINKAT => self.sys_readlinkat( + a0.into(), + self.into_in_userptr(a1).unwrap(), + self.into_out_userptr(a2).unwrap(), + a3, + ), Sys::FCHMOD => self.unimplemented("fchmod", Ok(0)), Sys::FCHMODAT => self.unimplemented("fchmodat", Ok(0)), Sys::FCHOWN => self.unimplemented("fchown", Ok(0)), Sys::FCHOWNAT => self.unimplemented("fchownat", Ok(0)), - Sys::FACCESSAT => self.sys_faccessat(a0.into(), a1.into(), a2, a3), + Sys::FACCESSAT => { + self.sys_faccessat(a0.into(), self.into_in_userptr(a1).unwrap(), a2, a3) + } Sys::DUP => self.sys_dup(a0.into()), Sys::DUP3 => self.sys_dup2(a0.into(), a1.into()), // TODO: handle `flags` Sys::PIPE2 => self.sys_pipe2(a0.into(), a1), // TODO: handle `flags` - Sys::UTIMENSAT => self.sys_utimensat(a0.into(), a1.into(), a2.into(), a3), + Sys::UTIMENSAT => { + self.sys_utimensat(a0.into(), self.into_in_userptr(a1).unwrap(), a2.into(), a3) + } Sys::COPY_FILE_RANGE => { - self.sys_copy_file_range(a0.into(), a1.into(), a2.into(), a3.into(), a4, a5) - .await + self.sys_copy_file_range( + a0.into(), + self.into_inout_userptr(a1).unwrap(), + a2.into(), + self.into_inout_userptr(a3).unwrap(), + a4, + a5, + ) + .await } // io multiplexing Sys::PSELECT6 => { - self.sys_pselect6(a0, a1.into(), a2.into(), a3.into(), a4.into(), a5) - .await + self.sys_pselect6( + a0, + self.into_inout_userptr(a1).unwrap(), + self.into_inout_userptr(a2).unwrap(), + self.into_inout_userptr(a3).unwrap(), + self.into_in_userptr(a4).unwrap(), + a5, + ) + .await } - Sys::PPOLL => self.sys_ppoll(a0.into(), a1, a2.into()).await, // ignore sigmask + Sys::PPOLL => { + self.sys_ppoll( + self.into_inout_userptr(a0).unwrap(), + a1, + self.into_in_userptr(a2).unwrap(), + ) + .await + } // ignore sigmask // Sys::EPOLL_CREATE1 => self.sys_epoll_create1(a0), // Sys::EPOLL_CTL => self.sys_epoll_ctl(a0, a1, a2, a3.into()), // Sys::EPOLL_PWAIT => self.sys_epoll_pwait(a0, a1.into(), a2, a3, a4), @@ -192,10 +314,23 @@ impl Syscall<'_> { Sys::MADVISE => self.unimplemented("madvise", Ok(0)), // signal - Sys::RT_SIGACTION => self.sys_rt_sigaction(a0, a1.into(), a2.into(), a3), - Sys::RT_SIGPROCMASK => self.sys_rt_sigprocmask(a0 as _, a1.into(), a2.into(), a3), + Sys::RT_SIGACTION => self.sys_rt_sigaction( + a0, + self.into_in_userptr(a1).unwrap(), + self.into_out_userptr(a2).unwrap(), + a3, + ), + Sys::RT_SIGPROCMASK => self.sys_rt_sigprocmask( + a0 as _, + self.into_in_userptr(a1).unwrap(), + self.into_out_userptr(a2).unwrap(), + a3, + ), // Sys::RT_SIGRETURN => self.sys_rt_sigreturn(), - Sys::SIGALTSTACK => self.sys_sigaltstack(a0.into(), a1.into()), + Sys::SIGALTSTACK => self.sys_sigaltstack( + self.into_in_userptr(a0).unwrap(), + self.into_out_userptr(a1).unwrap(), + ), // Sys::KILL => self.sys_kill(a0, a1), // schedule @@ -205,9 +340,23 @@ impl Syscall<'_> { // socket Sys::SOCKET => self.sys_socket(a0, a1, a2), Sys::CONNECT => self.sys_connect(a0, a1.into(), a2).await, - Sys::ACCEPT => self.sys_accept(a0, a1.into(), a2.into()).await, + Sys::ACCEPT => { + self.sys_accept( + a0, + self.into_out_userptr(a1).unwrap(), + self.into_inout_userptr(a2).unwrap(), + ) + .await + } // Sys::ACCEPT4 => self.sys_accept(a0, a1.into(), a2.into()), // use accept for accept4 - Sys::SENDTO => self.sys_sendto(a0, a1.into(), a2, a3, a4.into(), a5), + Sys::SENDTO => self.sys_sendto( + a0, + self.into_in_userptr(a1).unwrap(), + a2, + a3, + self.into_in_userptr(a4).unwrap(), + a5, + ), Sys::RECVFROM => { self.sys_recvfrom(a0, a1.into(), a2, a3, a4.into(), a5.into()) .await @@ -215,41 +364,70 @@ impl Syscall<'_> { Sys::SENDMSG => self.unimplemented("sys_sendmsg(),", Ok(0)), Sys::RECVMSG => self.unimplemented("sys_recvmsg(a0, a1.into(), a2),", Ok(0)), Sys::SHUTDOWN => self.sys_shutdown(a0, a1), - Sys::BIND => self.sys_bind(a0, a1.into(), a2), + Sys::BIND => self.sys_bind(a0, self.into_in_userptr(a1).unwrap(), a2), Sys::LISTEN => self.sys_listen(a0, a1), - Sys::GETSOCKNAME => self.sys_getsockname(a0, a1.into(), a2.into()), + Sys::GETSOCKNAME => self.sys_getsockname( + a0, + self.into_out_userptr(a1).unwrap(), + self.into_inout_userptr(a2).unwrap(), + ), Sys::GETPEERNAME => { self.unimplemented("sys_getpeername(a0, a1.into(), a2.into()),", Ok(0)) } - Sys::SETSOCKOPT => self.sys_setsockopt(a0, a1, a2, a3.into(), a4), + Sys::SETSOCKOPT => { + self.sys_setsockopt(a0, a1, a2, self.into_in_userptr(a3).unwrap(), a4) + } Sys::GETSOCKOPT => { self.unimplemented("sys_getsockopt(a0, a1, a2, a3.into(), a4.into()),", Ok(0)) } // process - Sys::CLONE => self.sys_clone(a0, a1, a2.into(), a3.into(), a4), - Sys::EXECVE => self.sys_execve(a0.into(), a1.into(), a2.into()), + Sys::CLONE => { + // warn!("a2={} a3={}", a2, a3); + // self.sys_clone( + // a0, + // a1, + // self.into_out_userptr(a2).unwrap(), + // self.into_out_userptr(a3).unwrap(), + // a4, + // ) + self.sys_clone(a0, a1, a2.into(), a3.into(), a4) + } + Sys::EXECVE => self.sys_execve( + self.into_in_userptr(a0).unwrap(), + self.into_in_userptr(a1).unwrap(), + self.into_in_userptr(a2).unwrap(), + ), Sys::EXIT => self.sys_exit(a0 as _), Sys::EXIT_GROUP => self.sys_exit_group(a0 as _), Sys::WAIT4 => { self.sys_wait4(a0 as _, self.into_out_userptr(a1).unwrap(), a2 as _) .await } - Sys::SET_TID_ADDRESS => self.sys_set_tid_address(a0.into()), - Sys::FUTEX => self.sys_futex(a0, a1 as _, a2 as _, a3.into()).await, + Sys::SET_TID_ADDRESS => self.sys_set_tid_address(self.into_out_userptr(a0).unwrap()), + Sys::FUTEX => { + self.sys_futex(a0, a1 as _, a2 as _, self.into_in_userptr(a3).unwrap()) + .await + } Sys::TKILL => self.unimplemented("tkill", Ok(0)), // time - Sys::NANOSLEEP => self.sys_nanosleep(a0.into()).await, + Sys::NANOSLEEP => self.sys_nanosleep(self.into_in_userptr(a0).unwrap()).await, Sys::SETITIMER => self.unimplemented("setitimer", Ok(0)), - Sys::GETTIMEOFDAY => self.sys_gettimeofday(a0.into(), a1.into()), - Sys::CLOCK_GETTIME => self.sys_clock_gettime(a0, a1.into()), + Sys::GETTIMEOFDAY => self.sys_gettimeofday( + self.into_out_userptr(a0).unwrap(), + self.into_in_userptr(a1).unwrap(), + ), + Sys::CLOCK_GETTIME => self.sys_clock_gettime(a0, self.into_out_userptr(a1).unwrap()), // sem #[cfg(not(target_arch = "mips"))] Sys::SEMGET => self.sys_semget(a0, a1, a2), #[cfg(not(target_arch = "mips"))] - Sys::SEMOP => self.sys_semop(a0, a1.into(), a2).await, + Sys::SEMOP => { + self.sys_semop(a0, self.into_in_userptr(a1).unwrap(), a2) + .await + } #[cfg(not(target_arch = "mips"))] Sys::SEMCTL => self.sys_semctl(a0, a1, a2, a3), @@ -266,13 +444,13 @@ impl Syscall<'_> { // system Sys::GETPID => self.sys_getpid(), Sys::GETTID => self.sys_gettid(), - Sys::UNAME => self.sys_uname(a0.into()), + Sys::UNAME => self.sys_uname(self.into_out_userptr(a0).unwrap()), Sys::UMASK => self.unimplemented("umask", Ok(0o777)), // Sys::GETRLIMIT => self.sys_getrlimit(), // Sys::SETRLIMIT => self.sys_setrlimit(), - Sys::GETRUSAGE => self.sys_getrusage(a0, a1.into()), - Sys::SYSINFO => self.sys_sysinfo(a0.into()), - Sys::TIMES => self.sys_times(a0.into()), + Sys::GETRUSAGE => self.sys_getrusage(a0, self.into_out_userptr(a1).unwrap()), + Sys::SYSINFO => self.sys_sysinfo(self.into_out_userptr(a0).unwrap()), + Sys::TIMES => self.sys_times(self.into_out_userptr(a0).unwrap()), Sys::GETUID => self.unimplemented("getuid", Ok(0)), Sys::GETGID => self.unimplemented("getgid", Ok(0)), Sys::SETUID => self.unimplemented("setuid", Ok(0)), @@ -287,9 +465,16 @@ impl Syscall<'_> { // Sys::SETPRIORITY => self.sys_set_priority(a0), Sys::PRCTL => self.unimplemented("prctl", Ok(0)), Sys::MEMBARRIER => self.unimplemented("membarrier", Ok(0)), - Sys::PRLIMIT64 => self.sys_prlimit64(a0, a1, a2.into(), a3.into()), + Sys::PRLIMIT64 => self.sys_prlimit64( + a0, + a1, + self.into_in_userptr(a2).unwrap(), + self.into_out_userptr(a3).unwrap(), + ), // Sys::REBOOT => self.sys_reboot(a0 as u32, a1 as u32, a2 as u32, a3.into()), - Sys::GETRANDOM => self.sys_getrandom(a0.into(), a1 as usize, a2 as u32), + Sys::GETRANDOM => { + self.sys_getrandom(self.into_out_userptr(a0).unwrap(), a1 as usize, a2 as u32) + } Sys::RT_SIGQUEUEINFO => self.unimplemented("rt_sigqueueinfo", Ok(0)), // kernel module @@ -313,30 +498,55 @@ impl Syscall<'_> { async fn x86_64_syscall(&mut self, sys_type: Sys, args: [usize; 6]) -> SysResult { let [a0, a1, a2, a3, a4, _a5] = args; match sys_type { - Sys::OPEN => self.sys_open(a0.into(), a1, a2), - Sys::STAT => self.sys_stat(a0.into(), a1.into()), - Sys::LSTAT => self.sys_lstat(a0.into(), a1.into()), - Sys::POLL => self.sys_poll(a0.into(), a1, a2 as _).await, - Sys::ACCESS => self.sys_access(a0.into(), a1), - Sys::PIPE => self.sys_pipe(a0.into()), - Sys::SELECT => { - self.sys_select(a0, a1.into(), a2.into(), a3.into(), a4.into()) + Sys::OPEN => self.sys_open(self.into_in_userptr(a0).unwrap(), a1, a2), + Sys::STAT => self.sys_stat( + self.into_in_userptr(a0).unwrap(), + self.into_out_userptr(a1).unwrap(), + ), + Sys::LSTAT => self.sys_lstat( + self.into_in_userptr(a0).unwrap(), + self.into_out_userptr(a1).unwrap(), + ), + Sys::POLL => { + self.sys_poll(self.into_inout_userptr(a0).unwrap(), a1, a2 as _) .await } + Sys::ACCESS => self.sys_access(self.into_in_userptr(a0).unwrap(), a1), + Sys::PIPE => self.sys_pipe(self.into_out_userptr(a0).unwrap()), + Sys::SELECT => { + self.sys_select( + a0, + self.into_inout_userptr(a1).unwrap(), + self.into_inout_userptr(a2).unwrap(), + self.into_inout_userptr(a3).unwrap(), + self.into_in_userptr(a4).unwrap(), + ) + .await + } Sys::DUP2 => self.sys_dup2(a0.into(), a1.into()), // Sys::ALARM => self.unimplemented("alarm", Ok(0)), Sys::FORK => self.sys_fork(), Sys::VFORK => self.sys_vfork().await, - Sys::RENAME => self.sys_rename(a0.into(), a1.into()), - Sys::MKDIR => self.sys_mkdir(a0.into(), a1), - Sys::RMDIR => self.sys_rmdir(a0.into()), - Sys::LINK => self.sys_link(a0.into(), a1.into()), - Sys::UNLINK => self.sys_unlink(a0.into()), - Sys::READLINK => self.sys_readlink(a0.into(), a1.into(), a2), + Sys::RENAME => self.sys_rename( + self.into_in_userptr(a0).unwrap(), + self.into_in_userptr(a1).unwrap(), + ), + Sys::MKDIR => self.sys_mkdir(self.into_in_userptr(a0).unwrap(), a1), + Sys::RMDIR => self.sys_rmdir(self.into_in_userptr(a0).unwrap()), + Sys::LINK => self.sys_link( + self.into_in_userptr(a0).unwrap(), + self.into_in_userptr(a1).unwrap(), + ), + Sys::UNLINK => self.sys_unlink(self.into_in_userptr(a0).unwrap()), + Sys::READLINK => self.sys_readlink( + self.into_in_userptr(a0).unwrap(), + self.into_out_userptr(a1).unwrap(), + a2, + ), Sys::CHMOD => self.unimplemented("chmod", Ok(0)), Sys::CHOWN => self.unimplemented("chown", Ok(0)), Sys::ARCH_PRCTL => self.sys_arch_prctl(a0 as _, a1), - Sys::TIME => self.sys_time(a0.into()), + Sys::TIME => self.sys_time(self.into_out_userptr(a0).unwrap()), // Sys::EPOLL_CREATE => self.sys_epoll_create(a0), // Sys::EPOLL_WAIT => self.sys_epoll_wait(a0, a1.into(), a2, a3), _ => self.unknown_syscall(sys_type), diff --git a/zircon-object/src/vm/vmar.rs b/zircon-object/src/vm/vmar.rs index e90eb3ed..41478960 100644 --- a/zircon-object/src/vm/vmar.rs +++ b/zircon-object/src/vm/vmar.rs @@ -4,7 +4,7 @@ use { alloc::{sync::Arc, vec, vec::Vec}, bitflags::bitflags, kernel_hal::vm::{ - GenericPageTable, IgnoreNotMappedErr, Page, PageSize, PageTable, PagingError, + GenericPageTable, IgnoreNotMappedErr, Page, PageSize, PageTable, PagingError, PagingResult, }, spin::Mutex, }; @@ -404,12 +404,19 @@ impl VmAddressRegion { /// get flags of vaddr pub fn get_vaddr_flags(&self, vaddr: usize) -> ZxResult { - let mut guard = self.inner.lock(); - let inner = guard.as_mut().ok_or(ZxError::BAD_STATE)?; - for mapping in &inner.mappings { - if mapping.contains(vaddr) { - return mapping.get_flags(vaddr); + let guard = self.inner.lock(); + let inner = guard.as_ref().unwrap(); + if !self.contains(vaddr) { + return Err(ZxError::NOT_FOUND); + } + if let Some(child) = inner.children.iter().find(|ch| ch.contains(vaddr)) { + return child.get_vaddr_flags(vaddr); + } + if let Some(mapping) = inner.mappings.iter().find(|map| map.contains(vaddr)) { + if let Ok((_, flags, _)) = mapping.query_vaddr(vaddr) { + return Ok(flags); } + return Err(ZxError::INTERNAL); } Err(ZxError::NO_MEMORY) } @@ -494,7 +501,8 @@ impl VmAddressRegion { self.overlap(begin, end) && !self.within(begin, end) } - fn contains(&self, vaddr: VirtAddr) -> bool { + /// return true if vmar contains vaddr, or return false. + pub fn contains(&self, vaddr: VirtAddr) -> bool { self.addr <= vaddr && vaddr < self.end_addr() } @@ -907,6 +915,11 @@ impl VmMapping { } } + /// query vaddr's PhysAddr, PhysAddr, PageSize. + pub fn query_vaddr(&self, vaddr: usize) -> PagingResult<(PhysAddr, MMUFlags, PageSize)> { + self.page_table.lock().query(vaddr) + } + /// Remove WRITE flag from the mappings for Copy-on-Write. pub(super) fn range_change(&self, offset: usize, len: usize, op: RangeChangeOp) { let inner = self.inner.try_lock(); From 2c4b2f2c70bfb770eb08b29daa4885d20cfd1f61 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sat, 19 Feb 2022 21:05:03 +0800 Subject: [PATCH 29/44] remove linux-user --- linux-user | 1 - 1 file changed, 1 deletion(-) delete mode 160000 linux-user diff --git a/linux-user b/linux-user deleted file mode 160000 index 8d04b64e..00000000 --- a/linux-user +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d04b64ea119d3e552ad2e79797e023647a48268 From d25a982a7a908ac41f6f10f1c8c3c442500aa381 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sun, 20 Feb 2022 17:57:30 +0800 Subject: [PATCH 30/44] refactor: replace ZxResult with PagingResult --- kernel-hal/src/libos/vm.rs | 2 +- linux-syscall/src/lib.rs | 101 +++++++++++++---------------------- zircon-object/src/vm/vmar.rs | 11 ++-- 3 files changed, 42 insertions(+), 72 deletions(-) diff --git a/kernel-hal/src/libos/vm.rs b/kernel-hal/src/libos/vm.rs index bf40ed25..081207cd 100644 --- a/kernel-hal/src/libos/vm.rs +++ b/kernel-hal/src/libos/vm.rs @@ -68,7 +68,7 @@ impl GenericPageTable for PageTable { } fn query(&self, vaddr: VirtAddr) -> PagingResult<(PhysAddr, MMUFlags, PageSize)> { - debug_assert!(is_aligned(vaddr)); + // debug_assert!(is_aligned(vaddr)); if PMEM_MAP_VADDR <= vaddr && vaddr < PMEM_MAP_VADDR + PMEM_SIZE { Ok(( vaddr - PMEM_MAP_VADDR, diff --git a/linux-syscall/src/lib.rs b/linux-syscall/src/lib.rs index 798c3a2c..be58a42e 100644 --- a/linux-syscall/src/lib.rs +++ b/linux-syscall/src/lib.rs @@ -28,13 +28,14 @@ use alloc::sync::Arc; use core::convert::TryFrom; use kernel_hal::user::{IoVecIn, IoVecOut, UserInOutPtr, UserInPtr, UserOutPtr}; +use kernel_hal::vm::{PagingError, PagingResult}; use kernel_hal::MMUFlags; use linux_object::error::{LxError, SysResult}; use linux_object::fs::FileDesc; use linux_object::process::{wait_child, wait_child_any, LinuxProcess, ProcessExt, RLimit}; use zircon_object::object::{KernelObject, KoID, Signal}; use zircon_object::task::{CurrentThread, Process, Thread, ThreadFn}; -use zircon_object::{vm::VirtAddr, ZxError, ZxResult}; +use zircon_object::{vm::VirtAddr, ZxError}; use self::consts::SyscallType as Sys; @@ -62,25 +63,30 @@ pub struct Syscall<'a> { } impl Syscall<'_> { - /// convert a usize num to in and out userptr - pub fn into_inout_userptr(&self, vaddr: usize) -> ZxResult> { - if 0 == vaddr { - return Ok(vaddr.into()); - } - + fn check_pagefault(&self, vaddr: usize, flags: MMUFlags) -> PagingResult<()> { let vmar = self.thread.proc().vmar(); if !vmar.contains(vaddr) { - return Err(ZxError::NO_MEMORY); + return Err(PagingError::NoMemory); } - let is_handle_read_pagefault; - let is_handle_write_pagefault; - if let Ok(vaddr_flags) = vmar.get_vaddr_flags(vaddr) { - is_handle_read_pagefault = !vaddr_flags.contains(MMUFlags::READ); - is_handle_write_pagefault = !vaddr_flags.contains(MMUFlags::WRITE); - } else { - is_handle_read_pagefault = true; - is_handle_write_pagefault = true; + let mut is_handle_read_pagefault = flags.contains(MMUFlags::READ); + let mut is_handle_write_pagefault = flags.contains(MMUFlags::WRITE); + + match vmar.get_vaddr_flags(vaddr) { + Ok(vaddr_flags) => { + is_handle_read_pagefault &= !vaddr_flags.contains(MMUFlags::READ); + is_handle_write_pagefault &= !vaddr_flags.contains(MMUFlags::WRITE); + } + Err(PagingError::NotMapped) => { + is_handle_read_pagefault &= true; + is_handle_write_pagefault &= true; + } + Err(PagingError::NoMemory) => { + return Err(PagingError::NoMemory); + } + Err(PagingError::AlreadyMapped) => { + panic!("get_vaddr_flags error!!!"); + } } if is_handle_read_pagefault { @@ -94,67 +100,37 @@ impl Syscall<'_> { panic!("into_out_userptr handle_page_fault: {:?}", err); } } + Ok(()) + } + + /// convert a usize num to in and out userptr + pub fn into_inout_userptr(&self, vaddr: usize) -> PagingResult> { + if 0 == vaddr { + return Ok(vaddr.into()); + } + + let access_flags = MMUFlags::READ | MMUFlags::WRITE; + self.check_pagefault(vaddr, access_flags)?; Ok(vaddr.into()) } /// convert a usize num to in userptr - pub fn into_in_userptr(&self, vaddr: usize) -> ZxResult> { + pub fn into_in_userptr(&self, vaddr: usize) -> PagingResult> { if 0 == vaddr { return Ok(vaddr.into()); } - let vmar = self.thread.proc().vmar(); - if !vmar.contains(vaddr) { - return Err(ZxError::NO_MEMORY); - } - - let is_handle_read_pagefault; - if let Ok(vaddr_flags) = vmar.get_vaddr_flags(vaddr) { - is_handle_read_pagefault = !vaddr_flags.contains(MMUFlags::READ); - } else { - is_handle_read_pagefault = true; - } - - if is_handle_read_pagefault { - error!("handle read pagefault"); - if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::READ) { - panic!("into_out_userptr handle_page_fault: {:?}", err); - } - } + self.check_pagefault(vaddr, MMUFlags::READ)?; Ok(vaddr.into()) } /// convert a usize num to out userptr - pub fn into_out_userptr(&self, vaddr: usize) -> ZxResult> { + pub fn into_out_userptr(&self, vaddr: usize) -> PagingResult> { if 0 == vaddr { return Ok(vaddr.into()); } - let vmar = self.thread.proc().vmar(); - if !vmar.contains(vaddr) { - return Err(ZxError::NO_MEMORY); - } - - let is_handle_write_pagefault; - if let Ok(vaddr_flags) = vmar.get_vaddr_flags(vaddr) { - is_handle_write_pagefault = !vaddr_flags.contains(MMUFlags::WRITE); - } else { - is_handle_write_pagefault = true; - } - - if is_handle_write_pagefault { - if let Err(err) = vmar.handle_page_fault(vaddr, MMUFlags::WRITE) { - panic!( - "into_out_userptr handle_page_fault: {:?} vaddr={}", - err, vaddr - ); - } - } - let f = vmar.get_vaddr_flags(vaddr).unwrap(); - // warn!("vaddr={:x} flags={:?} before={:?}", vaddr, f, before_flags); - if !f.contains(MMUFlags::WRITE) { - panic!("handle pagefault error"); - } + self.check_pagefault(vaddr, MMUFlags::WRITE)?; Ok(vaddr.into()) } @@ -174,9 +150,6 @@ impl Syscall<'_> { } }; let [a0, a1, a2, a3, a4, a5] = args; - // for reg in args { - // self.check_addr(reg); - // } let ret = match sys_type { Sys::READ => { self.sys_read(a0.into(), self.into_out_userptr(a1).unwrap(), a2) diff --git a/zircon-object/src/vm/vmar.rs b/zircon-object/src/vm/vmar.rs index 41478960..dac69055 100644 --- a/zircon-object/src/vm/vmar.rs +++ b/zircon-object/src/vm/vmar.rs @@ -403,22 +403,19 @@ impl VmAddressRegion { } /// get flags of vaddr - pub fn get_vaddr_flags(&self, vaddr: usize) -> ZxResult { + pub fn get_vaddr_flags(&self, vaddr: usize) -> PagingResult { let guard = self.inner.lock(); let inner = guard.as_ref().unwrap(); if !self.contains(vaddr) { - return Err(ZxError::NOT_FOUND); + return Err(PagingError::NoMemory); } if let Some(child) = inner.children.iter().find(|ch| ch.contains(vaddr)) { return child.get_vaddr_flags(vaddr); } if let Some(mapping) = inner.mappings.iter().find(|map| map.contains(vaddr)) { - if let Ok((_, flags, _)) = mapping.query_vaddr(vaddr) { - return Ok(flags); - } - return Err(ZxError::INTERNAL); + return mapping.query_vaddr(vaddr).map(|(_, flags, _)| flags); } - Err(ZxError::NO_MEMORY) + return Err(PagingError::NoMemory); } /// Determine final address with given input `offset` and `len`. From 210e1832573072b11f14b960fe12bff674dccc44 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Sun, 20 Feb 2022 21:13:56 +0800 Subject: [PATCH 31/44] remove check_pagefault logic in libos mod --- kernel-hal/src/libos/vm.rs | 2 +- linux-syscall/src/lib.rs | 11 ++++++++++- zircon-object/src/vm/vmar.rs | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel-hal/src/libos/vm.rs b/kernel-hal/src/libos/vm.rs index 081207cd..bf40ed25 100644 --- a/kernel-hal/src/libos/vm.rs +++ b/kernel-hal/src/libos/vm.rs @@ -68,7 +68,7 @@ impl GenericPageTable for PageTable { } fn query(&self, vaddr: VirtAddr) -> PagingResult<(PhysAddr, MMUFlags, PageSize)> { - // debug_assert!(is_aligned(vaddr)); + debug_assert!(is_aligned(vaddr)); if PMEM_MAP_VADDR <= vaddr && vaddr < PMEM_MAP_VADDR + PMEM_SIZE { Ok(( vaddr - PMEM_MAP_VADDR, diff --git a/linux-syscall/src/lib.rs b/linux-syscall/src/lib.rs index be58a42e..eb0484f9 100644 --- a/linux-syscall/src/lib.rs +++ b/linux-syscall/src/lib.rs @@ -28,7 +28,9 @@ use alloc::sync::Arc; use core::convert::TryFrom; use kernel_hal::user::{IoVecIn, IoVecOut, UserInOutPtr, UserInPtr, UserOutPtr}; -use kernel_hal::vm::{PagingError, PagingResult}; +#[cfg(target_os = "none")] +use kernel_hal::vm::PagingError; +use kernel_hal::vm::PagingResult; use kernel_hal::MMUFlags; use linux_object::error::{LxError, SysResult}; use linux_object::fs::FileDesc; @@ -63,6 +65,12 @@ pub struct Syscall<'a> { } impl Syscall<'_> { + #[cfg(not(target_os = "none"))] + fn check_pagefault(&self, _vaddr: usize, _flags: MMUFlags) -> PagingResult<()> { + Ok(()) + } + + #[cfg(target_os = "none")] fn check_pagefault(&self, vaddr: usize, flags: MMUFlags) -> PagingResult<()> { let vmar = self.thread.proc().vmar(); if !vmar.contains(vaddr) { @@ -82,6 +90,7 @@ impl Syscall<'_> { is_handle_write_pagefault &= true; } Err(PagingError::NoMemory) => { + warn!("check_pagefault: vaddr(0x{:x}) NoMemory", vaddr); return Err(PagingError::NoMemory); } Err(PagingError::AlreadyMapped) => { diff --git a/zircon-object/src/vm/vmar.rs b/zircon-object/src/vm/vmar.rs index dac69055..e5de0565 100644 --- a/zircon-object/src/vm/vmar.rs +++ b/zircon-object/src/vm/vmar.rs @@ -415,7 +415,7 @@ impl VmAddressRegion { if let Some(mapping) = inner.mappings.iter().find(|map| map.contains(vaddr)) { return mapping.query_vaddr(vaddr).map(|(_, flags, _)| flags); } - return Err(PagingError::NoMemory); + Err(PagingError::NoMemory) } /// Determine final address with given input `offset` and `len`. From a0ac9a1fb51b5640efee9f5d3974fec216f04ac1 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Tue, 22 Feb 2022 09:04:18 +0800 Subject: [PATCH 32/44] fix: ingore timeout argument when op is wake --- .gitignore | 1 + linux-syscall/src/lib.rs | 5 +++-- linux-syscall/src/misc.rs | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f105611a..0040951c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ zCore/generic_fw_jump.bin zCore/fw_jump.bin zCore/src/platform/riscv/boot/kernel-vars.ld zCore/bug.txt +.vscode/settings.json diff --git a/linux-syscall/src/lib.rs b/linux-syscall/src/lib.rs index eb0484f9..62f588c9 100644 --- a/linux-syscall/src/lib.rs +++ b/linux-syscall/src/lib.rs @@ -90,7 +90,7 @@ impl Syscall<'_> { is_handle_write_pagefault &= true; } Err(PagingError::NoMemory) => { - warn!("check_pagefault: vaddr(0x{:x}) NoMemory", vaddr); + error!("check_pagefault: vaddr(0x{:x}) NoMemory", vaddr); return Err(PagingError::NoMemory); } Err(PagingError::AlreadyMapped) => { @@ -388,7 +388,8 @@ impl Syscall<'_> { } Sys::SET_TID_ADDRESS => self.sys_set_tid_address(self.into_out_userptr(a0).unwrap()), Sys::FUTEX => { - self.sys_futex(a0, a1 as _, a2 as _, self.into_in_userptr(a3).unwrap()) + // ignore timeout argument when op is wake + self.sys_futex(a0, a1 as _, a2 as _, a3) .await } Sys::TKILL => self.unimplemented("tkill", Ok(0)), diff --git a/linux-syscall/src/misc.rs b/linux-syscall/src/misc.rs index f24ec748..df50c34b 100644 --- a/linux-syscall/src/misc.rs +++ b/linux-syscall/src/misc.rs @@ -74,13 +74,24 @@ impl Syscall<'_> { uaddr: usize, op: u32, val: i32, - timeout: UserInPtr, + timeout_addr: usize, ) -> SysResult { let op = FutexFlags::from_bits_truncate(op); + let timeout; + if op.contains(FutexFlags::WAKE) { + timeout = self.into_inout_userptr::(0).unwrap(); + } else { + let timeout_result = self.into_inout_userptr::(timeout_addr); + timeout = match timeout_result { + Ok(t) => t, + Err(_e) => return Err(LxError::EACCES), + } + } info!( "futex: uaddr: {:#x}, op: {:?}, val: {}, timeout_ptr: {:?}", uaddr, op, val, timeout ); + if op.contains(FutexFlags::PRIVATE) { warn!("process-shared futex is unimplemented"); } From 63e147a304addebb347140479ff812b78338be35 Mon Sep 17 00:00:00 2001 From: pleasewhy <1943788269@qq.com> Date: Tue, 22 Feb 2022 21:45:56 +0800 Subject: [PATCH 33/44] style --- linux-syscall/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux-syscall/src/lib.rs b/linux-syscall/src/lib.rs index 62f588c9..aebabc9c 100644 --- a/linux-syscall/src/lib.rs +++ b/linux-syscall/src/lib.rs @@ -389,8 +389,7 @@ impl Syscall<'_> { Sys::SET_TID_ADDRESS => self.sys_set_tid_address(self.into_out_userptr(a0).unwrap()), Sys::FUTEX => { // ignore timeout argument when op is wake - self.sys_futex(a0, a1 as _, a2 as _, a3) - .await + self.sys_futex(a0, a1 as _, a2 as _, a3).await } Sys::TKILL => self.unimplemented("tkill", Ok(0)), From dd5ebd44a0a6e377ca5920b83c4f9e7ee050d22c Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Sat, 6 Nov 2021 02:15:41 +0800 Subject: [PATCH 34/44] Add support to exit qemu for bare-metal test --- kernel-hal/Cargo.toml | 2 +- kernel-hal/src/bare/arch/riscv/cpu.rs | 5 ++ kernel-hal/src/bare/arch/riscv/sbi.rs | 5 ++ kernel-hal/src/bare/arch/x86_64/cpu.rs | 9 ++++ kernel-hal/src/bare/arch/x86_64/special.rs | 12 +---- kernel-hal/src/hal_fn.rs | 3 ++ kernel-hal/src/libos/cpu.rs | 5 ++ zCore/Cargo.toml | 17 ++++++- zCore/Makefile | 7 ++- zCore/src/lang.rs | 11 ++-- zCore/src/main.rs | 1 + zCore/src/utils.rs | 58 ++++++++++++++++------ zircon-object/src/dev/pci/pio.rs | 18 ++++--- 13 files changed, 113 insertions(+), 40 deletions(-) diff --git a/kernel-hal/Cargo.toml b/kernel-hal/Cargo.toml index c6264f95..7162f263 100644 --- a/kernel-hal/Cargo.toml +++ b/kernel-hal/Cargo.toml @@ -35,7 +35,7 @@ bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator", rev = # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] -executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } +executor = { git = "https://github.com/rcore-os/executor.git", rev = "85b9335" } naive-timer = "0.2.0" # All mode on x86_64 diff --git a/kernel-hal/src/bare/arch/riscv/cpu.rs b/kernel-hal/src/bare/arch/riscv/cpu.rs index 9baae917..7c09ec34 100644 --- a/kernel-hal/src/bare/arch/riscv/cpu.rs +++ b/kernel-hal/src/bare/arch/riscv/cpu.rs @@ -9,5 +9,10 @@ hal_fn_impl! { fn cpu_frequency() -> u16 { *CPU_FREQ_MHZ } + + fn reset() -> ! { + info!("shutdown..."); + super::sbi::shutdown() + } } } diff --git a/kernel-hal/src/bare/arch/riscv/sbi.rs b/kernel-hal/src/bare/arch/riscv/sbi.rs index 8c66f210..e67b6c82 100644 --- a/kernel-hal/src/bare/arch/riscv/sbi.rs +++ b/kernel-hal/src/bare/arch/riscv/sbi.rs @@ -49,6 +49,11 @@ pub fn send_ipi(sipi_value: usize) { sbi_call(SBI_SEND_IPI, sipi_value, 0, 0); } +pub fn shutdown() -> ! { + sbi_call(SBI_SHUTDOWN, 0, 0, 0); + unreachable!(); +} + hal_fn_impl! { impl mod crate::hal_fn::console { fn console_write_early(s: &str) { diff --git a/kernel-hal/src/bare/arch/x86_64/cpu.rs b/kernel-hal/src/bare/arch/x86_64/cpu.rs index b00b45ab..2ccd3abd 100644 --- a/kernel-hal/src/bare/arch/x86_64/cpu.rs +++ b/kernel-hal/src/bare/arch/x86_64/cpu.rs @@ -22,5 +22,14 @@ hal_fn_impl! { .max(DEFAULT) }) } + + fn reset() -> ! { + info!("shutdown..."); + loop { + use zcore_drivers::io::{Io, Pio}; + Pio::::new(0x604).write(0x2000); + super::interrupt::wait_for_interrupt(); + } + } } } diff --git a/kernel-hal/src/bare/arch/x86_64/special.rs b/kernel-hal/src/bare/arch/x86_64/special.rs index 7419e10d..c472fb8e 100644 --- a/kernel-hal/src/bare/arch/x86_64/special.rs +++ b/kernel-hal/src/bare/arch/x86_64/special.rs @@ -1,16 +1,6 @@ //! Functions only available on x86 platforms. -use x86_64::instructions::port::Port; - -/// IO Port in instruction -pub fn pio_read(port: u16) -> u32 { - unsafe { Port::new(port).read() } -} - -/// IO Port out instruction -pub fn pio_write(port: u16, value: u32) { - unsafe { Port::new(port).write(value) } -} +pub use zcore_drivers::io::{Io, Pio}; /// Get physical address of `acpi_rsdp` and `smbios` on x86_64. pub fn pc_firmware_tables() -> (u64, u64) { diff --git a/kernel-hal/src/hal_fn.rs b/kernel-hal/src/hal_fn.rs index 33161c18..997a9d21 100644 --- a/kernel-hal/src/hal_fn.rs +++ b/kernel-hal/src/hal_fn.rs @@ -37,6 +37,9 @@ hal_fn_def! { /// Current CPU frequency in MHz. pub fn cpu_frequency() -> u16 { 3000 } + + /// Shutdown/reboot the machine. + pub fn reset() -> !; } /// Physical memory operations. diff --git a/kernel-hal/src/libos/cpu.rs b/kernel-hal/src/libos/cpu.rs index c137134e..9c60efb5 100644 --- a/kernel-hal/src/libos/cpu.rs +++ b/kernel-hal/src/libos/cpu.rs @@ -5,5 +5,10 @@ hal_fn_impl! { fn cpu_id() -> u8 { std::thread::current().id().as_u64().get() as u8 } + + fn reset() -> ! { + info!("shutdown..."); + std::process::exit(0); + } } } diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index d87eac6e..bad06f56 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -16,15 +16,30 @@ doc = false [features] default = ["libos"] + +# Print colorless logs colorless-log = [] + +# Enable graphical output graphic = ["kernel-hal/graphic"] + +# Directly link the user image to the kernel image link-user-img = [] +# For bare-metal testing, if kernel panic or the root process is finished, +# shutdown the machine and exit QEMU. +baremetal-test = [] + +# Run as Zircon mode zircon = ["zcore-loader/zircon"] +# Run as Linux mode linux = ["zcore-loader/linux", "linux-object", "rcore-fs", "rcore-fs-sfs"] +# Run as LibOS libos = ["kernel-hal/libos", "zcore-loader/libos", "async-std", "chrono", "rcore-fs-hostfs"] +# Run on QEMU board-qemu = [] +# Run on Allwinner d1 (riscv only) board-d1 = ["link-user-img"] [dependencies] @@ -49,7 +64,7 @@ rcore-fs-hostfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] buddy_system_allocator = "0.7" -executor = { git = "https://github.com/rcore-os/executor.git", rev = "04b6b7b" } +executor = { git = "https://github.com/rcore-os/executor.git", rev = "85b9335" } # Bare-metal mode on x86_64 [target.'cfg(all(target_os = "none", target_arch = "x86_64"))'.dependencies] diff --git a/zCore/Makefile b/zCore/Makefile index 9f61f8b2..a39b8aee 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -6,13 +6,14 @@ MODE ?= debug LOG ?= warn LINUX ?= LIBOS ?= +TEST ?= GRAPHIC ?= HYPERVISOR ?= V ?= USER ?= ZBI ?= bringup -CMDLINE ?= +CMDLINE ?= LOG=$(LOG) SMP ?= 1 ACCEL ?= @@ -89,6 +90,10 @@ else endif endif +ifeq ($(TEST), 1) + features += baremetal-test +endif + ifeq ($(GRAPHIC), on) features += graphic else ifeq ($(MAKECMDGOALS), vbox) diff --git a/zCore/src/lang.rs b/zCore/src/lang.rs index 121da959..b76ae295 100644 --- a/zCore/src/lang.rs +++ b/zCore/src/lang.rs @@ -3,15 +3,18 @@ use core::alloc::Layout; use core::panic::PanicInfo; use log::*; -//use zircon_object::util::kcounter::KCounterDescriptorArray; #[panic_handler] fn panic(info: &PanicInfo) -> ! { println!("\n\n{}", info); error!("\n\n{}", info); - //error!("{:#?}", KCounterDescriptorArray::get()); - loop { - core::hint::spin_loop(); + + if cfg!(feature = "baremetal-test") { + kernel_hal::cpu::reset(); + } else { + loop { + core::hint::spin_loop(); + } } } diff --git a/zCore/src/main.rs b/zCore/src/main.rs index d7b155cf..4efc8d8a 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -54,6 +54,7 @@ fn primary_main(config: kernel_hal::KernelConfig) { } #[allow(dead_code)] +#[cfg(not(feature = "libos"))] fn secondary_main() -> ! { kernel_hal::secondary_init(); utils::wait_for_exit(None) diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index 5f1cd00b..2793f6ac 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -2,6 +2,7 @@ #![allow(unused_variables)] use alloc::{collections::BTreeMap, string::String, sync::Arc}; +use zircon_object::object::KernelObject; use zircon_object::task::Process; #[derive(Debug)] @@ -63,11 +64,30 @@ pub fn boot_options() -> BootOptions { } } +fn check_exit_code(proc: Arc) -> i32 { + let code = proc.exit_code().unwrap_or(-1); + if code != 0 { + error!( + "process {:?}({}) exited with code {:?}", + proc.name(), + proc.id(), + code + ); + } else { + info!( + "process {:?}({}) exited with code 0", + proc.name(), + proc.id() + ) + } + code as i32 +} + +#[cfg(feature = "libos")] pub fn wait_for_exit(proc: Option>) -> ! { - #[cfg(feature = "libos")] - if let Some(proc) = proc { + let exit_code = if let Some(proc) = proc { let future = async move { - use zircon_object::object::{KernelObject, Signal}; + use zircon_object::object::Signal; let object: Arc = proc.clone(); let signal = if cfg!(feature = "zircon") { Signal::USER_SIGNAL_0 @@ -75,14 +95,7 @@ pub fn wait_for_exit(proc: Option>) -> ! { Signal::PROCESS_TERMINATED }; object.wait_signal(signal).await; - let code = proc.exit_code().unwrap_or(-1); - info!( - "process {:?}({}) exited with code {:?}", - proc.name(), - proc.id(), - code - ); - code + check_exit_code(proc) }; // If the graphic mode is on, run the process in another thread. @@ -93,12 +106,25 @@ pub fn wait_for_exit(proc: Option>) -> ! { handle }; - let code = async_std::task::block_on(future); - std::process::exit(code as i32); - } + async_std::task::block_on(future) + } else { + warn!("No process to run, exit!"); + 0 + }; + std::process::exit(exit_code); +} + +#[cfg(not(feature = "libos"))] +pub fn wait_for_exit(proc: Option>) -> ! { loop { - #[cfg(not(feature = "libos"))] - executor::run_until_idle(); + let has_task = executor::run_until_idle(); + if cfg!(feature = "baremetal-test") && !has_task { + proc.map(check_exit_code); + // if let Some(p) = proc { + // check_exit_code(p); + // } + kernel_hal::cpu::reset(); + } kernel_hal::interrupt::wait_for_interrupt(); } } diff --git a/zircon-object/src/dev/pci/pio.rs b/zircon-object/src/dev/pci/pio.rs index 36bde801..73d03076 100644 --- a/zircon-object/src/dev/pci/pio.rs +++ b/zircon-object/src/dev/pci/pio.rs @@ -12,7 +12,7 @@ pub fn pci_bdf_raw_addr(bus: u8, dev: u8, func: u8, offset: u8) -> u32 { cfg_if::cfg_if! { if #[cfg(all(target_arch = "x86_64", target_os = "none"))] { - use kernel_hal::x86_64::{pio_read, pio_write}; + use kernel_hal::x86_64::{Io, Pio}; use spin::Mutex; static PIO_LOCK: Mutex<()> = Mutex::new(()); @@ -21,30 +21,36 @@ if #[cfg(all(target_arch = "x86_64", target_os = "none"))] { const PCI_CONFIG_ENABLE: u32 = 1 << 31; pub fn pio_config_read_addr(addr: u32, width: usize) -> ZxResult { + let mut port_cfg = Pio::::new(PCI_CONFIG_ADDR); + let port_data = Pio::::new(PCI_CONFIG_DATA); + let _lock = PIO_LOCK.lock(); let shift = ((addr & 0x3) << 3) as usize; if shift + width > 32 { return Err(ZxError::INVALID_ARGS); } - pio_write(PCI_CONFIG_ADDR, (addr & !0x3) | PCI_CONFIG_ENABLE); - let tmp_val = u32::from_le(pio_read(PCI_CONFIG_DATA)); + port_cfg.write((addr & !0x3) | PCI_CONFIG_ENABLE); + let tmp_val = u32::from_le(port_data.read()); Ok((tmp_val >> shift) & (((1u64 << width) - 1) as u32)) } pub fn pio_config_write_addr(addr: u32, val: u32, width: usize) -> ZxResult { + let mut port_cfg = Pio::::new(PCI_CONFIG_ADDR); + let mut port_data = Pio::::new(PCI_CONFIG_DATA); + let _lock = PIO_LOCK.lock(); let shift = ((addr & 0x3) << 3) as usize; if shift + width > 32 { return Err(ZxError::INVALID_ARGS); } - pio_write(PCI_CONFIG_ADDR, (addr & !0x3) | PCI_CONFIG_ENABLE); + port_cfg.write((addr & !0x3) | PCI_CONFIG_ENABLE); let width_mask = ((1u64 << width) - 1) as u32; let val = val & width_mask; let tmp_val = if width < 32 { - (u32::from_le(pio_read(PCI_CONFIG_DATA)) & !(width_mask << shift)) | (val << shift) + (u32::from_le(port_data.read()) & !(width_mask << shift)) | (val << shift) } else { val }; - pio_write(PCI_CONFIG_DATA, u32::to_le(tmp_val)); + port_data.write(u32::to_le(tmp_val)); Ok(()) } } else { From 7763b9d4e0ca2a7bc59ad8accf7c4612e25f9cb9 Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Wed, 23 Feb 2022 20:46:32 +0800 Subject: [PATCH 35/44] Remove old test scripts --- .gitignore | 19 +- scripts/baremetal-core-tests.py | 77 -- ...baremetal-libc-test-find-failed-riscv64.py | 72 -- scripts/baremetal-libc-test-find-failed.py | 95 -- scripts/baremetal-libc-test-ones-riscv64.py | 66 -- scripts/baremetal-libc-test-ones.py | 107 --- scripts/baremetal-libc-test.py | 105 --- scripts/baremetal-test-riscv64.py | 79 -- scripts/core-tests.py | 77 -- scripts/libos-libc-tests.py | 76 -- scripts/linux/baremetal-test-all.txt | 477 ---------- scripts/linux/baremetal-test-allow-rv64.txt | 525 ----------- scripts/linux/baremetal-test-allow.txt | 477 ---------- .../linux/baremetal-test-allow.txt.busybox | 53 -- .../linux/baremetal-test-allow.txt.lmbench | 27 - scripts/linux/baremetal-test-allow.txt.lua | 9 - scripts/linux/baremetal-test-allow.txt.oscomp | 33 - scripts/linux/baremetal-test-fail-rv64.txt | 71 -- scripts/linux/baremetal-test-fail.txt | 57 -- scripts/linux/baremetal-test-ones-rv64.txt | 1 - scripts/linux/baremetal-test-ones.txt | 2 - scripts/linux/libos-test-allow-failed.txt | 40 - scripts/requirements.txt | 2 - scripts/unix-core-testone.py | 22 - scripts/unix-core-tests.py | 85 -- scripts/zircon/test-check-passed.txt | 511 ----------- scripts/zircon/testcases-all.txt | 825 ------------------ scripts/zircon/testcases-failed-baremetal.txt | 266 ------ scripts/zircon/testcases-failed-libos.txt | 337 ------- scripts/zircon/testcases.txt | 52 -- 30 files changed, 6 insertions(+), 4639 deletions(-) delete mode 100755 scripts/baremetal-core-tests.py delete mode 100755 scripts/baremetal-libc-test-find-failed-riscv64.py delete mode 100755 scripts/baremetal-libc-test-find-failed.py delete mode 100755 scripts/baremetal-libc-test-ones-riscv64.py delete mode 100755 scripts/baremetal-libc-test-ones.py delete mode 100755 scripts/baremetal-libc-test.py delete mode 100755 scripts/baremetal-test-riscv64.py delete mode 100755 scripts/core-tests.py delete mode 100755 scripts/libos-libc-tests.py delete mode 100644 scripts/linux/baremetal-test-all.txt delete mode 100644 scripts/linux/baremetal-test-allow-rv64.txt delete mode 100644 scripts/linux/baremetal-test-allow.txt delete mode 100644 scripts/linux/baremetal-test-allow.txt.busybox delete mode 100644 scripts/linux/baremetal-test-allow.txt.lmbench delete mode 100644 scripts/linux/baremetal-test-allow.txt.lua delete mode 100644 scripts/linux/baremetal-test-allow.txt.oscomp delete mode 100644 scripts/linux/baremetal-test-fail-rv64.txt delete mode 100644 scripts/linux/baremetal-test-fail.txt delete mode 100644 scripts/linux/baremetal-test-ones-rv64.txt delete mode 100644 scripts/linux/baremetal-test-ones.txt delete mode 100644 scripts/linux/libos-test-allow-failed.txt delete mode 100644 scripts/requirements.txt delete mode 100644 scripts/unix-core-testone.py delete mode 100644 scripts/unix-core-tests.py delete mode 100644 scripts/zircon/test-check-passed.txt delete mode 100644 scripts/zircon/testcases-all.txt delete mode 100644 scripts/zircon/testcases-failed-baremetal.txt delete mode 100644 scripts/zircon/testcases-failed-libos.txt delete mode 100644 scripts/zircon/testcases.txt diff --git a/.gitignore b/.gitignore index e77b3d6c..55d19b18 100644 --- a/.gitignore +++ b/.gitignore @@ -6,17 +6,10 @@ Cargo.lock /riscv_rootfs /prebuilt/linux/alpine* /prebuilt/linux/riscv64/prebuild* -.idea -scripts/linux/test-result.txt -scripts/zircon/test-result.txt -scripts/zircon/test-output.txt -rusty-tags.vi -*.img -zCore/src/link_user.S -scripts/rboot.conf -stdout-baremetal-test -stdout-zcore -scripts/script.sh -stdout-baremetal-test-rv64 -stdout-rv64 zCore/src/platform/riscv/boot/kernel-vars.ld +*.img +*.log +.idea +.DS_Store +.vscode/ +__pycache__ diff --git a/scripts/baremetal-core-tests.py b/scripts/baremetal-core-tests.py deleted file mode 100755 index 2adf6990..00000000 --- a/scripts/baremetal-core-tests.py +++ /dev/null @@ -1,77 +0,0 @@ -import pexpect -import sys -import re -import os - -TIMEOUT = 20 -ZCORE_PATH = '../zCore' -BASE = 'zircon/' -OUTPUT_FILE = BASE + 'test-output-baremetal.txt' -RESULT_FILE = BASE + 'test-result-baremetal.txt' -CHECK_FILE = BASE + 'test-check-passed.txt' -DBG_FILE = BASE + 'dbg-b.txt' -TEST_CASE_FILE = BASE + 'testcases-all.txt' - - -class Tee: - def __init__(self, name, mode): - self.file = open(name, mode) - self.stdout = sys.stdout - sys.stdout = self - - def __del__(self): - sys.stdout = self.stdout - self.file.close() - - def write(self, data): - self.file.write(data) - self.stdout.write(data) - - def flush(self): - self.file.flush() - -if os.path.exists(OUTPUT_FILE): os.remove(OUTPUT_FILE) -if os.path.exists(RESULT_FILE): os.remove(RESULT_FILE) -if os.path.exists(DBG_FILE): os.remove(DBG_FILE) - -with open(TEST_CASE_FILE, "r") as tcf: - lines = tcf.readlines() - for line in lines: - with open(DBG_FILE, "a") as dbg: print(line, file=dbg) - - child = pexpect.spawn("make -C %s test MODE=release TEST_FILTER='%s'" % (ZCORE_PATH, line.replace('\n','')), - timeout=TIMEOUT, encoding='utf-8') - child.logfile = Tee(OUTPUT_FILE, 'a') - - index = child.expect(['finished!', 'panicked', pexpect.EOF, pexpect.TIMEOUT]) - result = ['FINISHED', 'PANICKED', 'EOF', 'TIMEOUT'][index] - print(result) - -passed = [] -failed = [] -passed_case = set() - -# see https://stackoverflow.com/questions/59379174/ignore-ansi-colors-in-pexpect-response -ansi_escape = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]") - -with open(OUTPUT_FILE, "r") as opf: - for line in opf: - line=ansi_escape.sub('',line) - with open(RESULT_FILE, "a") as rstf: - if line.startswith('[ OK ]'): - print(line, file=rstf) - elif line.startswith('[ FAILED ]') and line.endswith(')\n'): - print(line, file=rstf) - - -# with open(CHECK_FILE, 'r') as f: -# check_case = set([case.strip() for case in f.readlines()]) - -# not_passed = check_case - passed_case -# if not_passed: -# print('=== Failed cases ===') -# for case in not_passed: -# print(case) -# exit(1) -# else: -# print('All checked case passed!') diff --git a/scripts/baremetal-libc-test-find-failed-riscv64.py b/scripts/baremetal-libc-test-find-failed-riscv64.py deleted file mode 100755 index fc2a9925..00000000 --- a/scripts/baremetal-libc-test-find-failed-riscv64.py +++ /dev/null @@ -1,72 +0,0 @@ -import os -import glob -import subprocess -import re -import sys -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -CHECK_FILE = BASE + 'baremetal-test-allow-rv64.txt' -FAIL_FILE = BASE + 'baremetal-test-fail-rv64.txt' -SCRIPT_FILE = 'script.sh' -RESULT_FILE ='../stdout-rv64' -script=r''' -#!/bin/bash - -cd .. && make baremetal-test-rv64 ROOTPROC=''' - -# ============================================== -passed = set() -failed = set() -timeout = set() - -FAILED = [ - "failed", - "panicked at", - "ERROR", -] - -with open(CHECK_FILE, 'r') as f: - allow_files = set([case.strip() for case in f.readlines()]) - -for file in allow_files: - script_file = script+file - with open(SCRIPT_FILE, 'w') as f: - print(script_file, file=f) - try: - subprocess.run(['sh',SCRIPT_FILE], timeout=TIMEOUT, check=True) - - with open(RESULT_FILE, 'r') as f: - output=f.read(); - - break_out_flag = False - for pattern in FAILED: - if re.search(pattern, output): - failed.add(file) - break_out_flag = True - else: - continue - if not break_out_flag: - passed.add(file) - except subprocess.CalledProcessError: - failed.add(file) - except subprocess.TimeoutExpired: - timeout.add(file) - - - -print("PASSED %d", len(passed)) -print("FAILED %d", len(failed)) -print(failed) -print("TIMEOUT %d", len(timeout)) - -with open(FAIL_FILE,'w') as f: - for bad_file in failed: - print(bad_file, file=f) - -if len(failed) > 0 : - sys.exit(-1) -else: - sys.exit(0) diff --git a/scripts/baremetal-libc-test-find-failed.py b/scripts/baremetal-libc-test-find-failed.py deleted file mode 100755 index bd82b0ca..00000000 --- a/scripts/baremetal-libc-test-find-failed.py +++ /dev/null @@ -1,95 +0,0 @@ -import os -import glob -import subprocess -import re -import sys -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -CHECK_FILE = BASE + 'baremetal-test-allow.txt' -FAIL_FILE = BASE + 'baremetal-test-fail.txt' -RBOOT_FILE = 'rboot.conf' -RESULT_FILE ='../stdout-zcore' -rboot= r''' -# The config file for rboot. -# Place me at \EFI\Boot\rboot.conf - -# The address at which the kernel stack is placed. -# kernel_stack_address=0xFFFFFF8000000000 - -# The size of the kernel stack, given in number of 4KiB pages. Defaults to 512. -# kernel_stack_size=128 - -# The virtual address offset from which physical memory is mapped, as described in -# https://os.phil-opp.com/paging-implementation/#map-the-complete-physical-memory -physical_memory_offset=0xFFFF800000000000 - -# The path of kernel ELF -kernel_path=\EFI\zCore\zcore.elf - -# The resolution of graphic output -resolution=1024x768 - -initramfs=\EFI\zCore\fuchsia.zbi -# LOG=debug/info/error/warn/trace -# add ROOTPROC info ? split CMD and ARG : ROOTPROC=/libc-test/src/functional/argv.exe? OR ROOTPROC=/bin/busybox?sh -cmdline=LOG=error:TERM=xterm-256color:console.shell=true:virtcon.disable=true:ROOTPROC=''' - -# ============================================== -passed = set() -failed = set() -timeout = set() - -FAILED = [ - "failed", - "ERROR", -] - -with open(CHECK_FILE, 'r') as f: - allow_files = set([case.strip() for case in f.readlines()]) - -for file in allow_files: - print(file) - rboot_file=rboot+file+'?' - print(rboot) - with open(RBOOT_FILE,'w') as f: - print(rboot_file, file=f) - try: - subprocess.run(r'cp rboot.conf ../zCore && cd ../ && make baremetal-test | tee stdout-zcore && sed -i ' - r'"/BdsDxe/d" stdout-zcore', - shell=True, timeout=TIMEOUT, check=True) - - with open(RESULT_FILE, 'r') as f: - output=f.read(); - - break_out_flag = False - for pattern in FAILED: - if re.search(pattern, output): - failed.add(file) - break_out_flag = True - else: - continue - if not break_out_flag: - passed.add(file) - except subprocess.CalledProcessError: - failed.add(file) - except subprocess.TimeoutExpired: - timeout.add(file) - - - -print("PASSED %d", len(passed)) -print("FAILED %d", len(failed)) -print(failed) -print("TIMEOUT %d", len(timeout)) - -with open(FAIL_FILE,'w') as f: - for bad_file in failed: - print(bad_file, file=f) - -if len(failed) > 0 : - sys.exit(-1) -else: - sys.exit(0) \ No newline at end of file diff --git a/scripts/baremetal-libc-test-ones-riscv64.py b/scripts/baremetal-libc-test-ones-riscv64.py deleted file mode 100755 index 3fce3a66..00000000 --- a/scripts/baremetal-libc-test-ones-riscv64.py +++ /dev/null @@ -1,66 +0,0 @@ -import os -import glob -import subprocess -import re -import sys - -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -CHECK_FILE = BASE + 'baremetal-test-ones-rv64.txt' -SCRIPT_FILE = 'script.sh' -RESULT_FILE ='../stdout-rv64' -script=r''' -#!/bin/bash - -cd .. && make baremetal-test-rv64 ROOTPROC=''' - -# ============================================== -passed = set() -failed = set() -timeout = set() - -FAILED = [ - "failed", - "panicked at", - "ERROR", -] - -with open(CHECK_FILE, 'r') as f: - allow_files = set([case.strip() for case in f.readlines()]) - -for file in allow_files: - script_file = script+file - with open(SCRIPT_FILE, 'w') as f: - print(script_file, file=f) - try: - subprocess.run(['sh',SCRIPT_FILE], timeout=TIMEOUT, check=True) - - with open(RESULT_FILE, 'r') as f: - output = f.read() - - break_out_flag = False - for pattern in FAILED: - if re.search(pattern, output): - failed.add(file) - break_out_flag = True - break - - if not break_out_flag: - passed.add(file) - except subprocess.CalledProcessError: - failed.add(file) - except subprocess.TimeoutExpired: - timeout.add(file) - -print("=======================================") -print("PASSED num: ", len(passed)) -print("=======================================") -print("FAILED num: ", len(failed)) -print(failed) -print("=======================================") -print("TIMEOUT num: ", len(timeout)) -print(timeout) -print("=======================================") diff --git a/scripts/baremetal-libc-test-ones.py b/scripts/baremetal-libc-test-ones.py deleted file mode 100755 index 5830feb7..00000000 --- a/scripts/baremetal-libc-test-ones.py +++ /dev/null @@ -1,107 +0,0 @@ -import os -import glob -import subprocess -import re -import sys - -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -CHECK_FILE = BASE + 'baremetal-test-ones.txt' -# FAIL_FILE = BASE + 'baremetal-test-fail.txt' -RBOOT_FILE = 'rboot.conf' -RESULT_FILE = '../stdout-zcore' -rboot = r''' -# The config file for rboot. -# Place me at \EFI\Boot\rboot.conf - -# The address at which the kernel stack is placed. -# kernel_stack_address=0xFFFFFF8000000000 - -# The size of the kernel stack, given in number of 4KiB pages. Defaults to 512. -# kernel_stack_size=128 - -# The virtual address offset from which physical memory is mapped, as described in -# https://os.phil-opp.com/paging-implementation/#map-the-complete-physical-memory -physical_memory_offset=0xFFFF800000000000 - -# The path of kernel ELF -kernel_path=\EFI\zCore\zcore.elf - -# The resolution of graphic output -resolution=1024x768 - -initramfs=\EFI\zCore\fuchsia.zbi -# LOG=debug/info/error/warn/trace -# add ROOTPROC info ? split CMD and ARG : ROOTPROC=/libc-test/src/functional/argv.exe? OR ROOTPROC=/bin/busybox?sh -cmdline=LOG=warn:TERM=xterm-256color:console.shell=true:virtcon.disable=true:ROOTPROC=''' - -# ============================================== -passed = set() -failed = set() -timeout = set() - -FAILED = [ - "failed", - "ERROR", -] - -with open(CHECK_FILE, 'r') as f: - allow_files = set([case.strip() for case in f.readlines()]) - -# with open(FAIL_FILE, 'r') as f: -# failed_files = set([case.strip() for case in f.readlines()]) - -for file in allow_files: - # if not (file in failed_files): - # print(file) - rboot_file = rboot + file + '?' - # print(rboot) - with open(RBOOT_FILE, 'w') as f: - print(rboot_file, file=f) - - try: - subprocess.run(r'cp rboot.conf ../zCore && cd ../ && make baremetal-test | tee stdout-zcore ' - r'&& ' - r'sed -i ' - r'"/BdsDxe/d" stdout-zcore', - shell=True, timeout=TIMEOUT, check=True) - - with open(RESULT_FILE, 'r') as f: - output = f.read() - - break_out_flag = False - for pattern in FAILED: - if re.search(pattern, output): - failed.add(file) - break_out_flag = True - break - - if not break_out_flag: - passed.add(file) - except subprocess.CalledProcessError: - failed.add(file) - except subprocess.TimeoutExpired: - timeout.add(file) - -print("=======================================") -print("PASSED num: ", len(passed)) -print("=======================================") -print("FAILED num: ", len(failed)) -print(failed) -print("=======================================") -print("TIMEOUT num: ", len(timeout)) -print(timeout) -print("=======================================") -# print("Total tested num: ", len(allow_files)-len(failed_files)) -# print("=======================================") -# with open(FAIL_FILE,'w') as f: -# for bad_file in failed: -# print(bad_file, file=f) - -if len(failed) > 3: - sys.exit(-1) -else: - sys.exit(0) diff --git a/scripts/baremetal-libc-test.py b/scripts/baremetal-libc-test.py deleted file mode 100755 index 436cee0f..00000000 --- a/scripts/baremetal-libc-test.py +++ /dev/null @@ -1,105 +0,0 @@ -import os -import glob -import subprocess -import re -import sys -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -CHECK_FILE = BASE + 'baremetal-test-allow.txt' -FAIL_FILE = BASE + 'baremetal-test-fail.txt' -RBOOT_FILE = 'rboot.conf' -RESULT_FILE ='../stdout-zcore' -rboot= r''' -# The config file for rboot. -# Place me at \EFI\Boot\rboot.conf - -# The address at which the kernel stack is placed. -# kernel_stack_address=0xFFFFFF8000000000 - -# The size of the kernel stack, given in number of 4KiB pages. Defaults to 512. -# kernel_stack_size=128 - -# The virtual address offset from which physical memory is mapped, as described in -# https://os.phil-opp.com/paging-implementation/#map-the-complete-physical-memory -physical_memory_offset=0xFFFF800000000000 - -# The path of kernel ELF -kernel_path=\EFI\zCore\zcore.elf - -# The resolution of graphic output -resolution=1024x768 - -initramfs=\EFI\zCore\x86_64.img -# LOG=debug/info/error/warn/trace -# add ROOTPROC info ? split CMD and ARG : ROOTPROC=/libc-test/src/functional/argv.exe? OR ROOTPROC=/bin/busybox?sh -cmdline=LOG=error:TERM=xterm-256color:console.shell=true:virtcon.disable=true:ROOTPROC=''' - -# ============================================== -passed = set() -failed = set() -timeout = set() - -FAILED = [ - "failed", - "ERROR", -] - -with open(CHECK_FILE, 'r') as f: - allow_files = set([case.strip() for case in f.readlines()]) - -with open(FAIL_FILE,'r') as f: - failed_files = set([case.strip() for case in f.readlines()]) - -for file in allow_files: - if not (file in failed_files): -# print(file) - rboot_file=rboot+file+'?' -# print(rboot) - with open(RBOOT_FILE,'w') as f: - print(rboot_file, file=f) - try: - subprocess.run(r'cp rboot.conf ../zCore && cd ../ && make baremetal-test | tee stdout-zcore ' - r'&& ' - r'sed -i ' - r'"/BdsDxe/d" stdout-zcore', - shell=True, timeout=TIMEOUT, check=True) - - with open(RESULT_FILE, 'r') as f: - output=f.read() - - break_out_flag = False - for pattern in FAILED: - if re.search(pattern, output): - failed.add(file) - break_out_flag = True - break - - if not break_out_flag: - passed.add(file) - except subprocess.CalledProcessError: - failed.add(file) - except subprocess.TimeoutExpired: - timeout.add(file) - -print("=======================================") -print("PASSED num: ", len(passed)) -print("=======================================") -print("FAILED num: ", len(failed)) -print(failed) -print("=======================================") -print("TIMEOUT num: ", len(timeout)) -print(timeout) -print("=======================================") -print("Total tested num: ", len(allow_files)-len(failed_files)) -print("=======================================") -# with open(FAIL_FILE,'w') as f: -# for bad_file in failed: -# print(bad_file, file=f) - -if len(failed) > 3 : - sys.exit(-1) -else: - sys.exit(0) diff --git a/scripts/baremetal-test-riscv64.py b/scripts/baremetal-test-riscv64.py deleted file mode 100755 index 0e7f76e6..00000000 --- a/scripts/baremetal-test-riscv64.py +++ /dev/null @@ -1,79 +0,0 @@ -import os -import glob -import subprocess -import re -import sys -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -CHECK_FILE = BASE + 'baremetal-test-allow-rv64.txt' -FAIL_FILE = BASE + 'baremetal-test-fail-rv64.txt' -SCRIPT_FILE = 'script.sh' -RESULT_FILE ='../stdout-rv64' -script=r''' -#!/bin/bash - -cd .. && make baremetal-test-rv64 ROOTPROC=''' - -# ============================================== -passed = set() -failed = set() -timeout = set() - -FAILED = [ - "panicked at", - "ERROR", -] - -with open(CHECK_FILE, 'r') as f: - allow_files = set([case.strip() for case in f.readlines()]) - -with open(FAIL_FILE,'r') as f: - failed_files = set([case.strip() for case in f.readlines()]) - -for file in allow_files: - if not (file in failed_files): - script_file = script+file - with open(SCRIPT_FILE, 'w') as f: - print(script_file, file=f) - try: - subprocess.run(['sh',SCRIPT_FILE], timeout=TIMEOUT, check=True) - - with open(RESULT_FILE, 'r') as f: - output=f.read() - - break_out_flag = False - for pattern in FAILED: - if re.search(pattern, output): - failed.add(file) - break_out_flag = True - break - - if not break_out_flag: - passed.add(file) - except subprocess.CalledProcessError: - failed.add(file) - except subprocess.TimeoutExpired: - timeout.add(file) - -print("=======================================") -print("PASSED num: ", len(passed)) -print("=======================================") -print("FAILED num: ", len(failed)) -print(failed) -print("=======================================") -print("TIMEOUT num: ", len(timeout)) -print(timeout) -print("=======================================") -print("Total tested num: ", len(allow_files)-len(failed_files)) -print("=======================================") -# with open(FAIL_FILE,'w') as f: -# for bad_file in failed: -# print(bad_file, file=f) - -if len(failed) > 3 : - sys.exit(-1) -else: - sys.exit(0) diff --git a/scripts/core-tests.py b/scripts/core-tests.py deleted file mode 100755 index c163966d..00000000 --- a/scripts/core-tests.py +++ /dev/null @@ -1,77 +0,0 @@ -import pexpect -import sys -import re - -TIMEOUT = 300 -ZCORE_PATH = '../zCore' -BASE = 'zircon/' -OUTPUT_FILE = BASE + 'test-output.txt' -RESULT_FILE = BASE + 'test-result.txt' -CHECK_FILE = BASE + 'test-check-passed.txt' -TEST_CASE_FILE = BASE + 'testcases.txt' - -CMDLINE = "LOG=warn:userboot=test/core-standalone-test:userboot.shutdown:core-tests=%s" - -class Tee: - def __init__(self, name, mode): - self.file = open(name, mode) - self.stdout = sys.stdout - sys.stdout = self - - def __del__(self): - sys.stdout = self.stdout - self.file.close() - - def write(self, data): - self.file.write(data) - self.stdout.write(data) - - def flush(self): - self.file.flush() - - -with open(TEST_CASE_FILE, "r") as f: - lines = f.readlines() - positive = [line for line in lines if not line.startswith('-')] - negative = [line[1:] for line in lines if line.startswith('-')] - test_filter = (','.join(positive) + ((',-' + ','.join(negative) if len(negative) > 0 else "") )).replace('\n', '') - -child = pexpect.spawn("make -C %s run MODE=release ZBI=core-tests CMDLINE='%s'" % (ZCORE_PATH, CMDLINE % test_filter), - timeout=TIMEOUT, encoding='utf-8') -child.logfile = Tee(OUTPUT_FILE, 'w') - -index = child.expect(['finished!', 'panicked', pexpect.EOF, pexpect.TIMEOUT]) -result = ['FINISHED', 'PANICKED', 'EOF', 'TIMEOUT'][index] -print(result) - -passed = [] -failed = [] -passed_case = set() - -# see https://stackoverflow.com/questions/59379174/ignore-ansi-colors-in-pexpect-response -ansi_escape = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]") - -with open(OUTPUT_FILE, "r") as f: - for line in f.readlines(): - line=ansi_escape.sub('',line) - if line.startswith('[ OK ]'): - passed += line - passed_case.add(line[13:].split(' ')[0]) - elif line.startswith('[ FAILED ]') and line.endswith(')\n'): - failed += line - -with open(RESULT_FILE, "w") as f: - f.writelines(passed) - f.writelines(failed) - -with open(CHECK_FILE, 'r') as f: - check_case = set([case.strip() for case in f.readlines()]) - -not_passed = check_case - passed_case -if not_passed: - print('=== Failed cases ===') - for case in not_passed: - print(case) - exit(1) -else: - print('All checked case passed!') diff --git a/scripts/libos-libc-tests.py b/scripts/libos-libc-tests.py deleted file mode 100755 index c4c286f6..00000000 --- a/scripts/libos-libc-tests.py +++ /dev/null @@ -1,76 +0,0 @@ -import os -import time -import glob -import subprocess -from termcolor import colored - -# ===============Must Config======================== - -TIMEOUT = 10 # seconds -ZCORE_PATH = '../zCore' -BASE = 'linux/' -OUTPUT_FILE = BASE + 'test-output.txt' -RESULT_FILE = BASE + 'test-result.txt' -CHECK_FILE = BASE + 'libos-test-allow-failed.txt' - -# ============================================== - -passed = set() -failed = set() -timeout = set() - - -def print_cases(cases, file=None): - for case in sorted(cases): - print(case, file=file) - - -subprocess.run("cargo build -p zcore --release --features 'linux libos'", - shell=True, check=True) - -for path in sorted(glob.glob("../rootfs/libc-test/src/*/*.exe")): - path = path[len('../rootfs'):] - # ignore static linked tests - if path.endswith('-static.exe'): - continue - try: - time_start = time.time() - subprocess.run("cd .. && ./target/release/zcore " + path, - shell=True, timeout=TIMEOUT, check=True) - time_end = time.time() - passed.add(path) - print(colored('PASSED in %.3fs: %s' % (time_end - time_start, path), 'green')) - except subprocess.CalledProcessError: - failed.add(path) - print(colored('FAILED: %s' % path, 'red')) - except subprocess.TimeoutExpired: - timeout.add(path) - print(colored('TIMEOUT: %s' % path, 'yellow')) - -with open(RESULT_FILE, "w") as f: - print('PASSED:', file=f) - print_cases(passed, file=f) - print('FAILED:', file=f) - print_cases(failed, file=f) - print('TIMEOUT:', file=f) - print_cases(timeout, file=f) - -with open(CHECK_FILE, 'r') as f: - allow_failed = set([case.strip() for case in f.readlines()]) - -more_passed = passed & allow_failed -if more_passed: - print(colored('=== Passed more cases ===', 'green')) - print_cases(more_passed) - -check_failed = (failed | timeout) - allow_failed -if check_failed: - print(colored('=== Failed cases ===', 'red')) - print_cases(failed - allow_failed) - print(colored('=== Timeout cases ===', 'yellow')) - print_cases(timeout - allow_failed) - exit(1) -else: - print(colored('All checked case passed!', 'green')) - -os.system('killall zcore') diff --git a/scripts/linux/baremetal-test-all.txt b/scripts/linux/baremetal-test-all.txt deleted file mode 100644 index 7127dff4..00000000 --- a/scripts/linux/baremetal-test-all.txt +++ /dev/null @@ -1,477 +0,0 @@ -/libc-test/src/functional/search_tsearch.exe -/libc-test/src/functional/fcntl-static.exe -/libc-test/src/functional/memstream-static.exe -/libc-test/src/functional/string_strcspn.exe -/libc-test/src/functional/crypt.exe -/libc-test/src/functional/tgmath.exe -/libc-test/src/functional/pthread_cancel-static.exe -/libc-test/src/functional/argv.exe -/libc-test/src/functional/strtod-static.exe -/libc-test/src/functional/time.exe -/libc-test/src/functional/search_insque.exe -/libc-test/src/functional/pthread_tsd-static.exe -/libc-test/src/functional/fnmatch.exe -/libc-test/src/functional/udiv-static.exe -/libc-test/src/functional/sem_open.exe -/libc-test/src/functional/random.exe -/libc-test/src/functional/strtold.exe -/libc-test/src/functional/env-static.exe -/libc-test/src/functional/string_memmem.exe -/libc-test/src/functional/search_tsearch-static.exe -/libc-test/src/functional/basename-static.exe -/libc-test/src/functional/sem_init.exe -/libc-test/src/functional/spawn-static.exe -/libc-test/src/functional/strtof-static.exe -/libc-test/src/functional/search_lsearch-static.exe -/libc-test/src/functional/string_memcpy-static.exe -/libc-test/src/functional/tgmath-static.exe -/libc-test/src/functional/strtol-static.exe -/libc-test/src/functional/dirname.exe -/libc-test/src/functional/tls_align_dlopen.exe -/libc-test/src/functional/setjmp-static.exe -/libc-test/src/functional/wcsstr.exe -/libc-test/src/functional/wcstol.exe -/libc-test/src/functional/mbc.exe -/libc-test/src/functional/iconv_open-static.exe -/libc-test/src/functional/inet_pton.exe -/libc-test/src/functional/pthread_cancel-points-static.exe -/libc-test/src/functional/strptime-static.exe -/libc-test/src/functional/search_hsearch-static.exe -/libc-test/src/functional/string_strchr-static.exe -/libc-test/src/functional/fdopen-static.exe -/libc-test/src/functional/ipc_shm.exe -/libc-test/src/functional/search_lsearch.exe -/libc-test/src/functional/tls_align-static.exe -/libc-test/src/functional/basename.exe -/libc-test/src/functional/mbc-static.exe -/libc-test/src/functional/pthread_robust-static.exe -/libc-test/src/functional/wcstol-static.exe -/libc-test/src/functional/fwscanf-static.exe -/libc-test/src/functional/ipc_msg.exe -/libc-test/src/functional/clock_gettime-static.exe -/libc-test/src/functional/stat-static.exe -/libc-test/src/functional/wcsstr-static.exe -/libc-test/src/functional/spawn.exe -/libc-test/src/functional/search_hsearch.exe -/libc-test/src/functional/string_memset.exe -/libc-test/src/functional/string_strcspn-static.exe -/libc-test/src/functional/string_strstr.exe -/libc-test/src/functional/pthread_robust.exe -/libc-test/src/functional/sscanf_long-static.exe -/libc-test/src/functional/pthread_cancel-points.exe -/libc-test/src/functional/fdopen.exe -/libc-test/src/functional/pthread_cond.exe -/libc-test/src/functional/tls_align.exe -/libc-test/src/functional/tls_local_exec.exe -/libc-test/src/functional/memstream.exe -/libc-test/src/functional/sem_init-static.exe -/libc-test/src/functional/popen-static.exe -/libc-test/src/functional/random-static.exe -/libc-test/src/functional/strtod_long.exe -/libc-test/src/functional/fscanf-static.exe -/libc-test/src/functional/swprintf.exe -/libc-test/src/functional/strtod.exe -/libc-test/src/functional/qsort.exe -/libc-test/src/functional/inet_pton-static.exe -/libc-test/src/functional/env.exe -/libc-test/src/functional/sscanf-static.exe -/libc-test/src/functional/tls_local_exec-static.exe -/libc-test/src/functional/strftime-static.exe -/libc-test/src/functional/dirname-static.exe -/libc-test/src/functional/pthread_cancel.exe -/libc-test/src/functional/fscanf.exe -/libc-test/src/functional/clock_gettime.exe -/libc-test/src/functional/crypt-static.exe -/libc-test/src/functional/socket.exe -/libc-test/src/functional/strptime.exe -/libc-test/src/functional/fcntl.exe -/libc-test/src/functional/string_memcpy.exe -/libc-test/src/functional/strtod_simple-static.exe -/libc-test/src/functional/pthread_mutex_pi.exe -/libc-test/src/functional/argv-static.exe -/libc-test/src/functional/search_insque-static.exe -/libc-test/src/functional/ungetc-static.exe -/libc-test/src/functional/string_memset-static.exe -/libc-test/src/functional/sem_open-static.exe -/libc-test/src/functional/clocale_mbfuncs-static.exe -/libc-test/src/functional/sscanf_long.exe -/libc-test/src/functional/string-static.exe -/libc-test/src/functional/ipc_sem-static.exe -/libc-test/src/functional/strtof.exe -/libc-test/src/functional/string_strstr-static.exe -/libc-test/src/functional/strtol.exe -/libc-test/src/functional/snprintf.exe -/libc-test/src/functional/tls_init.exe -/libc-test/src/functional/clocale_mbfuncs.exe -/libc-test/src/functional/iconv_open.exe -/libc-test/src/functional/snprintf-static.exe -/libc-test/src/functional/tls_init_dlopen.exe -/libc-test/src/functional/ipc_msg-static.exe -/libc-test/src/functional/time-static.exe -/libc-test/src/functional/tls_init-static.exe -/libc-test/src/functional/ungetc.exe -/libc-test/src/functional/strtod_simple.exe -/libc-test/src/functional/string_strchr.exe -/libc-test/src/functional/dlopen.exe -/libc-test/src/functional/vfork-static.exe -/libc-test/src/functional/ipc_shm-static.exe -/libc-test/src/functional/vfork.exe -/libc-test/src/functional/pthread_mutex.exe -/libc-test/src/functional/stat.exe -/libc-test/src/functional/strtold-static.exe -/libc-test/src/functional/ipc_sem.exe -/libc-test/src/functional/swprintf-static.exe -/libc-test/src/functional/popen.exe -/libc-test/src/functional/strtod_long-static.exe -/libc-test/src/functional/sscanf.exe -/libc-test/src/functional/setjmp.exe -/libc-test/src/functional/udiv.exe -/libc-test/src/functional/fwscanf.exe -/libc-test/src/functional/utime.exe -/libc-test/src/functional/utime-static.exe -/libc-test/src/functional/fnmatch-static.exe -/libc-test/src/functional/pthread_tsd.exe -/libc-test/src/functional/pthread_mutex_pi-static.exe -/libc-test/src/functional/pthread_mutex-static.exe -/libc-test/src/functional/qsort-static.exe -/libc-test/src/functional/string.exe -/libc-test/src/functional/pthread_cond-static.exe -/libc-test/src/functional/strftime.exe -/libc-test/src/functional/string_memmem-static.exe -/libc-test/src/functional/socket-static.exe -/libc-test/src/common/runtest.exe -/libc-test/src/regression/pthread_atfork-errno-clobber-static.exe -/libc-test/src/regression/setenv-oom.exe -/libc-test/src/regression/fpclassify-invalid-ld80.exe -/libc-test/src/regression/execle-env-static.exe -/libc-test/src/regression/setvbuf-unget-static.exe -/libc-test/src/regression/flockfile-list-static.exe -/libc-test/src/regression/sigaltstack.exe -/libc-test/src/regression/scanf-bytes-consumed.exe -/libc-test/src/regression/putenv-doublefree-static.exe -/libc-test/src/regression/getpwnam_r-errno.exe -/libc-test/src/regression/ftello-unflushed-append-static.exe -/libc-test/src/regression/setvbuf-unget.exe -/libc-test/src/regression/inet_ntop-v4mapped-static.exe -/libc-test/src/regression/pthread_cancel-sem_wait.exe -/libc-test/src/regression/inet_pton-empty-last-field-static.exe -/libc-test/src/regression/sscanf-eof-static.exe -/libc-test/src/regression/ftello-unflushed-append.exe -/libc-test/src/regression/strverscmp-static.exe -/libc-test/src/regression/printf-fmt-n-static.exe -/libc-test/src/regression/inet_pton-empty-last-field.exe -/libc-test/src/regression/putenv-doublefree.exe -/libc-test/src/regression/mkstemp-failure.exe -/libc-test/src/regression/regex-backref-0-static.exe -/libc-test/src/regression/malloc-oom-static.exe -/libc-test/src/regression/sigprocmask-internal.exe -/libc-test/src/regression/pthread-robust-detach-static.exe -/libc-test/src/regression/memmem-oob-static.exe -/libc-test/src/regression/memmem-oob-read.exe -/libc-test/src/regression/lseek-large.exe -/libc-test/src/regression/printf-fmt-g-zeros.exe -/libc-test/src/regression/malloc-0.exe -/libc-test/src/regression/wcsstr-false-negative.exe -/libc-test/src/regression/pthread_cond-smasher-static.exe -/libc-test/src/regression/wcsstr-false-negative-static.exe -/libc-test/src/regression/tls_get_new-dtv.exe -/libc-test/src/regression/printf-fmt-g-round-static.exe -/libc-test/src/regression/uselocale-0.exe -/libc-test/src/regression/flockfile-list.exe -/libc-test/src/regression/getpwnam_r-errno-static.exe -/libc-test/src/regression/dn_expand-ptr-0-static.exe -/libc-test/src/regression/malloc-brk-fail-static.exe -/libc-test/src/regression/statvfs.exe -/libc-test/src/regression/scanf-match-literal-eof-static.exe -/libc-test/src/regression/daemon-failure.exe -/libc-test/src/regression/fflush-exit.exe -/libc-test/src/regression/mkstemp-failure-static.exe -/libc-test/src/regression/pthread-robust-detach.exe -/libc-test/src/regression/syscall-sign-extend-static.exe -/libc-test/src/regression/rewind-clear-error.exe -/libc-test/src/regression/setenv-oom-static.exe -/libc-test/src/regression/regex-escaped-high-byte.exe -/libc-test/src/regression/dn_expand-empty-static.exe -/libc-test/src/regression/regex-negated-range-static.exe -/libc-test/src/regression/regex-ere-backref-static.exe -/libc-test/src/regression/sem_close-unmap-static.exe -/libc-test/src/regression/mkdtemp-failure.exe -/libc-test/src/regression/printf-fmt-n.exe -/libc-test/src/regression/rlimit-open-files.exe -/libc-test/src/regression/iswspace-null.exe -/libc-test/src/regression/pthread_exit-cancel.exe -/libc-test/src/regression/sigreturn.exe -/libc-test/src/regression/wcsncpy-read-overflow-static.exe -/libc-test/src/regression/daemon-failure-static.exe -/libc-test/src/regression/memmem-oob.exe -/libc-test/src/regression/pthread_condattr_setclock.exe -/libc-test/src/regression/lrand48-signextend.exe -/libc-test/src/regression/rlimit-open-files-static.exe -/libc-test/src/regression/sigaltstack-static.exe -/libc-test/src/regression/regex-bracket-icase.exe -/libc-test/src/regression/pthread_cond-smasher.exe -/libc-test/src/regression/scanf-bytes-consumed-static.exe -/libc-test/src/regression/scanf-match-literal-eof.exe -/libc-test/src/regression/malloc-0-static.exe -/libc-test/src/regression/lrand48-signextend-static.exe -/libc-test/src/regression/raise-race-static.exe -/libc-test/src/regression/printf-1e9-oob-static.exe -/libc-test/src/regression/fgetwc-buffering.exe -/libc-test/src/regression/pthread_cancel-sem_wait-static.exe -/libc-test/src/regression/sem_close-unmap.exe -/libc-test/src/regression/printf-fmt-g-round.exe -/libc-test/src/regression/pthread_once-deadlock-static.exe -/libc-test/src/regression/pthread_atfork-errno-clobber.exe -/libc-test/src/regression/pthread_exit-cancel-static.exe -/libc-test/src/regression/pthread_once-deadlock.exe -/libc-test/src/regression/pthread_exit-dtor.exe -/libc-test/src/regression/iconv-roundtrips-static.exe -/libc-test/src/regression/syscall-sign-extend.exe -/libc-test/src/regression/uselocale-0-static.exe -/libc-test/src/regression/regex-bracket-icase-static.exe -/libc-test/src/regression/strverscmp.exe -/libc-test/src/regression/lseek-large-static.exe -/libc-test/src/regression/scanf-nullbyte-char.exe -/libc-test/src/regression/malloc-brk-fail.exe -/libc-test/src/regression/pthread_create-oom-static.exe -/libc-test/src/regression/regexec-nosub.exe -/libc-test/src/regression/rewind-clear-error-static.exe -/libc-test/src/regression/regex-negated-range.exe -/libc-test/src/regression/inet_ntop-v4mapped.exe -/libc-test/src/regression/regex-ere-backref.exe -/libc-test/src/regression/memmem-oob-read-static.exe -/libc-test/src/regression/sscanf-eof.exe -/libc-test/src/regression/iswspace-null-static.exe -/libc-test/src/regression/printf-1e9-oob.exe -/libc-test/src/regression/mbsrtowcs-overflow-static.exe -/libc-test/src/regression/dn_expand-ptr-0.exe -/libc-test/src/regression/regexec-nosub-static.exe -/libc-test/src/regression/iconv-roundtrips.exe -/libc-test/src/regression/pthread_rwlock-ebusy.exe -/libc-test/src/regression/getpwnam_r-crash.exe -/libc-test/src/regression/printf-fmt-g-zeros-static.exe -/libc-test/src/regression/sigprocmask-internal-static.exe -/libc-test/src/regression/pthread_cond_wait-cancel_ignored.exe -/libc-test/src/regression/sigreturn-static.exe -/libc-test/src/regression/scanf-nullbyte-char-static.exe -/libc-test/src/regression/execle-env.exe -/libc-test/src/regression/raise-race.exe -/libc-test/src/regression/getpwnam_r-crash-static.exe -/libc-test/src/regression/statvfs-static.exe -/libc-test/src/regression/pthread_rwlock-ebusy-static.exe -/libc-test/src/regression/pthread_create-oom.exe -/libc-test/src/regression/fpclassify-invalid-ld80-static.exe -/libc-test/src/regression/fgets-eof.exe -/libc-test/src/regression/regex-escaped-high-byte-static.exe -/libc-test/src/regression/fgetwc-buffering-static.exe -/libc-test/src/regression/mkdtemp-failure-static.exe -/libc-test/src/regression/fgets-eof-static.exe -/libc-test/src/regression/malloc-oom.exe -/libc-test/src/regression/wcsncpy-read-overflow.exe -/libc-test/src/regression/mbsrtowcs-overflow.exe -/libc-test/src/regression/pthread_exit-dtor-static.exe -/libc-test/src/regression/regex-backref-0.exe -/libc-test/src/regression/pthread_cond_wait-cancel_ignored-static.exe -/libc-test/src/regression/pthread_condattr_setclock-static.exe -/libc-test/src/regression/fflush-exit-static.exe -/libc-test/src/regression/dn_expand-empty.exe -/libc-test/src/musl/pleval-static.exe -/libc-test/src/math/nextafter.exe -/libc-test/src/math/acosf.exe -/libc-test/src/math/scalbln.exe -/libc-test/src/math/ceil.exe -/libc-test/src/math/erff.exe -/libc-test/src/math/exp2l.exe -/libc-test/src/math/sinh.exe -/libc-test/src/math/remainderl.exe -/libc-test/src/math/ceill.exe -/libc-test/src/math/roundl.exe -/libc-test/src/math/lgammal.exe -/libc-test/src/math/lrintl.exe -/libc-test/src/math/exp10.exe -/libc-test/src/math/asinh.exe -/libc-test/src/math/fabs.exe -/libc-test/src/math/ldexpl.exe -/libc-test/src/math/fminf.exe -/libc-test/src/math/atan.exe -/libc-test/src/math/y0.exe -/libc-test/src/math/pow10l.exe -/libc-test/src/math/exp10f.exe -/libc-test/src/math/tan.exe -/libc-test/src/math/modf.exe -/libc-test/src/math/log10f.exe -/libc-test/src/math/log2.exe -/libc-test/src/math/fmaxl.exe -/libc-test/src/math/j0.exe -/libc-test/src/math/nexttowardl.exe -/libc-test/src/math/rintf.exe -/libc-test/src/math/scalblnf.exe -/libc-test/src/math/lrint.exe -/libc-test/src/math/sinl.exe -/libc-test/src/math/log1pl.exe -/libc-test/src/math/rint.exe -/libc-test/src/math/logf.exe -/libc-test/src/math/j1.exe -/libc-test/src/math/nearbyintl.exe -/libc-test/src/math/sinhl.exe -/libc-test/src/math/logbf.exe -/libc-test/src/math/jnf.exe -/libc-test/src/math/ldexpf.exe -/libc-test/src/math/truncf.exe -/libc-test/src/math/llrintf.exe -/libc-test/src/math/pow10f.exe -/libc-test/src/math/cosf.exe -/libc-test/src/math/log2f.exe -/libc-test/src/math/yn.exe -/libc-test/src/math/log1pf.exe -/libc-test/src/math/logl.exe -/libc-test/src/math/nearbyintf.exe -/libc-test/src/math/logbl.exe -/libc-test/src/math/lgammaf_r.exe -/libc-test/src/math/nearbyint.exe -/libc-test/src/math/hypotl.exe -/libc-test/src/math/asinhl.exe -/libc-test/src/math/logb.exe -/libc-test/src/math/scalblnl.exe -/libc-test/src/math/ilogbf.exe -/libc-test/src/math/atan2f.exe -/libc-test/src/math/fpclassify.exe -/libc-test/src/math/asinl.exe -/libc-test/src/math/log1p.exe -/libc-test/src/math/sqrtf.exe -/libc-test/src/math/sqrt.exe -/libc-test/src/math/llrint.exe -/libc-test/src/math/modfl.exe -/libc-test/src/math/fdiml.exe -/libc-test/src/math/fenv.exe -/libc-test/src/math/sincosf.exe -/libc-test/src/math/log10.exe -/libc-test/src/math/ceilf.exe -/libc-test/src/math/erf.exe -/libc-test/src/math/erfl.exe -/libc-test/src/math/lroundf.exe -/libc-test/src/math/j1f.exe -/libc-test/src/math/sqrtl.exe -/libc-test/src/math/fabsf.exe -/libc-test/src/math/lgamma.exe -/libc-test/src/math/llroundl.exe -/libc-test/src/math/floorl.exe -/libc-test/src/math/fminl.exe -/libc-test/src/math/llround.exe -/libc-test/src/math/tgammal.exe -/libc-test/src/math/drem.exe -/libc-test/src/math/tgamma.exe -/libc-test/src/math/exp2.exe -/libc-test/src/math/atanhl.exe -/libc-test/src/math/exp10l.exe -/libc-test/src/math/remquol.exe -/libc-test/src/math/y1.exe -/libc-test/src/math/scalbn.exe -/libc-test/src/math/rintl.exe -/libc-test/src/math/remquof.exe -/libc-test/src/math/fmod.exe -/libc-test/src/math/y1f.exe -/libc-test/src/math/expf.exe -/libc-test/src/math/exp.exe -/libc-test/src/math/cbrt.exe -/libc-test/src/math/ldexp.exe -/libc-test/src/math/nextafterf.exe -/libc-test/src/math/fmodl.exe -/libc-test/src/math/sincosl.exe -/libc-test/src/math/tgammaf.exe -/libc-test/src/math/ilogbl.exe -/libc-test/src/math/log.exe -/libc-test/src/math/tanf.exe -/libc-test/src/math/asinhf.exe -/libc-test/src/math/powf.exe -/libc-test/src/math/nexttowardf.exe -/libc-test/src/math/atanl.exe -/libc-test/src/math/coshl.exe -/libc-test/src/math/llroundf.exe -/libc-test/src/math/nexttoward.exe -/libc-test/src/math/acosh.exe -/libc-test/src/math/sin.exe -/libc-test/src/math/expl.exe -/libc-test/src/math/tanl.exe -/libc-test/src/math/lrintf.exe -/libc-test/src/math/fmin.exe -/libc-test/src/math/fmaf.exe -/libc-test/src/math/asin.exe -/libc-test/src/math/lgammal_r.exe -/libc-test/src/math/pow10.exe -/libc-test/src/math/floor.exe -/libc-test/src/math/j0f.exe -/libc-test/src/math/nextafterl.exe -/libc-test/src/math/fmax.exe -/libc-test/src/math/asinf.exe -/libc-test/src/math/cosh.exe -/libc-test/src/math/frexp.exe -/libc-test/src/math/acos.exe -/libc-test/src/math/trunc.exe -/libc-test/src/math/fdimf.exe -/libc-test/src/math/acoshf.exe -/libc-test/src/math/atanh.exe -/libc-test/src/math/exp2f.exe -/libc-test/src/math/jn.exe -/libc-test/src/math/ynf.exe -/libc-test/src/math/floorf.exe -/libc-test/src/math/scalb.exe -/libc-test/src/math/atanhf.exe -/libc-test/src/math/fma.exe -/libc-test/src/math/scalbf.exe -/libc-test/src/math/expm1.exe -/libc-test/src/math/copysign.exe -/libc-test/src/math/lroundl.exe -/libc-test/src/math/cos.exe -/libc-test/src/math/erfcf.exe -/libc-test/src/math/truncl.exe -/libc-test/src/math/scalbnl.exe -/libc-test/src/math/acoshl.exe -/libc-test/src/math/cosl.exe -/libc-test/src/math/sinhf.exe -/libc-test/src/math/sinf.exe -/libc-test/src/math/fmal.exe -/libc-test/src/math/remainder.exe -/libc-test/src/math/lgammaf.exe -/libc-test/src/math/fabsl.exe -/libc-test/src/math/cbrtf.exe -/libc-test/src/math/log10l.exe -/libc-test/src/math/pow.exe -/libc-test/src/math/atan2l.exe -/libc-test/src/math/powl.exe -/libc-test/src/math/log2l.exe -/libc-test/src/math/remquo.exe -/libc-test/src/math/sincos.exe -/libc-test/src/math/frexpf.exe -/libc-test/src/math/fmaxf.exe -/libc-test/src/math/expm1f.exe -/libc-test/src/math/llrintl.exe -/libc-test/src/math/tanhf.exe -/libc-test/src/math/hypotf.exe -/libc-test/src/math/acosl.exe -/libc-test/src/math/remainderf.exe -/libc-test/src/math/lgamma_r.exe -/libc-test/src/math/fmodf.exe -/libc-test/src/math/tanh.exe -/libc-test/src/math/hypot.exe -/libc-test/src/math/round.exe -/libc-test/src/math/frexpl.exe -/libc-test/src/math/expm1l.exe -/libc-test/src/math/tanhl.exe -/libc-test/src/math/copysignf.exe -/libc-test/src/math/atan2.exe -/libc-test/src/math/coshf.exe -/libc-test/src/math/scalbnf.exe -/libc-test/src/math/ilogb.exe -/libc-test/src/math/y0f.exe -/libc-test/src/math/cbrtl.exe -/libc-test/src/math/erfcl.exe -/libc-test/src/math/copysignl.exe -/libc-test/src/math/lround.exe -/libc-test/src/math/isless.exe -/libc-test/src/math/erfc.exe -/libc-test/src/math/atanf.exe -/libc-test/src/math/dremf.exe -/libc-test/src/math/roundf.exe -/libc-test/src/math/fdim.exe -/libc-test/src/math/modff.exe \ No newline at end of file diff --git a/scripts/linux/baremetal-test-allow-rv64.txt b/scripts/linux/baremetal-test-allow-rv64.txt deleted file mode 100644 index 9dc46d80..00000000 --- a/scripts/linux/baremetal-test-allow-rv64.txt +++ /dev/null @@ -1,525 +0,0 @@ -/oscomp/brk? -/oscomp/chdir? -/oscomp/clone? -/oscomp/close? -/oscomp/dup? -/oscomp/dup2? -/oscomp/execve? -/oscomp/exit? -/oscomp/fork? -/oscomp/fstat? -/oscomp/getcwd? -/oscomp/getdents? -/oscomp/getpid? -/oscomp/getppid? -/oscomp/gettimeofday? -/oscomp/mkdir_? -/oscomp/mmap? -/oscomp/mount? -/oscomp/munmap? -/oscomp/open? -/oscomp/openat? -/oscomp/pipe? -/oscomp/read? -/oscomp/sleep? -/oscomp/test_echo? -/oscomp/times? -/oscomp/umount? -/oscomp/uname? -/oscomp/unlink? -/oscomp/wait? -/oscomp/waitpid? -/oscomp/write? -/oscomp/yield? -/bin/busybox?cal -/bin/busybox?clear -/bin/busybox?date -/bin/busybox?df -/bin/busybox?dmesg -/bin/busybox?du -/bin/busybox?false -/bin/busybox?true -/bin/busybox?uname -/bin/busybox?uptime -/bin/busybox?ps -/bin/busybox?pwd -/bin/busybox?free -/bin/busybox?hwclock -/bin/busybox?ls -/libc-test/functional/search_tsearch.exe? -/libc-test/functional/fcntl-static.exe? -/libc-test/functional/memstream-static.exe? -/libc-test/functional/string_strcspn.exe? -/libc-test/functional/crypt.exe? -/libc-test/functional/tgmath.exe? -/libc-test/functional/pthread_cancel-static.exe? -/libc-test/functional/argv.exe? -/libc-test/functional/strtod-static.exe? -/libc-test/functional/time.exe? -/libc-test/functional/search_insque.exe? -/libc-test/functional/pthread_tsd-static.exe? -/libc-test/functional/fnmatch.exe? -/libc-test/functional/udiv-static.exe? -/libc-test/functional/sem_open.exe? -/libc-test/functional/random.exe? -/libc-test/functional/strtold.exe? -/libc-test/functional/env-static.exe? -/libc-test/functional/string_memmem.exe? -/libc-test/functional/search_tsearch-static.exe? -/libc-test/functional/basename-static.exe? -/libc-test/functional/sem_init.exe? -/libc-test/functional/spawn-static.exe? -/libc-test/functional/strtof-static.exe? -/libc-test/functional/search_lsearch-static.exe? -/libc-test/functional/string_memcpy-static.exe? -/libc-test/functional/tgmath-static.exe? -/libc-test/functional/strtol-static.exe? -/libc-test/functional/dirname.exe? -/libc-test/functional/tls_align_dlopen.exe? -/libc-test/functional/setjmp-static.exe? -/libc-test/functional/wcsstr.exe? -/libc-test/functional/wcstol.exe? -/libc-test/functional/mbc.exe? -/libc-test/functional/iconv_open-static.exe? -/libc-test/functional/inet_pton.exe? -/libc-test/functional/pthread_cancel-points-static.exe? -/libc-test/functional/strptime-static.exe? -/libc-test/functional/search_hsearch-static.exe? -/libc-test/functional/string_strchr-static.exe? -/libc-test/functional/fdopen-static.exe? -/libc-test/functional/ipc_shm.exe? -/libc-test/functional/search_lsearch.exe? -/libc-test/functional/tls_align-static.exe? -/libc-test/functional/basename.exe? -/libc-test/functional/mbc-static.exe? -/libc-test/functional/pthread_robust-static.exe? -/libc-test/functional/wcstol-static.exe? -/libc-test/functional/fwscanf-static.exe? -/libc-test/functional/ipc_msg.exe? -/libc-test/functional/clock_gettime-static.exe? -/libc-test/functional/stat-static.exe? -/libc-test/functional/wcsstr-static.exe? -/libc-test/functional/spawn.exe? -/libc-test/functional/search_hsearch.exe? -/libc-test/functional/string_memset.exe? -/libc-test/functional/string_strcspn-static.exe? -/libc-test/functional/string_strstr.exe? -/libc-test/functional/pthread_robust.exe? -/libc-test/functional/sscanf_long-static.exe? -/libc-test/functional/pthread_cancel-points.exe? -/libc-test/functional/fdopen.exe? -/libc-test/functional/pthread_cond.exe? -/libc-test/functional/tls_align.exe? -/libc-test/functional/tls_local_exec.exe? -/libc-test/functional/memstream.exe? -/libc-test/functional/sem_init-static.exe? -/libc-test/functional/popen-static.exe? -/libc-test/functional/random-static.exe? -/libc-test/functional/strtod_long.exe? -/libc-test/functional/fscanf-static.exe? -/libc-test/functional/swprintf.exe? -/libc-test/functional/strtod.exe? -/libc-test/functional/qsort.exe? -/libc-test/functional/inet_pton-static.exe? -/libc-test/functional/env.exe? -/libc-test/functional/sscanf-static.exe? -/libc-test/functional/tls_local_exec-static.exe? -/libc-test/functional/strftime-static.exe? -/libc-test/functional/dirname-static.exe? -/libc-test/functional/pthread_cancel.exe? -/libc-test/functional/fscanf.exe? -/libc-test/functional/clock_gettime.exe? -/libc-test/functional/crypt-static.exe? -/libc-test/functional/socket.exe? -/libc-test/functional/strptime.exe? -/libc-test/functional/fcntl.exe? -/libc-test/functional/string_memcpy.exe? -/libc-test/functional/strtod_simple-static.exe? -/libc-test/functional/pthread_mutex_pi.exe? -/libc-test/functional/argv-static.exe? -/libc-test/functional/search_insque-static.exe? -/libc-test/functional/ungetc-static.exe? -/libc-test/functional/string_memset-static.exe? -/libc-test/functional/sem_open-static.exe? -/libc-test/functional/clocale_mbfuncs-static.exe? -/libc-test/functional/sscanf_long.exe? -/libc-test/functional/string-static.exe? -/libc-test/functional/ipc_sem-static.exe? -/libc-test/functional/strtof.exe? -/libc-test/functional/string_strstr-static.exe? -/libc-test/functional/strtol.exe? -/libc-test/functional/snprintf.exe? -/libc-test/functional/tls_init.exe? -/libc-test/functional/clocale_mbfuncs.exe? -/libc-test/functional/iconv_open.exe? -/libc-test/functional/snprintf-static.exe? -/libc-test/functional/tls_init_dlopen.exe? -/libc-test/functional/ipc_msg-static.exe? -/libc-test/functional/time-static.exe? -/libc-test/functional/tls_init-static.exe? -/libc-test/functional/ungetc.exe? -/libc-test/functional/strtod_simple.exe? -/libc-test/functional/string_strchr.exe? -/libc-test/functional/dlopen.exe? -/libc-test/functional/vfork-static.exe? -/libc-test/functional/ipc_shm-static.exe? -/libc-test/functional/vfork.exe? -/libc-test/functional/pthread_mutex.exe? -/libc-test/functional/stat.exe? -/libc-test/functional/strtold-static.exe? -/libc-test/functional/ipc_sem.exe? -/libc-test/functional/swprintf-static.exe? -/libc-test/functional/popen.exe? -/libc-test/functional/strtod_long-static.exe? -/libc-test/functional/sscanf.exe? -/libc-test/functional/setjmp.exe? -/libc-test/functional/udiv.exe? -/libc-test/functional/fwscanf.exe? -/libc-test/functional/utime.exe? -/libc-test/functional/utime-static.exe? -/libc-test/functional/fnmatch-static.exe? -/libc-test/functional/pthread_tsd.exe? -/libc-test/functional/pthread_mutex_pi-static.exe? -/libc-test/functional/pthread_mutex-static.exe? -/libc-test/functional/qsort-static.exe? -/libc-test/functional/string.exe? -/libc-test/functional/pthread_cond-static.exe? -/libc-test/functional/strftime.exe? -/libc-test/functional/string_memmem-static.exe? -/libc-test/functional/socket-static.exe? -/libc-test/common/runtest.exe? -/libc-test/regression/pthread_atfork-errno-clobber-static.exe? -/libc-test/regression/setenv-oom.exe? -/libc-test/regression/fpclassify-invalid-ld80.exe? -/libc-test/regression/execle-env-static.exe? -/libc-test/regression/setvbuf-unget-static.exe? -/libc-test/regression/flockfile-list-static.exe? -/libc-test/regression/sigaltstack.exe? -/libc-test/regression/scanf-bytes-consumed.exe? -/libc-test/regression/putenv-doublefree-static.exe? -/libc-test/regression/getpwnam_r-errno.exe? -/libc-test/regression/ftello-unflushed-append-static.exe? -/libc-test/regression/setvbuf-unget.exe? -/libc-test/regression/inet_ntop-v4mapped-static.exe? -/libc-test/regression/pthread_cancel-sem_wait.exe? -/libc-test/regression/inet_pton-empty-last-field-static.exe? -/libc-test/regression/sscanf-eof-static.exe? -/libc-test/regression/ftello-unflushed-append.exe? -/libc-test/regression/strverscmp-static.exe? -/libc-test/regression/printf-fmt-n-static.exe? -/libc-test/regression/inet_pton-empty-last-field.exe? -/libc-test/regression/putenv-doublefree.exe? -/libc-test/regression/mkstemp-failure.exe? -/libc-test/regression/regex-backref-0-static.exe? -/libc-test/regression/malloc-oom-static.exe? -/libc-test/regression/sigprocmask-internal.exe? -/libc-test/regression/pthread-robust-detach-static.exe? -/libc-test/regression/memmem-oob-static.exe? -/libc-test/regression/memmem-oob-read.exe? -/libc-test/regression/lseek-large.exe? -/libc-test/regression/printf-fmt-g-zeros.exe? -/libc-test/regression/malloc-0.exe? -/libc-test/regression/wcsstr-false-negative.exe? -/libc-test/regression/pthread_cond-smasher-static.exe? -/libc-test/regression/wcsstr-false-negative-static.exe? -/libc-test/regression/tls_get_new-dtv.exe? -/libc-test/regression/printf-fmt-g-round-static.exe? -/libc-test/regression/uselocale-0.exe? -/libc-test/regression/flockfile-list.exe? -/libc-test/regression/getpwnam_r-errno-static.exe? -/libc-test/regression/dn_expand-ptr-0-static.exe? -/libc-test/regression/malloc-brk-fail-static.exe? -/libc-test/regression/statvfs.exe? -/libc-test/regression/scanf-match-literal-eof-static.exe? -/libc-test/regression/daemon-failure.exe? -/libc-test/regression/fflush-exit.exe? -/libc-test/regression/mkstemp-failure-static.exe? -/libc-test/regression/pthread-robust-detach.exe? -/libc-test/regression/syscall-sign-extend-static.exe? -/libc-test/regression/rewind-clear-error.exe? -/libc-test/regression/setenv-oom-static.exe? -/libc-test/regression/regex-escaped-high-byte.exe? -/libc-test/regression/dn_expand-empty-static.exe? -/libc-test/regression/regex-negated-range-static.exe? -/libc-test/regression/regex-ere-backref-static.exe? -/libc-test/regression/sem_close-unmap-static.exe? -/libc-test/regression/mkdtemp-failure.exe? -/libc-test/regression/printf-fmt-n.exe? -/libc-test/regression/rlimit-open-files.exe? -/libc-test/regression/iswspace-null.exe? -/libc-test/regression/pthread_exit-cancel.exe? -/libc-test/regression/sigreturn.exe? -/libc-test/regression/wcsncpy-read-overflow-static.exe? -/libc-test/regression/daemon-failure-static.exe? -/libc-test/regression/memmem-oob.exe? -/libc-test/regression/pthread_condattr_setclock.exe? -/libc-test/regression/lrand48-signextend.exe? -/libc-test/regression/rlimit-open-files-static.exe? -/libc-test/regression/sigaltstack-static.exe? -/libc-test/regression/regex-bracket-icase.exe? -/libc-test/regression/pthread_cond-smasher.exe? -/libc-test/regression/scanf-bytes-consumed-static.exe? -/libc-test/regression/scanf-match-literal-eof.exe? -/libc-test/regression/malloc-0-static.exe? -/libc-test/regression/lrand48-signextend-static.exe? -/libc-test/regression/raise-race-static.exe? -/libc-test/regression/printf-1e9-oob-static.exe? -/libc-test/regression/fgetwc-buffering.exe? -/libc-test/regression/pthread_cancel-sem_wait-static.exe? -/libc-test/regression/sem_close-unmap.exe? -/libc-test/regression/printf-fmt-g-round.exe? -/libc-test/regression/pthread_once-deadlock-static.exe? -/libc-test/regression/pthread_atfork-errno-clobber.exe? -/libc-test/regression/pthread_exit-cancel-static.exe? -/libc-test/regression/pthread_once-deadlock.exe? -/libc-test/regression/pthread_exit-dtor.exe? -/libc-test/regression/iconv-roundtrips-static.exe? -/libc-test/regression/syscall-sign-extend.exe? -/libc-test/regression/uselocale-0-static.exe? -/libc-test/regression/regex-bracket-icase-static.exe? -/libc-test/regression/strverscmp.exe? -/libc-test/regression/lseek-large-static.exe? -/libc-test/regression/scanf-nullbyte-char.exe? -/libc-test/regression/malloc-brk-fail.exe? -/libc-test/regression/pthread_create-oom-static.exe? -/libc-test/regression/regexec-nosub.exe? -/libc-test/regression/rewind-clear-error-static.exe? -/libc-test/regression/regex-negated-range.exe? -/libc-test/regression/inet_ntop-v4mapped.exe? -/libc-test/regression/regex-ere-backref.exe? -/libc-test/regression/memmem-oob-read-static.exe? -/libc-test/regression/sscanf-eof.exe? -/libc-test/regression/iswspace-null-static.exe? -/libc-test/regression/printf-1e9-oob.exe? -/libc-test/regression/mbsrtowcs-overflow-static.exe? -/libc-test/regression/dn_expand-ptr-0.exe? -/libc-test/regression/regexec-nosub-static.exe? -/libc-test/regression/iconv-roundtrips.exe? -/libc-test/regression/pthread_rwlock-ebusy.exe? -/libc-test/regression/getpwnam_r-crash.exe? -/libc-test/regression/printf-fmt-g-zeros-static.exe? -/libc-test/regression/sigprocmask-internal-static.exe? -/libc-test/regression/pthread_cond_wait-cancel_ignored.exe? -/libc-test/regression/sigreturn-static.exe? -/libc-test/regression/scanf-nullbyte-char-static.exe? -/libc-test/regression/execle-env.exe? -/libc-test/regression/raise-race.exe? -/libc-test/regression/getpwnam_r-crash-static.exe? -/libc-test/regression/statvfs-static.exe? -/libc-test/regression/pthread_rwlock-ebusy-static.exe? -/libc-test/regression/pthread_create-oom.exe? -/libc-test/regression/fpclassify-invalid-ld80-static.exe? -/libc-test/regression/fgets-eof.exe? -/libc-test/regression/regex-escaped-high-byte-static.exe? -/libc-test/regression/fgetwc-buffering-static.exe? -/libc-test/regression/mkdtemp-failure-static.exe? -/libc-test/regression/fgets-eof-static.exe? -/libc-test/regression/malloc-oom.exe? -/libc-test/regression/wcsncpy-read-overflow.exe? -/libc-test/regression/mbsrtowcs-overflow.exe? -/libc-test/regression/pthread_exit-dtor-static.exe? -/libc-test/regression/regex-backref-0.exe? -/libc-test/regression/pthread_cond_wait-cancel_ignored-static.exe? -/libc-test/regression/pthread_condattr_setclock-static.exe? -/libc-test/regression/fflush-exit-static.exe? -/libc-test/regression/dn_expand-empty.exe? -/libc-test/musl/pleval-static.exe? -/libc-test/math/nextafter.exe? -/libc-test/math/acosf.exe? -/libc-test/math/scalbln.exe? -/libc-test/math/ceil.exe? -/libc-test/math/erff.exe? -/libc-test/math/exp2l.exe? -/libc-test/math/sinh.exe? -/libc-test/math/remainderl.exe? -/libc-test/math/ceill.exe? -/libc-test/math/roundl.exe? -/libc-test/math/lgammal.exe? -/libc-test/math/lrintl.exe? -/libc-test/math/exp10.exe? -/libc-test/math/asinh.exe? -/libc-test/math/fabs.exe? -/libc-test/math/ldexpl.exe? -/libc-test/math/fminf.exe? -/libc-test/math/atan.exe? -/libc-test/math/y0.exe? -/libc-test/math/pow10l.exe? -/libc-test/math/exp10f.exe? -/libc-test/math/tan.exe? -/libc-test/math/modf.exe? -/libc-test/math/log10f.exe? -/libc-test/math/log2.exe? -/libc-test/math/fmaxl.exe? -/libc-test/math/j0.exe? -/libc-test/math/nexttowardl.exe? -/libc-test/math/rintf.exe? -/libc-test/math/scalblnf.exe? -/libc-test/math/lrint.exe? -/libc-test/math/sinl.exe? -/libc-test/math/log1pl.exe? -/libc-test/math/rint.exe? -/libc-test/math/logf.exe? -/libc-test/math/j1.exe? -/libc-test/math/nearbyintl.exe? -/libc-test/math/sinhl.exe? -/libc-test/math/logbf.exe? -/libc-test/math/jnf.exe? -/libc-test/math/ldexpf.exe? -/libc-test/math/truncf.exe? -/libc-test/math/llrintf.exe? -/libc-test/math/pow10f.exe? -/libc-test/math/cosf.exe? -/libc-test/math/log2f.exe? -/libc-test/math/yn.exe? -/libc-test/math/log1pf.exe? -/libc-test/math/logl.exe? -/libc-test/math/nearbyintf.exe? -/libc-test/math/logbl.exe? -/libc-test/math/lgammaf_r.exe? -/libc-test/math/nearbyint.exe? -/libc-test/math/hypotl.exe? -/libc-test/math/asinhl.exe? -/libc-test/math/logb.exe? -/libc-test/math/scalblnl.exe? -/libc-test/math/ilogbf.exe? -/libc-test/math/atan2f.exe? -/libc-test/math/fpclassify.exe? -/libc-test/math/asinl.exe? -/libc-test/math/log1p.exe? -/libc-test/math/sqrtf.exe? -/libc-test/math/sqrt.exe? -/libc-test/math/llrint.exe? -/libc-test/math/modfl.exe? -/libc-test/math/fdiml.exe? -/libc-test/math/fenv.exe? -/libc-test/math/sincosf.exe? -/libc-test/math/log10.exe? -/libc-test/math/ceilf.exe? -/libc-test/math/erf.exe? -/libc-test/math/erfl.exe? -/libc-test/math/lroundf.exe? -/libc-test/math/j1f.exe? -/libc-test/math/sqrtl.exe? -/libc-test/math/fabsf.exe? -/libc-test/math/lgamma.exe? -/libc-test/math/llroundl.exe? -/libc-test/math/floorl.exe? -/libc-test/math/fminl.exe? -/libc-test/math/llround.exe? -/libc-test/math/tgammal.exe? -/libc-test/math/drem.exe? -/libc-test/math/tgamma.exe? -/libc-test/math/exp2.exe? -/libc-test/math/atanhl.exe? -/libc-test/math/exp10l.exe? -/libc-test/math/remquol.exe? -/libc-test/math/y1.exe? -/libc-test/math/scalbn.exe? -/libc-test/math/rintl.exe? -/libc-test/math/remquof.exe? -/libc-test/math/fmod.exe? -/libc-test/math/y1f.exe? -/libc-test/math/expf.exe? -/libc-test/math/exp.exe? -/libc-test/math/cbrt.exe? -/libc-test/math/ldexp.exe? -/libc-test/math/nextafterf.exe? -/libc-test/math/fmodl.exe? -/libc-test/math/sincosl.exe? -/libc-test/math/tgammaf.exe? -/libc-test/math/ilogbl.exe? -/libc-test/math/log.exe? -/libc-test/math/tanf.exe? -/libc-test/math/asinhf.exe? -/libc-test/math/powf.exe? -/libc-test/math/nexttowardf.exe? -/libc-test/math/atanl.exe? -/libc-test/math/coshl.exe? -/libc-test/math/llroundf.exe? -/libc-test/math/nexttoward.exe? -/libc-test/math/acosh.exe? -/libc-test/math/sin.exe? -/libc-test/math/expl.exe? -/libc-test/math/tanl.exe? -/libc-test/math/lrintf.exe? -/libc-test/math/fmin.exe? -/libc-test/math/fmaf.exe? -/libc-test/math/asin.exe? -/libc-test/math/lgammal_r.exe? -/libc-test/math/pow10.exe? -/libc-test/math/floor.exe? -/libc-test/math/j0f.exe? -/libc-test/math/nextafterl.exe? -/libc-test/math/fmax.exe? -/libc-test/math/asinf.exe? -/libc-test/math/cosh.exe? -/libc-test/math/frexp.exe? -/libc-test/math/acos.exe? -/libc-test/math/trunc.exe? -/libc-test/math/fdimf.exe? -/libc-test/math/acoshf.exe? -/libc-test/math/atanh.exe? -/libc-test/math/exp2f.exe? -/libc-test/math/jn.exe? -/libc-test/math/ynf.exe? -/libc-test/math/floorf.exe? -/libc-test/math/scalb.exe? -/libc-test/math/atanhf.exe? -/libc-test/math/fma.exe? -/libc-test/math/scalbf.exe? -/libc-test/math/expm1.exe? -/libc-test/math/copysign.exe? -/libc-test/math/lroundl.exe? -/libc-test/math/cos.exe? -/libc-test/math/erfcf.exe? -/libc-test/math/truncl.exe? -/libc-test/math/scalbnl.exe? -/libc-test/math/acoshl.exe? -/libc-test/math/cosl.exe? -/libc-test/math/sinhf.exe? -/libc-test/math/sinf.exe? -/libc-test/math/fmal.exe? -/libc-test/math/remainder.exe? -/libc-test/math/lgammaf.exe? -/libc-test/math/fabsl.exe? -/libc-test/math/cbrtf.exe? -/libc-test/math/log10l.exe? -/libc-test/math/pow.exe? -/libc-test/math/atan2l.exe? -/libc-test/math/powl.exe? -/libc-test/math/log2l.exe? -/libc-test/math/remquo.exe? -/libc-test/math/sincos.exe? -/libc-test/math/frexpf.exe? -/libc-test/math/fmaxf.exe? -/libc-test/math/expm1f.exe? -/libc-test/math/llrintl.exe? -/libc-test/math/tanhf.exe? -/libc-test/math/hypotf.exe? -/libc-test/math/acosl.exe? -/libc-test/math/remainderf.exe? -/libc-test/math/lgamma_r.exe? -/libc-test/math/fmodf.exe? -/libc-test/math/tanh.exe? -/libc-test/math/hypot.exe? -/libc-test/math/round.exe? -/libc-test/math/frexpl.exe? -/libc-test/math/expm1l.exe? -/libc-test/math/tanhl.exe? -/libc-test/math/copysignf.exe? -/libc-test/math/atan2.exe? -/libc-test/math/coshf.exe? -/libc-test/math/scalbnf.exe? -/libc-test/math/ilogb.exe? -/libc-test/math/y0f.exe? -/libc-test/math/cbrtl.exe? -/libc-test/math/erfcl.exe? -/libc-test/math/copysignl.exe? -/libc-test/math/lround.exe? -/libc-test/math/isless.exe? -/libc-test/math/erfc.exe? -/libc-test/math/atanf.exe? -/libc-test/math/dremf.exe? -/libc-test/math/roundf.exe? -/libc-test/math/fdim.exe? -/libc-test/math/modff.exe? \ No newline at end of file diff --git a/scripts/linux/baremetal-test-allow.txt b/scripts/linux/baremetal-test-allow.txt deleted file mode 100644 index 7127dff4..00000000 --- a/scripts/linux/baremetal-test-allow.txt +++ /dev/null @@ -1,477 +0,0 @@ -/libc-test/src/functional/search_tsearch.exe -/libc-test/src/functional/fcntl-static.exe -/libc-test/src/functional/memstream-static.exe -/libc-test/src/functional/string_strcspn.exe -/libc-test/src/functional/crypt.exe -/libc-test/src/functional/tgmath.exe -/libc-test/src/functional/pthread_cancel-static.exe -/libc-test/src/functional/argv.exe -/libc-test/src/functional/strtod-static.exe -/libc-test/src/functional/time.exe -/libc-test/src/functional/search_insque.exe -/libc-test/src/functional/pthread_tsd-static.exe -/libc-test/src/functional/fnmatch.exe -/libc-test/src/functional/udiv-static.exe -/libc-test/src/functional/sem_open.exe -/libc-test/src/functional/random.exe -/libc-test/src/functional/strtold.exe -/libc-test/src/functional/env-static.exe -/libc-test/src/functional/string_memmem.exe -/libc-test/src/functional/search_tsearch-static.exe -/libc-test/src/functional/basename-static.exe -/libc-test/src/functional/sem_init.exe -/libc-test/src/functional/spawn-static.exe -/libc-test/src/functional/strtof-static.exe -/libc-test/src/functional/search_lsearch-static.exe -/libc-test/src/functional/string_memcpy-static.exe -/libc-test/src/functional/tgmath-static.exe -/libc-test/src/functional/strtol-static.exe -/libc-test/src/functional/dirname.exe -/libc-test/src/functional/tls_align_dlopen.exe -/libc-test/src/functional/setjmp-static.exe -/libc-test/src/functional/wcsstr.exe -/libc-test/src/functional/wcstol.exe -/libc-test/src/functional/mbc.exe -/libc-test/src/functional/iconv_open-static.exe -/libc-test/src/functional/inet_pton.exe -/libc-test/src/functional/pthread_cancel-points-static.exe -/libc-test/src/functional/strptime-static.exe -/libc-test/src/functional/search_hsearch-static.exe -/libc-test/src/functional/string_strchr-static.exe -/libc-test/src/functional/fdopen-static.exe -/libc-test/src/functional/ipc_shm.exe -/libc-test/src/functional/search_lsearch.exe -/libc-test/src/functional/tls_align-static.exe -/libc-test/src/functional/basename.exe -/libc-test/src/functional/mbc-static.exe -/libc-test/src/functional/pthread_robust-static.exe -/libc-test/src/functional/wcstol-static.exe -/libc-test/src/functional/fwscanf-static.exe -/libc-test/src/functional/ipc_msg.exe -/libc-test/src/functional/clock_gettime-static.exe -/libc-test/src/functional/stat-static.exe -/libc-test/src/functional/wcsstr-static.exe -/libc-test/src/functional/spawn.exe -/libc-test/src/functional/search_hsearch.exe -/libc-test/src/functional/string_memset.exe -/libc-test/src/functional/string_strcspn-static.exe -/libc-test/src/functional/string_strstr.exe -/libc-test/src/functional/pthread_robust.exe -/libc-test/src/functional/sscanf_long-static.exe -/libc-test/src/functional/pthread_cancel-points.exe -/libc-test/src/functional/fdopen.exe -/libc-test/src/functional/pthread_cond.exe -/libc-test/src/functional/tls_align.exe -/libc-test/src/functional/tls_local_exec.exe -/libc-test/src/functional/memstream.exe -/libc-test/src/functional/sem_init-static.exe -/libc-test/src/functional/popen-static.exe -/libc-test/src/functional/random-static.exe -/libc-test/src/functional/strtod_long.exe -/libc-test/src/functional/fscanf-static.exe -/libc-test/src/functional/swprintf.exe -/libc-test/src/functional/strtod.exe -/libc-test/src/functional/qsort.exe -/libc-test/src/functional/inet_pton-static.exe -/libc-test/src/functional/env.exe -/libc-test/src/functional/sscanf-static.exe -/libc-test/src/functional/tls_local_exec-static.exe -/libc-test/src/functional/strftime-static.exe -/libc-test/src/functional/dirname-static.exe -/libc-test/src/functional/pthread_cancel.exe -/libc-test/src/functional/fscanf.exe -/libc-test/src/functional/clock_gettime.exe -/libc-test/src/functional/crypt-static.exe -/libc-test/src/functional/socket.exe -/libc-test/src/functional/strptime.exe -/libc-test/src/functional/fcntl.exe -/libc-test/src/functional/string_memcpy.exe -/libc-test/src/functional/strtod_simple-static.exe -/libc-test/src/functional/pthread_mutex_pi.exe -/libc-test/src/functional/argv-static.exe -/libc-test/src/functional/search_insque-static.exe -/libc-test/src/functional/ungetc-static.exe -/libc-test/src/functional/string_memset-static.exe -/libc-test/src/functional/sem_open-static.exe -/libc-test/src/functional/clocale_mbfuncs-static.exe -/libc-test/src/functional/sscanf_long.exe -/libc-test/src/functional/string-static.exe -/libc-test/src/functional/ipc_sem-static.exe -/libc-test/src/functional/strtof.exe -/libc-test/src/functional/string_strstr-static.exe -/libc-test/src/functional/strtol.exe -/libc-test/src/functional/snprintf.exe -/libc-test/src/functional/tls_init.exe -/libc-test/src/functional/clocale_mbfuncs.exe -/libc-test/src/functional/iconv_open.exe -/libc-test/src/functional/snprintf-static.exe -/libc-test/src/functional/tls_init_dlopen.exe -/libc-test/src/functional/ipc_msg-static.exe -/libc-test/src/functional/time-static.exe -/libc-test/src/functional/tls_init-static.exe -/libc-test/src/functional/ungetc.exe -/libc-test/src/functional/strtod_simple.exe -/libc-test/src/functional/string_strchr.exe -/libc-test/src/functional/dlopen.exe -/libc-test/src/functional/vfork-static.exe -/libc-test/src/functional/ipc_shm-static.exe -/libc-test/src/functional/vfork.exe -/libc-test/src/functional/pthread_mutex.exe -/libc-test/src/functional/stat.exe -/libc-test/src/functional/strtold-static.exe -/libc-test/src/functional/ipc_sem.exe -/libc-test/src/functional/swprintf-static.exe -/libc-test/src/functional/popen.exe -/libc-test/src/functional/strtod_long-static.exe -/libc-test/src/functional/sscanf.exe -/libc-test/src/functional/setjmp.exe -/libc-test/src/functional/udiv.exe -/libc-test/src/functional/fwscanf.exe -/libc-test/src/functional/utime.exe -/libc-test/src/functional/utime-static.exe -/libc-test/src/functional/fnmatch-static.exe -/libc-test/src/functional/pthread_tsd.exe -/libc-test/src/functional/pthread_mutex_pi-static.exe -/libc-test/src/functional/pthread_mutex-static.exe -/libc-test/src/functional/qsort-static.exe -/libc-test/src/functional/string.exe -/libc-test/src/functional/pthread_cond-static.exe -/libc-test/src/functional/strftime.exe -/libc-test/src/functional/string_memmem-static.exe -/libc-test/src/functional/socket-static.exe -/libc-test/src/common/runtest.exe -/libc-test/src/regression/pthread_atfork-errno-clobber-static.exe -/libc-test/src/regression/setenv-oom.exe -/libc-test/src/regression/fpclassify-invalid-ld80.exe -/libc-test/src/regression/execle-env-static.exe -/libc-test/src/regression/setvbuf-unget-static.exe -/libc-test/src/regression/flockfile-list-static.exe -/libc-test/src/regression/sigaltstack.exe -/libc-test/src/regression/scanf-bytes-consumed.exe -/libc-test/src/regression/putenv-doublefree-static.exe -/libc-test/src/regression/getpwnam_r-errno.exe -/libc-test/src/regression/ftello-unflushed-append-static.exe -/libc-test/src/regression/setvbuf-unget.exe -/libc-test/src/regression/inet_ntop-v4mapped-static.exe -/libc-test/src/regression/pthread_cancel-sem_wait.exe -/libc-test/src/regression/inet_pton-empty-last-field-static.exe -/libc-test/src/regression/sscanf-eof-static.exe -/libc-test/src/regression/ftello-unflushed-append.exe -/libc-test/src/regression/strverscmp-static.exe -/libc-test/src/regression/printf-fmt-n-static.exe -/libc-test/src/regression/inet_pton-empty-last-field.exe -/libc-test/src/regression/putenv-doublefree.exe -/libc-test/src/regression/mkstemp-failure.exe -/libc-test/src/regression/regex-backref-0-static.exe -/libc-test/src/regression/malloc-oom-static.exe -/libc-test/src/regression/sigprocmask-internal.exe -/libc-test/src/regression/pthread-robust-detach-static.exe -/libc-test/src/regression/memmem-oob-static.exe -/libc-test/src/regression/memmem-oob-read.exe -/libc-test/src/regression/lseek-large.exe -/libc-test/src/regression/printf-fmt-g-zeros.exe -/libc-test/src/regression/malloc-0.exe -/libc-test/src/regression/wcsstr-false-negative.exe -/libc-test/src/regression/pthread_cond-smasher-static.exe -/libc-test/src/regression/wcsstr-false-negative-static.exe -/libc-test/src/regression/tls_get_new-dtv.exe -/libc-test/src/regression/printf-fmt-g-round-static.exe -/libc-test/src/regression/uselocale-0.exe -/libc-test/src/regression/flockfile-list.exe -/libc-test/src/regression/getpwnam_r-errno-static.exe -/libc-test/src/regression/dn_expand-ptr-0-static.exe -/libc-test/src/regression/malloc-brk-fail-static.exe -/libc-test/src/regression/statvfs.exe -/libc-test/src/regression/scanf-match-literal-eof-static.exe -/libc-test/src/regression/daemon-failure.exe -/libc-test/src/regression/fflush-exit.exe -/libc-test/src/regression/mkstemp-failure-static.exe -/libc-test/src/regression/pthread-robust-detach.exe -/libc-test/src/regression/syscall-sign-extend-static.exe -/libc-test/src/regression/rewind-clear-error.exe -/libc-test/src/regression/setenv-oom-static.exe -/libc-test/src/regression/regex-escaped-high-byte.exe -/libc-test/src/regression/dn_expand-empty-static.exe -/libc-test/src/regression/regex-negated-range-static.exe -/libc-test/src/regression/regex-ere-backref-static.exe -/libc-test/src/regression/sem_close-unmap-static.exe -/libc-test/src/regression/mkdtemp-failure.exe -/libc-test/src/regression/printf-fmt-n.exe -/libc-test/src/regression/rlimit-open-files.exe -/libc-test/src/regression/iswspace-null.exe -/libc-test/src/regression/pthread_exit-cancel.exe -/libc-test/src/regression/sigreturn.exe -/libc-test/src/regression/wcsncpy-read-overflow-static.exe -/libc-test/src/regression/daemon-failure-static.exe -/libc-test/src/regression/memmem-oob.exe -/libc-test/src/regression/pthread_condattr_setclock.exe -/libc-test/src/regression/lrand48-signextend.exe -/libc-test/src/regression/rlimit-open-files-static.exe -/libc-test/src/regression/sigaltstack-static.exe -/libc-test/src/regression/regex-bracket-icase.exe -/libc-test/src/regression/pthread_cond-smasher.exe -/libc-test/src/regression/scanf-bytes-consumed-static.exe -/libc-test/src/regression/scanf-match-literal-eof.exe -/libc-test/src/regression/malloc-0-static.exe -/libc-test/src/regression/lrand48-signextend-static.exe -/libc-test/src/regression/raise-race-static.exe -/libc-test/src/regression/printf-1e9-oob-static.exe -/libc-test/src/regression/fgetwc-buffering.exe -/libc-test/src/regression/pthread_cancel-sem_wait-static.exe -/libc-test/src/regression/sem_close-unmap.exe -/libc-test/src/regression/printf-fmt-g-round.exe -/libc-test/src/regression/pthread_once-deadlock-static.exe -/libc-test/src/regression/pthread_atfork-errno-clobber.exe -/libc-test/src/regression/pthread_exit-cancel-static.exe -/libc-test/src/regression/pthread_once-deadlock.exe -/libc-test/src/regression/pthread_exit-dtor.exe -/libc-test/src/regression/iconv-roundtrips-static.exe -/libc-test/src/regression/syscall-sign-extend.exe -/libc-test/src/regression/uselocale-0-static.exe -/libc-test/src/regression/regex-bracket-icase-static.exe -/libc-test/src/regression/strverscmp.exe -/libc-test/src/regression/lseek-large-static.exe -/libc-test/src/regression/scanf-nullbyte-char.exe -/libc-test/src/regression/malloc-brk-fail.exe -/libc-test/src/regression/pthread_create-oom-static.exe -/libc-test/src/regression/regexec-nosub.exe -/libc-test/src/regression/rewind-clear-error-static.exe -/libc-test/src/regression/regex-negated-range.exe -/libc-test/src/regression/inet_ntop-v4mapped.exe -/libc-test/src/regression/regex-ere-backref.exe -/libc-test/src/regression/memmem-oob-read-static.exe -/libc-test/src/regression/sscanf-eof.exe -/libc-test/src/regression/iswspace-null-static.exe -/libc-test/src/regression/printf-1e9-oob.exe -/libc-test/src/regression/mbsrtowcs-overflow-static.exe -/libc-test/src/regression/dn_expand-ptr-0.exe -/libc-test/src/regression/regexec-nosub-static.exe -/libc-test/src/regression/iconv-roundtrips.exe -/libc-test/src/regression/pthread_rwlock-ebusy.exe -/libc-test/src/regression/getpwnam_r-crash.exe -/libc-test/src/regression/printf-fmt-g-zeros-static.exe -/libc-test/src/regression/sigprocmask-internal-static.exe -/libc-test/src/regression/pthread_cond_wait-cancel_ignored.exe -/libc-test/src/regression/sigreturn-static.exe -/libc-test/src/regression/scanf-nullbyte-char-static.exe -/libc-test/src/regression/execle-env.exe -/libc-test/src/regression/raise-race.exe -/libc-test/src/regression/getpwnam_r-crash-static.exe -/libc-test/src/regression/statvfs-static.exe -/libc-test/src/regression/pthread_rwlock-ebusy-static.exe -/libc-test/src/regression/pthread_create-oom.exe -/libc-test/src/regression/fpclassify-invalid-ld80-static.exe -/libc-test/src/regression/fgets-eof.exe -/libc-test/src/regression/regex-escaped-high-byte-static.exe -/libc-test/src/regression/fgetwc-buffering-static.exe -/libc-test/src/regression/mkdtemp-failure-static.exe -/libc-test/src/regression/fgets-eof-static.exe -/libc-test/src/regression/malloc-oom.exe -/libc-test/src/regression/wcsncpy-read-overflow.exe -/libc-test/src/regression/mbsrtowcs-overflow.exe -/libc-test/src/regression/pthread_exit-dtor-static.exe -/libc-test/src/regression/regex-backref-0.exe -/libc-test/src/regression/pthread_cond_wait-cancel_ignored-static.exe -/libc-test/src/regression/pthread_condattr_setclock-static.exe -/libc-test/src/regression/fflush-exit-static.exe -/libc-test/src/regression/dn_expand-empty.exe -/libc-test/src/musl/pleval-static.exe -/libc-test/src/math/nextafter.exe -/libc-test/src/math/acosf.exe -/libc-test/src/math/scalbln.exe -/libc-test/src/math/ceil.exe -/libc-test/src/math/erff.exe -/libc-test/src/math/exp2l.exe -/libc-test/src/math/sinh.exe -/libc-test/src/math/remainderl.exe -/libc-test/src/math/ceill.exe -/libc-test/src/math/roundl.exe -/libc-test/src/math/lgammal.exe -/libc-test/src/math/lrintl.exe -/libc-test/src/math/exp10.exe -/libc-test/src/math/asinh.exe -/libc-test/src/math/fabs.exe -/libc-test/src/math/ldexpl.exe -/libc-test/src/math/fminf.exe -/libc-test/src/math/atan.exe -/libc-test/src/math/y0.exe -/libc-test/src/math/pow10l.exe -/libc-test/src/math/exp10f.exe -/libc-test/src/math/tan.exe -/libc-test/src/math/modf.exe -/libc-test/src/math/log10f.exe -/libc-test/src/math/log2.exe -/libc-test/src/math/fmaxl.exe -/libc-test/src/math/j0.exe -/libc-test/src/math/nexttowardl.exe -/libc-test/src/math/rintf.exe -/libc-test/src/math/scalblnf.exe -/libc-test/src/math/lrint.exe -/libc-test/src/math/sinl.exe -/libc-test/src/math/log1pl.exe -/libc-test/src/math/rint.exe -/libc-test/src/math/logf.exe -/libc-test/src/math/j1.exe -/libc-test/src/math/nearbyintl.exe -/libc-test/src/math/sinhl.exe -/libc-test/src/math/logbf.exe -/libc-test/src/math/jnf.exe -/libc-test/src/math/ldexpf.exe -/libc-test/src/math/truncf.exe -/libc-test/src/math/llrintf.exe -/libc-test/src/math/pow10f.exe -/libc-test/src/math/cosf.exe -/libc-test/src/math/log2f.exe -/libc-test/src/math/yn.exe -/libc-test/src/math/log1pf.exe -/libc-test/src/math/logl.exe -/libc-test/src/math/nearbyintf.exe -/libc-test/src/math/logbl.exe -/libc-test/src/math/lgammaf_r.exe -/libc-test/src/math/nearbyint.exe -/libc-test/src/math/hypotl.exe -/libc-test/src/math/asinhl.exe -/libc-test/src/math/logb.exe -/libc-test/src/math/scalblnl.exe -/libc-test/src/math/ilogbf.exe -/libc-test/src/math/atan2f.exe -/libc-test/src/math/fpclassify.exe -/libc-test/src/math/asinl.exe -/libc-test/src/math/log1p.exe -/libc-test/src/math/sqrtf.exe -/libc-test/src/math/sqrt.exe -/libc-test/src/math/llrint.exe -/libc-test/src/math/modfl.exe -/libc-test/src/math/fdiml.exe -/libc-test/src/math/fenv.exe -/libc-test/src/math/sincosf.exe -/libc-test/src/math/log10.exe -/libc-test/src/math/ceilf.exe -/libc-test/src/math/erf.exe -/libc-test/src/math/erfl.exe -/libc-test/src/math/lroundf.exe -/libc-test/src/math/j1f.exe -/libc-test/src/math/sqrtl.exe -/libc-test/src/math/fabsf.exe -/libc-test/src/math/lgamma.exe -/libc-test/src/math/llroundl.exe -/libc-test/src/math/floorl.exe -/libc-test/src/math/fminl.exe -/libc-test/src/math/llround.exe -/libc-test/src/math/tgammal.exe -/libc-test/src/math/drem.exe -/libc-test/src/math/tgamma.exe -/libc-test/src/math/exp2.exe -/libc-test/src/math/atanhl.exe -/libc-test/src/math/exp10l.exe -/libc-test/src/math/remquol.exe -/libc-test/src/math/y1.exe -/libc-test/src/math/scalbn.exe -/libc-test/src/math/rintl.exe -/libc-test/src/math/remquof.exe -/libc-test/src/math/fmod.exe -/libc-test/src/math/y1f.exe -/libc-test/src/math/expf.exe -/libc-test/src/math/exp.exe -/libc-test/src/math/cbrt.exe -/libc-test/src/math/ldexp.exe -/libc-test/src/math/nextafterf.exe -/libc-test/src/math/fmodl.exe -/libc-test/src/math/sincosl.exe -/libc-test/src/math/tgammaf.exe -/libc-test/src/math/ilogbl.exe -/libc-test/src/math/log.exe -/libc-test/src/math/tanf.exe -/libc-test/src/math/asinhf.exe -/libc-test/src/math/powf.exe -/libc-test/src/math/nexttowardf.exe -/libc-test/src/math/atanl.exe -/libc-test/src/math/coshl.exe -/libc-test/src/math/llroundf.exe -/libc-test/src/math/nexttoward.exe -/libc-test/src/math/acosh.exe -/libc-test/src/math/sin.exe -/libc-test/src/math/expl.exe -/libc-test/src/math/tanl.exe -/libc-test/src/math/lrintf.exe -/libc-test/src/math/fmin.exe -/libc-test/src/math/fmaf.exe -/libc-test/src/math/asin.exe -/libc-test/src/math/lgammal_r.exe -/libc-test/src/math/pow10.exe -/libc-test/src/math/floor.exe -/libc-test/src/math/j0f.exe -/libc-test/src/math/nextafterl.exe -/libc-test/src/math/fmax.exe -/libc-test/src/math/asinf.exe -/libc-test/src/math/cosh.exe -/libc-test/src/math/frexp.exe -/libc-test/src/math/acos.exe -/libc-test/src/math/trunc.exe -/libc-test/src/math/fdimf.exe -/libc-test/src/math/acoshf.exe -/libc-test/src/math/atanh.exe -/libc-test/src/math/exp2f.exe -/libc-test/src/math/jn.exe -/libc-test/src/math/ynf.exe -/libc-test/src/math/floorf.exe -/libc-test/src/math/scalb.exe -/libc-test/src/math/atanhf.exe -/libc-test/src/math/fma.exe -/libc-test/src/math/scalbf.exe -/libc-test/src/math/expm1.exe -/libc-test/src/math/copysign.exe -/libc-test/src/math/lroundl.exe -/libc-test/src/math/cos.exe -/libc-test/src/math/erfcf.exe -/libc-test/src/math/truncl.exe -/libc-test/src/math/scalbnl.exe -/libc-test/src/math/acoshl.exe -/libc-test/src/math/cosl.exe -/libc-test/src/math/sinhf.exe -/libc-test/src/math/sinf.exe -/libc-test/src/math/fmal.exe -/libc-test/src/math/remainder.exe -/libc-test/src/math/lgammaf.exe -/libc-test/src/math/fabsl.exe -/libc-test/src/math/cbrtf.exe -/libc-test/src/math/log10l.exe -/libc-test/src/math/pow.exe -/libc-test/src/math/atan2l.exe -/libc-test/src/math/powl.exe -/libc-test/src/math/log2l.exe -/libc-test/src/math/remquo.exe -/libc-test/src/math/sincos.exe -/libc-test/src/math/frexpf.exe -/libc-test/src/math/fmaxf.exe -/libc-test/src/math/expm1f.exe -/libc-test/src/math/llrintl.exe -/libc-test/src/math/tanhf.exe -/libc-test/src/math/hypotf.exe -/libc-test/src/math/acosl.exe -/libc-test/src/math/remainderf.exe -/libc-test/src/math/lgamma_r.exe -/libc-test/src/math/fmodf.exe -/libc-test/src/math/tanh.exe -/libc-test/src/math/hypot.exe -/libc-test/src/math/round.exe -/libc-test/src/math/frexpl.exe -/libc-test/src/math/expm1l.exe -/libc-test/src/math/tanhl.exe -/libc-test/src/math/copysignf.exe -/libc-test/src/math/atan2.exe -/libc-test/src/math/coshf.exe -/libc-test/src/math/scalbnf.exe -/libc-test/src/math/ilogb.exe -/libc-test/src/math/y0f.exe -/libc-test/src/math/cbrtl.exe -/libc-test/src/math/erfcl.exe -/libc-test/src/math/copysignl.exe -/libc-test/src/math/lround.exe -/libc-test/src/math/isless.exe -/libc-test/src/math/erfc.exe -/libc-test/src/math/atanf.exe -/libc-test/src/math/dremf.exe -/libc-test/src/math/roundf.exe -/libc-test/src/math/fdim.exe -/libc-test/src/math/modff.exe \ No newline at end of file diff --git a/scripts/linux/baremetal-test-allow.txt.busybox b/scripts/linux/baremetal-test-allow.txt.busybox deleted file mode 100644 index 8314c08c..00000000 --- a/scripts/linux/baremetal-test-allow.txt.busybox +++ /dev/null @@ -1,53 +0,0 @@ -/bin/busybox ash -c exit -/bin/busybox sh -c exit -/bin/busybox basename /aaa/bbb -/bin/busybox cal -/bin/busybox clear -/bin/busybox date -/bin/busybox df -/bin/busybox dirname /aaa/bbb -/bin/busybox dmesg -/bin/busybox du -/bin/busybox expr 1 + 1 -/bin/busybox false -/bin/busybox true -/bin/busybox which ls -/bin/busybox uname -/bin/busybox uptime -/bin/busybox printf "abc\n" -/bin/busybox ps -/bin/busybox pwd -/bin/busybox free -/bin/busybox hwclock -/bin/busybox kill 10 -/bin/busybox ls -/bin/busybox sleep 1 -/bin/busybox touch test.txt -/bin/busybox echo "hello world" > test.txt -/bin/busybox cat test.txt -/bin/busybox cut -c 3 test.txt -/bin/busybox od test.txt -/bin/busybox head test.txt -/bin/busybox tail test.txt -/bin/busybox hexdump -C test.txt -/bin/busybox md5sum test.txt -/bin/busybox echo "ccccccc" >> test.txt -/bin/busybox echo "bbbbbbb" >> test.txt -/bin/busybox echo "aaaaaaa" >> test.txt -/bin/busybox echo "2222222" >> test.txt -/bin/busybox echo "1111111" >> test.txt -/bin/busybox echo "bbbbbbb" >> test.txt -/bin/busybox sort test.txt | ./busybox uniq -/bin/busybox stat test.txt -/bin/busybox strings test.txt -/bin/busybox wc test.txt -/bin/busybox [ -f test.txt ] -/bin/busybox more test.txt -/bin/busybox rm test.txt -/bin/busybox mkdir test_dir -/bin/busybox mv test_dir test -/bin/busybox rmdir test -/bin/busybox grep hello busybox_cmd.txt -/bin/busybox cp busybox_cmd.txt busybox_cmd.bak -/bin/busybox rm busybox_cmd.bak -/bin/busybox find -name "busybox_cmd.txt" diff --git a/scripts/linux/baremetal-test-allow.txt.lmbench b/scripts/linux/baremetal-test-allow.txt.lmbench deleted file mode 100644 index f1a951d8..00000000 --- a/scripts/linux/baremetal-test-allow.txt.lmbench +++ /dev/null @@ -1,27 +0,0 @@ -/bin/lmbench_all lat_syscall -P 1 null -/bin/lmbench_all lat_syscall -P 1 read -/bin/lmbench_all lat_syscall -P 1 write -/bin/busybox mkdir -p /var/tmp -/bin/busybox touch /var/tmp/lmbench -/bin/lmbench_all lat_syscall -P 1 stat /var/tmp/lmbench -/bin/lmbench_all lat_syscall -P 1 fstat /var/tmp/lmbench -/bin/lmbench_all lat_syscall -P 1 open /var/tmp/lmbench -/bin/lmbench_all lat_select -n 100 -P 1 file -/bin/lmbench_all lat_sig -P 1 install -/bin/lmbench_all lat_sig -P 1 catch -/bin/lmbench_all lat_sig -P 1 prot lat_sig -/bin/lmbench_all lat_pipe -P 1 -/bin/lmbench_all lat_proc -P 1 fork -/bin/lmbench_all lat_proc -P 1 exec -/bin/busybox cp /bin/hello /tmp -/bin/lmbench_all lat_proc -P 1 shell -/bin/lmbench_all lmdd label="File /var/tmp/XXX write bandwidth:" of=/var/tmp/XXX move=645m fsync=1 print=3 -/bin/lmbench_all lat_pagefault -P 1 /var/tmp/XXX -/bin/lmbench_all lat_mmap -P 1 512k /var/tmp/XXX -/bin/lmbench_all lat_fs /var/tmp -/bin/lmbench_all bw_pipe -P 1 -/bin/lmbench_all bw_file_rd -P 1 512k io_only /var/tmp/XXX -/bin/lmbench_all bw_file_rd -P 1 512k open2close /var/tmp/XXX -/bin/lmbench_all bw_mmap_rd -P 1 512k mmap_only /var/tmp/XXX -/bin/lmbench_all bw_mmap_rd -P 1 512k open2close /var/tmp/XXX -/bin/lmbench_all lat_ctx -P 1 -s 32 2 4 8 16 24 32 64 96 diff --git a/scripts/linux/baremetal-test-allow.txt.lua b/scripts/linux/baremetal-test-allow.txt.lua deleted file mode 100644 index 20eadd8e..00000000 --- a/scripts/linux/baremetal-test-allow.txt.lua +++ /dev/null @@ -1,9 +0,0 @@ -/bin/lua /bin/date.lua -/bin/lua /bin/file_io.lua -/bin/lua /bin/max_min.lua -/bin/lua /bin/random.lua -/bin/lua /bin/remove.lua -/bin/lua /bin/round_num.lua -/bin/lua /bin/sin30.lua -/bin/lua /bin/sort.lua -/bin/lua /bin/strings.lua diff --git a/scripts/linux/baremetal-test-allow.txt.oscomp b/scripts/linux/baremetal-test-allow.txt.oscomp deleted file mode 100644 index 36a925e5..00000000 --- a/scripts/linux/baremetal-test-allow.txt.oscomp +++ /dev/null @@ -1,33 +0,0 @@ -/bin/brk -/bin/chdir -/bin/clone -/bin/close -/bin/dup -/bin/dup2 -/bin/execve -/bin/exit -/bin/fork -/bin/fstat -/bin/getcwd -/bin/getdents -/bin/getpid -/bin/getppid -/bin/gettimeofday -/bin/mkdir_ -/bin/mmap -/bin/mount -/bin/munmap -/bin/open -/bin/openat -/bin/pipe -/bin/read -/bin/sleep -/bin/test_echo -/bin/times -/bin/umount -/bin/uname -/bin/unlink -/bin/wait -/bin/waitpid -/bin/write -/bin/yield diff --git a/scripts/linux/baremetal-test-fail-rv64.txt b/scripts/linux/baremetal-test-fail-rv64.txt deleted file mode 100644 index a0015d07..00000000 --- a/scripts/linux/baremetal-test-fail-rv64.txt +++ /dev/null @@ -1,71 +0,0 @@ -/libc-test/functional/pthread_cond.exe? -/libc-test/functional/pthread_robust.exe? -/libc-test/functional/vfork-static.exe? -/libc-test/regression/pthread_cancel-sem_wait.exe? -/libc-test/regression/execle-env-static.exe? -/libc-test/regression/pthread-robust-detach-static.exe? -/libc-test/functional/strptime.exe? -/libc-test/functional/pthread_cancel-points-static.exe? -/libc-test/regression/execle-env.exe? -/libc-test/functional/popen-static.exe? -/libc-test/regression/malloc-brk-fail-static.exe? -/libc-test/regression/pthread_atfork-errno-clobber-static.exe? -/libc-test/functional/sem_open-static.exe? -/libc-test/functional/tls_init.exe? -/libc-test/functional/vfork.exe? -/libc-test/regression/setenv-oom-static.exe? -/libc-test/functional/strtod_long.exe? -/libc-test/functional/pthread_cancel-points.exe? -/libc-test/regression/setenv-oom.exe? -/libc-test/functional/pthread_mutex.exe? -/oscomp/clone? -/libc-test/functional/spawn-static.exe? -/libc-test/regression/malloc-brk-fail.exe? -/libc-test/regression/sem_close-unmap.exe? -/libc-test/functional/fcntl-static.exe? -/libc-test/regression/malloc-oom-static.exe? -/bin/busybox?dmesg -/libc-test/functional/ipc_sem-static.exe? -/libc-test/functional/popen.exe? -/libc-test/regression/sem_close-unmap-static.exe? -/libc-test/functional/pthread_cond-static.exe? -/libc-test/regression/pthread-robust-detach.exe? -/libc-test/regression/tls_get_new-dtv.exe? -/libc-test/regression/malloc-oom.exe? -/libc-test/functional/ipc_msg.exe? -/libc-test/math/fmod.exe? -/libc-test/functional/strtod_long-static.exe? -/libc-test/functional/strptime-static.exe? -/libc-test/functional/ipc_msg-static.exe? -/libc-test/regression/statvfs-static.exe? -/libc-test/functional/tls_init_dlopen.exe? -/libc-test/regression/pthread_cancel-sem_wait-static.exe? -/libc-test/regression/statvfs.exe? -/libc-test/functional/pthread_robust-static.exe? -/libc-test/functional/tls_align_dlopen.exe? -/libc-test/functional/sem_open.exe? -/libc-test/regression/pthread_create-oom-static.exe? -/libc-test/regression/pthread_create-oom.exe? -/libc-test/functional/pthread_mutex-static.exe? -/libc-test/functional/spawn.exe? -/libc-test/functional/fcntl.exe? -/libc-test/functional/tls_init-static.exe? -/oscomp/waitpid? -/oscomp/wait? -/oscomp/fork? -/oscomp/exit? -/libc-test/common/runtest.exe? -/libc-test/functional/tls_local_exec.exe? -/libc-test/functional/sem_init-static.exe? -/libc-test/functional/sem_init.exe? -/libc-test/functional/tls_local_exec-static.exe? -/libc-test/functional/pthread_tsd.exe? -/libc-test/functional/pthread_tsd-static.exe? -/libc-test/regression/pthread_cond-smasher-static.exe? -/libc-test/regression/pthread_rwlock-ebusy-static.exe? -/libc-test/regression/pthread_once-deadlock.exe? -/libc-test/regression/pthread_exit-cancel-static.exe? -/libc-test/regression/pthread_once-deadlock-static.exe? -/libc-test/regression/pthread_exit-cancel.exe? -/libc-test/regression/pthread_rwlock-ebusy.exe? -/libc-test/regression/pthread_atfork-errno-clobber.exe?' diff --git a/scripts/linux/baremetal-test-fail.txt b/scripts/linux/baremetal-test-fail.txt deleted file mode 100644 index 8cd3b486..00000000 --- a/scripts/linux/baremetal-test-fail.txt +++ /dev/null @@ -1,57 +0,0 @@ -/libc-test/src/regression/getpwnam_r-errno-static.exe -/libc-test/src/functional/ipc_msg-static.exe -/libc-test/src/functional/ipc_sem-static.exe -/libc-test/src/regression/daemon-failure-static.exe -/libc-test/src/regression/malloc-oom-static.exe -/libc-test/src/regression/statvfs.exe -/libc-test/src/regression/pthread-robust-detach.exe -/libc-test/src/functional/pthread_cancel-points.exe -/libc-test/src/regression/daemon-failure.exe -/libc-test/src/functional/spawn.exe -/libc-test/src/regression/fflush-exit-static.exe -/libc-test/src/functional/ipc_msg.exe -/libc-test/src/functional/tls_init_dlopen.exe -/libc-test/src/regression/pthread_create-oom-static.exe -/libc-test/src/regression/getpwnam_r-crash.exe -/libc-test/src/functional/ipc_shm-static.exe -/libc-test/src/regression/getpwnam_r-crash-static.exe -/libc-test/src/regression/pthread_rwlock-ebusy-static.exe -/libc-test/src/regression/malloc-brk-fail.exe -/libc-test/src/functional/vfork-static.exe -/libc-test/src/functional/pthread_cancel-points-static.exe -/libc-test/src/functional/ipc_sem.exe -/libc-test/src/functional/tls_align_dlopen.exe -/libc-test/src/functional/fcntl-static.exe -/libc-test/src/regression/pthread_create-oom.exe -/libc-test/src/regression/getpwnam_r-errno.exe -/libc-test/src/regression/fflush-exit.exe -/libc-test/src/regression/pthread_exit-dtor-static.exe -/libc-test/src/regression/setenv-oom-static.exe -/libc-test/src/functional/strptime-static.exe -/libc-test/src/functional/popen-static.exe -/libc-test/src/regression/pthread_exit-dtor.exe -/libc-test/src/functional/vfork.exe -/libc-test/src/regression/sem_close-unmap.exe -/libc-test/src/functional/ipc_shm.exe -/libc-test/src/regression/pthread-robust-detach-static.exe -/libc-test/src/functional/sem_open-static.exe -/libc-test/src/regression/malloc-brk-fail-static.exe -/libc-test/src/functional/sem_open.exe -/libc-test/src/functional/strptime.exe -/libc-test/src/functional/spawn-static.exe -/libc-test/src/regression/pthread_atfork-errno-clobber.exe -/libc-test/src/functional/fcntl.exe -/libc-test/src/functional/pthread_robust.exe -/libc-test/src/regression/setenv-oom.exe -/libc-test/src/functional/pthread_robust-static.exe -/libc-test/src/regression/malloc-oom.exe -/libc-test/src/functional/strtod_long.exe -/libc-test/src/regression/pthread_atfork-errno-clobber-static.exe -/libc-test/src/functional/strtod_long-static.exe -/libc-test/src/functional/popen.exe -/libc-test/src/regression/statvfs-static.exe -/libc-test/src/regression/sem_close-unmap-static.exe -/libc-test/src/regression/execle-env-static.exe -/libc-test/src/regression/execle-env.exe -/libc-test/src/functional/pthread_tsd-static.exe -/libc-test/src/functional/tls_init-static.exe diff --git a/scripts/linux/baremetal-test-ones-rv64.txt b/scripts/linux/baremetal-test-ones-rv64.txt deleted file mode 100644 index 3356902a..00000000 --- a/scripts/linux/baremetal-test-ones-rv64.txt +++ /dev/null @@ -1 +0,0 @@ -/libc-test/functional/argv-static.exe? \ No newline at end of file diff --git a/scripts/linux/baremetal-test-ones.txt b/scripts/linux/baremetal-test-ones.txt deleted file mode 100644 index bedf9f4a..00000000 --- a/scripts/linux/baremetal-test-ones.txt +++ /dev/null @@ -1,2 +0,0 @@ -/libc-test/src/functional/argv-static.exe -/libc-test/src/functional/argv.exe diff --git a/scripts/linux/libos-test-allow-failed.txt b/scripts/linux/libos-test-allow-failed.txt deleted file mode 100644 index ab764485..00000000 --- a/scripts/linux/libos-test-allow-failed.txt +++ /dev/null @@ -1,40 +0,0 @@ -/libc-test/src/common/runtest.exe -/libc-test/src/functional/fcntl.exe -/libc-test/src/functional/ipc_msg.exe -/libc-test/src/functional/ipc_sem.exe -/libc-test/src/functional/ipc_shm.exe -/libc-test/src/functional/popen.exe -/libc-test/src/functional/pthread_cancel-points.exe -/libc-test/src/functional/pthread_cond.exe -/libc-test/src/functional/pthread_robust.exe -/libc-test/src/functional/sem_open.exe -/libc-test/src/functional/socket.exe -/libc-test/src/functional/spawn.exe -/libc-test/src/functional/strptime.exe -/libc-test/src/functional/strtod_long.exe -/libc-test/src/functional/tls_align.exe -/libc-test/src/functional/tls_align_dlopen.exe -/libc-test/src/functional/tls_init_dlopen.exe -/libc-test/src/functional/utime.exe -/libc-test/src/functional/vfork.exe -/libc-test/src/math/fmal.exe -/libc-test/src/math/powf.exe -/libc-test/src/regression/daemon-failure.exe -/libc-test/src/regression/execle-env.exe -/libc-test/src/regression/fflush-exit.exe -/libc-test/src/regression/getpwnam_r-crash.exe -/libc-test/src/regression/getpwnam_r-errno.exe -/libc-test/src/regression/pthread-robust-detach.exe -/libc-test/src/regression/pthread_atfork-errno-clobber.exe -/libc-test/src/regression/pthread_exit-dtor.exe -/libc-test/src/regression/sem_close-unmap.exe -/libc-test/src/regression/sigreturn.exe -/libc-test/src/regression/statvfs.exe -/libc-test/src/functional/pthread_cancel.exe -/libc-test/src/functional/pthread_mutex.exe -/libc-test/src/functional/pthread_mutex_pi.exe -/libc-test/src/regression/pthread_cond-smasher.exe -/libc-test/src/regression/pthread_cond_wait-cancel_ignored.exe -/libc-test/src/regression/pthread_condattr_setclock.exe -/libc-test/src/regression/pthread_once-deadlock.exe -/libc-test/src/regression/raise-race.exe diff --git a/scripts/requirements.txt b/scripts/requirements.txt deleted file mode 100644 index 516bbf2f..00000000 --- a/scripts/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pexpect -termcolor diff --git a/scripts/unix-core-testone.py b/scripts/unix-core-testone.py deleted file mode 100644 index 2f22d8f7..00000000 --- a/scripts/unix-core-testone.py +++ /dev/null @@ -1,22 +0,0 @@ -import pexpect -import sys -import re -import argparse - -TIMEOUT = 300 -ZBI_PATH = '../prebuilt/zircon/x64/core-tests.zbi' -CMDLINE_BASE = 'LOG=warn:userboot=test/core-standalone-test:userboot.shutdown:core-tests=' - -parser = argparse.ArgumentParser() -parser.add_argument('testcase', nargs=1) -args = parser.parse_args() - -child = pexpect.spawn("cargo run -p zcore --release --features 'zircon libos' -- '%s' '%s'" % - (ZBI_PATH, CMDLINE_BASE+args.testcase[0]), - timeout=TIMEOUT, encoding='utf-8') - -child.logfile = sys.stdout - -index = child.expect(['finished!', 'panicked', pexpect.EOF, pexpect.TIMEOUT]) -result = ['FINISHED', 'PANICKED', 'EOF', 'TIMEOUT'][index] -print(result) diff --git a/scripts/unix-core-tests.py b/scripts/unix-core-tests.py deleted file mode 100644 index 25d792f5..00000000 --- a/scripts/unix-core-tests.py +++ /dev/null @@ -1,85 +0,0 @@ -import pexpect -import sys -import re -import os -import subprocess - -TIMEOUT = 300 -BASE = 'zircon/' -OUTPUT_FILE = BASE + 'test-output-libos.txt' -RESULT_FILE = BASE + 'test-result-libos.txt' -CHECK_FILE = BASE + 'test-check-passed.txt' -TEST_CASE_ALL = BASE + 'testcases-all.txt' -TEST_CASE_EXCEPTION = BASE + 'testcases-failed-libos.txt' -ZBI_PATH = '../prebuilt/zircon/x64/core-tests.zbi' -CMDLINE_BASE = 'LOG=warn:userboot=test/core-standalone-test:userboot.shutdown:core-tests=' - -class Tee: - def __init__(self, name, mode): - self.file = open(name, mode) - self.stdout = sys.stdout - sys.stdout = self - - def __del__(self): - sys.stdout = self.stdout - self.file.close() - - def write(self, data): - self.file.write(data) - self.stdout.write(data) - - def flush(self): - self.file.flush() - -if os.path.exists(OUTPUT_FILE): os.remove(OUTPUT_FILE) -if os.path.exists(RESULT_FILE): os.remove(RESULT_FILE) - -with open(TEST_CASE_ALL, "r") as tcf: - all_case = set([case.strip() for case in tcf.readlines()]) -with open(TEST_CASE_EXCEPTION, "r") as tcf: - exception_case = set([case.strip() for case in tcf.readlines()]) -check_case = all_case - exception_case - -subprocess.run("cargo build -p zcore --release --features 'zircon libos'", - shell=True, check=True) - -for line in check_case: - child = pexpect.spawn("../target/release/zcore", [ZBI_PATH, CMDLINE_BASE+line], - timeout=TIMEOUT, encoding='utf-8') - - child.logfile = Tee(OUTPUT_FILE, 'a') - - index = child.expect(['finished!', 'panicked', pexpect.EOF, pexpect.TIMEOUT]) - result = ['FINISHED', 'PANICKED', 'EOF', 'TIMEOUT'][index] - # print(result) - -passed = [] -failed = [] -passed_case = set() - -# see https://stackoverflow.com/questions/59379174/ignore-ansi-colors-in-pexpect-response -ansi_escape = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]") - - -with open(OUTPUT_FILE, "r") as opf: - for line in opf.readlines(): - line=ansi_escape.sub('',line) - if line.startswith('[ OK ]'): - passed += line - passed_case.add(line[13:].split(' ')[0]) - elif line.startswith('[ FAILED ]') and line.endswith(')\n'): - failed += line - -with open(RESULT_FILE, "a") as rstf: - rstf.writelines(passed) - rstf.writelines(failed) - - -not_passed = check_case - passed_case -if failed: - print('=== Failed cases ===') - for case in failed: - print(case) - exit(1) -else: - print('All checked case passed!') diff --git a/scripts/zircon/test-check-passed.txt b/scripts/zircon/test-check-passed.txt deleted file mode 100644 index 5f18a5b5..00000000 --- a/scripts/zircon/test-check-passed.txt +++ /dev/null @@ -1,511 +0,0 @@ -Bti.Clone -Bti.Create -Bti.GetInfoTest -Bti.Pin -Bti.PinContigFlag -Bti.PinContiguous -Bti.Resize -C11MutexTest.InitalizeLocalMutex -C11MutexTest.MultiThreadedContention -C11MutexTest.StaticInitalizerSameBytesAsAuto -C11MutexTest.TimeoutElapsed -C11MutexTest.TryMutexMultiThreadedContention -C11ThreadTest.CreateAndVerifyThreadHandle -C11ThreadTest.DetachedThreadKeepsRunning -C11ThreadTest.LongNameSucceeds -C11ThreadTest.NullNameThreadShouldSucceed -C11ThreadTest.SelfDetachAndFree -C11ThreadTest.ThreadLocalErrno -ChannelInternalTest.CallFinishWithoutPreviouslyCallingCallReturnsBadState -ChannelInternalTest.TransferChannelWithPendingCallInSourceProcess -ChannelTest.CallBytesFitIsOk -ChannelTest.CallConsumesHandlesOnError -ChannelTest.CallConsumesHandlesOnSuccess -ChannelTest.CallDeadlineExceededReturnsTimedOut -ChannelTest.CallHandleAndBytesFitsIsOk -ChannelTest.CallHandlesFitIsOk -ChannelTest.CallNotifiedOnPeerClosed -ChannelTest.CallNullptrNumBytesIsInvalidArgs -ChannelTest.CallNullptrNumHandlesInvalidArgs -ChannelTest.CallPendingTransactionsUseDifferentIds -ChannelTest.CallResponseBiggerThanRdNumBytesReturnsBufferTooSmall -ChannelTest.CallResponseBiggerThanRdNumHandlesReturnsBufferTooSmall -ChannelTest.CallWrittenBytesSmallerThanZxTxIdReturnsInvalidArgs -ChannelTest.CloseClearsSignalsWriteable -ChannelTest.CloseSignalsPeerClosed -ChannelTest.CloseSignalsPeerReturnsPeerClosed -ChannelTest.ConcurrentReadsConsumeUniqueElements -ChannelTest.CreateIsOkAndEndpointsAreRelated -ChannelTest.IsWriteableByDefault -ChannelTest.NestingIsOk -ChannelTest.OnFlightHandlesSignalledWhenPeerIsClosed -ChannelTest.ReadAndWriteWithMultipleSizes -ChannelTest.ReadEtcHandleInfoValidation -ChannelTest.ReadMayDiscardWithNullBufferDiscardHandlesReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithNullBufferDiscardsDataReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithNullBuffersReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithSmallerBufferDiscardHandlesAndDateReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithZeroSizeBuffersDiscardHandlesAndDataReturnsBufferTooSmall -ChannelTest.ReadRemainingMessagesWhenPeerIsClosed -ChannelTest.ReadWhenEmptyAndClosedReturnsPeerClosed -ChannelTest.ReadWhenEmptyReturnsShouldWait -ChannelTest.WaitManyIsSignaledForBothWrites -ChannelTest.WaitManyIsSignaledOnAnyElementWrite -ChannelTest.WriteConsumesAllHandles -ChannelTest.WriteNonTransferableHandleReturnsAccessDeniedAndClosesHandle -ChannelTest.WriteRepeatedHandlesReturnsBadHandlesAndClosesHandle -ChannelTest.WriteSelfHandleReturnsNotSupported -ChannelTest.WriteToEndpointCausesOtherToBecomeReadable -ChannelWriteEtcTest.ByteCountIsMaxPlusOneShouldFail -ChannelWriteEtcTest.ByteCountIsMaxShouldSucceed -ChannelWriteEtcTest.ChannelHandleInTransferredHandlesShouldFail -ChannelWriteEtcTest.ChannelHandleNotValidShouldFail -ChannelWriteEtcTest.ChannelHandleWithoutWriteRightShouldFail -ChannelWriteEtcTest.DuplicateHandlesInTransferredHandlesShouldSucceed -ChannelWriteEtcTest.FailureDoesNotResultInReceivedPacket -ChannelWriteEtcTest.HandleArgNotAChannelHandleShouldFail -ChannelWriteEtcTest.HandleCountAndDataCountBothZeroShouldSucceed -ChannelWriteEtcTest.HandleCountBoundaryChecks -ChannelWriteEtcTest.HandleDoesNotMatchTypeShouldFail -ChannelWriteEtcTest.HandleWithoutDuplicateRightsMoveOpSucceedsDuplicateOpFails -ChannelWriteEtcTest.HandleWithoutTransferRightShouldFail -ChannelWriteEtcTest.ImproperlyInitalizedResultsArgReportedBackAsOriginallyInitalized -ChannelWriteEtcTest.InvalidHandleInTransferredHandlesShouldFail -ChannelWriteEtcTest.InvalidOpArgShouldFail -ChannelWriteEtcTest.MaximumNumberHandlesWithZeroCountArrayArgShouldSucceed -ChannelWriteEtcTest.MultipleHandlesSomeInvalidResultsReportedCorrectly -ChannelWriteEtcTest.NullptrArgWhenSizeNonZeroShouldFail -ChannelWriteEtcTest.OppositeChannelEndClosedShouldFail -ChannelWriteEtcTest.OptionsArgNonZeroShouldFail -ChannelWriteEtcTest.RemoveAllHandleRightsShouldSucceed -ChannelWriteEtcTest.RemovingSomeHandleRightsShouldSucceed -ChannelWriteEtcTest.RepeatedHandlesWithOpMoveHandlesShouldFail -ChannelWriteEtcTest.SameHandleRightsBitsShouldSucceed -ChannelWriteEtcTest.SameHandleRightsFlagShouldSucceed -ChannelWriteEtcTest.SentHandleReferrsToSameObject -ClockTest.ClockMonotonic -ClockTest.DeadlineAfter -ConditionalVariableTest.BroadcastSignalThreadWait -ConditionalVariableTest.ConditionalVariablesTimeout -ConditionalVariableTest.SignalThreadWait -CppThreadTest.CreateAndVerifyThreadHandle -DebugLogTest.WriteRead -DefaultExceptionHandlerTest.UnhandledHardwareException -EventPairTest.CheckNoFlagsSupported -EventPairTest.HandleRightsAreCorrect -EventPairTest.HandlesNotInvalid -EventPairTest.KoidsAreCorrect -EventPairTest.SignalEventPairAndClearVerifySignals -EventPairTest.SignalingClosedPeerReturnsPeerClosed -EventPairTest.SignalPeerAndVerifyRecived -EventPairTest.SignalPeerThenCloseAndVerifySignalReceived -ExecutableTlsTest.AlignmentInitializerInThread -ExecutableTlsTest.AlignmentInitializierInMain -ExecutableTlsTest.ArrayInitializerInMain -ExecutableTlsTest.ArrayInitializerInThread -ExecutableTlsTest.ArrayInitializerSpamThread -ExecutableTlsTest.ArrayInitializierSpamMain -ExecutableTlsTest.BasicInitalizersInMain -ExecutableTlsTest.BasicInitalizersInThread -ExecutableTlsTest.BigArrayInitializerInMain -ExecutableTlsTest.BigArrayInitializerInThread -ExecutableTlsTest.StructureInitalizierInMain -ExecutableTlsTest.StructureInitializerInThread -FifoTest.DequeueSignalsWriteable -FifoTest.EmptyQueueReturnsErrShouldWait -FifoTest.EndpointCloseSignalsPeerClosed -FifoTest.EndpointsAreRelated -FifoTest.FifoOrderIsPreserved -FifoTest.IndividualReadsPreserveOrder -FifoTest.InvalidParametersReturnOutOfRange -FifoTest.PartialWriteQueuesElementsThatFit -FifoTest.ReadAndWriteValidatesSizeAndElementCount -FPUTest.LongComputeLoop -FutexTest.EventSignaling -FutexTest.MisalignedFutextAddr -FutexTest.Requeue -FutexTest.RequeueSameAddr -FutexTest.RequeueUnqueuedOnTimeout -FutexTest.RequeueValueMismatch -FutexTest.ThreadSuspended -FutexTest.WaitBadAddress -FutexTest.WaitTimeout -FutexTest.WaitTimeoutElapsed -FutexTest.WaitValueMismatch -FutexTest.Wakeup -FutexTest.WakeupAddress -FutexTest.WakeupLimit -HandleCloseTest.Many -HandleCloseTest.ManyInvalidHandlesShouldNotFail -HandleDup.Duplicate -HandleDup.Replace -HandleDup.ReplaceFailureBothInvalid -HandleDup.ReplaceSuccessOrigInvalid -HandleInfoTest.DupAndInfoRights -HandleInfoTest.DuplicateRights -HandleInfoTest.RelatedKoid -HandleInfoTest.ReplaceRights -HandleTransferTest.CancelsWait -HandleTransferTest.OverChannelThenRead -HandleWaitTest.HandleWaitMultipleThreads -HandleWaitTest.HandleWaitTest -InterruptTest.BindPort -InterruptTest.NonBindablePort -InterruptTest.NullOutputTimestamp -InterruptTest.UnableToBindVirtualInterruptToVcpu -InterruptTest.UnBindPort -InterruptTest.VirtualInterrupts -JobGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -JobGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -JobGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -JobGetInfoTest.InfoHandleBasicInvalidHandleFails -JobGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -JobGetInfoTest.InfoHandleBasicNullActualSucceeds -JobGetInfoTest.InfoHandleBasicNullAvailSucceeds -JobGetInfoTest.InfoHandleBasicOnSelfSuceeds -JobGetInfoTest.InfoJobChildJobsGetChild -JobGetInfoTest.InfoJobChildrenInvalidHandleFails -JobGetInfoTest.InfoJobChildrenJobHandleIsBadHandle -JobGetInfoTest.InfoJobChildrenOnSelfSuceeds -JobGetInfoTest.InfoJobChildrenRequiresEnumerateRights -JobGetInfoTest.InfoJobChildrenSmallBufferIsOk -JobGetInfoTest.InfoJobChildrenThreadHandleIsBadHandle -JobGetInfoTest.InfoJobChildrenZeroSizedBufferIsOk -JobGetInfoTest.InfoJobProcessesGetChild -JobGetInfoTest.InfoJobProcessesInvalidHandleFails -JobGetInfoTest.InfoJobProcessesOnSelfSuceeds -JobGetInfoTest.InfoJobProcessesProcessbHandleIsBadHandle -JobGetInfoTest.InfoJobProcessesRequiresEnumerateRights -JobGetInfoTest.InfoJobProcessesSmallBufferIsOk -JobGetInfoTest.InfoJobProcessesThreadHandleIsBadHandle -JobGetInfoTest.InfoJobProcessesZeroSizedBufferIsOk -MemoryMappingTest.MmapFlagsTest -MemoryMappingTest.MmapLenTest -MemoryMappingTest.MmapOffsetTest -MemoryMappingTest.MmapZerofilledTest -MsiTest.AllocateSyscall -MsiTest.CreateSyscallArgs -MsiTest.Msi -ObjectChildTest.InvalidHandleReturnsBadHandle -ObjectGetInfoTest.ClosedValidHandleFails -ObjectGetInfoTest.HandleCountCorrectness -ObjectGetInfoTest.InvalidHandleFails -ObjectGetInfoTest.OpenValidHandleSuceeds -ObjectWaitManyTest.InvalidHandle -ObjectWaitManyTest.TooManyObjects -ObjectWaitManyTest.TransientSignalsNotReturned -ObjectWaitManyTest.WaitForEventsSignaled -ObjectWaitManyTest.WaitForEventsThenSignal -ObjectWaitOneTest.EmptySignalSet -ObjectWaitOneTest.TransientSignalsNotReturned -ObjectWaitOneTest.WaitForEventSignaled -ObjectWaitOneTest.WaitForEventThenSignal -ObjectWaitOneTest.WaitForEventTimeout -ObjectWaitOneTest.WaitForEventTimeoutPreSignalClear -PortStressTest.CloseWaitRace -PortTest.AsyncWaitChannel -PortTest.AsyncWaitChannelTimedOut -PortTest.AsyncWaitCloseOrder -PortTest.AsyncWaitEventManyAllProcessed -PortTest.AsyncWaitEventRepeat -PortTest.ChannelAsyncWaitOnExistingStateIsNotified -PortTest.CloseQueueRace -PortTest.PortTimeout -PortTest.QueueAndClose -PortTest.QueueNullPtrReturnsInvalidArgs -PortTest.QueueTooMany -PortTest.QueueWaitVerifyUserPacket -PortTest.ThreadEvents -ProcessDebugTest.ReadMemoryAtOffsetIsOk -ProcessDebugTest.WriteMemoryAtOffsetIsOk -ProcessDebugUtilsTest.XorShiftIsOk -ProcessGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -ProcessGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -ProcessGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -ProcessGetInfoTest.InfoHandleBasicInvalidHandleFails -ProcessGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoHandleBasicNullActualSucceeds -ProcessGetInfoTest.InfoHandleBasicNullAvailSucceeds -ProcessGetInfoTest.InfoHandleBasicOnSelfSuceeds -ProcessGetInfoTest.InfoProcessBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessInvalidHandleFails -ProcessGetInfoTest.InfoProcessJobHandleIsBadHandle -ProcessGetInfoTest.InfoProcessMapsJobHandleIsBadHandle -ProcessGetInfoTest.InfoProcessMapsThreadHandleIsBadHandle -ProcessGetInfoTest.InfoProcessNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessNullActualSucceeds -ProcessGetInfoTest.InfoProcessNullAvailSucceeds -ProcessGetInfoTest.InfoProcessOnSelfSuceeds -ProcessGetInfoTest.InfoProcessThreadHandleIsBadHandle -ProcessGetInfoTest.InfoProcessThreadsInvalidHandleFails -ProcessGetInfoTest.InfoProcessThreadsSelfSuceeds -ProcessGetInfoTest.InfoProcessThreadsZeroSizedBufferSucceeds -ProcessGetInfoTest.InfoProcessVmosOnSelfFails -ProcessTest.CreateAndKillJobRaceStress -ProcessTest.EmptyNameSucceeds -ProcessTest.KillChannelHandleCycle -ProcessTest.KillProcessViaThreadKill -ProcessTest.LongNameSucceeds -ProcessTest.MiniProcessSanity -ProcessTest.ProcessNotKilledViaProcessClose -ProcessTest.ProcessNotKilledViaThreadClose -ProcessTest.ProcessStartFail -ProcessTest.ProcessStartNoHandle -ProcessTest.ProcessStartWriteThreadState -ProcessTest.SuspendSelf -ProgressiveCloneDiscardTests.ProgressiveCloneClose -ProgressiveCloneDiscardTests.ProgressiveCloneTruncate -PThreadBarrierTest.InitWithNoThreadsReturnsInval -PThreadBarrierTest.SingleThreadWinsBarrierObject -PthreadTls.PthreadTls -SocketTest.BytesOutstanding -SocketTest.Datagram -SocketTest.DatagramNoShortWrite -SocketTest.DatagramPeek -SocketTest.DatagramPeekEmpty -SocketTest.EmptySocketShouldWait -SocketTest.EndpointsAreRelated -SocketTest.PeekingIntoEmpty -SocketTest.PeekingLeavesData -SocketTest.PeerClosedError -SocketTest.PeerClosedSetProperty -SocketTest.ReadIntoNullBuffer -SocketTest.SetThreshholdsAndCheckSignals -SocketTest.SetThreshholdsProp -SocketTest.ShortWrite -SocketTest.ShutdownRead -SocketTest.ShutdownReadBytesOutstanding -SocketTest.ShutdownWrite -SocketTest.ShutdownWriteBytesOutstanding -SocketTest.SignalClosedPeer -SocketTest.Signals -SocketTest.WriteFromNullBuffer -SocketTest.WriteReadDataVerify -SocketTest.ZeroSize -StackTest.MainThreadStack -StackTest.ThreadStack -StreamTestCase.Append -StreamTestCase.Create -StreamTestCase.ExtendFillsWithZeros -StreamTestCase.ReadV -StreamTestCase.ReadVAt -StreamTestCase.ReadVectorAlias -StreamTestCase.Seek -StreamTestCase.WriteExtendsContentSize -StreamTestCase.WriteExtendsVMOSize -StreamTestCase.WriteV -StreamTestCase.WriteVAt -SyncCompletionTest.Initializer -SyncCompletionTest.MultiWait -SyncCompletionTest.PresignalMultiWait -SyncCompletionTest.PresignalSingleWait -SyncCompletionTest.ResetCycleMultiWait -SyncCompletionTest.ResetCycleSingleWait -SyncCompletionTest.SignalRequeue -SyncCompletionTest.SingleWait -SyncCompletionTest.SpuriousWakeupHandled -SyncCompletionTest.TimeoutMultiWait -SyncCompletionTest.TimeoutSingleWait -SyncCondition.ConditionTest -SyncCondition.TimeoutTest -SyncMutex.Mutexes -SyncMutex.TimeoutElapsed -SyncMutex.TryMutexes -TaskGetInfoTest.InfoStatsSmokeTest -TaskGetInfoTest.InfoStatsUnstartedSuceeds -TaskGetInfoTest.InfoTaskRuntimeWrongType -TaskGetInfoTest.InfoTaskStatsBadActualgIsInvalidArg -TaskGetInfoTest.InfoTaskStatsBadAvailIsInvalidArg -TaskGetInfoTest.InfoTaskStatsInvalidBufferPointerFails -TaskGetInfoTest.InfoTaskStatsInvalidHandleFails -TaskGetInfoTest.InfoTaskStatsJobHandleIsBadHandle -TaskGetInfoTest.InfoTaskStatsNullActualAndAvailSucceeds -TaskGetInfoTest.InfoTaskStatsNullActualSucceeds -TaskGetInfoTest.InfoTaskStatsNullAvailSucceeds -TaskGetInfoTest.InfoTaskStatsThreadHandleIsBadHandle -Thread.SuspendAfterDeath -ThreadGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -ThreadGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -ThreadGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -ThreadGetInfoTest.InfoHandleBasicInvalidHandleFails -ThreadGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoHandleBasicNullActualSucceeds -ThreadGetInfoTest.InfoHandleBasicNullAvailSucceeds -ThreadGetInfoTest.InfoHandleBasicOnSelfSuceeds -ThreadGetInfoTest.InfoHandleCountBadActualgIsInvalidArg -ThreadGetInfoTest.InfoHandleCountBadAvailIsInvalidArg -ThreadGetInfoTest.InfoHandleCountInvalidBufferPointerFails -ThreadGetInfoTest.InfoHandleCountInvalidHandleFails -ThreadGetInfoTest.InfoHandleCountNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoHandleCountNullActualSucceeds -ThreadGetInfoTest.InfoHandleCountNullAvailSucceeds -ThreadGetInfoTest.InfoHandleCountOnSelfSuceeds -ThreadGetInfoTest.InfoThreadBadActualgIsInvalidArg -ThreadGetInfoTest.InfoThreadBadAvailIsInvalidArg -ThreadGetInfoTest.InfoThreadExceptionReportInvalidHandleFails -ThreadGetInfoTest.InfoThreadInvalidBufferPointerFails -ThreadGetInfoTest.InfoThreadInvalidHandleFails -ThreadGetInfoTest.InfoThreadJobHandleIsBadHandle -ThreadGetInfoTest.InfoThreadNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoThreadNullActualSucceeds -ThreadGetInfoTest.InfoThreadNullAvailSucceeds -ThreadGetInfoTest.InfoThreadOnSelfSuceeds -ThreadGetInfoTest.InfoThreadProcessHandleIsBadHandle -ThreadGetInfoTest.InfoThreadStatsJobHandleIsBadHandle -ThreadGetInfoTest.InfoThreadStatsProcessHandleIsBadHandle -Threads.Basics -Threads.Detach -Threads.EmptyNameSucceeds -Threads.InfoTaskStatsFails -Threads.InvalidRights -Threads.KillSuspendedThread -Threads.LongNameSucceeds -Threads.NonstartedThread -Threads.ResumeSuspended -Threads.StartSuspendedAndResumedThread -Threads.SuspendChannelCall -Threads.SuspendMultiple -Threads.SuspendPortCall -Threads.SuspendSelf -Threads.SuspendSleeping -Threads.SuspendStopsThread -Threads.ThreadLocalRegisterState -Threads.ThreadStartOnInitialThread -Threads.ThreadStartWithZeroInstructionPointer -Threads.WritingArmFlagsRegister -Threads.WritingGeneralRegisterState -TicksTest.ElapsedTimeUsingTicks -Vmar.AllocateOobTest -Vmar.AllocateUnsatisfiableTest -Vmar.AllowFaultsTest -Vmar.BasicAllocateTest -Vmar.ConcurrentUnmapReadMemory -Vmar.DestroyedVmarTest -Vmar.DestroyTest -Vmar.MapInCompactTest -Vmar.ObjectInfoTest -Vmar.PartialUnmapAndRead -Vmar.PartialUnmapAndWrite -Vmar.PartialUnmapWithVmarOffset -Vmar.ProtectMultipleTest -Vmar.ProtectSplitTest -Vmar.ProtectTest -Vmar.RightsDropTest -Vmar.UnalignedLenMapTest -Vmar.UnalignedLenTest -Vmar.UnmapBaseNotMappedTest -Vmar.UnmapMultipleTest -Vmar.UnmapSplitTest -Vmar.VmarMapRangeOffsetTest -Vmar.VmarMapRangeOffsetTest -VmarGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -VmarGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -VmarGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -VmarGetInfoTest.InfoHandleBasicInvalidHandleFails -VmarGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -VmarGetInfoTest.InfoHandleBasicNullActualSucceeds -VmarGetInfoTest.InfoHandleBasicNullAvailSucceeds -VmarGetInfoTest.InfoHandleBasicOnSelfSuceeds -VmarGetInfoTest.InfoVmarBadActualgIsInvalidArg -VmarGetInfoTest.InfoVmarBadAvailIsInvalidArg -VmarGetInfoTest.InfoVmarInvalidBufferPointerFails -VmarGetInfoTest.InfoVmarInvalidHandleFails -VmarGetInfoTest.InfoVmarJobHandleIsBadHandle -VmarGetInfoTest.InfoVmarNullActualAndAvailSucceeds -VmarGetInfoTest.InfoVmarNullActualSucceeds -VmarGetInfoTest.InfoVmarNullAvailSucceeds -VmarGetInfoTest.InfoVmarOnSelfFails -VmarGetInfoTest.InfoVmarProcessHandleIsBadHandle -VmarGetInfoTest.InfoVmarThreadHandleIsBadHandle -VmoClone2TestCase.Children -VmoClone2TestCase.CloneVmarWrite -VmoClone2TestCase.CloneVmoWrite -VmoClone2TestCase.CloseClone -VmoClone2TestCase.CloseOriginal -VmoClone2TestCase.DisjointCloneProgressive -VmoClone2TestCase.DisjointCloneTest2 -VmoClone2TestCase.ForbidContiguousVmo -VmoClone2TestCase.Info -VmoClone2TestCase.ManyChildren -VmoClone2TestCase.ManyChildrenRevClose -VmoClone2TestCase.ManyCloneMapping -VmoClone2TestCase.ManyCloneMappingOffset -VmoClone2TestCase.ManyCloneOffset -VmoClone2TestCase.ObjMemAccounting -VmoClone2TestCase.Offset -VmoClone2TestCase.OffsetProgressiveWrite -VmoClone2TestCase.OffsetTest2 -VmoClone2TestCase.OutOfBounds -VmoClone2TestCase.Overflow -VmoClone2TestCase.ParentStartLimitRegression -VmoClone2TestCase.ParentVmarWrite -VmoClone2TestCase.ParentVmoWrite -VmoClone2TestCase.PinBeforeCreateFailure -VmoClone2TestCase.Read -VmoClone2TestCase.ResizeDisjointChild -VmoClone2TestCase.ResizeGrow -VmoClone2TestCase.ResizeMultipleProgressive -VmoClone2TestCase.ResizeOffsetChild -VmoClone2TestCase.ResizeOverSiblingRange -VmoClone2TestCase.SmallClone -VmoClone2TestCase.SmallCloneChild -VmoClone2TestCase.SmallClones -VmoClone2TestCase.SplitPageClosure -VmoClone2TestCase.Uncached -VmoClone2TestCase.ZeroPageWrite -VmoCloneDisjointClonesTests.DisjointCloneEarlyClose -VmoCloneDisjointClonesTests.DisjointCloneLateClose -VmoCloneResizeTests.ResizeChild -VmoCloneResizeTests.ResizeOriginal -VmoCloneTestCase.Decommit -VmoCloneTestCase.NameProperty -VmoCloneTestCase.NoResize -VmoCloneTestCase.Rights -VmoCloneTestCase.SizeAlign -VmoSignalTestCase.ChildSignalClone -VmoSignalTestCase.ChildSignalMap -VmoSignalTestCase.SignalSanity -VmoSliceTestCase.ChildSliceOfContiguousParentIsContiguous -VmoSliceTestCase.CommitChild -VmoSliceTestCase.CowPageSourceThroughSlices -VmoSliceTestCase.DecommitChild -VmoSliceTestCase.DecommitParent -VmoSliceTestCase.Nested -VmoSliceTestCase.NonResizable -VmoSliceTestCase.NonSlice -VmoSliceTestCase.NotCoWType -VmoSliceTestCase.RoundUpSize -VmoSliceTestCase.RoundUpSizePhysical -VmoSliceTestCase.WriteThrough -VmoSliceTestCase.ZeroChildren -VmoSliceTestCase.ZeroChildrenGrandchildClosedLast -VmoSliceTestCase.ZeroSized -VmoTestCase.ContentSize -VmoTestCase.Create -VmoTestCase.Map -VmoTestCase.NoResize -VmoTestCase.ReadWrite -VmoTestCase.ReadWriteBadLen -VmoTestCase.ReadWriteRange -VmoTestCase.Resize -VmoTestCase.ResizeAlign -VmoTestCase.SizeAlign -VmoTestCase.UncachedContiguous -VmoZeroTestCase.AllocateAfterMerge -VmoZeroTestCase.AllocateAfterMergeHiddenChild -VmoZeroTestCase.ChildZeroThenWrite -VmoZeroTestCase.ContentInParentAndChild -VmoZeroTestCase.Contiguous -VmoZeroTestCase.DecommitMiddle -VmoZeroTestCase.EmptyCowChildren -VmoZeroTestCase.MergeZeroChildren -VmoZeroTestCase.Nested -VmoZeroTestCase.ResizeOverHiddenMarkers -VmoZeroTestCase.UnalignedCommitted -VmoZeroTestCase.UnalignedSubPage -VmoZeroTestCase.UnalignedUnCommitted -VmoZeroTestCase.WriteCowParent -VmoZeroTestcase.ZeroFreesAndAllocates -VmoZeroTestCase.ZeroLengths diff --git a/scripts/zircon/testcases-all.txt b/scripts/zircon/testcases-all.txt deleted file mode 100644 index 2f8b8582..00000000 --- a/scripts/zircon/testcases-all.txt +++ /dev/null @@ -1,825 +0,0 @@ -Bti.Create -Bti.Pin -Bti.PinContiguous -Bti.PinContigFlag -Bti.Resize -Bti.Clone -Bti.GetInfoTest -Bti.NoDelayedUnpin -Bti.DecommitRace -BadAccessTest.InvalidMappedAddressFails -BadAccessTest.KernelMappedAddressChannelWriteFails -BadAccessTest.NormalMappedAddressChannelWriteSucceeds -BadAccessTest.SyscallNumTest -BadAccessTest.PciCfgPioRwChannelReadHandle -BadAccessTest.ChannelReadHandle -ConditionalVariableTest.BroadcastSignalThreadWait -ConditionalVariableTest.SignalThreadWait -ConditionalVariableTest.ConditionalVariablesTimeout -C11MutexTest.MultiThreadedContention -C11MutexTest.TryMutexMultiThreadedContention -C11MutexTest.InitalizeLocalMutex -C11MutexTest.StaticInitalizerSameBytesAsAuto -C11MutexTest.TimeoutElapsed -C11ThreadTest.ThreadLocalErrno -C11ThreadTest.NullNameThreadShouldSucceed -C11ThreadTest.CreateAndVerifyThreadHandle -C11ThreadTest.DetachedThreadKeepsRunning -C11ThreadTest.LongNameSucceeds -C11ThreadTest.SelfDetachAndFree -ChannelInternalTest.CallFinishWithoutPreviouslyCallingCallReturnsBadState -ChannelInternalTest.TransferChannelWithPendingCallInSourceProcess -ChannelTest.CreateIsOkAndEndpointsAreRelated -ChannelTest.IsWriteableByDefault -ChannelTest.WriteToEndpointCausesOtherToBecomeReadable -ChannelTest.WriteConsumesAllHandles -ChannelTest.WaitManyIsSignaledOnAnyElementWrite -ChannelTest.WaitManyIsSignaledForBothWrites -ChannelTest.ReadWhenEmptyReturnsShouldWait -ChannelTest.ReadWhenEmptyAndClosedReturnsPeerClosed -ChannelTest.ReadRemainingMessagesWhenPeerIsClosed -ChannelTest.CloseSignalsPeerClosed -ChannelTest.CloseClearsSignalsWriteable -ChannelTest.CloseSignalsPeerReturnsPeerClosed -ChannelTest.OnFlightHandlesSignalledWhenPeerIsClosed -ChannelTest.WriteNonTransferableHandleReturnsAccessDeniedAndClosesHandle -ChannelTest.WriteRepeatedHandlesReturnsBadHandlesAndClosesHandle -ChannelTest.ConcurrentReadsConsumeUniqueElements -ChannelTest.ReadMayDiscardWithNullBuffersReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithNullBufferDiscardsDataReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithNullBufferDiscardHandlesReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithZeroSizeBuffersDiscardHandlesAndDataReturnsBufferTooSmall -ChannelTest.ReadMayDiscardWithSmallerBufferDiscardHandlesAndDateReturnsBufferTooSmall -ChannelTest.CallWrittenBytesSmallerThanZxTxIdReturnsInvalidArgs -ChannelTest.CallResponseBiggerThanRdNumBytesReturnsBufferTooSmall -ChannelTest.CallResponseBiggerThanRdNumHandlesReturnsBufferTooSmall -ChannelTest.CallBytesFitIsOk -ChannelTest.CallHandlesFitIsOk -ChannelTest.CallHandleAndBytesFitsIsOk -ChannelTest.CallNullptrNumBytesIsInvalidArgs -ChannelTest.CallNullptrNumHandlesInvalidArgs -ChannelTest.CallPendingTransactionsUseDifferentIds -ChannelTest.CallDeadlineExceededReturnsTimedOut -ChannelTest.CallConsumesHandlesOnSuccess -ChannelTest.CallConsumesHandlesOnError -ChannelTest.CallNotifiedOnPeerClosed -ChannelTest.NestingIsOk -ChannelTest.WriteSelfHandleReturnsNotSupported -ChannelTest.ReadEtcHandleInfoValidation -ChannelTest.ReadAndWriteWithMultipleSizes -ChannelWriteEtcTest.MultipleHandlesSomeInvalidResultsReportedCorrectly -ChannelWriteEtcTest.ImproperlyInitalizedResultsArgReportedBackAsOriginallyInitalized -ChannelWriteEtcTest.FailureDoesNotResultInReceivedPacket -ChannelWriteEtcTest.SentHandleReferrsToSameObject -ChannelWriteEtcTest.InvalidOpArgShouldFail -ChannelWriteEtcTest.HandleArgNotAChannelHandleShouldFail -ChannelWriteEtcTest.ChannelHandleNotValidShouldFail -ChannelWriteEtcTest.ChannelHandleWithoutWriteRightShouldFail -ChannelWriteEtcTest.HandleWithoutTransferRightShouldFail -ChannelWriteEtcTest.InvalidHandleInTransferredHandlesShouldFail -ChannelWriteEtcTest.RepeatedHandlesWithOpMoveHandlesShouldFail -ChannelWriteEtcTest.DuplicateHandlesInTransferredHandlesShouldSucceed -ChannelWriteEtcTest.HandleDoesNotMatchTypeShouldFail -ChannelWriteEtcTest.OptionsArgNonZeroShouldFail -ChannelWriteEtcTest.ChannelHandleInTransferredHandlesShouldFail -ChannelWriteEtcTest.OppositeChannelEndClosedShouldFail -ChannelWriteEtcTest.HandleCountBoundaryChecks -ChannelWriteEtcTest.HandleCountAndDataCountBothZeroShouldSucceed -ChannelWriteEtcTest.MaximumNumberHandlesWithZeroCountArrayArgShouldSucceed -ChannelWriteEtcTest.ByteCountIsMaxShouldSucceed -ChannelWriteEtcTest.ByteCountIsMaxPlusOneShouldFail -ChannelWriteEtcTest.NullptrArgWhenSizeNonZeroShouldFail -ChannelWriteEtcTest.RemoveAllHandleRightsShouldSucceed -ChannelWriteEtcTest.RemovingSomeHandleRightsShouldSucceed -ChannelWriteEtcTest.SameHandleRightsBitsShouldSucceed -ChannelWriteEtcTest.SameHandleRightsFlagShouldSucceed -ChannelWriteEtcTest.HandleWithoutDuplicateRightsMoveOpSucceedsDuplicateOpFails -CppThreadTest.CreateAndVerifyThreadHandle -CpuMaskProfile.EmptyMaskIsValid -CpuMaskProfile.ApplyProfile -ClockTest.ClockMonotonic -ClockTest.DeadlineAfter -DefaultExceptionHandlerTest.UnhandledHardwareException -DefaultExceptionHandlerTest.UnhandledPolicyException -DebugLogTest.WriteRead -ExecutableTlsTest.BasicInitalizersInThread -ExecutableTlsTest.BasicInitalizersInMain -ExecutableTlsTest.ArrayInitializerInThread -ExecutableTlsTest.ArrayInitializerInMain -ExecutableTlsTest.BigArrayInitializerInThread -ExecutableTlsTest.BigArrayInitializerInMain -ExecutableTlsTest.StructureInitializerInThread -ExecutableTlsTest.StructureInitalizierInMain -ExecutableTlsTest.AlignmentInitializerInThread -ExecutableTlsTest.AlignmentInitializierInMain -ExecutableTlsTest.ArrayInitializerSpamThread -ExecutableTlsTest.ArrayInitializierSpamMain -EventPairTest.HandlesNotInvalid -EventPairTest.HandleRightsAreCorrect -EventPairTest.KoidsAreCorrect -EventPairTest.CheckNoFlagsSupported -EventPairTest.SignalEventPairAndClearVerifySignals -EventPairTest.SignalPeerAndVerifyRecived -EventPairTest.SignalPeerThenCloseAndVerifySignalReceived -EventPairTest.SignalingClosedPeerReturnsPeerClosed -FifoTest.InvalidParametersReturnOutOfRange -FifoTest.EndpointsAreRelated -FifoTest.EmptyQueueReturnsErrShouldWait -FifoTest.ReadAndWriteValidatesSizeAndElementCount -FifoTest.DequeueSignalsWriteable -FifoTest.FifoOrderIsPreserved -FifoTest.PartialWriteQueuesElementsThatFit -FifoTest.IndividualReadsPreserveOrder -FifoTest.EndpointCloseSignalsPeerClosed -FPUTest.LongComputeLoop -FutexTest.WaitValueMismatch -FutexTest.WaitTimeout -FutexTest.WaitTimeoutElapsed -FutexTest.WaitBadAddress -FutexTest.Wakeup -FutexTest.WakeupLimit -FutexTest.WakeupAddress -FutexTest.RequeueValueMismatch -FutexTest.RequeueSameAddr -FutexTest.Requeue -FutexTest.RequeueUnqueuedOnTimeout -FutexTest.ThreadSuspended -FutexTest.MisalignedFutextAddr -FutexTest.EventSignaling -HandleCloseTest.Many -HandleCloseTest.ManyInvalidHandlesShouldNotFail -HandleCloseTest.ManyDuplicateTest -HandleDup.ReplaceSuccessOrigInvalid -HandleDup.ReplaceFailureBothInvalid -HandleDup.Replace -HandleDup.Duplicate -HandleInfoTest.DupAndInfoRights -HandleInfoTest.RelatedKoid -HandleInfoTest.DuplicateRights -HandleInfoTest.ReplaceRights -HandleTransferTest.OverChannelThenRead -HandleTransferTest.CancelsWait -HandleWaitTest.HandleWaitTest -HandleWaitTest.HandleWaitMultipleThreads -InterruptTest.NonBindablePort -InterruptTest.BindTriggeredIrqToPorts -InterruptTest.BindPort -InterruptTest.UnBindPort -InterruptTest.VirtualInterrupts -InterruptTest.WaitThreadFunctionsAfterSuspendResume -InterruptTest.MAYBE_BindVcpuTest -InterruptTest.UnableToBindVirtualInterruptToVcpu -InterruptTest.MAYBE_UnableToBindToVcpuAfterPort -InterruptTest.NullOutputTimestamp -JobTest.BasicTest -JobTest.CreateTest -JobTest.CreateMissingRightsTest -JobTest.PolicyInvalidTopicTest -JobTest.PolicyBasicOverrideAllowTest -JobTest.PolicyTimerSlackInvalidOptionsTest -JobTest.PolicyTimerSlackInvalidCountTest -JobTest.PolicyTimerSlackValid -JobTest.KillJobNoChildTest -JobTest.JobSignals -JobTest.PolicyBasicOverrideDenyTest -JobTest.PolicyTimerSlackInvalidPolicyTest -JobTest.PolicyTimerSlackNonEmptyTest -JobTest.KillTest -JobTest.KillJobRemovesFromTree -JobTest.CloseJobRemovesFromTree -JobTest.KillJobChain -JobTest.OneCriticalProcessKillsOneJob -JobTest.ManyCriticalProcessesKillOneJob -JobTest.OneCriticalProcessKillsJobTree -JobTest.OneCriticalProcessKillsOneJobIfRetcodeNonzero -JobTest.CriticalProcessNotInAncestor -JobTest.CriticalProcessAlreadySet -JobTest.SetJobOomKillBit -JobTest.WaitTest -JobTest.MaxHeightSmoke -JobTest.GetRuntimeTest -JobGetInfoTest.InfoJobProcessesPartiallyUnmappedBufferIsInvalidArgs -JobGetInfoTest.InfoJobProcessesGetChild -JobGetInfoTest.InfoJobChildJobsGetChild -JobGetInfoTest.InfoJobProcessesOnSelfSuceeds -JobGetInfoTest.InfoJobProcessesInvalidHandleFails -JobGetInfoTest.InfoJobProcessesZeroSizedBufferIsOk -JobGetInfoTest.InfoJobProcessesSmallBufferIsOk -JobGetInfoTest.InfoJobProcessesNullAvailSucceeds -JobGetInfoTest.InfoJobProcessesNullActualSucceeds -JobGetInfoTest.InfoJobProcessesNullActualAndAvailSucceeds -JobGetInfoTest.InfoJobProcessesInvalidBufferPointerFails -JobGetInfoTest.InfoJobProcessesBadActualgIsInvalidArg -JobGetInfoTest.InfoJobProcessesBadAvailIsInvalidArg -MemoryMappingTest.MmapZerofilledTest -MemoryMappingTest.MmapLenTest -MemoryMappingTest.MmapOffsetTest -MemoryMappingTest.MmapProtExecTest -MemoryMappingTest.MmapFlagsTest -MemoryMappingTest.AddressSpaceLimitsTest -MemoryMappingTest.MmapProtTest -MemoryMappingTest.MprotectTest -MsiTest.AllocateSyscall -MsiTest.CreateSyscallArgs -MsiTest.Msi -ObjectWaitManyTest.TooManyObjects -ObjectWaitManyTest.InvalidHandle -ObjectWaitManyTest.WaitForEventsSignaled -ObjectWaitManyTest.WaitForEventsThenSignal -ObjectWaitManyTest.TransientSignalsNotReturned -ObjectChildTest.InvalidHandleReturnsBadHandle -ObjectGetInfoTest.OpenValidHandleSuceeds -ObjectGetInfoTest.ClosedValidHandleFails -ObjectGetInfoTest.HandleCountCorrectness -ObjectGetInfoTest.InvalidHandleFails -ObjectWaitOneTest.WaitForEventSignaled -ObjectWaitOneTest.WaitForEventTimeout -ObjectWaitOneTest.EmptySignalSet -ObjectWaitOneTest.WaitForEventTimeoutPreSignalClear -ObjectWaitOneTest.WaitForEventThenSignal -ObjectWaitOneTest.TransientSignalsNotReturned -Pager.SinglePageTest_vmar -Pager.SinglePageTest_vmo -Pager.UncommittedSinglePageTest_vmar -Pager.UncommittedSinglePageTest_vmo -Pager.PresupplyTest_vmar -Pager.PresupplyTest_vmo -Pager.EarlySupplyTest_vmar -Pager.EarlySupplyTest_vmo -Pager.SequentialMultipageTest_vmar -Pager.SequentialMultipageTest_vmo -Pager.ConcurrentMultipageAccessTest_vmar -Pager.ConcurrentMultipageAccessTest_vmo -Pager.ConcurrentOverlappingAccessTest_vmar -Pager.ConcurrentOverlappingAccessTest_vmo -Pager.BulkSingleSupplyTest_vmar -Pager.BulkSingleSupplyTest_vmo -Pager.BulkOddLengthSupplyTest_vmar -Pager.BulkOddLengthSupplyTest_vmo -Pager.BulkOddOffsetSupplyTest_vmar -Pager.BulkOddOffsetSupplyTest_vmo -Pager.OverlapSupplyTest_vmar -Pager.OverlapSupplyTest_vmo -Pager.ManyRequestTest_vmar -Pager.ManyRequestTest_vmo -Pager.SuccessiveVmoTest -Pager.MultipleConcurrentVmoTest -Pager.VmarUnmapTest -Pager.VmarRemapTest -Pager.VmarMapRangeTest -Pager.ReadResizeTest_vmar -Pager.ReadResizeTest_vmo -Pager.SuspendReadTest_vmar -Pager.SuspendReadTest_vmo -Pager.VmoInfoPagerTest -Pager.DetachPageCompleteTest -Pager.ClosePageCompleteTest -Pager.ReadCloseInterruptLateTest_vmar -Pager.ReadCloseInterruptLateTest_vmo -Pager.ReadDetachInterruptLateTest_vmar -Pager.ReadDetachInterruptLateTest_vmo -Pager.ReadCloseInterruptEarlyTest_vmar -Pager.ReadCloseInterruptEarlyTest_vmo -Pager.ReadDetachInterruptEarlyTest_vmar -Pager.ReadDetachInterruptEarlyTest_vmo -Pager.ClosePagerTest -Pager.DetachClosePagerTest -Pager.ClosePortTest -Pager.CloneReadFromCloneTest_vmar -Pager.CloneReadFromCloneTest_vmo -Pager.CloneReadFromParentTest_vmar -Pager.CloneReadFromParentTest_vmo -Pager.CloneSimultaneousReadTest_vmar -Pager.CloneSimultaneousReadTest_vmo -Pager.CloneSimultaneousChildReadTest_vmar -Pager.CloneSimultaneousChildReadTest_vmo -Pager.CloneWriteToCloneTest_vmar -Pager.CloneWriteToCloneTest_vmo -Pager.CloneDetachTest -Pager.CloneCommitTest -Pager.CloneSplitCommitTest -Pager.CloneResizeCloneHazard -Pager.CloneResizeParentOK -Pager.CloneShrinkGrowParent -Pager.SimpleCommitTest -Pager.SplitCommitTest -Pager.OverlapCommitTest -Pager.OverlapCommitSupplyTest -Pager.MultisupplyCommitTest -Pager.MulticommitSupplyTest -Pager.CommitRedundantSupplyTest -Pager.ResizeCommitTest -Pager.SuspendCommitTest -Pager.InvalidPagerCreate -Pager.InvalidPagerCreateVmo -Pager.InvalidPagerDetachVmo -Pager.InvalidPagerSupplyPages -Pager.ResizeNonresizableVmo -Pager.DecommitTest -Pager.UncommittedSupply -Pager.InvalidPagerOpRange -Pager.FailSinglePage_vmar -Pager.FailSinglePage_vmo -Pager.FailExactRange -Pager.FailMultipleCommits -Pager.FailMultipleVmos -Pager.FailOverlappingRange -Pager.FailRedundant -Pager.FailAfterDetach -Pager.SupplyAfterFail -Pager.FailErrorCode -Pager.WritingZeroFork -Pager.CleanThreadKill -PortTest.AsyncWaitInvalidOption -PortTest.QueueNullPtrReturnsInvalidArgs -PortTest.QueueWaitVerifyUserPacket -PortTest.PortTimeout -PortTest.QueueAndClose -PortTest.QueueTooMany -PortTest.AsyncWaitChannelTimedOut -PortTest.AsyncWaitChannel -PortTest.AsyncWaitCloseOrder -PortTest.AsyncWaitEventRepeat -PortTest.AsyncWaitEventManyAllProcessed -PortTest.EventAsyncSignalWaitSingle -PortTest.ChannelAsyncWaitOnExistingStateIsNotified -PortTest.CancelEventKey -PortTest.CancelEventKeyAfter -PortTest.ThreadEvents -PortTest.Timestamp -PortTest.CloseQueueRace -PortStressTest.WaitSignalCancel -PortStressTest.SignalCloseWait -PortStressTest.CloseWaitRace -ProcessTest.ProcessWaitAsyncCancelSelf -ProcessTest.LongNameSucceeds -ProcessTest.EmptyNameSucceeds -ProcessTest.MiniProcessSanity -ProcessTest.ProcessStartNoHandle -ProcessTest.ProcessStartFail -ProcessTest.ProcessNotKilledViaThreadClose -ProcessTest.ProcessNotKilledViaProcessClose -ProcessTest.KillProcessViaThreadKill -ProcessTest.KillChannelHandleCycle -ProcessTest.SuspendSelf -ProcessTest.CreateAndKillJobRaceStress -ProcessTest.GetRuntimeNoPermission -ProcessTest.InfoReflectsProcessState -ProcessTest.Suspend -ProcessTest.SuspendMultipleThreads -ProcessTest.SuspendBeforeCreatingThreads -ProcessTest.SuspendBeforeStartingThreads -ProcessTest.SuspendProcessThenThread -ProcessTest.SuspendThreadThenProcess -ProcessTest.SuspendThreadAndProcessBeforeStartingProcess -ProcessTest.SuspendTwice -ProcessTest.SuspendTwiceBeforeCreatingThreads -ProcessTest.SuspendWithDyingThread -ProcessTest.GetTaskRuntime -ProcessTest.ProcessStartWriteThreadState -ProcessTest.ForbidDestroyRootVmar -ProcessDebugUtilsTest.XorShiftIsOk -ProcessDebugTest.ReadMemoryAtOffsetIsOk -ProcessDebugTest.WriteMemoryAtOffsetIsOk -ProcessDebugTest.ReadMemoryAtInvalidOffsetReturnsErrorNoMemory -ProcessDebugTest.WriteAtInvalidOffsetReturnsErrorNoMemory -ProcessDebugVDSO.WriteToVdsoAddressReturnsAccessDenied -Pthread.Basic -Pthread.SelfMainThread -Pthread.BigStackSize -Pthread.GetstackMainThread -Pthread.GetstackOtherThread -Pthread.GetstackOtherThreadExplicitSize -PThreadBarrierTest.SingleThreadWinsBarrierObject -PThreadBarrierTest.SingleThreadWinsBarrierObjectResetsBetweenIterations -PThreadBarrierTest.InitWithNoThreadsReturnsInval -PthreadTls.PthreadTls -ProcessGetInfoTest.InfoHandleBasicOnSelfSuceeds -ProcessGetInfoTest.InfoHandleBasicInvalidHandleFails -ProcessGetInfoTest.InfoHandleBasicNullAvailSucceeds -ProcessGetInfoTest.InfoHandleBasicNullActualSucceeds -ProcessGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -ProcessGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -ProcessGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessOnSelfSuceeds -ProcessGetInfoTest.InfoProcessInvalidHandleFails -ProcessGetInfoTest.InfoProcessNullAvailSucceeds -ProcessGetInfoTest.InfoProcessNullActualSucceeds -ProcessGetInfoTest.InfoProcessNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessJobHandleIsBadHandle -ProcessGetInfoTest.InfoProcessThreadHandleIsBadHandle -ProcessGetInfoTest.InfoProcessThreadsSelfSuceeds -ProcessGetInfoTest.InfoProcessThreadsInvalidHandleFails -ProcessGetInfoTest.InfoProcessThreadsZeroSizedBufferSucceeds -ProcessGetInfoTest.InfoProcessMapsUnstartedSuceeds -ProcessGetInfoTest.InfoProcessMapsSmokeTest -ProcessGetInfoTest.InfoProcessHandleStats -ProcessGetInfoTest.InfoProcessHandleTable -ProcessGetInfoTest.InfoProcessHandleTableInsufficientRights -ProcessGetInfoTest.InfoProcessHandleTableEmpty -ProcessGetInfoTest.InfoProcessHandleTableSelf -ProcessGetInfoTest.InfoProcessHandleTableInvalidHandleFails -ProcessGetInfoTest.InfoProcessHandleTableNullAvailSuceeds -ProcessGetInfoTest.InfoProcessHandleTableNullActualAvailSuceeds -ProcessGetInfoTest.InfoProcessHandleTableInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessMapsOnSelfFails -ProcessGetInfoTest.InfoProcessMapsInvalidHandleFails -ProcessGetInfoTest.InfoProcessMapsNullAvailSucceeds -ProcessGetInfoTest.InfoProcessMapsNullActualSucceeds -ProcessGetInfoTest.InfoProcessMapsNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessMapsInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessMapsBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessMapsBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessMapsZeroSizedBufferIsOk -ProcessGetInfoTest.InfoProcessMapsSmallBufferIsOk -ProcessGetInfoTest.InfoProcessMapsPartiallyUnmappedBufferIsInvalidArgs -ProcessGetInfoTest.InfoProcessMapsRequiresInspectRights -ProcessGetInfoTest.InfoProcessVmosSmokeTest -ProcessGetInfoTest.InfoProcessVmosInvalidHandleFails -ProcessGetInfoTest.InfoProcessVmosNullAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosNullActualSucceeds -ProcessGetInfoTest.InfoProcessVmosNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessVmosBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessVmosBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessVmosZeroSizedBufferIsOk -ProcessGetInfoTest.InfoProcessVmosSmallBufferIsOk -ProcessGetInfoTest.InfoProcessVmosPartiallyUnmappedBufferIsInvalidArgs -ProcessGetInfoTest.InfoProcessVmosRequiresInspectRights -ProcessGetInfoTest.InfoProcessVmosJobHandleIsBadHandle -ProcessGetInfoTest.InfoProcessVmosThreadHandleIsBadHandle -ProcessGetInfoTest.InfoHandleBasicZeroSizedFails -ProcessGetInfoTest.InfoProcessZeroSizedBufferFails -ProcessGetInfoTest.InfoProcessThreadsNullAvailSucceeds -ProcessGetInfoTest.InfoProcessThreadsNullActualSucceeds -ProcessGetInfoTest.InfoProcessThreadsNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessThreadsInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessThreadsBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessThreadsBadAvailIsInvalidArg -ProgressiveCloneDiscardTests.ProgressiveCloneClose -ProgressiveCloneDiscardTests.ProgressiveCloneTruncate -ProfileTest.CreateProfileWithDefaultInitializedProfileInfoIsError -ProfileTest.CreateProfileWithMutuallyExclusiveFlagsIsInvalidArgs -ProfileTest.CreateProfileWithNoProfileInfoIsInvalidArgs -ProfileTest.CreateProfileWithInvalidHandleIsBadHandle -ProfileTest.CreateProfileWithNullProfileIsInvalidArgs -Resource.ProbeAddressSpace -Resource.BasicActions -Resource.InvalidArgs -Resource.ExclusiveShared -Resource.SharedExclusive -Resource.VmoCreation -Resource.VmoCreationSmaller -Resource.VmoCreationUnaligned -Resource.VmoReplaceAsExecutable -Resource.CreateResourceSlice -Resource.Ioports -SocketTest.EndpointsAreRelated -SocketTest.EmptySocketShouldWait -SocketTest.WriteReadDataVerify -SocketTest.PeerClosedError -SocketTest.PeekingLeavesData -SocketTest.PeekingIntoEmpty -SocketTest.Signals -SocketTest.SetThreshholdsProp -SocketTest.SetThreshholdsAndCheckSignals -SocketTest.SignalClosedPeer -SocketTest.PeerClosedSetProperty -SocketTest.ShutdownWrite -SocketTest.ShutdownRead -SocketTest.BytesOutstanding -SocketTest.ShutdownWriteBytesOutstanding -SocketTest.ShutdownReadBytesOutstanding -SocketTest.ShortWrite -SocketTest.Datagram -SocketTest.DatagramPeek -SocketTest.DatagramPeekEmpty -SocketTest.DatagramNoShortWrite -SocketTest.ZeroSize -SocketTest.ReadIntoNullBuffer -SocketTest.ReadIntoBadBuffer -SocketTest.WriteFromNullBuffer -SocketTest.WriteFromBadBuffer -StackTest.MainThreadStack -StackTest.ThreadStack -StreamTestCase.Create -StreamTestCase.Seek -StreamTestCase.ReadV -StreamTestCase.WriteV -StreamTestCase.WriteExtendsContentSize -StreamTestCase.WriteExtendsVMOSize -StreamTestCase.ReadVAt -StreamTestCase.WriteVAt -StreamTestCase.ReadVectorAlias -StreamTestCase.Append -StreamTestCase.ExtendFillsWithZeros -SyncCompletionTest.Initializer -SyncCompletionTest.SingleWait -SyncCompletionTest.MultiWait -SyncCompletionTest.TimeoutSingleWait -SyncCompletionTest.TimeoutMultiWait -SyncCompletionTest.PresignalSingleWait -SyncCompletionTest.PresignalMultiWait -SyncCompletionTest.ResetCycleSingleWait -SyncCompletionTest.ResetCycleMultiWait -SyncCompletionTest.SignalRequeue -SyncCompletionTest.SpuriousWakeupHandled -SyncCondition.ConditionTest -SyncCondition.TimeoutTest -SyncMutex.NoRecursion -SyncMutex.Mutexes -SyncMutex.TryMutexes -SyncMutex.TimeoutElapsed -SystemEvent.RetrieveOom -SystemEvent.CannotSignalOomFromUserspace -SystemEvent.RetrieveMempressureCritical -SystemEvent.CannotSignalMempressureCriticalFromUserspace -SystemEvent.RetreiveMempressureWarning -SystemEvent.CannotSignalMempressureWarningFromUserspace -SystemEvent.RetrieveMempressureNormal -SystemEvent.CannotSignalMempressureNormalFromUserspace -SystemEvent.ExactlyOneMemoryEventSignaled -SchedulerProfileTest.CreateProfileWithDefaultPriorityIsOk -SchedulerProfileTest.CreateProfileWithLowestPriorityIsOk -SchedulerProfileTest.CreateProfileWithLowPriorityIsOk -SchedulerProfileTest.CreateProfileWithHihgPriorityIsOk -SchedulerProfileTest.CreateProfileWithHighestPriorityIsOk -SchedulerProfileTest.CreateProfileWithPriorityExceedingHighestIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPriorityBelowLowestIsInvalidArgs -SchedulerProfileTest.CreateProfileWithDeadlineIsOk -SchedulerProfileTest.CreateProfileWithZeroCapacityIsInvalidArgs -SchedulerProfileTest.CreateProfileWithDeadlineBelowCapacityIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPeriodBelowDeadlineIsInvalidArgs -SchedulerProfileTest.CreateProfileOnNonRootJobIsAccessDenied -SchedulerProfileTest.CreateProfileWithNonZeroOptionsIsInvalidArgs -SchedulerProfileTest.SetThreadPriorityIsOk -Threads.ThreadStartWithZeroInstructionPointer -Threads.Basics -Threads.InvalidRights -Threads.Detach -Threads.EmptyNameSucceeds -Threads.LongNameSucceeds -Threads.ThreadStartOnInitialThread -Threads.NonstartedThread -Threads.InfoTaskStatsFails -Threads.GetLastScheduledCpu -Threads.GetInfoRuntime -Threads.GetAffinity -Threads.ResumeSuspended -Threads.SuspendSleeping -Threads.SuspendChannelCall -Threads.SuspendPortCall -Threads.SuspendStopsThread -Threads.SuspendMultiple -Threads.SuspendSelf -Threads.KillSuspendedThread -Threads.StartSuspendedThread -Threads.StartSuspendedAndResumedThread -Threads.SuspendSingleWaitAsyncSignalDelivery -Threads.SuspendRepeatingWaitAsyncSignalDelivery -Threads.ReadingGeneralRegisterState -Threads.ReadingFpRegisterState -Threads.ReadingVectorRegisterState -Threads.WritingGeneralRegisterState -Threads.WritingSingleStepState -Threads.WritingFpRegisterState -Threads.WritingVectorRegisterState -Threads.WritingVectorRegisterState_UnsupportedFieldsIgnored -Threads.WriteThreadStateWithInvalidMxcsrIsInvalidArgs -Threads.ThreadLocalRegisterState -Threads.NoncanonicalRipAddressSyscall -Threads.NoncanonicalRipAddressIRETQ -Threads.WritingArmFlagsRegister -Threads.WriteReadDebugRegisterState -Threads.DebugRegistersValidation -Threads.X86AcFlagUserCopy -TaskGetInfoTest.InfoStatsUnstartedSuceeds -TaskGetInfoTest.InfoStatsSmokeTest -TaskGetInfoTest.InfoTaskStatsInvalidHandleFails -TaskGetInfoTest.InfoTaskStatsNullAvailSucceeds -TaskGetInfoTest.InfoTaskStatsNullActualSucceeds -TaskGetInfoTest.InfoTaskStatsNullActualAndAvailSucceeds -TaskGetInfoTest.InfoTaskStatsInvalidBufferPointerFails -TaskGetInfoTest.InfoTaskStatsBadActualgIsInvalidArg -TaskGetInfoTest.InfoTaskStatsBadAvailIsInvalidArg -TaskGetInfoTest.InfoTaskStatsJobHandleIsBadHandle -TaskGetInfoTest.InfoTaskStatsThreadHandleIsBadHandle -TaskGetInfoTest.InfoTaskRuntimeWrongType -TaskGetInfoTest.InfoTaskStatsZeroSizedBufferIsTooSmall -TaskGetInfoTest.InfoTaskRuntimeInvalidHandle -ThreadGetInfoTest.InfoHandleBasicOnSelfSuceeds -ThreadGetInfoTest.InfoHandleBasicInvalidHandleFails -ThreadGetInfoTest.InfoHandleBasicNullAvailSucceeds -ThreadGetInfoTest.InfoHandleBasicNullActualSucceeds -ThreadGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -ThreadGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -ThreadGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -ThreadGetInfoTest.InfoHandleCountOnSelfSuceeds -ThreadGetInfoTest.InfoHandleCountInvalidHandleFails -ThreadGetInfoTest.InfoHandleCountNullAvailSucceeds -ThreadGetInfoTest.InfoHandleCountNullActualSucceeds -ThreadGetInfoTest.InfoHandleCountNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoHandleCountInvalidBufferPointerFails -ThreadGetInfoTest.InfoHandleCountBadActualgIsInvalidArg -ThreadGetInfoTest.InfoHandleCountBadAvailIsInvalidArg -ThreadGetInfoTest.InfoThreadOnSelfSuceeds -ThreadGetInfoTest.InfoThreadInvalidHandleFails -ThreadGetInfoTest.InfoThreadNullAvailSucceeds -ThreadGetInfoTest.InfoThreadNullActualSucceeds -ThreadGetInfoTest.InfoThreadNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoThreadInvalidBufferPointerFails -ThreadGetInfoTest.InfoThreadBadActualgIsInvalidArg -ThreadGetInfoTest.InfoThreadBadAvailIsInvalidArg -ThreadGetInfoTest.InfoThreadJobHandleIsBadHandle -ThreadGetInfoTest.InfoThreadProcessHandleIsBadHandle -ThreadGetInfoTest.InfoThreadStatsJobHandleIsBadHandle -ThreadGetInfoTest.InfoThreadStatsProcessHandleIsBadHandle -ThreadGetInfoTest.InfoHandleBasicZeroSizedBufferFails -ThreadGetInfoTest.InfoHandleCountZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadStatsOnSelfSuceeds -ThreadGetInfoTest.InfoThreadStatsInvalidHandleFails -ThreadGetInfoTest.InfoThreadStatsNullAvailSucceeds -ThreadGetInfoTest.InfoThreadStatsNullActualSucceeds -ThreadGetInfoTest.InfoThreadStatsNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoThreadStatsInvalidBufferPointerFails -ThreadGetInfoTest.InfoThreadStatsBadActualgIsInvalidArg -ThreadGetInfoTest.InfoThreadStatsBadAvailIsInvalidArg -ThreadGetInfoTest.InfoThreadStatsZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadExceptionReportInvalidHandleFails -Thread.SuspendAfterDeath -TicksTest.ElapsedTimeUsingTicks -Vmar.DestroyTest -Vmar.BasicAllocateTest -Vmar.MapInCompactTest -Vmar.AllocateOobTest -Vmar.UnalignedLenTest -Vmar.UnalignedLenMapTest -Vmar.ObjectInfoTest -Vmar.UnmapSplitTest -Vmar.UnmapMultipleTest -Vmar.UnmapBaseNotMappedTest -Vmar.MapInUppderLimitTest -Vmar.AllocateUnsatisfiableTest -Vmar.DestroyedVmarTest -Vmar.MapOverDestroyedTest -Vmar.AlignmentVmarMapTest -Vmar.AlignmentVmarAllocateTest -Vmar.VmarMapRangeOffsetTest -Vmar.OvermappingTest -Vmar.InvalidArgsTest -Vmar.RightsDropTest -Vmar.ProtectTest -Vmar.NestedRegionPermsTest -Vmar.MapSpecificOverwriteTest -Vmar.ProtectSplitTest -Vmar.ProtectMultipleTest -Vmar.ProtectOverDemandPagedTest -Vmar.ProtectLargeUncomittedTest -Vmar.RangeOpCommitVmoPages -Vmar.UnmapLargeUncommittedTest -Vmar.PartialUnmapAndRead -Vmar.PartialUnmapAndWrite -Vmar.PartialUnmapWithVmarOffset -Vmar.AllowFaultsTest -Vmar.ConcurrentUnmapReadMemory -VmoTestCase.ReadOnlyMap -VmoTestCase.Create -VmoTestCase.ReadWriteBadLen -VmoTestCase.ReadWrite -VmoTestCase.ReadWriteRange -VmoTestCase.Map -VmoTestCase.MapRead -VmoTestCase.ParallelRead -VmoTestCase.NoPermMap -VmoTestCase.NoPermProtect -VmoTestCase.Resize -VmoTestCase.NoResize -VmoTestCase.Info -VmoTestCase.SizeAlign -VmoTestCase.ResizeAlign -VmoTestCase.ContentSize -VmoTestCase.Rights -VmoTestCase.Commit -VmoTestCase.ZeroPage -VmoTestCase.Cache -VmoTestCase.PhysicalSlice -VmoTestCase.CacheOp -VmoTestCase.CacheFlush -VmoTestCase.DecommitMisaligned -VmoTestCase.ResizeHazard -VmoTestCase.CompressedContiguous -VmoTestCase.UncachedContiguous -VmarGetInfoTest.InfoHandleBasicOnSelfSuceeds -VmarGetInfoTest.InfoHandleBasicInvalidHandleFails -VmarGetInfoTest.InfoHandleBasicNullAvailSucceeds -VmarGetInfoTest.InfoHandleBasicNullActualSucceeds -VmarGetInfoTest.InfoHandleBasicNullActualAndAvailSucceeds -VmarGetInfoTest.InfoHandleBasicInvalidBufferPointerFails -VmarGetInfoTest.InfoHandleBasicBadActualgIsInvalidArg -VmarGetInfoTest.InfoHandleBasicBadAvailIsInvalidArg -VmarGetInfoTest.InfoVmarOnSelfFails -VmarGetInfoTest.InfoVmarInvalidHandleFails -VmarGetInfoTest.InfoVmarNullAvailSucceeds -VmarGetInfoTest.InfoVmarNullActualSucceeds -VmarGetInfoTest.InfoVmarNullActualAndAvailSucceeds -VmarGetInfoTest.InfoVmarInvalidBufferPointerFails -VmarGetInfoTest.InfoVmarBadActualgIsInvalidArg -VmarGetInfoTest.InfoVmarBadAvailIsInvalidArg -VmarGetInfoTest.InfoVmarJobHandleIsBadHandle -VmarGetInfoTest.InfoVmarProcessHandleIsBadHandle -VmarGetInfoTest.InfoVmarThreadHandleIsBadHandle -VmarGetInfoTest.InfoHandleBasicZeroSizedBufferFails -VmarGetInfoTest.InfoVmarZeroSizedBufferFails -VersionTest.ZxStringView -VersionTest.StdStringView -VersionTest.StdString -VersionTest.CXX14StdString -VmoCloneTestCase.SizeAlign -VmoCloneTestCase.NameProperty -VmoCloneTestCase.Commit -VmoCloneTestCase.Decommit -VmoCloneTestCase.Rights -VmoCloneTestCase.NoResize -VmoClone2TestCase.Info -VmoClone2TestCase.Read -VmoClone2TestCase.CloneVmoWrite -VmoClone2TestCase.ParentVmoWrite -VmoClone2TestCase.CloneVmarWrite -VmoClone2TestCase.ParentVmarWrite -VmoClone2TestCase.CloseOriginal -VmoClone2TestCase.CloseClone -VmoClone2TestCase.ObjMemAccounting -VmoClone2TestCase.ZeroPageWrite -VmoClone2TestCase.SplitPageClosure -VmoClone2TestCase.Offset -VmoClone2TestCase.OffsetTest2 -VmoClone2TestCase.OffsetProgressiveWrite -VmoClone2TestCase.Overflow -VmoClone2TestCase.OutOfBounds -VmoClone2TestCase.SmallClone -VmoClone2TestCase.SmallCloneChild -VmoClone2TestCase.SmallClones -VmoClone2TestCase.DisjointCloneTest2 -VmoClone2TestCase.DisjointCloneProgressive -VmoClone2TestCase.ResizeGrow -VmoClone2TestCase.ResizeOffsetChild -VmoClone2TestCase.ResizeDisjointChild -VmoClone2TestCase.ResizeMultipleProgressive -VmoClone2TestCase.ResizeOverSiblingRange -VmoClone2TestCase.Children -VmoClone2TestCase.ManyChildren -VmoClone2TestCase.ManyChildrenRevClose -VmoClone2TestCase.ManyCloneMapping -VmoClone2TestCase.ManyCloneOffset -VmoClone2TestCase.ForbidContiguousVmo -VmoClone2TestCase.PinBeforeCreateFailure -VmoClone2TestCase.PinClonePages -VmoClone2TestCase.Uncached -VmoClone2TestCase.ParentStartLimitRegression -VmoClone2TestCase.ManyCloneMappingOffset -VmoClone2TestCase.NoPhysical -VmoClone2TestCase.NoSnapshotPager -VmoZeroTestCase.UnalignedSubPage -VmoZeroTestCase.UnalignedCommitted -VmoZeroTestCase.UnalignedUnCommitted -VmoZeroTestCase.DecommitMiddle -VmoZeroTestCase.Contiguous -VmoZeroTestCase.ContentInParentAndChild -VmoZeroTestCase.EmptyCowChildren -VmoZeroTestCase.MergeZeroChildren -VmoZeroTestCase.AllocateAfterMerge -VmoZeroTestCase.AllocateAfterMergeHiddenChild -VmoZeroTestCase.WriteCowParent -VmoZeroTestCase.ChildZeroThenWrite -VmoZeroTestCase.Nested -VmoZeroTestCase.ZeroLengths -VmoZeroTestCase.ResizeOverHiddenMarkers -VmoSliceTestCase.WriteThrough -VmoSliceTestCase.DecommitParent -VmoSliceTestCase.Nested -VmoSliceTestCase.NonSlice -VmoSliceTestCase.NonResizable -VmoSliceTestCase.CommitChild -VmoSliceTestCase.DecommitChild -VmoSliceTestCase.ZeroSized -VmoSliceTestCase.ChildSliceOfContiguousParentIsContiguous -VmoSliceTestCase.ZeroChildren -VmoSliceTestCase.ZeroChildrenGrandchildClosedLast -VmoSliceTestCase.CowPageSourceThroughSlices -VmoSliceTestCase.RoundUpSizePhysical -VmoSliceTestCase.RoundUpSize -VmoSliceTestCase.NotCoWType -VmoSliceTestCase.Pin -VmoSignalTestCase.SignalSanity -VmoSignalTestCase.ChildSignalClone -VmoSignalTestCase.ChildSignalMap -VmoCloneResizeTests.ResizeChild -VmoCloneResizeTests.ResizeOriginal -VmoCloneDisjointClonesTests.DisjointCloneEarlyClose -VmoCloneDisjointClonesTests.DisjointCloneLateClose \ No newline at end of file diff --git a/scripts/zircon/testcases-failed-baremetal.txt b/scripts/zircon/testcases-failed-baremetal.txt deleted file mode 100644 index 91e87502..00000000 --- a/scripts/zircon/testcases-failed-baremetal.txt +++ /dev/null @@ -1,266 +0,0 @@ - -BadAccessTest.InvalidMappedAddressFails -BadAccessTest.SyscallNumTest -CpuMaskProfile.EmptyMaskIsValid -DefaultExceptionHandlerTest.UnhandledPolicyException -HandleCloseTest.ManyDuplicateTest -JobGetInfoTest.InfoJobProcessesBadActualgIsInvalidArg -JobGetInfoTest.InfoJobProcessesBadAvailIsInvalidArg -JobGetInfoTest.InfoJobProcessesInvalidBufferPointerFails -JobGetInfoTest.InfoJobProcessesNullActualAndAvailSucceeds -JobGetInfoTest.InfoJobProcessesNullActualSucceeds -JobGetInfoTest.InfoJobProcessesNullAvailSucceeds -JobTest.CloseJobRemovesFromTree -JobTest.CriticalProcessAlreadySet -JobTest.GetRuntimeTest -JobTest.JobSignals -JobTest.KillJobChain -JobTest.KillJobRemovesFromTree -JobTest.KillTest -JobTest.ManyCriticalProcessesKillOneJob -JobTest.MaxHeightSmoke -JobTest.OneCriticalProcessKillsJobTree -JobTest.OneCriticalProcessKillsOneJob -JobTest.PolicyBasicOverrideDenyTest -JobTest.PolicyTimerSlackInvalidPolicyTest -JobTest.SetJobOomKillBit -MemoryMappingTest.AddressSpaceLimitsTest -Pager.BulkOddLengthSupplyTest_vmar -Pager.BulkOddLengthSupplyTest_vmo -Pager.BulkOddOffsetSupplyTest_vmar -Pager.BulkOddOffsetSupplyTest_vmo -Pager.BulkSingleSupplyTest_vmar -Pager.BulkSingleSupplyTest_vmo -Pager.CleanThreadKill -Pager.CloneCommitTest -Pager.CloneDetachTest -Pager.CloneReadFromCloneTest_vmar -Pager.CloneReadFromCloneTest_vmo -Pager.CloneReadFromParentTest_vmar -Pager.CloneReadFromParentTest_vmo -Pager.CloneResizeCloneHazard -Pager.CloneResizeParentOK -Pager.CloneShrinkGrowParent -Pager.CloneSimultaneousChildReadTest_vmar -Pager.CloneSimultaneousChildReadTest_vmo -Pager.CloneSimultaneousReadTest_vmar -Pager.CloneSimultaneousReadTest_vmo -Pager.CloneSplitCommitTest -Pager.CloneWriteToCloneTest_vmar -Pager.CloneWriteToCloneTest_vmo -Pager.ClosePageCompleteTest -Pager.ClosePagerTest -Pager.ClosePortTest -Pager.CommitRedundantSupplyTest -Pager.ConcurrentMultipageAccessTest_vmar -Pager.ConcurrentMultipageAccessTest_vmo -Pager.ConcurrentOverlappingAccessTest_vmar -Pager.ConcurrentOverlappingAccessTest_vmo -Pager.DecommitTest -Pager.DetachClosePagerTest -Pager.DetachPageCompleteTest -Pager.EarlySupplyTest_vmar -Pager.EarlySupplyTest_vmo -Pager.FailAfterDetach -Pager.FailErrorCode -Pager.FailExactRange -Pager.FailMultipleCommits -Pager.FailMultipleVmos -Pager.FailOverlappingRange -Pager.FailRedundant -Pager.FailSinglePage_vmar -Pager.FailSinglePage_vmo -Pager.InvalidPagerCreate -Pager.InvalidPagerCreateVmo -Pager.InvalidPagerDetachVmo -Pager.InvalidPagerOpRange -Pager.InvalidPagerSupplyPages -Pager.ManyRequestTest_vmar -Pager.ManyRequestTest_vmo -Pager.MulticommitSupplyTest -Pager.MultipleConcurrentVmoTest -Pager.MultisupplyCommitTest -Pager.OverlapCommitSupplyTest -Pager.OverlapCommitTest -Pager.OverlapSupplyTest_vmar -Pager.OverlapSupplyTest_vmo -Pager.PresupplyTest_vmar -Pager.PresupplyTest_vmo -Pager.ReadCloseInterruptEarlyTest_vmar -Pager.ReadCloseInterruptEarlyTest_vmo -Pager.ReadCloseInterruptLateTest_vmar -Pager.ReadCloseInterruptLateTest_vmo -Pager.ReadDetachInterruptEarlyTest_vmar -Pager.ReadDetachInterruptEarlyTest_vmo -Pager.ReadDetachInterruptLateTest_vmar -Pager.ReadDetachInterruptLateTest_vmo -Pager.ReadResizeTest_vmar -Pager.ReadResizeTest_vmo -Pager.ResizeCommitTest -Pager.ResizeNonresizableVmo -Pager.SequentialMultipageTest_vmar -Pager.SequentialMultipageTest_vmo -Pager.SimpleCommitTest -Pager.SinglePageTest_vmar -Pager.SinglePageTest_vmo -Pager.SplitCommitTest -Pager.SuccessiveVmoTest -Pager.SupplyAfterFail -Pager.SuspendCommitTest -Pager.SuspendReadTest_vmar -Pager.SuspendReadTest_vmo -Pager.UncommittedSinglePageTest_vmar -Pager.UncommittedSinglePageTest_vmo -Pager.UncommittedSupply -Pager.VmarMapRangeTest -Pager.VmarRemapTest -Pager.VmarUnmapTest -Pager.VmoInfoPagerTest -Pager.WritingZeroFork -PortTest.CancelEventKey -PortTest.CancelEventKeyAfter -PortTest.EventAsyncSignalWaitSingle -ProcessDebugTest.ReadMemoryAtInvalidOffsetReturnsErrorNoMemory -ProcessDebugTest.WriteAtInvalidOffsetReturnsErrorNoMemory -ProcessDebugVDSO.WriteToVdsoAddressReturnsAccessDenied -ProcessGetInfoTest.InfoHandleBasicZeroSizedFails -ProcessGetInfoTest.InfoProcessHandleStats -ProcessGetInfoTest.InfoProcessHandleTable -ProcessGetInfoTest.InfoProcessHandleTableEmpty -ProcessGetInfoTest.InfoProcessHandleTableInsufficientRights -ProcessGetInfoTest.InfoProcessHandleTableInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessHandleTableInvalidHandleFails -ProcessGetInfoTest.InfoProcessHandleTableNullActualAvailSuceeds -ProcessGetInfoTest.InfoProcessHandleTableNullAvailSuceeds -ProcessGetInfoTest.InfoProcessHandleTableSelf -ProcessGetInfoTest.InfoProcessMapsBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessMapsBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessMapsInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessMapsInvalidHandleFails -ProcessGetInfoTest.InfoProcessMapsNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessMapsNullActualSucceeds -ProcessGetInfoTest.InfoProcessMapsNullAvailSucceeds -ProcessGetInfoTest.InfoProcessMapsOnSelfFails -ProcessGetInfoTest.InfoProcessMapsPartiallyUnmappedBufferIsInvalidArgs -ProcessGetInfoTest.InfoProcessMapsRequiresInspectRights -ProcessGetInfoTest.InfoProcessMapsSmallBufferIsOk -ProcessGetInfoTest.InfoProcessMapsSmokeTest -ProcessGetInfoTest.InfoProcessMapsUnstartedSuceeds -ProcessGetInfoTest.InfoProcessMapsZeroSizedBufferIsOk -ProcessGetInfoTest.InfoProcessThreadsBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessThreadsBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessThreadsInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessThreadsNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessThreadsNullActualSucceeds -ProcessGetInfoTest.InfoProcessThreadsNullAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessVmosBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessVmosInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessVmosInvalidHandleFails -ProcessGetInfoTest.InfoProcessVmosJobHandleIsBadHandle -ProcessGetInfoTest.InfoProcessVmosNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosNullActualSucceeds -ProcessGetInfoTest.InfoProcessVmosNullAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosPartiallyUnmappedBufferIsInvalidArgs -ProcessGetInfoTest.InfoProcessVmosRequiresInspectRights -ProcessGetInfoTest.InfoProcessVmosSmallBufferIsOk -ProcessGetInfoTest.InfoProcessVmosSmokeTest -ProcessGetInfoTest.InfoProcessVmosThreadHandleIsBadHandle -ProcessGetInfoTest.InfoProcessVmosZeroSizedBufferIsOk -ProcessGetInfoTest.InfoProcessZeroSizedBufferFails -ProcessTest.ForbidDestroyRootVmar -ProcessTest.GetRuntimeNoPermission -ProcessTest.GetTaskRuntime -ProcessTest.InfoReflectsProcessState -ProcessTest.Suspend -ProcessTest.SuspendBeforeCreatingThreads -ProcessTest.SuspendBeforeStartingThreads -ProcessTest.SuspendMultipleThreads -ProcessTest.SuspendProcessThenThread -ProcessTest.SuspendThreadAndProcessBeforeStartingProcess -ProcessTest.SuspendThreadThenProcess -ProcessTest.SuspendTwice -ProcessTest.SuspendTwiceBeforeCreatingThreads -ProcessTest.SuspendWithDyingThread -ProfileTest.CreateProfileWithDefaultInitializedProfileInfoIsError -ProfileTest.CreateProfileWithInvalidHandleIsBadHandle -ProfileTest.CreateProfileWithMutuallyExclusiveFlagsIsInvalidArgs -ProfileTest.CreateProfileWithNoProfileInfoIsInvalidArgs -ProfileTest.CreateProfileWithNullProfileIsInvalidArgs -Resource.BasicActions -Resource.CreateResourceSlice -Resource.ExclusiveShared -Resource.InvalidArgs -Resource.Ioports -Resource.ProbeAddressSpace -Resource.SharedExclusive -Resource.VmoCreation -Resource.VmoCreationSmaller -Resource.VmoCreationUnaligned -Resource.VmoReplaceAsExecutable -SchedulerProfileTest.CreateProfileOnNonRootJobIsAccessDenied -SchedulerProfileTest.CreateProfileWithDeadlineBelowCapacityIsInvalidArgs -SchedulerProfileTest.CreateProfileWithDeadlineIsOk -SchedulerProfileTest.CreateProfileWithDefaultPriorityIsOk -SchedulerProfileTest.CreateProfileWithHighestPriorityIsOk -SchedulerProfileTest.CreateProfileWithHihgPriorityIsOk -SchedulerProfileTest.CreateProfileWithLowestPriorityIsOk -SchedulerProfileTest.CreateProfileWithLowPriorityIsOk -SchedulerProfileTest.CreateProfileWithNonZeroOptionsIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPeriodBelowDeadlineIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPriorityBelowLowestIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPriorityExceedingHighestIsInvalidArgs -SchedulerProfileTest.CreateProfileWithZeroCapacityIsInvalidArgs -SchedulerProfileTest.SetThreadPriorityIsOk -SystemEvent.CannotSignalOomFromUserspace -TaskGetInfoTest.InfoTaskRuntimeInvalidHandle -TaskGetInfoTest.InfoTaskStatsZeroSizedBufferIsTooSmall -ThreadGetInfoTest.InfoHandleBasicZeroSizedBufferFails -ThreadGetInfoTest.InfoHandleCountZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadStatsBadActualgIsInvalidArg -ThreadGetInfoTest.InfoThreadStatsBadAvailIsInvalidArg -ThreadGetInfoTest.InfoThreadStatsInvalidBufferPointerFails -ThreadGetInfoTest.InfoThreadStatsInvalidHandleFails -ThreadGetInfoTest.InfoThreadStatsNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoThreadStatsNullActualSucceeds -ThreadGetInfoTest.InfoThreadStatsNullAvailSucceeds -ThreadGetInfoTest.InfoThreadStatsOnSelfSuceeds -ThreadGetInfoTest.InfoThreadStatsZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadZeroSizedBufferFails -Threads.DebugRegistersValidation -Threads.GetAffinity -Threads.GetInfoRuntime -Threads.GetLastScheduledCpu -Threads.NoncanonicalRipAddressIRETQ -Threads.NoncanonicalRipAddressSyscall -Threads.ReadingFpRegisterState -Threads.ReadingGeneralRegisterState -Threads.ReadingVectorRegisterState -Threads.SuspendRepeatingWaitAsyncSignalDelivery -Threads.SuspendSingleWaitAsyncSignalDelivery -Threads.WriteReadDebugRegisterState -Threads.WriteThreadStateWithInvalidMxcsrIsInvalidArgs -Threads.WritingFpRegisterState -Threads.WritingSingleStepState -Threads.WritingVectorRegisterState -Threads.WritingVectorRegisterState_UnsupportedFieldsIgnored -Vmar.AlignmentVmarAllocateTest -Vmar.AlignmentVmarMapTest -VmarGetInfoTest.InfoHandleBasicZeroSizedBufferFails -VmarGetInfoTest.InfoVmarZeroSizedBufferFails -Vmar.InvalidArgsTest -Vmar.MapInUppderLimitTest -Vmar.MapSpecificOverwriteTest -Vmar.NestedRegionPermsTest -Vmar.OvermappingTest -VmoCloneTestCase.NoPhysical -VmoCloneTestCase.NoSnapshotPager -VmoSliceTestCase.Pin -VmoTestCase.Cache -VmoTestCase.CacheFlush -VmoTestCase.Commit -VmoTestCase.CompressedContiguous -VmoTestCase.DecommitMisaligned -VmoTestCase.Info -VmoTestCase.PhysicalSlice -VmoTestCase.Rights diff --git a/scripts/zircon/testcases-failed-libos.txt b/scripts/zircon/testcases-failed-libos.txt deleted file mode 100644 index 34578a24..00000000 --- a/scripts/zircon/testcases-failed-libos.txt +++ /dev/null @@ -1,337 +0,0 @@ -BadAccessTest.ChannelReadHandle -BadAccessTest.InvalidMappedAddressFails -BadAccessTest.KernelMappedAddressChannelWriteFails -BadAccessTest.PciCfgPioRwChannelReadHandle -BadAccessTest.SyscallNumTest -Bti.DecommitRace -Bti.NoDelayedUnpin -Bti.PinContigFlag -Bti.PinContiguous -ChannelInternalTest.CallFinishWithoutPreviouslyCallingCallReturnsBadState -ChannelTest.CallPendingTransactionsUseDifferentIds -CpuMaskProfile.ApplyProfile -CpuMaskProfile.EmptyMaskIsValid -DefaultExceptionHandlerTest.UnhandledHardwareException -DefaultExceptionHandlerTest.UnhandledPolicyException -FutexTest.RequeueUnqueuedOnTimeout -FutexTest.ThreadSuspended -FutexTest.WaitTimeoutElapsed -FutexTest.Wakeup -FutexTest.WakeupAddress -HandleCloseTest.ManyDuplicateTest -HandleTransferTest.CancelsWait -InterruptTest.BindTriggeredIrqToPorts -InterruptTest.MAYBE_BindVcpuTest -InterruptTest.MAYBE_UnableToBindToVcpuAfterPort -JobGetInfoTest.InfoJobProcessesBadActualgIsInvalidArg -JobGetInfoTest.InfoJobProcessesBadAvailIsInvalidArg -JobGetInfoTest.InfoJobProcessesInvalidBufferPointerFails -JobGetInfoTest.InfoJobProcessesNullActualAndAvailSucceeds -JobGetInfoTest.InfoJobProcessesNullActualSucceeds -JobGetInfoTest.InfoJobProcessesNullAvailSucceeds -JobGetInfoTest.InfoJobProcessesPartiallyUnmappedBufferIsInvalidArgs -JobTest.CloseJobRemovesFromTree -JobTest.CriticalProcessAlreadySet -JobTest.GetRuntimeTest -JobTest.JobSignals -JobTest.KillJobChain -JobTest.KillJobRemovesFromTree -JobTest.KillTest -JobTest.ManyCriticalProcessesKillOneJob -JobTest.MaxHeightSmoke -JobTest.OneCriticalProcessKillsJobTree -JobTest.OneCriticalProcessKillsOneJob -JobTest.OneCriticalProcessKillsOneJobIfRetcodeNonzero -JobTest.PolicyBasicOverrideDenyTest -JobTest.PolicyTimerSlackInvalidPolicyTest -JobTest.SetJobOomKillBit -JobTest.WaitTest -MemoryMappingTest.AddressSpaceLimitsTest -MemoryMappingTest.MmapProtExecTest -MemoryMappingTest.MprotectTest -Pager.BulkOddLengthSupplyTest_vmar -Pager.BulkOddLengthSupplyTest_vmo -Pager.BulkOddOffsetSupplyTest_vmar -Pager.BulkOddOffsetSupplyTest_vmo -Pager.BulkSingleSupplyTest_vmar -Pager.BulkSingleSupplyTest_vmo -Pager.CleanThreadKill -Pager.CloneCommitTest -Pager.CloneDetachTest -Pager.CloneReadFromCloneTest_vmar -Pager.CloneReadFromCloneTest_vmo -Pager.CloneReadFromParentTest_vmar -Pager.CloneReadFromParentTest_vmo -Pager.CloneResizeCloneHazard -Pager.CloneResizeParentOK -Pager.CloneShrinkGrowParent -Pager.CloneSimultaneousChildReadTest_vmar -Pager.CloneSimultaneousChildReadTest_vmo -Pager.CloneSimultaneousReadTest_vmar -Pager.CloneSimultaneousReadTest_vmo -Pager.CloneSplitCommitTest -Pager.CloneWriteToCloneTest_vmar -Pager.CloneWriteToCloneTest_vmo -Pager.ClosePageCompleteTest -Pager.ClosePagerTest -Pager.ClosePortTest -Pager.CommitRedundantSupplyTest -Pager.ConcurrentMultipageAccessTest_vmar -Pager.ConcurrentMultipageAccessTest_vmo -Pager.ConcurrentOverlappingAccessTest_vmar -Pager.ConcurrentOverlappingAccessTest_vmo -Pager.DecommitTest -Pager.DetachClosePagerTest -Pager.DetachPageCompleteTest -Pager.EarlySupplyTest_vmar -Pager.EarlySupplyTest_vmo -Pager.FailAfterDetach -Pager.FailErrorCode -Pager.FailExactRange -Pager.FailMultipleCommits -Pager.FailMultipleVmos -Pager.FailOverlappingRange -Pager.FailRedundant -Pager.FailSinglePage_vmar -Pager.FailSinglePage_vmo -Pager.InvalidPagerCreate -Pager.InvalidPagerCreateVmo -Pager.InvalidPagerDetachVmo -Pager.InvalidPagerOpRange -Pager.InvalidPagerSupplyPages -Pager.ManyRequestTest_vmar -Pager.ManyRequestTest_vmo -Pager.MulticommitSupplyTest -Pager.MultipleConcurrentVmoTest -Pager.MultisupplyCommitTest -Pager.OverlapCommitSupplyTest -Pager.OverlapCommitTest -Pager.OverlapSupplyTest_vmar -Pager.OverlapSupplyTest_vmo -Pager.PresupplyTest_vmar -Pager.PresupplyTest_vmo -Pager.ReadCloseInterruptEarlyTest_vmar -Pager.ReadCloseInterruptEarlyTest_vmo -Pager.ReadCloseInterruptLateTest_vmar -Pager.ReadCloseInterruptLateTest_vmo -Pager.ReadDetachInterruptEarlyTest_vmar -Pager.ReadDetachInterruptEarlyTest_vmo -Pager.ReadDetachInterruptLateTest_vmar -Pager.ReadDetachInterruptLateTest_vmo -Pager.ReadResizeTest_vmar -Pager.ReadResizeTest_vmo -Pager.ResizeCommitTest -Pager.ResizeNonresizableVmo -Pager.SequentialMultipageTest_vmar -Pager.SequentialMultipageTest_vmo -Pager.SimpleCommitTest -Pager.SinglePageTest_vmar -Pager.SinglePageTest_vmo -Pager.SplitCommitTest -Pager.SuccessiveVmoTest -Pager.SupplyAfterFail -Pager.SuspendCommitTest -Pager.SuspendReadTest_vmar -Pager.SuspendReadTest_vmo -Pager.UncommittedSinglePageTest_vmar -Pager.UncommittedSinglePageTest_vmo -Pager.UncommittedSupply -Pager.VmarMapRangeTest -Pager.VmarRemapTest -Pager.VmarUnmapTest -Pager.VmoInfoPagerTest -Pager.WritingZeroFork -PortStressTest.SignalCloseWait -PortStressTest.WaitSignalCancel -PortTest.AsyncWaitInvalidOption -PortTest.CancelEventKey -PortTest.CancelEventKeyAfter -PortTest.EventAsyncSignalWaitSingle -PortTest.Timestamp -ProcessDebugVDSO.WriteToVdsoAddressReturnsAccessDenied -ProcessGetInfoTest.InfoHandleBasicZeroSizedFails -ProcessGetInfoTest.InfoProcessHandleStats -ProcessGetInfoTest.InfoProcessHandleTable -ProcessGetInfoTest.InfoProcessHandleTableEmpty -ProcessGetInfoTest.InfoProcessHandleTableInsufficientRights -ProcessGetInfoTest.InfoProcessHandleTableInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessHandleTableInvalidHandleFails -ProcessGetInfoTest.InfoProcessHandleTableNullActualAvailSuceeds -ProcessGetInfoTest.InfoProcessHandleTableNullAvailSuceeds -ProcessGetInfoTest.InfoProcessHandleTableSelf -ProcessGetInfoTest.InfoProcessMapsBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessMapsBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessMapsInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessMapsInvalidHandleFails -ProcessGetInfoTest.InfoProcessMapsNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessMapsNullActualSucceeds -ProcessGetInfoTest.InfoProcessMapsNullAvailSucceeds -ProcessGetInfoTest.InfoProcessMapsOnSelfFails -ProcessGetInfoTest.InfoProcessMapsPartiallyUnmappedBufferIsInvalidArgs -ProcessGetInfoTest.InfoProcessMapsRequiresInspectRights -ProcessGetInfoTest.InfoProcessMapsSmallBufferIsOk -ProcessGetInfoTest.InfoProcessMapsSmokeTest -ProcessGetInfoTest.InfoProcessMapsUnstartedSuceeds -ProcessGetInfoTest.InfoProcessMapsZeroSizedBufferIsOk -ProcessGetInfoTest.InfoProcessThreadsBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessThreadsBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessThreadsInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessThreadsNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessThreadsNullActualSucceeds -ProcessGetInfoTest.InfoProcessThreadsNullAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosBadActualgIsInvalidArg -ProcessGetInfoTest.InfoProcessVmosBadAvailIsInvalidArg -ProcessGetInfoTest.InfoProcessVmosInvalidBufferPointerFails -ProcessGetInfoTest.InfoProcessVmosInvalidHandleFails -ProcessGetInfoTest.InfoProcessVmosJobHandleIsBadHandle -ProcessGetInfoTest.InfoProcessVmosNullActualAndAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosNullActualSucceeds -ProcessGetInfoTest.InfoProcessVmosNullAvailSucceeds -ProcessGetInfoTest.InfoProcessVmosPartiallyUnmappedBufferIsInvalidArgs -ProcessGetInfoTest.InfoProcessVmosRequiresInspectRights -ProcessGetInfoTest.InfoProcessVmosSmallBufferIsOk -ProcessGetInfoTest.InfoProcessVmosSmokeTest -ProcessGetInfoTest.InfoProcessVmosThreadHandleIsBadHandle -ProcessGetInfoTest.InfoProcessVmosZeroSizedBufferIsOk -ProcessGetInfoTest.InfoProcessZeroSizedBufferFails -ProcessTest.CreateAndKillJobRaceStress -ProcessTest.ForbidDestroyRootVmar -ProcessTest.GetRuntimeNoPermission -ProcessTest.GetTaskRuntime -ProcessTest.InfoReflectsProcessState -ProcessTest.ProcessStartNoHandle -ProcessTest.ProcessStartWriteThreadState -ProcessTest.Suspend -ProcessTest.SuspendBeforeCreatingThreads -ProcessTest.SuspendBeforeStartingThreads -ProcessTest.SuspendMultipleThreads -ProcessTest.SuspendProcessThenThread -ProcessTest.SuspendThreadAndProcessBeforeStartingProcess -ProcessTest.SuspendThreadThenProcess -ProcessTest.SuspendTwice -ProcessTest.SuspendTwiceBeforeCreatingThreads -ProcessTest.SuspendWithDyingThread -ProfileTest.CreateProfileWithDefaultInitializedProfileInfoIsError -ProfileTest.CreateProfileWithInvalidHandleIsBadHandle -ProfileTest.CreateProfileWithMutuallyExclusiveFlagsIsInvalidArgs -ProfileTest.CreateProfileWithNoProfileInfoIsInvalidArgs -ProfileTest.CreateProfileWithNullProfileIsInvalidArgs -Resource.BasicActions -Resource.CreateResourceSlice -Resource.ExclusiveShared -Resource.InvalidArgs -Resource.Ioports -Resource.ProbeAddressSpace -Resource.SharedExclusive -Resource.VmoCreation -Resource.VmoCreationSmaller -Resource.VmoCreationUnaligned -Resource.VmoReplaceAsExecutable -SchedulerProfileTest.CreateProfileOnNonRootJobIsAccessDenied -SchedulerProfileTest.CreateProfileWithDeadlineBelowCapacityIsInvalidArgs -SchedulerProfileTest.CreateProfileWithDeadlineIsOk -SchedulerProfileTest.CreateProfileWithDefaultPriorityIsOk -SchedulerProfileTest.CreateProfileWithHighestPriorityIsOk -SchedulerProfileTest.CreateProfileWithHihgPriorityIsOk -SchedulerProfileTest.CreateProfileWithLowestPriorityIsOk -SchedulerProfileTest.CreateProfileWithLowPriorityIsOk -SchedulerProfileTest.CreateProfileWithNonZeroOptionsIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPeriodBelowDeadlineIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPriorityBelowLowestIsInvalidArgs -SchedulerProfileTest.CreateProfileWithPriorityExceedingHighestIsInvalidArgs -SchedulerProfileTest.CreateProfileWithZeroCapacityIsInvalidArgs -SchedulerProfileTest.SetThreadPriorityIsOk -SocketTest.ReadIntoBadBuffer -SocketTest.WriteFromBadBuffer -SyncMutex.NoRecursion -SyncMutex.TimeoutElapsed -SystemEvent.CannotSignalMempressureCriticalFromUserspace -SystemEvent.CannotSignalMempressureNormalFromUserspace -SystemEvent.CannotSignalMempressureWarningFromUserspace -SystemEvent.CannotSignalOomFromUserspace -SystemEvent.ExactlyOneMemoryEventSignaled -SystemEvent.RetreiveMempressureWarning -SystemEvent.RetrieveMempressureCritical -SystemEvent.RetrieveMempressureNormal -SystemEvent.RetrieveOom -TaskGetInfoTest.InfoTaskRuntimeInvalidHandle -TaskGetInfoTest.InfoTaskStatsZeroSizedBufferIsTooSmall -ThreadGetInfoTest.InfoHandleBasicZeroSizedBufferFails -ThreadGetInfoTest.InfoHandleCountZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadStatsBadActualgIsInvalidArg -ThreadGetInfoTest.InfoThreadStatsBadAvailIsInvalidArg -ThreadGetInfoTest.InfoThreadStatsInvalidBufferPointerFails -ThreadGetInfoTest.InfoThreadStatsInvalidHandleFails -ThreadGetInfoTest.InfoThreadStatsNullActualAndAvailSucceeds -ThreadGetInfoTest.InfoThreadStatsNullActualSucceeds -ThreadGetInfoTest.InfoThreadStatsNullAvailSucceeds -ThreadGetInfoTest.InfoThreadStatsOnSelfSuceeds -ThreadGetInfoTest.InfoThreadStatsZeroSizedBufferFails -ThreadGetInfoTest.InfoThreadZeroSizedBufferFails -Threads.DebugRegistersValidation -Threads.GetAffinity -Threads.GetInfoRuntime -Threads.GetLastScheduledCpu -Threads.KillSuspendedThread -Threads.NoncanonicalRipAddressIRETQ -Threads.NoncanonicalRipAddressSyscall -Threads.ReadingFpRegisterState -Threads.ReadingGeneralRegisterState -Threads.ReadingVectorRegisterState -Threads.StartSuspendedAndResumedThread -Threads.StartSuspendedThread -Threads.SuspendMultiple -Threads.SuspendRepeatingWaitAsyncSignalDelivery -Threads.SuspendSingleWaitAsyncSignalDelivery -Threads.SuspendSleeping -Threads.SuspendStopsThread -Threads.ThreadLocalRegisterState -Threads.ThreadStartWithZeroInstructionPointer -Threads.WriteReadDebugRegisterState -Threads.WriteThreadStateWithInvalidMxcsrIsInvalidArgs -Threads.WritingFpRegisterState -Threads.WritingGeneralRegisterState -Threads.WritingSingleStepState -Threads.WritingVectorRegisterState -Threads.WritingVectorRegisterState_UnsupportedFieldsIgnored -Threads.X86AcFlagUserCopy -Vmar.AlignmentVmarAllocateTest -Vmar.AlignmentVmarMapTest -VmarGetInfoTest.InfoHandleBasicZeroSizedBufferFails -VmarGetInfoTest.InfoVmarZeroSizedBufferFails -Vmar.InvalidArgsTest -Vmar.MapInUppderLimitTest -Vmar.MapSpecificOverwriteTest -Vmar.NestedRegionPermsTest -Vmar.OvermappingTest -Vmar.ProtectLargeUncomittedTest -Vmar.ProtectOverDemandPagedTest -Vmar.RangeOpCommitVmoPages -Vmar.UnmapLargeUncommittedTest -VmoClone2TestCase.ForbidContiguousVmo -VmoClone2TestCase.ManyCloneMappingOffset -VmoClone2TestCase.NoPhysical -VmoClone2TestCase.NoSnapshotPager -VmoClone2TestCase.ParentVmarWrite -VmoCloneTestCase.Commit -VmoCloneTestCase.ManyCloneMappingOffset -VmoCloneTestCase.NoPhysical -VmoCloneTestCase.NoSnapshotPager -VmoSliceTestCase.ChildSliceOfContiguousParentIsContiguous -VmoSliceTestCase.Pin -VmoSliceTestCase.RoundUpSizePhysical -VmoTestCase.Cache -VmoTestCase.CacheFlush -VmoTestCase.CacheOp -VmoTestCase.Commit -VmoTestCase.CompressedContiguous -VmoTestCase.DecommitMisaligned -VmoTestCase.Info -VmoTestCase.NoPermMap -VmoTestCase.NoPermProtect -VmoTestCase.PhysicalSlice -VmoTestCase.ReadOnlyMap -VmoTestCase.ResizeHazard -VmoTestCase.Rights -VmoTestCase.UncachedContiguous -VmoZeroTestCase.Contiguous diff --git a/scripts/zircon/testcases.txt b/scripts/zircon/testcases.txt deleted file mode 100644 index 17a89ea1..00000000 --- a/scripts/zircon/testcases.txt +++ /dev/null @@ -1,52 +0,0 @@ -* --Bti.NoDelayedUnpin --Bti.DecommitRace --ProcessDebugVDSO.* --HandleCloseTest.ManyDuplicateTest* --JobTest.* --JobGetInfoTest.InfoJobProcessesPartiallyUnmappedBufferIsInvalidArgs --JobGetInfoTest.InfoJobChildrenPartiallyUnmappedBufferIsInvalidArgs --PortTest.AsyncWaitInvalidOption --PortTest.Timestamp --PortStressTest.WaitSignalCancel --PortStressTest.SignalCloseWait --ProcessTest.ProcessWaitAsyncCancelSelf --Pthread.* --PThreadBarrierTest.SingleThreadWinsBarrierObjectResetsBetweenIterations --SyncMutex.NoRecursion --Threads.Reading*State --Threads.DebugRegistersValidation --Threads.NoncanonicalRipAddressIRETQ --Threads.StartSuspendedThread --Threads.X86AcFlagUserCopy --Vmar.ProtectOverDemandPagedTest --Vmar.ProtectLargeUncomittedTest --Vmar.UnmapLargeUncommittedTest --Vmar.NestedRegionPermsTest --Vmar.MapSpecificOverwriteTest --Vmar.MapOverDestroyedTest --MemoryMappingTest.MprotectTest --MemoryMappingTest.MmapProtExecTest --MemoryMappingTest.MmapProtTest --VmoTestCase.ReadOnlyMap --VmoTestCase.MapRead --VmoTestCase.ParallelRead --VmoTestCase.NoPermMap --VmoTestCase.NoPermProtect --VmoTestCase.Commit --VmoTestCase.CacheOp --VmoTestCase.ResizeHazard --VmoTestCase.Cache* --VmoTestCase.ZeroPage --VmoTestCase.PinTests --VmoCloneTestCase.Commit --VmoClone2TestCase.PinClonePages --SocketTest.ReadIntoBadBuffer --SocketTest.WriteFromBadBuffer --VersionTest.* --BadAccessTest.* --InterruptTest.BindTriggeredIrqToPort --InterruptTest.WaitThreadFunctionsAfterSuspendResume --*Profile* --SystemEvent.* --Resource.* From 180081bae7a9c70839cfb8e715c741eaf11112bb Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Wed, 23 Feb 2022 21:02:12 +0800 Subject: [PATCH 36/44] tests: update Makefile --- Makefile | 6 ---- drivers/src/utils/mod.rs | 2 ++ zCore/Makefile | 57 +++++++++++++++--------------------- zCore/src/utils.rs | 19 ++++++------ zircon-syscall/src/object.rs | 2 +- 5 files changed, 35 insertions(+), 51 deletions(-) diff --git a/Makefile b/Makefile index 0d9207c8..d8057237 100644 --- a/Makefile +++ b/Makefile @@ -98,9 +98,3 @@ baremetal-test-img: prebuilt/linux/$(ROOTFS_TAR) rcore-fs-fuse @cp prebuilt/linux/libc-libos.so rootfs/lib/ld-musl-x86_64.so.1 @echo Resizing $(ARCH).img @qemu-img resize $(OUT_IMG) +5M - -baremetal-test: - @make -C zCore baremetal-test MODE=release LINUX=1 | tee stdout-baremetal-test - -baremetal-test-rv64: - @make -C zCore baremetal-test-rv64 ARCH=riscv64 MODE=release LINUX=1 ROOTPROC=$(ROOTPROC) | tee -a stdout-baremetal-test-rv64 | tee stdout-rv64 diff --git a/drivers/src/utils/mod.rs b/drivers/src/utils/mod.rs index ab72e181..6a67b29f 100644 --- a/drivers/src/utils/mod.rs +++ b/drivers/src/utils/mod.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + mod event_listener; mod id_allocator; mod irq_manager; diff --git a/zCore/Makefile b/zCore/Makefile index a39b8aee..d1d6e633 100644 --- a/zCore/Makefile +++ b/zCore/Makefile @@ -8,12 +8,12 @@ LINUX ?= LIBOS ?= TEST ?= GRAPHIC ?= +DISK ?= HYPERVISOR ?= V ?= USER ?= ZBI ?= bringup -CMDLINE ?= LOG=$(LOG) SMP ?= 1 ACCEL ?= @@ -21,6 +21,12 @@ ACCEL ?= OBJDUMP ?= rust-objdump --print-imm-hex --x86-asm-syntax=intel OBJCOPY ?= rust-objcopy --binary-architecture=$(ARCH) +ifeq ($(LINUX), 1) + CMDLINE ?= LOG=$(LOG) +else + CMDLINE ?= LOG=$(LOG):TERM=xterm-256color:console.shell=true:virtcon.disable=true +endif + ifeq ($(LINUX), 1) user_img := $(ARCH).img else ifeq ($(USER), 1) @@ -126,32 +132,33 @@ endif qemu_opts := -smp $(SMP) ifeq ($(ARCH), x86_64) - baremetal-test-qemu_opts := \ + qemu_opts += \ -machine q35 \ -cpu Haswell,+smap,-check,-fsgsbase \ - -m 4G \ + -m 1G \ -serial mon:stdio \ -drive format=raw,if=pflash,readonly=on,file=$(ovmf) \ -drive format=raw,file=fat:rw:$(esp) \ - -device ich9-ahci,id=ahci \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 \ -nic none - qemu_opts += $(baremetal-test-qemu_opts) \ - -drive format=qcow2,id=userdisk,if=none,file=$(qemu_disk) \ - -device ide-hd,bus=ahci.0,drive=userdisk else ifeq ($(ARCH), riscv64) qemu_opts += \ -machine virt \ -bios default \ -m 512M \ -no-reboot \ - -no-shutdown \ -serial mon:stdio \ - -drive format=qcow2,id=userdisk,file=$(qemu_disk) \ - -device virtio-blk-device,drive=userdisk \ -kernel $(kernel_img) \ -initrd $(USER_IMG) \ - -append "LOG=$(LOG)" + -append "$(CMDLINE)" +endif + +ifeq ($(DISK), on) + ifeq ($(ARCH), x86_64) + qemu_opts += -device ide-hd,bus=ahci.0,drive=userdisk + else ifeq ($(ARCH), riscv64) + qemu_opts += -device virtio-blk-device,drive=userdisk + endif + qemu_opts += -drive format=qcow2,id=userdisk,if=none,file=$(qemu_disk) endif ifeq ($(GRAPHIC), on) @@ -165,7 +172,6 @@ ifeq ($(GRAPHIC), on) endif else qemu_opts += -display none -nographic - baremetal-test-qemu_opts += -display none -nographic endif ifeq ($(ACCEL), 1) @@ -198,6 +204,10 @@ endif .PHONY: justrun justrun: $(qemu_disk) +ifeq ($(ARCH), x86_64) + $(sed) 's#initramfs=.*#initramfs=\\EFI\\zCore\\$(notdir $(user_img))#' $(esp)/EFI/Boot/rboot.conf + $(sed) 's#cmdline=.*#cmdline=$(CMDLINE)#' $(esp)/EFI/Boot/rboot.conf +endif $(qemu) $(qemu_opts) .PHONY: debugrun @@ -243,12 +253,6 @@ ifeq ($(ARCH), x86_64) cp rboot.conf $(esp)/EFI/Boot/rboot.conf cp $(kernel_elf) $(esp)/EFI/zCore/zcore.elf cp $(user_img) $(esp)/EFI/zCore/ - $(sed) "s/fuchsia.zbi/$(notdir $(user_img))/" $(esp)/EFI/Boot/rboot.conf - ifneq ($(CMDLINE),) - $(sed) "s#cmdline=.*#cmdline=$(CMDLINE)#" $(esp)/EFI/Boot/rboot.conf - else - $(sed) "s/LOG=warn/LOG=$(LOG)/" $(esp)/EFI/Boot/rboot.conf - endif else ifeq ($(ARCH), riscv64) $(OBJCOPY) $(kernel_elf) --strip-all -O binary $@ endif @@ -271,21 +275,6 @@ image: hdiutil create -fs fat32 -ov -volname EFI -format UDTO -srcfolder $(esp) $(build_path)/zcore.cdr qemu-img convert -f raw $(build_path)/zcore.cdr -O qcow2 $(build_path)/zcore.qcow2 -################ Tests ################ - -.PHONY: baremetal-qemu-disk -baremetal-qemu-disk: - @qemu-img create -f qcow2 $(build_path)/disk.qcow2 100M - -.PHONY: baremetal-test -baremetal-test: - cp rboot.conf $(esp)/EFI/Boot/rboot.conf - timeout --foreground 8s $(qemu) $(baremetal-test-qemu_opts) - -.PHONY: baremetal-test-rv64 -baremetal-test-rv64: build $(qemu_disk) - timeout --foreground 8s $(qemu) $(qemu_opts) -append ROOTPROC=$(ROOTPROC) - ################ Deprecated ################ VMDISK := $(build_path)/boot.vdi diff --git a/zCore/src/utils.rs b/zCore/src/utils.rs index 2793f6ac..2b847fea 100644 --- a/zCore/src/utils.rs +++ b/zCore/src/utils.rs @@ -39,11 +39,13 @@ pub fn boot_options() -> BootOptions { std::process::exit(-1); } - let log_level = std::env::var("LOG").unwrap_or_default(); - let cmdline = if cfg!(feature = "zircon") { - args.get(2).cloned().unwrap_or_default() + let (cmdline, log_level) = if cfg!(feature = "zircon") { + let cmdline = args.get(2).cloned().unwrap_or_default(); + let options = parse_cmdline(&cmdline); + let log_level = String::from(*options.get("LOG").unwrap_or(&"")); + (cmdline, log_level) } else { - String::new() + (String::new(), std::env::var("LOG").unwrap_or_default()) }; BootOptions { cmdline, @@ -89,10 +91,10 @@ pub fn wait_for_exit(proc: Option>) -> ! { let future = async move { use zircon_object::object::Signal; let object: Arc = proc.clone(); - let signal = if cfg!(feature = "zircon") { - Signal::USER_SIGNAL_0 - } else { + let signal = if cfg!(any(feature = "linux", feature = "baremetal-test")) { Signal::PROCESS_TERMINATED + } else { + Signal::USER_SIGNAL_0 }; object.wait_signal(signal).await; check_exit_code(proc) @@ -120,9 +122,6 @@ pub fn wait_for_exit(proc: Option>) -> ! { let has_task = executor::run_until_idle(); if cfg!(feature = "baremetal-test") && !has_task { proc.map(check_exit_code); - // if let Some(p) = proc { - // check_exit_code(p); - // } kernel_hal::cpu::reset(); } kernel_hal::interrupt::wait_for_interrupt(); diff --git a/zircon-syscall/src/object.rs b/zircon-syscall/src/object.rs index 6051e87b..d7dc418c 100644 --- a/zircon-syscall/src/object.rs +++ b/zircon-syscall/src/object.rs @@ -291,7 +291,7 @@ impl Syscall<'_> { info_ptr.write(job.get_info())?; } Topic::ProcessVmos => { - error!("A dummy implementation for utest Bti.NoDelayedUnpin, it does not check the reture value"); + warn!("A dummy implementation for utest Bti.NoDelayedUnpin, it does not check the reture value"); actual.write(0)?; avail.write(0)?; } From 813678d3c35a562dc6acc59d260ca76e50af3e4f Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Wed, 23 Feb 2022 21:22:44 +0800 Subject: [PATCH 37/44] Add submodule tests from https://github.com/rcore-os/zcore-tests --- .gitmodules | 3 +++ tests | 1 + 2 files changed, 4 insertions(+) create mode 160000 tests diff --git a/.gitmodules b/.gitmodules index d78daaaa..38982db8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "rboot"] path = rboot url = https://github.com/rcore-os/rboot.git +[submodule "tests"] + path = tests + url = https://github.com/rcore-os/zcore-tests.git diff --git a/tests b/tests new file mode 160000 index 00000000..aa1e1cc2 --- /dev/null +++ b/tests @@ -0,0 +1 @@ +Subproject commit aa1e1cc2d96d36523b24d17ecaedff158fca3937 From d941d2c084730fccdb7700527d25fb0db4bb523a Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Wed, 23 Feb 2022 21:27:28 +0800 Subject: [PATCH 38/44] Update github workflows --- .github/workflows/build-20211102.yml | 2 +- .github/workflows/test-20211102.yml | 190 ++++++++++++++------------- 2 files changed, 103 insertions(+), 89 deletions(-) diff --git a/.github/workflows/build-20211102.yml b/.github/workflows/build-20211102.yml index 5c8fc965..032ff858 100644 --- a/.github/workflows/build-20211102.yml +++ b/.github/workflows/build-20211102.yml @@ -4,7 +4,7 @@ on: push: pull_request: schedule: - - cron: '40 3 * * *' # every day at 3:40 + - cron: '0 22 * * *' # every day at 22:00 UTC jobs: check: diff --git a/.github/workflows/test-20211102.yml b/.github/workflows/test-20211102.yml index c0d500bf..c2a78fea 100644 --- a/.github/workflows/test-20211102.yml +++ b/.github/workflows/test-20211102.yml @@ -4,7 +4,7 @@ on: push: pull_request: schedule: - - cron: '40 3 * * *' # every day at 3:40 + - cron: '0 22 * * *' # every day at 22:00 UTC jobs: test: @@ -43,8 +43,29 @@ jobs: - name: Run benchmarks run: cargo bench - core-test: + zircon-core-test-libos: runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Pull prebuilt images + run: git lfs pull -I prebuilt/zircon/x64/core-tests.zbi,prebuilt/zircon/x64/libzircon-libos.so,prebuilt/zircon/x64/userboot-libos.so + - name: Install dependencies + run: pip3 install -r tests/requirements.txt + - name: Run fast tests + if: github.event_name != 'schedule' + run: cd tests && python3 zircon_core_test.py --libos --fast + - name: Run full tests + if: github.event_name == 'schedule' + run: cd tests && python3 zircon_core_test.py --libos + + zircon-core-test-baremetal: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + arch: [x86_64] steps: - uses: actions/checkout@v2 with: @@ -56,108 +77,101 @@ jobs: profile: minimal toolchain: nightly-2021-11-02 components: rust-src - - name: Install QEMU - run: | - sudo apt update - sudo apt install qemu-system-x86 - - name: Build zCore - run: cd zCore && make build MODE=release - - name: Run core-tests - run: | - cd scripts - pip3 install -r requirements.txt - python3 core-tests.py - - libos-core-test: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Pull prebuilt images - run: git lfs pull -I prebuilt/zircon/x64/core-tests.zbi,prebuilt/zircon/x64/libzircon-libos.so,prebuilt/zircon/x64/userboot-libos.so - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-02 - components: rust-src - - name: Run libos-core-tests - run: | - cd scripts - pip3 install -r requirements.txt - python3 unix-core-tests.py - - libos-libc-test: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Pull prebuilt images - run: git lfs pull -I prebuilt/linux/libc-libos.so - - name: Install musl toolchain - run: sudo apt-get install musl-tools musl-dev -y - - name: Prepare rootfs and libc-test - run: make rootfs && make libc-test - - name: Run libos-libc-tests - run: | - cd scripts - pip3 install -r requirements.txt - python3 libos-libc-tests.py - cat linux/test-result.txt - - baremetal-libc-test: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-02 - components: rust-src - - name: Pull prebuilt images - run: git lfs pull -I prebuilt/linux/libc-libos.so - - name: Install musl toolchain qemu-system-x86 + - name: Install dependencies run: | sudo apt-get update - sudo apt-get install musl-tools musl-dev qemu-system-x86 -y - - name: Prepare rootfs and libc-test - run: make baremetal-test-img - - name: Build kernel - run: cd zCore && make build MODE=release LINUX=1 ARCH=x86_64 - - name: create qemu disk - run: cd zCore && make baremetal-qemu-disk MODE=release LINUX=1 ARCH=x86_64 - - name: Run baremetal-libc-test + sudo apt-get install ninja-build -y + pip3 install -r tests/requirements.txt + - name: Cache QEMU + uses: actions/cache@v1 + with: + path: qemu-6.1.0 + key: qemu-6.1.0-${{ matrix.arch }} + - name: Install QEMU run: | - cd scripts - python3 ./baremetal-libc-test.py + [ ! -d qemu-6.1.0 ] && wget https://download.qemu.org/qemu-6.1.0.tar.xz \ + && tar xJf qemu-6.1.0.tar.xz > /dev/null \ + && cd qemu-6.1.0 && ./configure --target-list=${{ matrix.arch }}-softmmu && cd .. + cd qemu-6.1.0 && sudo make install -j + qemu-system-${{ matrix.arch }} --version + - name: Run fast tests + if: github.event_name != 'schedule' + run: cd tests && python3 zircon_core_test.py --fast + - name: Run full tests + if: github.event_name == 'schedule' + run: cd tests && python3 zircon_core_test.py - baremetal-rv64-oscomp-test: + linux-libc-test-libos: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: submodules: 'recursive' + - name: Pull prebuilt images + run: git lfs pull -I prebuilt/linux/libc-libos.so + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install musl-tools musl-dev -y + pip3 install -r tests/requirements.txt + - name: Prepare rootfs + run: make rootfs && make libc-test + - name: Run fast tests + if: github.event_name != 'schedule' + run: cd tests && python3 linux_libc_test.py --libos --fast + - name: Run full tests + if: github.event_name == 'schedule' + run: cd tests && python3 linux_libc_test.py --libos + + linux-libc-test-baremetal: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + arch: [x86_64, riscv64] + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Pull prebuilt images + run: git lfs pull -I prebuilt/linux/libc-libos.so - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly-2021-11-02 components: rust-src, llvm-tools-preview - - uses: actions-rs/install@v0.1 + - if: matrix.arch == 'riscv64' + uses: actions-rs/install@v0.1 with: crate: cargo-binutils version: latest - - name: Install cargo tools and qemu-system-riscv64 + - name: Install dependencies run: | - sudo apt update - sudo apt install qemu-utils - wget https://github.com/rcore-os/qemu-prebuilt/releases/download/5.2.0-riscv64/qemu-system-riscv64.tar.xz > /dev/null - tar xJf qemu-system-riscv64.tar.xz && sudo cp qemu-system-riscv64 /usr/local/bin - wget https://github.com/rcore-os/qemu-prebuilt/releases/download/qemu-share/qemu-share.tar.xz > /dev/null - tar xJf qemu-share.tar.xz && sudo cp -r qemu /usr/local/share/ - - name: Prepare rootfs and oscomp - run: make riscv-image - - name: Build kernel - run: cd zCore && make build MODE=release LINUX=1 ARCH=riscv64 - - name: Run baremetal-libc-test + sudo apt-get update + sudo apt-get install musl-tools musl-dev ninja-build -y + pip3 install -r tests/requirements.txt + - name: Cache QEMU + uses: actions/cache@v1 + with: + path: qemu-6.1.0 + key: qemu-6.1.0-${{ matrix.arch }} + - name: Install QEMU run: | - cd scripts - python3 baremetal-test-riscv64.py + [ ! -d qemu-6.1.0 ] && wget https://download.qemu.org/qemu-6.1.0.tar.xz \ + && tar xJf qemu-6.1.0.tar.xz > /dev/null \ + && cd qemu-6.1.0 && ./configure --target-list=${{ matrix.arch }}-softmmu && cd .. + cd qemu-6.1.0 && sudo make install -j + qemu-system-${{ matrix.arch }} --version + - name: Prepare rootfs + run: | + if [ "${{ matrix.arch }}" = "x86_64" ]; then + make baremetal-test-img + elif [ "${{ matrix.arch }}" = "riscv64" ]; then + make riscv-image + fi + - name: Run fast tests + if: github.event_name != 'schedule' + run: cd tests && python3 linux_libc_test.py --arch ${{ matrix.arch }} --fast + - name: Run full tests + if: github.event_name == 'schedule' + run: cd tests && python3 linux_libc_test.py --arch ${{ matrix.arch }} From 5ed7c74091bed612c4452e996d6ca16034be8e2d Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Sat, 26 Feb 2022 16:32:11 +0800 Subject: [PATCH 39/44] update toolchain to 2022-01-20 Signed-off-by: Runji Wang --- .github/workflows/{build-20211102.yml => build.yml} | 8 ++++---- .github/workflows/{test-20211102.yml => test.yml} | 8 ++++---- README.md | 7 ++++--- drivers/Cargo.toml | 2 +- drivers/src/io/pio.rs | 1 + drivers/src/lib.rs | 1 - drivers/src/net/realtek/utils.rs | 2 ++ drivers/src/scheme/display.rs | 2 +- kernel-hal/Cargo.toml | 9 +++++---- kernel-hal/src/bare/arch/riscv/sbi.rs | 2 +- kernel-hal/src/bare/arch/x86_64/mod.rs | 2 +- kernel-hal/src/lib.rs | 1 - kernel-hal/src/libos/macos.rs | 2 +- linux-syscall/src/file/poll.rs | 3 +-- loader/src/lib.rs | 1 - rboot | 2 +- rust-toolchain | 2 +- zCore/src/main.rs | 1 - zCore/src/platform/riscv/entry.rs | 2 ++ 19 files changed, 30 insertions(+), 28 deletions(-) rename .github/workflows/{build-20211102.yml => build.yml} (94%) rename .github/workflows/{test-20211102.yml => test.yml} (97%) diff --git a/.github/workflows/build-20211102.yml b/.github/workflows/build.yml similarity index 94% rename from .github/workflows/build-20211102.yml rename to .github/workflows/build.yml index 5c8fc965..2329a212 100644 --- a/.github/workflows/build-20211102.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 override: true components: rust-src, rustfmt, clippy - name: Check code format @@ -38,7 +38,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 components: rust-src, llvm-tools-preview - uses: actions-rs/install@v0.1 with: @@ -62,7 +62,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 override: true target: aarch64-unknown-linux-gnu - uses: actions-rs/cargo@v1 @@ -83,7 +83,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 target: x86_64-fuchsia - name: Build Zircon user programs run: cd zircon-user && make build MODE=release diff --git a/.github/workflows/test-20211102.yml b/.github/workflows/test.yml similarity index 97% rename from .github/workflows/test-20211102.yml rename to .github/workflows/test.yml index c0d500bf..45e6eb08 100644 --- a/.github/workflows/test-20211102.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 components: rust-src - name: Install QEMU run: | @@ -77,7 +77,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 components: rust-src - name: Run libos-core-tests run: | @@ -111,7 +111,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 components: rust-src - name: Pull prebuilt images run: git lfs pull -I prebuilt/linux/libc-libos.so @@ -139,7 +139,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-11-02 + toolchain: nightly-2022-01-20 components: rust-src, llvm-tools-preview - uses: actions-rs/install@v0.1 with: diff --git a/README.md b/README.md index ed51f6c4..7e708314 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,10 @@ Environments: * [Git LFS](https://git-lfs.github.com) ### Developing environment info -- current rustc -- rustc 1.56.0-nightly (08095fc1f 2021-07-26) -- current rust-toolchain -- nightly-2021-07-27 -- current qemu -- 5.2.0 + +- current rustc -- rustc 1.60.0-nightly (5e57faa78 2022-01-19) +- current rust-toolchain -- nightly-2022-01-20 +- current qemu -- 5.2.0 -> 6.2.0 Clone repo and pull prebuilt fuchsia images: diff --git a/drivers/Cargo.toml b/drivers/Cargo.toml index a3bbff31..a3e47e62 100644 --- a/drivers/Cargo.toml +++ b/drivers/Cargo.toml @@ -35,4 +35,4 @@ acpi = "4.0" x2apic = "0.4" [target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies] -riscv = { git = "https://github.com/rust-embedded/riscv", rev = "418c1053", features = ["inline-asm"] } +riscv = { git = "https://github.com/rust-embedded/riscv", rev = "cd31989", features = ["inline-asm"] } diff --git a/drivers/src/io/pio.rs b/drivers/src/io/pio.rs index 7d03ca02..47fa8f86 100644 --- a/drivers/src/io/pio.rs +++ b/drivers/src/io/pio.rs @@ -1,3 +1,4 @@ +use core::arch::asm; use core::marker::PhantomData; use super::Io; diff --git a/drivers/src/lib.rs b/drivers/src/lib.rs index 124b75d0..75dede10 100644 --- a/drivers/src/lib.rs +++ b/drivers/src/lib.rs @@ -1,5 +1,4 @@ #![cfg_attr(not(feature = "mock"), no_std)] -#![feature(asm)] #![feature(doc_cfg)] extern crate alloc; diff --git a/drivers/src/net/realtek/utils.rs b/drivers/src/net/realtek/utils.rs index 8ffdfe9d..9e89f319 100644 --- a/drivers/src/net/realtek/utils.rs +++ b/drivers/src/net/realtek/utils.rs @@ -1,3 +1,5 @@ +use core::arch::asm; + // c906 const FREQUENCY: u64 = 24_000_000; // C906: 24_000_000, Qemu: 10_000_000 const MMIO_MTIMECMP0: *mut u64 = 0x0200_4000usize as *mut u64; diff --git a/drivers/src/scheme/display.rs b/drivers/src/scheme/display.rs index e9a8499d..33c91a17 100644 --- a/drivers/src/scheme/display.rs +++ b/drivers/src/scheme/display.rs @@ -148,7 +148,7 @@ impl<'a> core::ops::Deref for FrameBuffer<'a> { impl<'a> core::ops::DerefMut for FrameBuffer<'a> { #[allow(clippy::needless_borrow)] fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.raw + self.raw } } diff --git a/kernel-hal/Cargo.toml b/kernel-hal/Cargo.toml index c6264f95..4e00d6dc 100644 --- a/kernel-hal/Cargo.toml +++ b/kernel-hal/Cargo.toml @@ -18,7 +18,8 @@ log = "0.4" spin = "0.9" cfg-if = "1.0" bitflags = "1.3" -trapframe = "0.8.0" +# TODO: trapframe = "0.9" +trapframe = { git = "https://github.com/rcore-os/trapframe-rs", rev = "8a0305b" } git-version = "0.3" numeric-enum-macro = "0.2" lazy_static = { version = "1.4", features = ["spin_no_std"] } @@ -40,15 +41,15 @@ naive-timer = "0.2.0" # All mode on x86_64 [target.'cfg(target_arch = "x86_64")'.dependencies] -x86 = "0.43" +x86 = "0.46" x86_64 = "0.14" # Bare-metal mode on x86_64 [target.'cfg(all(target_os = "none", target_arch = "x86_64"))'.dependencies] uefi = "0.11" raw-cpuid = "9.0" -x86-smpboot = { git = "https://github.com/rcore-os/x86-smpboot", rev = "43ffedf" } +x86-smpboot = { git = "https://github.com/rcore-os/x86-smpboot", rev = "1069df3" } # Bare-metal mode on riscv64 [target.'cfg(all(target_os = "none", target_arch = "riscv64"))'.dependencies] -riscv = { git = "https://github.com/rust-embedded/riscv", rev = "418c1053", features = ["inline-asm"] } +riscv = { git = "https://github.com/rust-embedded/riscv", rev = "cd31989", features = ["inline-asm"] } diff --git a/kernel-hal/src/bare/arch/riscv/sbi.rs b/kernel-hal/src/bare/arch/riscv/sbi.rs index 570a7500..8458be47 100644 --- a/kernel-hal/src/bare/arch/riscv/sbi.rs +++ b/kernel-hal/src/bare/arch/riscv/sbi.rs @@ -32,7 +32,7 @@ pub const SBI_ERR_ALREADY_STOPPED: usize = usize::MAX - 7; // -8 fn sbi_call(eid: usize, fid: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { let ret; unsafe { - asm!("ecall", + core::arch::asm!("ecall", in("a0") arg0, in("a1") arg1, in("a2") arg2, diff --git a/kernel-hal/src/bare/arch/x86_64/mod.rs b/kernel-hal/src/bare/arch/x86_64/mod.rs index a20f82b8..d4d9a614 100644 --- a/kernel-hal/src/bare/arch/x86_64/mod.rs +++ b/kernel-hal/src/bare/arch/x86_64/mod.rs @@ -36,7 +36,7 @@ pub fn primary_init() { let stack_fn = |pid: usize| -> usize { // split and reuse the current stack let mut stack: usize; - unsafe { asm!("mov {}, rsp", out(reg) stack) }; + unsafe { core::arch::asm!("mov {}, rsp", out(reg) stack) }; stack -= 0x4000 * pid; stack }; diff --git a/kernel-hal/src/lib.rs b/kernel-hal/src/lib.rs index 1eb766d7..2f8026ca 100644 --- a/kernel-hal/src/lib.rs +++ b/kernel-hal/src/lib.rs @@ -2,7 +2,6 @@ #![cfg_attr(not(feature = "libos"), no_std)] #![cfg_attr(feature = "libos", feature(thread_id_value))] -#![feature(asm)] #![feature(doc_cfg)] #![allow(clippy::uninit_vec)] #![deny(warnings)] diff --git a/kernel-hal/src/libos/macos.rs b/kernel-hal/src/libos/macos.rs index d7b5313d..12228c49 100644 --- a/kernel-hal/src/libos/macos.rs +++ b/kernel-hal/src/libos/macos.rs @@ -68,7 +68,7 @@ extern "C" fn sig_handler(_sig: libc::c_int, _si: *mut libc::siginfo_t, uc: *mut // segmentation violation is rethrown. _ => { // switch back to kernel gs - asm!( + core::arch::asm!( " mov rdi, gs:48 syscall diff --git a/linux-syscall/src/file/poll.rs b/linux-syscall/src/file/poll.rs index 7b22b792..82e0aa8a 100644 --- a/linux-syscall/src/file/poll.rs +++ b/linux-syscall/src/file/poll.rs @@ -8,7 +8,6 @@ use alloc::boxed::Box; use alloc::vec::Vec; use bitvec::prelude::{BitVec, Lsb0}; use core::future::Future; -use core::mem::size_of; use core::pin::Pin; use core::task::{Context, Poll}; use core::time::Duration; @@ -282,7 +281,7 @@ bitflags! { } /// fd size per item -const FD_PER_ITEM: usize = 8 * size_of::(); +const FD_PER_ITEM: usize = u32::BITS as usize; /// max Fdset size const MAX_FDSET_SIZE: usize = 1024 / FD_PER_ITEM; diff --git a/loader/src/lib.rs b/loader/src/lib.rs index dd54790f..65014956 100644 --- a/loader/src/lib.rs +++ b/loader/src/lib.rs @@ -1,7 +1,6 @@ //! Linux and Zircon user programs loader and runner. #![no_std] -#![feature(asm)] #![feature(doc_cfg)] #![deny(warnings, unused_must_use, missing_docs)] diff --git a/rboot b/rboot index 39d6e244..97e48ba1 160000 --- a/rboot +++ b/rboot @@ -1 +1 @@ -Subproject commit 39d6e2443edd4e4c4e912b10ac9890c5b83be77b +Subproject commit 97e48ba1bd7a3be7d0b6bd63c4afe3fc25dd09be diff --git a/rust-toolchain b/rust-toolchain index 0a72dc50..12ae469c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-11-02 \ No newline at end of file +nightly-2022-01-20 \ No newline at end of file diff --git a/zCore/src/main.rs b/zCore/src/main.rs index 6b234468..ffac539a 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -1,6 +1,5 @@ #![no_main] #![cfg_attr(not(feature = "libos"), no_std)] -#![feature(global_asm)] #![feature(lang_items)] #![feature(core_intrinsics)] #![feature(asm)] diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index bb9f99d1..45b4dfb7 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -1,3 +1,5 @@ +use core::arch::global_asm; + #[cfg(feature = "board-qemu")] global_asm!(include_str!("boot/boot_qemu.asm")); #[cfg(feature = "board-d1")] From 63aff2c3dd517829085d623fc70b3c9bf55e19b9 Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Tue, 1 Mar 2022 22:44:24 +0800 Subject: [PATCH 40/44] update trapframe and fix compile for riscv Signed-off-by: Runji Wang --- kernel-hal/Cargo.toml | 3 +-- zCore/src/platform/riscv/entry.rs | 13 +++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/kernel-hal/Cargo.toml b/kernel-hal/Cargo.toml index 4e00d6dc..69c24edd 100644 --- a/kernel-hal/Cargo.toml +++ b/kernel-hal/Cargo.toml @@ -18,8 +18,7 @@ log = "0.4" spin = "0.9" cfg-if = "1.0" bitflags = "1.3" -# TODO: trapframe = "0.9" -trapframe = { git = "https://github.com/rcore-os/trapframe-rs", rev = "8a0305b" } +trapframe = "0.9" git-version = "0.3" numeric-enum-macro = "0.2" lazy_static = { version = "1.4", features = ["spin_no_std"] } diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index 45b4dfb7..eb172e66 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -1,11 +1,16 @@ use core::arch::global_asm; #[cfg(feature = "board-qemu")] -global_asm!(include_str!("boot/boot_qemu.asm")); -#[cfg(feature = "board-d1")] -global_asm!(include_str!("boot/boot_d1.asm")); +global_asm!( + include_str!("boot/boot_qemu.asm"), + include_str!("boot/entry64.asm"), +); -global_asm!(include_str!("boot/entry64.asm")); +#[cfg(feature = "board-d1")] +global_asm!( + include_str!("boot/boot_d1.asm"), + include_str!("boot/entry64.asm"), +); use super::consts::*; use core::str::FromStr; From 928e063dd91620e48fb78a47f724d7d48b7230d1 Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Wed, 2 Mar 2022 23:47:20 +0800 Subject: [PATCH 41/44] fix compile error after rebase Signed-off-by: Runji Wang --- drivers/src/irq/riscv_plic.rs | 2 +- kernel-hal/src/bare/arch/riscv/cpu.rs | 2 +- zCore/Cargo.toml | 3 --- zCore/src/main.rs | 1 - zCore/src/platform/riscv/entry.rs | 3 +-- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index ab281ba8..46d3c8a0 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -1,5 +1,5 @@ use core::ops::Range; - +use core::arch::asm; use spin::Mutex; use crate::io::{Io, Mmio}; diff --git a/kernel-hal/src/bare/arch/riscv/cpu.rs b/kernel-hal/src/bare/arch/riscv/cpu.rs index c2b796c7..2444addc 100644 --- a/kernel-hal/src/bare/arch/riscv/cpu.rs +++ b/kernel-hal/src/bare/arch/riscv/cpu.rs @@ -13,7 +13,7 @@ hal_fn_impl! { fn cpu_id() -> u8 { let mut cpu_id; unsafe { - asm!("mv {0}, tp", out(reg) cpu_id); + core::arch::asm!("mv {0}, tp", out(reg) cpu_id); } cpu_id } diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index bbdad75b..2e83a80d 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -39,9 +39,6 @@ zircon-object = { path = "../zircon-object" } linux-object = { path = "../linux-object", optional = true } rcore-fs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec", optional = true } rcore-fs-sfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "7c232ec", optional = true } -riscv = { version = "0.7", features = ["inline-asm"] } -# const_env_impl = "0.1.3" - # LibOS mode [target.'cfg(not(target_os = "none"))'.dependencies] diff --git a/zCore/src/main.rs b/zCore/src/main.rs index ffac539a..8a148708 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -2,7 +2,6 @@ #![cfg_attr(not(feature = "libos"), no_std)] #![feature(lang_items)] #![feature(core_intrinsics)] -#![feature(asm)] // #![deny(warnings)] // comment this on develop use core::sync::atomic::{AtomicBool, Ordering}; diff --git a/zCore/src/platform/riscv/entry.rs b/zCore/src/platform/riscv/entry.rs index eb172e66..cd1b25e7 100644 --- a/zCore/src/platform/riscv/entry.rs +++ b/zCore/src/platform/riscv/entry.rs @@ -1,5 +1,3 @@ -use core::arch::global_asm; - #[cfg(feature = "board-qemu")] global_asm!( include_str!("boot/boot_qemu.asm"), @@ -13,6 +11,7 @@ global_asm!( ); use super::consts::*; +use core::arch::{asm, global_asm}; use core::str::FromStr; use kernel_hal::arch::sbi::{hart_start, send_ipi, SBI_SUCCESS}; use kernel_hal::KernelConfig; From 9b8b4e4ce172e11b606dafd0ff5316f752aa8b9b Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Wed, 2 Mar 2022 23:57:52 +0800 Subject: [PATCH 42/44] fix cargo fmt and clippy Signed-off-by: Runji Wang --- drivers/src/irq/riscv_plic.rs | 2 +- linux-syscall/src/misc.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/src/irq/riscv_plic.rs b/drivers/src/irq/riscv_plic.rs index 46d3c8a0..42f3999e 100644 --- a/drivers/src/irq/riscv_plic.rs +++ b/drivers/src/irq/riscv_plic.rs @@ -1,5 +1,5 @@ -use core::ops::Range; use core::arch::asm; +use core::ops::Range; use spin::Mutex; use crate::io::{Io, Mmio}; diff --git a/linux-syscall/src/misc.rs b/linux-syscall/src/misc.rs index df50c34b..b5cf5d4d 100644 --- a/linux-syscall/src/misc.rs +++ b/linux-syscall/src/misc.rs @@ -77,16 +77,15 @@ impl Syscall<'_> { timeout_addr: usize, ) -> SysResult { let op = FutexFlags::from_bits_truncate(op); - let timeout; - if op.contains(FutexFlags::WAKE) { - timeout = self.into_inout_userptr::(0).unwrap(); + let timeout = if op.contains(FutexFlags::WAKE) { + self.into_inout_userptr::(0).unwrap() } else { let timeout_result = self.into_inout_userptr::(timeout_addr); - timeout = match timeout_result { + match timeout_result { Ok(t) => t, Err(_e) => return Err(LxError::EACCES), } - } + }; info!( "futex: uaddr: {:#x}, op: {:?}, val: {}, timeout_ptr: {:?}", uaddr, op, val, timeout From 48b279c2ac63d4cb0850acf5a1551b2bb9e94881 Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Sat, 5 Mar 2022 14:58:47 +0800 Subject: [PATCH 43/44] Update zcore-tests --- tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests b/tests index aa1e1cc2..3f8b3d57 160000 --- a/tests +++ b/tests @@ -1 +1 @@ -Subproject commit aa1e1cc2d96d36523b24d17ecaedff158fca3937 +Subproject commit 3f8b3d571eb7382edad37039ee82c2ecbf94ea43 From ea463472a505112738e38ca5d085a16b36d3e7c8 Mon Sep 17 00:00:00 2001 From: shzhxh Date: Wed, 9 Mar 2022 12:24:35 +0800 Subject: [PATCH 44/44] update zcore-tests --- tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests b/tests index 3f8b3d57..2a957e7a 160000 --- a/tests +++ b/tests @@ -1 +1 @@ -Subproject commit 3f8b3d571eb7382edad37039ee82c2ecbf94ea43 +Subproject commit 2a957e7accc358c0c84327095deca0b0a76b6867