summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
AgeCommit message (Collapse)Author
2015-07-10Avoid calling pool_put(9) while holding a mutex here as well to prevent lockMark Kettenis
order problems. ok sthen@
2015-07-09Prevent possible interrupt recursion before unwinding the stack.Mike Belopuhov
Xen delivers about 20 seconds worth of missed LAPIC timer events after we enable interrupts on application CPUs and this makes us recurse and burn the stack. OK kettenis, guenther, deraadt, "good find" mlarkin
2015-07-02introduce srp, which according to the manpage i wrote is short forDavid Gwynne
"shared reference pointers". srp allows concurrent access to a data structure by multiple cpus while avoiding interlocking cpu opcodes. it manages its own reference counts and the garbage collection of those data structure to avoid use after frees. internally srp is a twisted version of hazard pointers, which are a relative of RCU. jmatthew wrote the bulk of a hazard pointer implementation and changed bpf to use it to allow mpsafe access to bpfilters. however, at s2k15 we were trying to apply it to other data structures but the memory overhead of every hazard pointer would have blown out significantly in several uses cases. a bulk of our time at s2k15 was spent reworking hazard pointers into srp. this diff adds the srp api and adds the necessary metadata to struct cpuinfo on our MP architectures. srp on uniprocessor platforms has alternate code that is optimised because it knows there'll be no concurrent access to data by multiple cpus. srp is made available to the system via param.h, so it should be available everywhere in the kernel. the docs likely need improvement cos im too close to the implementation. ok mpi@
2015-06-30Clean up a needless check in an if statement.Mike Larkin
ok kettenis@
2015-06-29Fix trap setup for double faults; error pointed out by Wei Liu a few monthsMike Larkin
ago and I forgot to commit this until now. From Wei Liu <wei.liu2 at citrix.com> ok mikeb@, guenther@, ratchov@
2015-06-29Remove some unused #definesMike Larkin
ok guenther@, millert@
2015-06-28Force the return to userspace from execve to go through iretq to get allPhilip Guenther
registers. This lets us kill the special handling of pid 1 in fork and merge {proc,child}_trampoline(). Do the same if ptrace(PT_SETREGS) is used to modify registers. ok mlarkin@ kettenis@
2015-06-28LDT is gone and not coming backPhilip Guenther
2015-06-28Split AST handling from trap() into ast() and get rid of T_ASTFLT.Philip Guenther
Don't skip the AST check when returning from *fork() in the child. Make sure to count interrupts even when they're deferred or stray. testing by krw@, and then many via snapshots
2015-06-25you need to include ddb/db_output.h so you know how to call db_printfDavid Gwynne
inside MP_LOCKDEBUG.
2015-06-24Uninitialized variables; pedro@Miod Vallat
2015-06-24Remove a couple of unused and old #defines that discussed phys and virtMike Larkin
address widths in 1st-gen amd64 cpus. ok kettenis, deraadt, guenther
2015-06-23If the kernel symbols fit completely into the 2 MB alignment holeAlexander Bluhm
after kernel bss but before end of the image, the page tables used the read-only mapping of the hole. When booting a small non-generic kernel, this resulted in a crash, while writing to the page tables later. Make sure that the page tables are created after esym and after end. OK mlarkin@ deraadt@
2015-06-22Add an #ifdef HIBERNATE to allow to build a kernel without hibernate butAlexander Bluhm
with acpi. OK mlarkin@
2015-06-22Make it possible to create write combing mappings through /dev/mem. This isMark Kettenis
done by introducining a magic offset. Pages below this offset are mapped with default memory attributes. Above this offset pages are mapped write combining. ok mlarkin@
2015-06-22document that boot.conf can contain comments;Jason McIntyre
from tilo stritzky thanks miod for help with the diff, and who also noted that leading whitespace gets stripped too;
2015-06-13Parse _CST objects and use the C-states they describe when they're sane.Philip Guenther
testing by many, particularly krw@ and jcs@ tweaks by kettenis@ ok deraadt@
2015-06-07Add a default panic case to a switch statement where code after assumesJonathan Gray
one of the cases was reached. Matches other parts of the mpbios code.
2015-06-07Add CR4_FSGSBASEPhilip Guenther
2015-06-07Enable use of mwait in non-MP boxes and report # of C-substates up to C7,Philip Guenther
truncating trailing zeros. Testing by many as part of a larger change to use ACPI _CST objects ok krw@
2015-06-06Enable rtwn(4) on RAMDISK_CD kernels for upgrades. ok deraadtStefan Sperling
2015-06-04Enable rtwn(4) on amd64.Stefan Sperling
2015-05-30Remove commented out DRMDEBUG/DRM_DEBUG lines. Other drivers don't haveJonathan Gray
similiar lines so drm shouldn't either.
2015-05-29Nuke annoying whitespace nits to shrink some future diffs.Kenneth R Westerback
2015-05-28when machdep.allowaperture sysctl is set to 3, allow concurrent accessJoshua Stein
2015-05-28Save the cpuid(6) eax bits in the cpu_info and report the SENSOR and ARATPhilip Guenther
bits from it. ok krw@ kettenis@
2015-05-24Treat primary cpu like others and put pointer to its GDT in cpu_info.ci_gdtPhilip Guenther
requested by and ok mlarkin@
2015-05-18Do lazy update/reset of the FS.base and %[def]s segment registers: resetingPhilip Guenther
segment registers in cpu_switchto if the old thread had made it to userspace and restoring FS.base only on first return to userspace since context switch. ok mlarkin@
2015-05-13Define END() to set ELF symbol size.Masao Uebayashi
OK miod@
2015-05-11Convert from uiomovei() to uiomove() to prevent short tranfersPhilip Guenther
diff from natano@bitrig, with some additional format and cast tweaks
2015-05-09Cleanup/rejig GPT code to be more readable, support different endianKenneth R Westerback
archs and different sized disk sectors. Make MBR have higher priority than GPT. Add many paranoia checks and associated DPRINTF's to make further development easier. Keep everything hidden behind #ifdef GPT. Tested and ok doug@ mpi@. Nothing bad seen by millert@.
2015-05-05emul_native is only used for kernel threads which can't dump core, soPhilip Guenther
delete coredump_trad(), uvm_coredump(), cpu_coredump(), struct md_coredump, and various #includes that are superfluous. This leaves compat_linux processes without a coredump callback. If that ability is desired, someone should update it to use coredump_elf32() and verify the results... ok kettenis@
2015-04-30Clean up some spacing. No functional changeMike Larkin
2015-04-30Remove SIZE_MAX from limits.h. It was added years ago before weTodd C. Miller
had a proper stdint.h. No ports fallout. OK guenther@ miod@
2015-04-28Explicitly include .codepatch and .codepatchend in .rodata such thatMark Kettenis
the binutils 2.17 linker doesn't make them disappear. ok deraadt@, guenther@
2015-04-25We now following the ABI and always clear cld on function entry, so removePhilip Guenther
the extra CLD instructions from when that wasn't true testing miod@ krw@
2015-04-25cpu_busy_cycle_fcn callback has never been usedPhilip Guenther
2015-04-24Use "softintr_pic0" instead of "softintr_fakepic" when faking aJonathan Gray
struct device so there is enough space in the buffer for a NUL and the unit is included in the string. discussed with deraadt and millert
2015-04-19Add support for x2apic modeStefan Fritsch
This is currently only enabled on hypervisors because on real hardware, it requires interrupt remapping which we don't support yet. But on virtualization it reduces the number of vmexits required per IPI from 4 to 1, causing a significant speed-up for MP guests. ok kettenis@
2015-04-19Add a missing pmap_kremoveStefan Fritsch
Noticed by mlarkin@
2015-04-18It seems that the CPUID lies about the monitor-line size, or at least ourMark Kettenis
interpretation of it isn't quite right. So instead of allocating memory and slicing it based on the parameters returned by CPUID, simply use a member in struct cpu_info like basically all other OSes out there do. Our struct cpu_info is large enough to never cause any overlap. This makes the mwait-based idle loop actually work. We still execute the CPUID instruction to make sure monitor/mwait is properly supported by the hardware we're running on. ok sthen@, deraadt@, guenther@
2015-04-18i386 and amd64 have only one syscall entry point now, so simply thePhilip Guenther
EIP/RIP adjustment for ERESTART ok mlarkin@
2015-04-16Enable ualea(4) where we have uhub(4), these USB device lists cry forMartin Pieuchot
unification...
2015-04-15include header required for DEBUG build; ok jsg@Christian Weisgerber
2015-04-15Unneeded return at the end of a void function.Mike Larkin
2015-04-02use correct capitalization of 'BlackBerry'Jasper Lievisse Adriaanse
"sure" deraadt@
2015-03-31Tracing across an interrupt frame was failing because the trace code thoughtPhilip Guenther
the interrupt frame was at the same address as the frame that was interrupted. Correct the calculated frame pointer for the interrupt frame to have the same offset to the struct trapframe on the stack as does syscall and trap. ok kettenis@ mlarkin@
2015-03-25Save/restore AVX registers and other XSAVE-managed state information whenMark Kettenis
entering/leaving a signal handler like we already do the the FPU and SSE state. This should make it possible to use AVX instructions in signal handlers. ok mlarkin@
2015-03-25Mark CPUID_LEAF inline asm as volatile to prevent the compiler from reorderingMark Kettenis
it with respect to other instructions. ok gunether@, mlarkin@
2015-03-24unwire lmc(4) and san(4).David Gwynne
they do "interesting" things with APIs i want to change, and i can't find any evidence anyone uses them anymore. instead of burning time on changes i cant test, ill take a chance that noone will miss them. no objections from anyone ok mpi@ deraadt@ henning@ sthen@