Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc irq fixes #104

Merged
merged 3 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading