From 21182336578882b93fff302a6df0419a8a5fc16a Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 6 Jan 2022 23:16:01 +0800 Subject: [PATCH] diagnose alignment bug in CI code --- services/pddb/src/api.rs | 13 +------------ services/pddb/src/backend/hw.rs | 3 +++ services/pddb/src/backend/types.rs | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/services/pddb/src/api.rs b/services/pddb/src/api.rs index 7858d1a4c..0b0800030 100644 --- a/services/pddb/src/api.rs +++ b/services/pddb/src/api.rs @@ -12,21 +12,10 @@ pub(crate) const PDDB_MAGIC: [u8; 4] = [0x50, 0x44, 0x44, 0x42]; #[allow(dead_code)] pub(crate) const PDDB_VERSION: u32 = 0x00_00_00_01; #[allow(dead_code)] -#[cfg(all( - not(any(target_os = "none", target_os = "xous")), - feature = "ci" -))] // PDDB_A_LEN may be shorter than xous::PDDB_LEN, to speed up testing. -// Also the CI digest scripts don't currently handle filesystems that aren't an even mutiple of 1 megabyte -// This has to do with the CI script parsing the page table itself in page-sized increments, and not handling -// the case that the page table isn't an even multiple of one page correctly. -pub(crate) const PDDB_A_LEN: usize = 4 * 1024 * 1024; #[allow(dead_code)] -#[cfg(not(all( - not(any(target_os = "none", target_os = "xous")), - feature = "ci" -)))] pub(crate) const PDDB_A_LEN: usize = xous::PDDB_LEN as usize; +// pub(crate) const PDDB_A_LEN: usize = 4 * 1024 * 1024; /// range for the starting point of a journal number, picked from a random seed /// the goal is to reduce info leakage about the age of structures relative to each other diff --git a/services/pddb/src/backend/hw.rs b/services/pddb/src/backend/hw.rs index 3a3cefb49..6250ea0c1 100644 --- a/services/pddb/src/backend/hw.rs +++ b/services/pddb/src/backend/hw.rs @@ -112,8 +112,11 @@ impl PddbOs { // the mbbb is located one page off from the Page Table let key_phys_base = PageAlignedPa::from(size_of::()); + log::debug!("key_phys_base: {:x?}", key_phys_base); let mbbb_phys_base = key_phys_base + PageAlignedPa::from(PAGE_SIZE); + log::debug!("mbbb_phys_base: {:x?}", mbbb_phys_base); let fscb_phys_base = PageAlignedPa::from(mbbb_phys_base.as_u32() + MBBB_PAGES as u32 * PAGE_SIZE as u32); + log::debug!("fscb_phys_base: {:x?}", fscb_phys_base); let llio = llio::Llio::new(&xns).unwrap(); // native hardware diff --git a/services/pddb/src/backend/types.rs b/services/pddb/src/backend/types.rs index d16591214..a06984347 100644 --- a/services/pddb/src/backend/types.rs +++ b/services/pddb/src/backend/types.rs @@ -146,7 +146,7 @@ impl Add for PageAlignedVa { } #[allow(dead_code)] -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug)] pub(crate) struct PageAlignedPa(PhysAddr); impl PageAlignedPa { #[allow(dead_code)]