IRC channel logs
2022-10-10.log
back to list of logs
<damo22>iska: yes we are very close, i mean, it does boot with smp but gets stuck due to some kind of threading issue because we are running code paths that have not been tested with multiprocessor yet <damo22>start acpi: acpi pci rumpdisk Kernel Page fault trap, eip 0xc10321b9 <damo22>Stopped at thread_select.part.0.constprop.0+0xc9: cmpl $0x1,0x58(%eax) <damo22>thread_select.part.0.constprop.0(0,0,7,0,0)+0xc9 <damo22>thread_block(c1061a80,f484c000,f4845ee0,c1061671)+0x4f <youpi>kdb doesn't know how many parameters functions take <youpi>so it just peeks what is on the stack <damo22>if im iterating through a task's threads to sync the iopbs, do i need to lock the task? <youpi>you very probably need to lock something to sync on the task list yes <damo22>im using the iopb simple lock, but not sure if thats enough <damo22> simple_lock (&new_task->machine.iopb_lock); <damo22> update_ktss_iopb (new_task->machine.iopb, new_task->machine.iopb_size); <--- this function now iterates through a tasks threads to sync them all <damo22> simple_unlock (&new_task->machine.iopb_lock); <youpi>it's not enough concerning the iteration itself <youpi>about iterating over threads to shoot tlb, did you see signal_cpus' comment ? <youpi>and PMAP_UPDATE_TLBS' users variable <damo22>there is a function that is supposed to be called by the interrupt right? <youpi>yes but I'm talking about iterating over threads etc. <youpi>but that's already handled by the users variable <youpi>remember that mach has already been run on smp <youpi>so normally only x86-specific code needs updating <damo22>i think we need to reintroduce some IPLs <damo22>* throughout the TLB code is that all kernel code that runs at or higher <damo22>* than splvm blocks out update interrupts, and that such code does not <youpi>disabling interrupts + lock is enough to protect things <damo22>but for the TLB sync, i think we just have to implement interrupt_processor(cpuX) as a IPI that triggers pmap_update_interrupt() on cpuX <damo22>and ensure interrupts are enabled when that is called <youpi>one doesn't have to ensure interrupts are enabled <youpi>just that they happen to get enabled sooner or later <youpi>which is all what spl is about <youpi>you need that for the clock to advance anyway.. <damo22>ok. This ktss thing is tricky though. im not sure why the threading is trampling all over each other <youpi>for ktss I'd say just interrupt all threads and be done <youpi>iopl change is rare enough that we don't need to optimize that <damo22> for (slot = 0; slot < NCPUS; slot++) <damo22> update_ktss_iopb_per_cpu (new_iopb, size, slot); <damo22>hmm its still page faulting at thread_select <damo22>so when splvm() is called that sets SPL7 ? <damo22>and we dont need to distinguish between splvm and splsched? <damo22>youpi: in thread_block, why does cpu_number() get called twice? <damo22>shouldnt it remember the cpu number it first called? <damo22>or the opposite, the myprocessor variable should be recomputed inside the spl <damo22>when the thread swaps, the other cpu cant read its memory <damo22>problem is %eax is zero when it shouldnt be <damo22>its trying to dereference 0x58(%eax) <damo22>my CPU_NUMBER() function was borked <damo22>linux_init(6,c11d0078,f8e90000,f9690000,f67ff000)+0x1a <damo22>how do i allow low addresses in bios such as 0xf0000 to be allowed in kernel? im getting kernel accessed userspace <damo22>how do i allow low addresses in bios such as 0xff000 to be allowed in kernel? im getting kernel accessed userspace page fault