Reduce logging significantly

This commit is contained in:
Jeremy Soller
2025-11-01 20:24:11 -06:00
parent 64f2314e2c
commit 91b835d29f
15 changed files with 30 additions and 47 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ impl Hpet {
let hpet = Hpet::new(find_one_sdt!("HPET"));
if let Some(hpet) = hpet {
println!(" HPET: {:X}", hpet.hpet_number);
debug!(" HPET: {:X}", hpet.hpet_number);
let mut hpet_t = ACPI_TABLE.hpet.write();
*hpet_t = Some(hpet);
+1 -1
View File
@@ -14,7 +14,7 @@ pub(super) fn init(madt: Madt) {
let mut gicd_opt = None;
let mut giccs = Vec::new();
for madt_entry in madt.iter() {
println!(" {:#x?}", madt_entry);
debug!(" {:#x?}", madt_entry);
match madt_entry {
MadtEntry::Gicc(gicc) => {
giccs.push(gicc);
+1 -1
View File
@@ -2,7 +2,7 @@ use super::Madt;
pub(super) fn init(madt: Madt) {
for madt_entry in madt.iter() {
println!(" {:#x?}", madt_entry);
debug!(" {:#x?}", madt_entry);
}
warn!("MADT not yet handled on this platform");
+4 -16
View File
@@ -22,9 +22,9 @@ pub(super) fn init(madt: Madt) {
let me = local_apic.id();
if local_apic.x2 {
println!(" X2APIC {}", me.get());
debug!(" X2APIC {}", me.get());
} else {
println!(" XAPIC {}: {:>08X}", me.get(), local_apic.address);
debug!(" XAPIC {}: {:>08X}", me.get(), local_apic.address);
}
if cfg!(not(feature = "multi_core")) {
@@ -62,10 +62,10 @@ pub(super) fn init(madt: Madt) {
}
for madt_entry in madt.iter() {
println!(" {:x?}", madt_entry);
debug!(" {:x?}", madt_entry);
if let MadtEntry::LocalApic(ap_local_apic) = madt_entry {
if u32::from(ap_local_apic.id) == me.get() {
println!(" This is my local APIC");
debug!(" This is my local APIC");
} else if ap_local_apic.flags & 1 == 1 {
let cpu_id = LogicalCpuId::next();
@@ -105,11 +105,6 @@ pub(super) fn init(madt: Madt) {
};
AP_READY.store(false, Ordering::SeqCst);
print!(
" AP {} APIC {}:",
ap_local_apic.processor, ap_local_apic.id
);
// Send INIT IPI
{
let mut icr = 0x4500;
@@ -118,7 +113,6 @@ pub(super) fn init(madt: Madt) {
} else {
icr |= u64::from(ap_local_apic.id) << 56;
}
print!(" IPI...");
local_apic.set_icr(icr);
}
@@ -133,26 +127,20 @@ pub(super) fn init(madt: Madt) {
icr |= u64::from(ap_local_apic.id) << 56;
}
print!(" SIPI...");
local_apic.set_icr(icr);
}
// Wait for trampoline ready
print!(" Wait...");
while unsafe { (*ap_ready.cast::<AtomicU8>()).load(Ordering::SeqCst) } == 0 {
hint::spin_loop();
}
print!(" Trampoline...");
while !AP_READY.load(Ordering::SeqCst) {
hint::spin_loop();
}
println!(" Ready");
unsafe {
RmmA::invalidate_all();
}
} else {
println!(" CPU Disabled");
}
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ impl Madt {
// safe because no APs have been started yet.
unsafe { MADT.get().write(Some(madt)) };
println!(" APIC: {:>08X}: {}", madt.local_address, madt.flags);
debug!(" APIC: {:>08X}: {}", madt.local_address, madt.flags);
arch::init(madt);
}
+3 -8
View File
@@ -103,14 +103,9 @@ pub unsafe fn init(already_supplied_rsdp: Option<*const u8>) {
let rsdp_opt = Rsdp::get_rsdp(&mut KernelMapper::lock(), already_supplied_rsdp);
if let Some(rsdp) = rsdp_opt {
info!("SDT address: {:#x}", rsdp.sdt_address());
debug!("SDT address: {:#x}", rsdp.sdt_address());
let rxsdt = get_sdt(rsdp.sdt_address(), &mut KernelMapper::lock());
for &c in rxsdt.signature.iter() {
print!("{}", c as char);
}
println!(":");
let rxsdt = if let Some(rsdt) = Rsdt::new(rxsdt) {
let mut initialized = false;
@@ -139,7 +134,7 @@ pub unsafe fn init(already_supplied_rsdp: Option<*const u8>) {
xsdt
} else {
println!("UNKNOWN RSDT OR XSDT SIGNATURE");
warn!("UNKNOWN RSDT OR XSDT SIGNATURE");
return;
};
@@ -170,7 +165,7 @@ pub unsafe fn init(already_supplied_rsdp: Option<*const u8>) {
#[cfg(target_arch = "aarch64")]
gtdt::Gtdt::init();
} else {
println!("NO RSDP FOUND");
error!("NO RSDP FOUND");
}
}
}
+1 -1
View File
@@ -147,7 +147,7 @@ unsafe fn overwrite(relocs: &[AltReloc], enable: KcpuFeatures) {
return;
}
info!("self-modifying features: {:?}", enable);
debug!("self-modifying features: {:?}", enable);
let mut mapper = KernelMapper::lock();
for reloc in relocs.iter().copied() {
+1 -1
View File
@@ -24,7 +24,7 @@ const PER_INT_CAP: u64 = 0x10;
pub unsafe fn init(hpet: &mut Hpet) -> bool {
unsafe {
info!("HPET @ {:#x}", { hpet.base_address.address });
debug!("HPET @ {:#x}", { hpet.base_address.address });
debug_caps(hpet);
trace!("HPET Before Init");
+2 -2
View File
@@ -73,7 +73,7 @@ impl LocalApic {
.is_some_and(|feature_info| feature_info.has_x2apic());
if !self.x2 {
info!("Detected xAPIC at {:#x}", physaddr.data());
debug!("Detected xAPIC at {:#x}", physaddr.data());
if let Some((_entry, _, flush)) = mapper.unmap_phys(virtaddr, true) {
// Unmap xAPIC page if already mapped
flush.flush();
@@ -83,7 +83,7 @@ impl LocalApic {
.expect("failed to map local APIC memory")
.flush();
} else {
info!("Detected x2APIC");
debug!("Detected x2APIC");
}
self.init_ap();
+5 -5
View File
@@ -54,21 +54,21 @@ unsafe fn init_hpet() -> bool {
pub unsafe fn init_noncore() {
unsafe {
info!("Initializing system timer");
debug!("Initializing system timer");
#[cfg(feature = "x86_kvm_pv")]
if tsc::init() {
info!("TSC used as system clock source");
debug!("TSC used as system clock source");
}
if init_hpet() {
info!("HPET used as system timer");
debug!("HPET used as system timer");
} else {
pit::init();
info!("PIT used as system timer");
debug!("PIT used as system timer");
}
info!("Finished initializing devices");
debug!("Finished initializing devices");
}
}
+1 -1
View File
@@ -111,7 +111,7 @@ pub fn get_kvm_support() -> &'static Option<KvmSupport> {
let supp_feats = KvmFeatureBits::from_bits_retain(res.eax);
info!("Detected KVM paravirtualization support, features {supp_feats:?}");
debug!("Detected KVM paravirtualization support, features {supp_feats:?}");
Some(KvmSupport {
max_leaf,
+2 -2
View File
@@ -184,8 +184,8 @@ fn kmain(bootstrap: Bootstrap) -> ! {
//Initialize global schemes, such as `acpi:`.
scheme::init_globals();
info!("BSP: {}", cpu_count());
info!("Env: {:?}", ::core::str::from_utf8(bootstrap.env));
info!("BSP: {} CPUs", cpu_count());
debug!("Env: {:?}", ::core::str::from_utf8(bootstrap.env));
BOOTSTRAP.call_once(|| bootstrap);
+1 -1
View File
@@ -735,7 +735,7 @@ fn init_sections(mut allocator: BumpAllocator<RmmA>) {
FREELIST.lock().for_orders = first_pages.map(|pair| pair.map(|(frame, _)| frame));
//debug_freelist();
info!("Initial freelist consistent");
debug!("Initial freelist consistent");
}
#[cold]
+5 -5
View File
@@ -35,27 +35,27 @@ pub(crate) struct KernelArgs {
impl KernelArgs {
pub(crate) fn print(&self) {
info!(
debug!(
"Kernel: {:X}:{:X}",
{ self.kernel_base },
self.kernel_base + self.kernel_size
);
info!(
debug!(
"Env: {:X}:{:X}",
{ self.env_base },
self.env_base + self.env_size
);
info!(
debug!(
"HWDESC: {:X}:{:X}",
{ self.hwdesc_base },
self.hwdesc_base + self.hwdesc_size
);
info!(
debug!(
"Areas: {:X}:{:X}",
{ self.areas_base },
self.areas_base + self.areas_size
);
info!(
debug!(
"Bootstrap: {:X}:{:X}",
{ self.bootstrap_base },
self.bootstrap_base + self.bootstrap_size
+1 -1
View File
@@ -123,7 +123,7 @@ pub unsafe fn usermode_bootstrap(bootstrap: &Bootstrap, token: &mut CleanLockTok
.expect("failed to copy memory to bootstrap");
let bootstrap_entry = u64::from_le_bytes(bootstrap_slice[0x1a..0x22].try_into().unwrap());
info!("Bootstrap entry point: {:X}", bootstrap_entry);
debug!("Bootstrap entry point: {:X}", bootstrap_entry);
assert_ne!(bootstrap_entry, 0);
println!("\n");