Skip to content

Commit

Permalink
Merge pull request #104 from Freax13/fix/misc-timer
Browse files Browse the repository at this point in the history
misc irq fixes
  • Loading branch information
Freax13 authored Dec 26, 2024
2 parents b8ed7d6 + dba2b08 commit bd88397
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tee/kernel/src/char_dev/mushroom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl OpenFileDescription for Output {
let mut addr = pointer.get();
let mut remaining_len = len;
while remaining_len > 0 {
let buffer_len = cmp::min(remaining_len, 0x1000);
let buffer_len = cmp::min(remaining_len, supervisor::OUTPUT_BUFFER_CAPACITY);
let mut buf = [0; supervisor::OUTPUT_BUFFER_CAPACITY];
let buf = &mut buf[..buffer_len];

Expand Down
5 changes: 3 additions & 2 deletions tee/supervisor-snp/src/ap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
ghcb::{create_ap, exit, run_vmpl, vmsa_tweak_bitmap},
output,
per_cpu::PerCpu,
scheduler::{start_next_ap, TIMER_VECTOR, WAKE_UP_VECTOR},
scheduler::{start_next_ap, STARTUP_VECTOR, TIMER_VECTOR, WAKE_UP_VECTOR},
};

use self::vmsa::Vmpl1Vmsa;
Expand Down Expand Up @@ -56,6 +56,7 @@ pub fn run_vcpu() -> ! {
if PerCpu::get().interrupted.swap(false, Ordering::SeqCst) {
while let Some(vector) = pop_pending_event() {
match vector.get() {
STARTUP_VECTOR => eoi(),
WAKE_UP_VECTOR => eoi(),
TIMER_VECTOR => {
requested_timer_irq = true;
Expand All @@ -72,7 +73,7 @@ pub fn run_vcpu() -> ! {
}

// See if the kernel was kicked.
if halted && WAKEUP_TOKEN.get(PerCpu::current_vcpu_index()) {
if halted && WAKEUP_TOKEN.take(PerCpu::current_vcpu_index()) {
halted = false;
}

Expand Down

0 comments on commit bd88397

Please sign in to comment.