diagnose alignment bug in CI code

This commit is contained in:
bunnie 2022-01-06 23:16:01 +08:00
parent 0c71622740
commit 2118233657
3 changed files with 5 additions and 13 deletions

View file

@ -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

View file

@ -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::<PageTableInFlash>());
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

View file

@ -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)]