Commit Graph

816 Commits

Author SHA1 Message Date
Jan Stoess 37031aa006 - Minor spinlock debugging fix
- In rare cases, we might get a NMI (or breakpoint exception) just after
sys_ipc has been invoked, but _before_ esp has been set to tss.esp0 in that
case, we need to switch stacks manually and preserve the processor-saved
frame. We make sure that, before tss there is enough scratch space to cover
EFLAGS, CS, and EIP saved by the processor; this way, we can get around
without having to spend KDB its own interrupt task gate
2008-01-25 16:24:21 +01:00
Jan Stoess cd7e97b512 - Some nicer debug output when dumping kernel memory configuration 2008-01-25 16:22:59 +01:00
Jan Stoess 7a1166eef8 - If kickstart tells l4 to grab some reserved memory for its own use, there
may be an overlap with boot modules. In that case, relocate the grub modules
and patch the MBI appropriately
2008-01-25 16:22:30 +01:00
Jan Stoess 50f174c618 - Tracebuffer/tracepoint changes improvements:
- Add a scientific notion when printing cycles and pmcs (4 digts + exponent)
 - Increase number of characters after which tracebuffer wraps around
 - Add a tsc filter for dumping tb entries
 - Add a function to dump tracebuffer automatically (tbuf_dump), e.g.
   periodically during timer interrupt
 - Take user tracepoints into account when enabling un-detailed tracing of
   records
 - Allow tp id filter to accept user ids
 - Fix K8 tracebuffer pmcs
 - When recording a tbuf entry, first record pmcs then (finally) the tsc
 - Start tracepoint detail levels with bit 0
 - Allow tracepoint to enter kdb without printing something on the console
 - Use TRACEPOINT_DETAIL for detailed tracing
 - Add some TRACE_..._DETAILS macros
 - Coalesce TRACE_... macros in tracepoints.h
2008-01-25 16:22:15 +01:00
Jan Stoess 50f4602adf - Tracebuffer cleanup and improvements:
- When determining number of records to dump in KDB, incorporate potential
display filters
-  Store tracebuffer size in metadate, and use it user level
- Merge user-level tracebuffer.h from ia32 and amd64
2008-01-18 11:23:39 +01:00
Jan Stoess e135c6a9e1 - Use macro functions for MSR sequences where possible 2008-01-17 12:20:30 +01:00
Jan Stoess 135bc251bc - Rename ia32 -> x86_x32, amd64 -> x86_x64
- Make naming of msrs consistent (X86_MSR_...)
2008-01-17 11:22:38 +01:00
Jan Stoess be46829c0b - Properly initialize count 2008-01-17 11:22:12 +01:00
Jan Stoess 0787b6dc7a - Add a catcher when dumping pagetable entries/tracebuffer items, to avoid
dumping hours and hours worth of items
- Properly calculate wrapped tsc/pmc values in tracebuffer
- Dump tracebuffer header also for when using tracebuffer shortcut 'Y'
2008-01-16 15:53:35 +01:00
Jan Stoess 5bb272212b Don't bail out if an IPI is pending, just return for now 2008-01-16 15:47:15 +01:00
Jan Stoess 997eeb3d4a - Introduce supppoprt for APIC error handling
- Start IOAPIC base after LAPIC LVT irqs
- Use uncacheable mappings for APIC and ACPI memory
-
2008-01-16 13:59:12 +01:00
Jan Stoess e029062e4e - No MIPS64 arch anymore 2008-01-15 20:26:49 +01:00
Jan Stoess 1778440519 - Rearrange functions belonging to generic pagetable walker
- Introduce a specific lookup_mapping(..., cpu) and a default
lookup_mapping(...), which calls the former with the reference_ptab cpu.
2008-01-11 11:10:33 +01:00
Jan Stoess cd7c8ab742 - No need to unmask NMI. 2008-01-11 11:09:13 +01:00
Jan Stoess 19b08d006a - When looking up a mapping, check if pg entry is existing after all 2008-01-11 11:08:47 +01:00
Jan Stoess db2182491c - Typo; thx to Thomas Chen 2008-01-11 11:08:00 +01:00
Jan Stoess aa68216064 - Fix ICR params for broadcasting NMIs 2008-01-11 11:04:44 +01:00
Jan Stoess 599a8f8a6e - Don't send synchronous XCPU requests when in KDB, since peer CPU sleeps
uninterruptible then.
2008-01-11 11:04:08 +01:00
Jan Stoess feefb89c45 - Tracebuffer: merge checking for strings, newlines during reading user buffer
- Tracebuffer: If user buffer was not completely mapped, print a placeholder
2008-01-11 11:02:38 +01:00
Jan Stoess 7793e0171f - Remove data.reference_ptab from pgent(...), since it's the default argument
- Beautify ipc substring debug output
- Small smp_sync bugfix for x64
2008-01-08 17:14:35 +01:00
Jan Stoess 0d972ce1e5 - When syncing smp pagetable entries, sync with reference ptab. 2008-01-08 16:45:00 +01:00
Jan Stoess e86e396e72 - When allocating tcbs, flush tlb via space_t function, otherwise remote
TLBs may get ignored
- When flushing a kernel address from the TLB, always flush remote TLBs
synchronously.
2008-01-08 14:09:58 +01:00
Jan Stoess b506bcee80 Tracebuffer updates:
- Make tracebuffer terminology consistent: each tb record has a type
and an id.
- Add a display type filter and merge it with the record type filter
- Improve readability of tracebuffer output: wrap lines automatically,
divide tsc/pmcs by 1000/1000000 and add 'K'/'M'
- Add 'Y' top level command to quickly print tracebuffer with default
parameters
- Add two different tracepoint types (DEFAULT and DETAIL), so that
detailed recording can be suppressed at runtime
- Use TP_DETAIL type for detailed IPC recording and substitute
TRACE_IPC_DETAILS() by TRACEPOINT(IPC_DETAILS, ...)
- Use TP_DETAIL type when recording context switches
- Improve user level tracebuffer stubs: record both id and type
correctly; generic functions don't need a TID argument, since it's
determined automatically;
2008-01-07 09:32:14 +01:00
Jan Stoess 0333c48c94 - No ARM architecture anymore 2007-12-11 13:21:03 +01:00
Jan Stoess 19a69a7109 - Typo
- Don't pass X86_KDS as argument, not needed on x32
2007-12-10 10:35:13 +01:00
Jan Stoess d5c18d97f8 - Don't need x32-specific debug.h anymore 2007-12-07 19:35:02 +01:00
Jan Stoess e57e39492a - Don't need x32-specific debug.h anymore 2007-12-07 19:34:55 +01:00
Jan Stoess efb6c1946d - indentation fix 2007-12-07 19:34:14 +01:00
Jan Stoess e74038aa60 - Make kdb cpulocal, with cmd_mode being global and static 2007-12-07 19:33:58 +01:00
Jan Stoess 0fe4cf831e - Typo 2007-12-07 19:33:38 +01:00
Jan Stoess b69d605bc7 - Don't trace switches from/to the KDB tcb 2007-12-07 19:33:32 +01:00
Jan Stoess b1c0dce7bb - Don't trace switches from/to the KDB tcb 2007-12-07 19:33:27 +01:00
Jan Stoess fd85699ac6 - Use x86_sleep rather than redunant assembler code 2007-12-07 19:33:09 +01:00
Jan Stoess 646bd7bbbe - Call cpu ctors late, when current_cpu and cpu-local PGTs have been
initialized
2007-12-07 19:32:46 +01:00
Jan Stoess 440a653ddd - kdebug_check_breakin is now kdebug_check_interrupt 2007-12-07 19:32:29 +01:00
Jan Stoess 3d6eb7e4b5 - x32/x64 specific debug.h not needed anymore
- publish  x86_reset() and x86_reboot_scheduled
2007-12-07 19:32:15 +01:00
Jan Stoess e7834268d3 - Introduce a new, SMP-safe scheme to enter the KDB:
- each CPU get's an own KDB tcb,
- entering the KDB is done via switch_to
- the KDB is reentrant in that the stack is always reset to the top
- inter-CPU synchronization is done based on an atomic variable and

