Unverified Commit a7c570ee authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #618

618: Fix SMP with 3 or more CPUs r=mkroening a=mkroening

Closes https://github.com/hermitcore/libhermit-rs/issues/617

.

Co-authored-by: Martin Kröning's avatarMartin Kröning <mkroening@posteo.net>
parents 50c9ea5f 4c65d11b
Pipeline #867575 passed with stages
in 9 minutes and 30 seconds
......@@ -94,10 +94,10 @@ test:qemu:
-display none -m 64M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- qemu-system-x86_64 -smp 2
- qemu-system-x86_64 -smp 4
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand
-device isa-debug-exit,iobase=0xf4,iosize=0x04
-display none -m 64M -serial stdio -enable-kvm
-display none -m 128M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- qemu-system-x86_64 -smp 1
......@@ -106,10 +106,10 @@ test:qemu:
-display none -m 64M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
- qemu-system-x86_64 -smp 2
- qemu-system-x86_64 -smp 4
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand
-device isa-debug-exit,iobase=0xf4,iosize=0x04
-display none -m 64M -serial stdio -enable-kvm
-display none -m 128M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
tags:
......
......@@ -21,7 +21,7 @@ pub const GDT_KERNEL_DATA: u16 = 2;
pub const GDT_FIRST_TSS: u16 = 3;
/// We dynamically allocate a GDT large enough to hold the maximum number of entries.
const GDT_ENTRIES: usize = 8;
const GDT_ENTRIES: usize = 8192;
static mut GDT: Gdt = Gdt::new();
......
......@@ -111,10 +111,17 @@ pub fn map<S>(
trace!("Mapping {pages:?} to {frames:?} with {flags:?}");
#[cfg(feature = "smp")]
let mut ipi_tlb_flush = false;
for (page, frame) in pages.zip(frames) {
unsafe {
// TODO: Require explicit unmaps
if let Ok((_frame, flush)) = recursive_page_table().unmap(page) {
#[cfg(feature = "smp")]
{
ipi_tlb_flush = true;
}
flush.flush();
}
recursive_page_table()
......@@ -125,7 +132,9 @@ pub fn map<S>(
}
#[cfg(feature = "smp")]
crate::arch::x86_64::kernel::apic::ipi_tlb_flush();
if ipi_tlb_flush {
crate::arch::x86_64::kernel::apic::ipi_tlb_flush();
}
}
pub fn map_heap<S: PageSize>(virt_addr: VirtAddr, count: usize)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment