summaryrefslogtreecommitdiff
path: root/sys/arch
AgeCommit message (Collapse)Author
2015-04-21Remove an extra lcr3 that snuck into pmap_switch during yesterday'sMike Larkin
cleanup, responsible for various reaper panics pointed out on bugs@ this morning. ok deraadt@
2015-04-21Remove a duplicate variable and #define that snuck in, in a previousMike Larkin
commit. ok deraadt@
2015-04-21The ELF psABI for PPC specifies that the stack shall always be 16-byte aligned.Philip Guenther
ok mpi@ deraadt@
2015-04-21rework sgi mutexes to use the owner pointer as the lock.David Gwynne
this is like src/sys/arch/alpha/alpha/mutex.c r1.14. this changes sgi mutexes so they record which cpu owns the lock rather than just if the lock is held or not. the diagnostics compare the owner to the current cpus curcpu() address so they can actually tell if the current cpu holds the lock instead of whether any cpu holds the lock. instead of using custom asm to implement a cas this uses atomic_cas_ptr. while im here i also shuffled the code. on MULTIPROCESSOR systems instead of duplicating code between mtx_enter and mtx_enter_try, mtx_enter simply loops on mtx_enter_try until it succeeds. this also provides an alternative implementation of mutexes on !MULTIPROCESSOR systems that avoids interlocking opcodes. mutexes wont contend on UP boxes, theyre basically wrappers around spls. we can just do the splraise, stash the owner as a guard value for DIAGNOSTIC and return. similarly, mtx_enter_try on UP will never fail, so we can just call mtx_enter and return 1. tested by and ok miod@
2015-04-21Reduce differences between i386 pmap modes.Mike Larkin
ok kettenis@
2015-04-20Remove most static, gives us much better ddb tracebacks from secondaryMiod Vallat
processors.
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-19Remove emulation of oss audio ioctls from linux emulation.Alexandre Ratchov
ok armani, guenther, sthen
2015-04-19Add a missing pmap_kremoveStefan Fritsch
Noticed by mlarkin@
2015-04-19Binary code patching on i386Stefan Fritsch
This commit ports the infrastructure to do binary code patching from amd64. The existing code patching for SMAP is converted to the new infrastruture. ok kettenis@ "should go in" deraadt@
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-17while trying to reproduce lockups on mp alpha i hit anDavid Gwynne
MUTEX_ASSERT_UNLOCKED, but it turns out alpha mutexes arent very friendly to diagnostics on smp systems. alpha mutexes contained an mtx_lock member. when 0 the mutex was unlocked, and when 1 it was locked. the MUTEX_ASSERT_UNLOCKED checked if mtx_lock was 1 to see if the current cpu owned the mutex, but in an mp system another cpu may have set mtx_lock to 1, which causes the assert to fire. this changes alpha mutexes so they record which cpu owns the lock rather than just if the lock is held or not. the diagnostics compare the owner to the current cpus curcpu() address so they can actually tell if the current cpu holds the lock instead of whether any cpu holds the lock. instead of using custom asm to implement a cas this uses atomic_cas_ptr, which on alpha uses gcc cas code. miod says he has far more confidence in the gcc cas than the code that was there before. while im here i also shuffled the code. on MULTIPROCESSOR systems instead of duplicating code between mtx_enter and mtx_enter_try, mtx_enter simply loops on mtx_enter_try until it succeeds. this also provides an alternative implementation of mutexes on !MULTIPROCESSOR systems that avoids interlocking opcodes. mutexes wont contend on UP boxes, theyre basically wrappers around spls. we can just do the splraise, stash the owner as a guard value for DIAGNOSTIC and return. similarly, mtx_enter_try on UP will never fail, so we can just call mtx_enter and return 1. ok miod@
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-14Reduce differences between non-PAE and PAE pmaps. This diff removes anMike Larkin
unneeded disable/enable_intr sequence around the PTE unmap operation.
2015-04-13Now that if_input() set the receiving interface pointer on mbufs for usMartin Pieuchot
there's no need to do it in m_devget(9). Stop passing an ``ifp'' will help for upcoming interface pointer -> index conversion. While here remove unused ``ifp'' argument from m_clget(9) and kill two birds^W layer violations in one commit. ok henning@
2015-04-12Fix some KNF, spacing, and typo issues. Moving the deck chairs around toMike Larkin
reduce differences between PAE and no-PAE i386 pmaps.
2015-04-12Fix some typos in comments, and remove an outdated comment about howMike Larkin
certain pmap structures are allocated. No functional change.
2015-04-12Bring PAE code back to life, in a different form. This diff (via bluhm thenMike Larkin
to deraadt, then myself) brings the PAE pmap on i386 (not touched in any significant way for years) closer to the current non-PAE pmap and allows us to take a big next step toward better i386 W^X in the kernel (similar to what we did a few months ago on amd64). Unlike the original PAE pmap, this diff will not be supporting > 4GB physical memory on i386 - this effort is specifically geared toward providing W^X (via NX) only. There still seems to be a bug removing certain pmap entries when PAE is enabled, so I'm leaving PAE mode disabled for the moment until we can figure out what is going on, but with this diff in the tree hopefully others can help. The pmap functions now operate through function pointers, due to the need to support both non-PAE and PAE forms. My unscientific testing showed less than 0.3% (a third of a percent) slowdown with this approach during a base build. Discussed for months with guenther, kettenis, and deraadt. ok kettenis@, deraadt@
2015-04-10Don't use pa_to_pvh() if we already have the page. Avoids an unused variableMark Kettenis
for non-DIAGNOSTIC kernels. ok deraadt@
2015-04-09Make the sparc64 pmap (more) mpsafe by protecting both the pmap itself and theMark Kettenis
pv lists with a mutex. Some minor code adjustments to prevent holding locks too long. This should make pmap_enter(9), pmap_remove(9) and pmap_page_protect(9) safe to use without holding the kernel lock.
2015-04-08Kill unused function.Martin Pieuchot
2015-04-08I believe UVM is clean now and no managed pages should be in use anymoreMark Kettenis
when we call pmap_release(). Turn debug code into printf and remove the code that tried to mop up. Override Debugger() such that it inserts a trap instruction directly into the code such that we get useful backtraces. This way I don't need to worry about pmap_release() removing pv entries when making this pmap mpsafe.
2015-04-08Check for link status in tsec_start(). Prevent the watchdog from fireingMartin Pieuchot
when no cable is plugged in but the interface is brough up. inputs and ok kettenis@
2015-04-08Convert to if_input().Martin Pieuchot
ok dlg@
2015-04-07Remove a lie, the early boot console does not need any mapping.Martin Pieuchot
In fact we even use the firmware interface for "bsd -c" and "bsd -d". So do the necessary firmware calls before calling initppc() to be able to use printf() really early in the boot sequence.
2015-04-07Convert to if_input().Martin Pieuchot
Tested with simh using a floppy image built by miod@
2015-04-07Do not pass an `ifp' argument to interface input handlers since itMartin Pieuchot
might be overwritten by pseudo-drivers. ok dlg@, henning@
2015-04-07Mark audio interrupt handlers as MPSAFE, they already grab the rightMartin Pieuchot
mutex when necessary. ok kettenis@, ratchov@
2015-04-07Use appropriate memory barriers.Martin Pieuchot
ok kettenis@, miod@
2015-04-03Convert to if_input().Martin Pieuchot
Tested by jsg@ with Qemu
2015-04-02use correct capitalization of 'BlackBerry'Jasper Lievisse Adriaanse
"sure" deraadt@
2015-04-02Merge openpic_init() into openpic_attach(), no functional change.Martin Pieuchot
2015-04-02One function pointer per pic function is enough.Martin Pieuchot
2015-04-02Cleanup function definitions, use only one define for DEBUG and removeMartin Pieuchot
unused headers.
2015-04-02Call if_input() without grabbing the kernel lock first.Mark Kettenis
2015-04-01Add cpu_pae variable (which will be later used to determine if PAE mode isMike Larkin
in use) now so that libkvm can be fixed before the rest of the bulk of PAE support is committed. requested by and ok deraadt@
2015-04-01Run most of the interrupt handler without holding the kernel lock.Mark Kettenis
2015-03-31Make it possisble to disable block address translation mechanism onMartin Pieuchot
processors that support it. Due to the way trap code is patched it is currently not possible to enabled/disable BAT at runtime. ok miod@, kettenis@
2015-03-31Merge two versions of ppc_check_procid().Martin Pieuchot
ok miod@, kettenis@ as part of a larger diff
2015-03-31Tell the firmware to shut down the fan management thread on the lastMartin Pieuchot
generation of G5s. Without this my PowerMac11,2 hang when smu(4) attaches.
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-31zero the frame pointer of the kernel stack of new threads to make ddb tracePhilip Guenther
happier ok dlg@ jsing@ kettenis@ mlarkin@
2015-03-30Remove isp stanzas. qlw is here to stay.Miod Vallat
2015-03-30Add a bus_dma_tag_t for DVMA usage, suitable for use for devices not sittingMiod Vallat
behind a sun4m iommu. Move the existing dvma routines from vm_machdep.c to this new dvma.c; this allows for a few declarations to be removed from public headers. Extend the device attachment arguments (struct confargs) to pass a bus_dma_tag_t. mainbus receives the dvma bus_dma_tag_t, and devices pass the tag unchanged to their children, except for iommu(4) which replaces it with its own. Change the few sun4m-only drivers to pick the bus_dma_tag_t from confargs rather than assume iommu; this allows qlw(4) to attach and work on sun4c. ok kettenis@
2015-03-30Always use the first value of the "interrupts" property the others doMartin Pieuchot
not correspond to the PCI function. Hopefully the first device that I find hitting this case is the second bge(4) interface of my PowerMac11,2.
2015-03-30Add defines for known offsets and magical values, map the correct pageMartin Pieuchot
and enable the mpic on G5 machines and finally introduce some helpers needed for suspend/resume. Is this called a rewrite? In my forest since s2k11, committing now that I need this for supporting Quad G5 machines.
2015-03-29Correctly match SUNW,fas in the boot path.Miod Vallat