NMIs
2007-12-07 19:31:13 +01:00
Jan Stoess 7f20101cb4 - Added compiler memory barrier 2007-12-07 19:30:40 +01:00
Jan Stoess d7f1832a15 - Added get_kdebug_tcb() and kdebug_check_interrupt 2007-12-07 19:30:23 +01:00
Jan Stoess 9bdfc7c014 - typo 2007-12-07 19:28:52 +01:00
Jan Stoess a59178f0b2 - Added a function to perform an iret to the current code location (e.g., to
re-enable NMIs).
2007-12-07 19:28:45 +01:00
Jan Stoess 296f0aa9b3 - Add SIMICS cache line configuration 2007-12-07 19:28:37 +01:00
Jan Stoess 862df7e18e - Added a function to perform an iret to the current code location (e.g., to
re-enable NMIs).
2007-12-07 19:28:24 +01:00
Jan Stoess 8199813781 - Avoid sloppy lingo 2007-12-07 19:24:38 +01:00
Jan Stoess 3996a048f9 - Added a function to perform an iret to the current code location (e.g., to
re-enable NMIs).
2007-12-07 19:24:30 +01:00
Jan Stoess 0ab0c02d81 - Move assigment operators to top
- Added function to compare and exchage
2007-12-07 19:02:42 +01:00
Jan Stoess 530c77a309 - Add function to broadcast NMI 2007-12-07 19:02:22 +01:00
Jan Stoess dff75e1e94 - kdebug_check_breakin is now kdebug_check_interrupt 2007-12-07 19:02:13 +01:00
Jan Stoess c808852629 - Add some missing XCPU irq functionality
- Introduce TRACEPOINT-based IRQ debugging
- Bugfix IRQ TCB migration
2007-12-07 19:01:52 +01:00
Jan Stoess b7b61e7913 - halt the processor during getc if config option is enabled 2007-12-07 19:00:49 +01:00