Commit graph

733 commits

Author SHA1 Message Date
Tomas Hruby
5c0927e108 SMP - clock calibration spurious IRQ deadlock fix
- this patch fixes a deadlock which may occur if we get a
   spurious interrupt while calibrating clocks during the boot
   time. Since we never handle interrupts while in the kernel
   (BKL locked) the interrupt code locks the lock. This is a
   different situation, a corner case, boot time only. We do not
   return to userspace but to the kernel, so the BKL is not
   unlocked. So we need irq handler which leaves the BKL
   unlocked.  The clock handler does it already, this patch adds
   a dummy spurious irq handler for the same reason. It is better
   to handle the situation this way to keep the normal runtime
   code simple.
2012-01-26 11:39:40 +00:00
Tomas Hruby
c468f4efa5 SMP - no_apic=0 and acpi=1 set when CONFIG_SMP=y
- this is a temporary change which makes images compiled for SMP
  boot in SMP mode by default.

- this change is needed until we can configure the multiboot
  images from the boot loader again.
2012-01-25 19:02:13 +00:00
Tomas Hruby
9e1d244cbe Revert 93b9873a56
- non need to have free PDEs per CPU since we only run one
  instance of the kernel at any time
2012-01-25 18:59:18 +00:00
Thomas Veerman
a6d0ee24c3 Use correct value for _NSIG
User processes can send signals with number up to _NSIG. There are a few
signal numbers above that used by the kernel, but should explicitly not
be included in the range or range checks in PM will fail.

The system processes use a different version of sigaddset, sigdelset,
sigemptyset, sigfillset, and sigismember which does not include a range
check on signal numbers (as opposed to the normal functions used by normal
processes).

This patch unbreaks test37 when the boot image is compiled with GCC/Clang.
2012-01-16 11:42:29 +00:00
Tomas Hruby
758d788bbe SMP - asyn send SMP safe
- we must not deliver messages from/to unstable address spaces.
  In such a case, we must postpone the delivery. To make sute
  that a process which is expecting an asynchronous message does
  not starve, we must remember that we skipped delivery of some
  messages and we must try to deliver again once the source
  address space is stable again.
2012-01-13 11:30:01 +00:00
Tomas Hruby
0bb56e0e04 SMP - smp_schedule()
- always issues an IPI
2012-01-13 11:30:01 +00:00
Tomas Hruby
41bd5f2fc6 SMP - cpu_is_idle made volatile 2012-01-13 11:30:00 +00:00
Tomas Hruby
8fa95abae4 SMP - fixed usage of stale TLB entries
- when kernel copies from userspace, it must be sure that the TLB
  entries are not stale and thus the referenced memory is correct

- everytime we change a process' address space we set p_stale_tlb
  bits for all CPUs.

- Whenever a cpu finds its bit set when it wants to access the
  process' memory, it refreshes the TLB

- it is more conservative than it needs to be but it has low
  overhead than checking precisely
2012-01-13 11:30:00 +00:00
Tomas Hruby
0a55e63413 SMP - fixed IPI livelock
- two CPUs can issue IPI to each other now without any hazzard

- we must be able to handle synchronous scheduling IPIs from
  other CPUs when we are waiting for attention from another one.
  Otherwise we might livelock.

- necessary barriers to prevent reordering
2012-01-13 11:30:00 +00:00
Tomas Hruby
0468fca72b SMP - do_update fix
- adjust_proc_slot() must preserve scheduling info, for example
  on which cpu the process should run

- do_update() - consitency check
2012-01-13 11:30:00 +00:00
Tomas Hruby
192db70960 KERNEL - cause SIGSEGV if bad pointer to kernel 2012-01-13 11:30:00 +00:00
Tomas Hruby
c82a5dd3e3 KERNEL - mini_senda simplification 2012-01-13 11:29:59 +00:00
Tomas Hruby
e4d46a2146 KERNEL - has_pending() not exposed
- has_pending() takes a special argument that tells the code
  whether we are scanning for asynchronous message or something
  else.

- has_pending() is not used directly anymore

- the new functions are wrappings around has_pending() to make
  the use more comfortable.

- these functions should become static inline eventually
2012-01-13 11:29:59 +00:00
Tomas Hruby
8d0a1f71bf KERNEL - do_privctl() fix
- after a driver is restarted, do not register permissions
  which are already set again.
2012-01-13 11:29:59 +00:00
Antoine Leca
36d29dedd5 Allow clang for kernel compilation
Remove .ident sections, and force separations of .text and
.data sections into separate program headers, for the benefit
of the check done by MINIX boot monitor in multiboot mode.
2012-01-12 13:36:22 +01:00
Ben Gras
7cd4002083 vm: clear map cache after kernel requests
. fixes a dirty tlb situation (i.e. random crashes)
	  on some hardware, seemingly new intel architectures
	  (e.g. my desktop i7 machine)
