mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
some more debugging to help trace through dict sync issues
This commit is contained in:
parent
b04dcc21ef
commit
ff2a7f8240
2 changed files with 6 additions and 0 deletions
|
|
@ -1570,6 +1570,7 @@ impl BasisCacheEntry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// generate nonce and write out
|
// generate nonce and write out
|
||||||
|
log::debug!("patching pp {:x?} with aad {:x?}, data {:x?}", pp, self.aad, &page[..256]);
|
||||||
hw.data_encrypt_and_patch_page(&self.cipher, &self.aad, &mut page, &pp);
|
hw.data_encrypt_and_patch_page(&self.cipher, &self.aad, &mut page, &pp);
|
||||||
|
|
||||||
// 4. Check for dirty keys, if there are still some, update vpage_num to target them; otherwise
|
// 4. Check for dirty keys, if there are still some, update vpage_num to target them; otherwise
|
||||||
|
|
@ -1594,6 +1595,7 @@ impl BasisCacheEntry {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
|
log::error!("dict sync could not happen, dictionary name invalid!");
|
||||||
Err(Error::new(ErrorKind::NotFound, "dict_sync called with an invalid dictionary name"))
|
Err(Error::new(ErrorKind::NotFound, "dict_sync called with an invalid dictionary name"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -373,6 +373,7 @@ impl PddbOs {
|
||||||
/// exactly to the first entry in the page table
|
/// exactly to the first entry in the page table
|
||||||
pub(crate) fn patch_data(&self, data: &[u8], offset: u32) {
|
pub(crate) fn patch_data(&self, data: &[u8], offset: u32) {
|
||||||
log::trace!("patch offset: {:x} len: {:x}", offset, data.len());
|
log::trace!("patch offset: {:x} len: {:x}", offset, data.len());
|
||||||
|
// log::trace!("patch bef: {:x?}", &self.pddb_mr.as_slice::<u8>()[offset as usize + self.data_phys_base.as_usize()..offset as usize + self.data_phys_base.as_usize() + 48]);
|
||||||
assert!(data.len() + offset as usize <= PDDB_A_LEN - self.data_phys_base.as_usize(), "attempt to store past disk boundary");
|
assert!(data.len() + offset as usize <= PDDB_A_LEN - self.data_phys_base.as_usize(), "attempt to store past disk boundary");
|
||||||
self.spinor.patch(
|
self.spinor.patch(
|
||||||
self.pddb_mr.as_slice(),
|
self.pddb_mr.as_slice(),
|
||||||
|
|
@ -380,6 +381,8 @@ impl PddbOs {
|
||||||
&data,
|
&data,
|
||||||
offset + self.data_phys_base.as_u32(),
|
offset + self.data_phys_base.as_u32(),
|
||||||
).expect("couldn't write to data region in the PDDB");
|
).expect("couldn't write to data region in the PDDB");
|
||||||
|
//log::trace!("patch aft: {:x?}", &self.pddb_mr.as_slice::<u8>()[offset as usize + self.data_phys_base.as_usize()..offset as usize + self.data_phys_base.as_usize() + 48]);
|
||||||
|
//log::trace!("patch end: {:x?}", &self.pddb_mr.as_slice::<u8>()[offset as usize + self.data_phys_base.as_usize() + 4048..offset as usize + self.data_phys_base.as_usize() + 4096])
|
||||||
}
|
}
|
||||||
fn patch_pagetable(&self, data: &[u8], offset: u32) {
|
fn patch_pagetable(&self, data: &[u8], offset: u32) {
|
||||||
if cfg!(feature = "mbbb") {
|
if cfg!(feature = "mbbb") {
|
||||||
|
|
@ -1620,6 +1623,7 @@ impl PddbOs {
|
||||||
msg: &data,
|
msg: &data,
|
||||||
}
|
}
|
||||||
).expect("couldn't encrypt data");
|
).expect("couldn't encrypt data");
|
||||||
|
// log::trace!("calling patch. nonce {:x?}, ct {:x?}, data {:x?}", nonce.as_slice(), &ciphertext[..32], &data[..32]);
|
||||||
self.patch_data(&[nonce.as_slice(), &ciphertext].concat(), pp.page_number() * PAGE_SIZE as u32);
|
self.patch_data(&[nonce.as_slice(), &ciphertext].concat(), pp.page_number() * PAGE_SIZE as u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue