From ccb4309cba794b893a5999b62449c360c14bb008 Mon Sep 17 00:00:00 2001 From: basmaelgaabouri Date: Thu, 27 Oct 2022 23:00:32 +0100 Subject: [PATCH] remove debug prints --- veracruz-utils/src/runtime_manager_message.rs | 2 +- .../src/virtio-console-server/src/main.rs | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/veracruz-utils/src/runtime_manager_message.rs b/veracruz-utils/src/runtime_manager_message.rs index 185432ab2..c63ca8c2c 100644 --- a/veracruz-utils/src/runtime_manager_message.rs +++ b/veracruz-utils/src/runtime_manager_message.rs @@ -81,7 +81,7 @@ pub enum RuntimeManagerResponse { /// parameters: /// Vec - The nitro attestation document from the enclave AttestationData(Vec), - #[cfg(any(feature = "icecap", feature = "linux"))] + #[cfg(any(feature = "icecap", feature = "icecap-cca", feature = "linux"))] /// The response to the `Attestation` request. Parameters (in order) are: /// - A byte encoding of the PSA attestation token, /// - A byte encoding of the Certificate Signing Request. diff --git a/workspaces/icecap-runtime/src/virtio-console-server/src/main.rs b/workspaces/icecap-runtime/src/virtio-console-server/src/main.rs index 01f1dc9c3..8cb961ef7 100644 --- a/workspaces/icecap-runtime/src/virtio-console-server/src/main.rs +++ b/workspaces/icecap-runtime/src/virtio-console-server/src/main.rs @@ -89,20 +89,20 @@ static mut VIRTIO_POOL: Option = None; // virtio pool page mappings for virtio-drivers #[no_mangle] pub unsafe extern "C" fn virtio_dma_alloc(pages: usize) -> usize { - debug_println!("virtio_pool: allocating {}x{} pages", pages, virtio_drivers::PAGE_SIZE); + //debug_println!("virtio_pool: allocating {}x{} pages", pages, virtio_drivers::PAGE_SIZE); let pool = VIRTIO_POOL.as_mut().unwrap(); if pool.mark + pages*virtio_drivers::PAGE_SIZE > pool.pool.len() { - debug_println!("virtio_pool: out of pages ({}/{})!", - pool.pool.len() / virtio_drivers::PAGE_SIZE, - pool.pool.len() / virtio_drivers::PAGE_SIZE - ); + // debug_println!("virtio_pool: out of pages ({}/{})!", + // pool.pool.len() / virtio_drivers::PAGE_SIZE, + // pool.pool.len() / virtio_drivers::PAGE_SIZE + // ); return 0; } let old_mark = pool.mark; pool.mark += pages*virtio_drivers::PAGE_SIZE; let p = &mut pool.pool[old_mark] as *mut _ as usize; - debug_println!("virtio_pool: allocating {}x{} pages -> {:012x}", pages, virtio_drivers::PAGE_SIZE, virtio_virt_to_phys(p as usize)); + //debug_println!("virtio_pool: allocating {}x{} pages -> {:012x}", pages, virtio_drivers::PAGE_SIZE, virtio_virt_to_phys(p as usize)); virtio_virt_to_phys(p as usize) } @@ -133,7 +133,7 @@ pub unsafe extern "C" fn virtio_virt_to_phys(vaddr: usize) -> usize { // entry point fn main(config: Config) -> Fallible<()> { - debug_println!("Hello from virtio-console-server!"); + // debug_println!("Hello from virtio-console-server!"); // FIXME: Yield 10 times to let the runtime start before the console server for _i in 1..10 { icecap_core::sel4::yield_(); @@ -177,26 +177,26 @@ fn main(config: Config) -> Fallible<()> { } } - debug_println!("virtio{}@{:012x}: sending...", virtio_i, virtio_mmio); + //debug_println!("virtio{}@{:012x}: sending...", virtio_i, virtio_mmio); // we need to send over a frame, allocate one from the pool let send_page = unsafe { VIRTIO_POOL.as_mut() }.unwrap().alloc(virtio_drivers::PAGE_SIZE)?; - let formatted = format!("\nhello from virtio-console-server over virtio{}@{:012x}!\n\n", virtio_i, virtio_mmio); + /* let formatted = format!("\nhello from virtio-console-server over virtio{}@{:012x}!\n\n", virtio_i, virtio_mmio); send_page[..formatted.as_bytes().len()].copy_from_slice(&formatted.as_bytes()); console.send_slice(&send_page[..formatted.as_bytes().len()])?; - +*/ // begin processing requests let mut rb = BufferedRingBuffer::new(RingBuffer::unmanaged_from_config( &config.client_ring_buffer, )); - debug_println!("virtio{}@{:012x}: processing requests...", virtio_i, virtio_mmio); + //debug_println!("virtio{}@{:012x}: processing requests...", virtio_i, virtio_mmio); // we may have already recieved data to send, but lost the notification // during initialization, so there may already be data in our ring buffer // we need to write out loop { let badge = config.event_nfn.wait(); - debug_println!("virtio{}@{:012x}: received notification\n", virtio_i, virtio_mmio); + //debug_println!("virtio{}@{:012x}: received notification\n", virtio_i, virtio_mmio); if badge & config.badges.irq != 0 { loop { console.ack_interrupt()?;