2012-01-11 01:15:35 +01:00
Tomas Hruby
aca5862db1 SMP - kernel links again 2011-12-20 13:05:25 +00:00
Tomas Hruby
9cd53f1cc0 SMP - fixed compilation and removed warnings 2011-12-20 12:58:20 +00:00
David van Moolenbroek
84662ec4b3 libsys: unbreak getidle() 2011-12-16 16:06:09 +00:00
Ben Gras
21168577a5 add -L for future compiler-rt lib location 2011-12-08 18:07:57 +01:00
David van Moolenbroek
1e1db53986 Introduce sys_getregs call, and let vfs use it 2011-11-22 02:07:33 +01:00
David van Moolenbroek
b02c260ecb Miscellaneous legacy cleanup 2011-11-07 22:20:55 +01:00
David van Moolenbroek
0f3423cd75 Kernel: fix compilation with DEBUG_RACE on 2011-11-07 19:59:02 +01:00
David van Moolenbroek
8b00ebde78 Kernel: remove unused MF_ASYNMSG 2011-11-01 19:21:19 +00:00
Arun Thomas
8b4492ed1c kernel: remove unused var 2011-11-02 18:45:08 +01:00
David van Moolenbroek
1992529666 Kernel: fix for senda erroneously setting errors
Bug reported and fixed by Arne Welzel.
2011-10-31 18:43:37 +00:00
Arun Thomas
f71ec49525 kernel: Remove legacy boot vars from pre_init 2011-09-19 16:39:51 +02:00
Arun Thomas
cb54d96eec Remove legacy boot monitor vars 2011-09-16 20:10:47 +02:00
Arun Thomas
46581e701a Add MKBOOTPARAM option 2011-09-16 17:31:07 +02:00
Arun Thomas
92fa3189ab MKSYSDEBUG: conditionally compile more debug code 2011-09-16 15:25:26 +02:00
Arun Thomas
8a0901c4cb Add MKTRACE 2011-09-07 17:52:48 +02:00
Arun Thomas
4ca68d42a0 Add MKLIVEUPDATE and MKSTATECTL 2011-09-02 16:57:22 +02:00
Arun Thomas
27c0e801f2 Cleaner MKSYSDEBUG option 2011-08-18 15:21:29 +02:00
Arun Thomas
593e3221fc Rename MKDEBUG to MKSYSDEBUG 2011-08-16 22:30:10 +02:00
Arun Thomas
40592de32d Optionally disable kernel debug code 2011-08-16 17:18:55 +02:00
Ben Gras
58c4a9b5f4 kernel: don't use -ffreestanding
. workaround for clang's stdint.h __STDC_HOSTED__ test
	  that causes the host stdint.h to be ignored for -ffreestanding,
	  causing a type to be double-defined in the kernel
2011-08-13 11:04:37 +00:00
Ben Gras
ca5e8b2c2d kernel: show segment-adjusted pagefault addr 2011-08-12 15:16:52 +00:00
Ben Gras
35cc7fbeb8 kernel: invlpg facility
. only use for single-page invalidations initially
	. shows tiny but statistically significant performance
	  improvement; will be more helpful in certain VM debug
	  modes
2011-08-12 13:08:27 +00:00
Arun Thomas
862fb8354d minix.ack.mk: use CPPFLAGS for ACK asm files 2011-08-05 14:16:48 +02:00
Ben Gras
c484bc1dc8 unbreak oxpcie in kernel 2011-08-04 17:26:39 +00:00
Arun Thomas
d69519f86a kernel: don't build cprofile code by default 2011-08-02 15:25:54 +02:00
Arun Thomas
aaefc6f838 Add MKMCONTEXT option 2011-08-02 13:57:31 +02:00
Arun Thomas
ae561b8f12 Add MKAPIC and MKACPI options 2011-07-31 16:22:43 +02:00
Arun Thomas
1a8cf59d04 Add MKWATCHDOG option 2011-07-29 20:37:39 +02:00
Ben Gras
01b152d6d9 kernel: add prototype for inkernel_disaster 2011-07-22 15:19:40 +02:00
Ben Gras
b984fa41df Revert "print kernel stacktrace for exceptions in kernel"
This reverts commit eff1369cab.

This was in a working branch and I only intended to commit
exception.c. But I committed the exact inverse. Sorry.
2011-07-22 15:01:44 +02:00
Erik van der Kouwe
dcc683b4ae Also compile the kernel as i586 (instead of i386) 2011-07-22 13:16:10 +02:00
Ben Gras
eff1369cab print kernel stacktrace for exceptions in kernel
fpu alignment check feature, checksum feature
2011-07-22 11:03:45 +00:00
Ben Gras
7ee78ffb82 kernel: improve exception debug printing
. fold 2 exception-in-kernel cases (pagefault and rest)
	  into 1
	. for exceptions that occur in kernel, don't just print
	  kernel stacktrace (typically that is just the exception
	  handler) but also the stacktrace of when the exception
	  happened
2011-07-22 10:57:08 +00:00
Arun Thomas
c356e9997e kernel: fix GCC warnings 2011-07-18 19:44:59 +02:00