Commit graph

331 commits

Author SHA1 Message Date
Olivier Houchard acc48b2a89 Try harder to detect if the allocated memory for L2 PTP comes from a 1MB
section or not.

Approved by:	re (blanket)
2005-06-16 13:23:39 +00:00
Olivier Houchard a56da6d0d2 Don't pass the kernel_pmap to pmap_fault_fixup() if the fault comes from
kernel mode, always use the curthread pmap instead. There are valid cases
were we can fault on a user address from the kernel without pcb_onfault
being set.

Approved by:	re (blanket)
2005-06-16 13:21:52 +00:00
Olivier Houchard 8f47151b3b Remove the last use of pmap_initialized. 2005-06-10 13:31:30 +00:00
Alan Cox 1c245ae7d1 Introduce a procedure, pmap_page_init(), that initializes the
vm_page's machine-dependent fields.  Use this function in
vm_pageq_add_new_page() so that the vm_page's machine-dependent and
machine-independent fields are initialized at the same time.

Remove code from pmap_init() for initializing the vm_page's
machine-dependent fields.

Remove stale comments from pmap_init().

Eliminate the Boolean variable pmap_initialized from the alpha, amd64,
i386, and ia64 pmap implementations.  Its use is no longer required
because of the above changes and earlier changes that result in physical
memory that is being mapped at initialization time being mapped without
pv entries.

Tested by: cognet, kensmith, marcel
2005-06-10 03:33:36 +00:00
Joseph Koshy f263522a45 MFP4:
- Implement sampling modes and logging support in hwpmc(4).

- Separate MI and MD parts of hwpmc(4) and allow sharing of
  PMC implementations across different architectures.
  Add support for P4 (EMT64) style PMCs to the amd64 code.

- New pmcstat(8) options: -E (exit time counts) -W (counts
  every context switch), -R (print log file).

- pmc(3) API changes, improve our ability to keep ABI compatibility
  in the future.  Add more 'alias' names for commonly used events.

- bug fixes & documentation.
2005-06-09 19:45:09 +00:00
Olivier Houchard 7fde88ae25 Use tabs, not spaces.
Reported by:	ru
2005-06-09 15:05:09 +00:00
Olivier Houchard d9948bbcbf Add ata stuff. 2005-06-09 12:32:15 +00:00
Olivier Houchard f60e923b23 - MFp4: modify slightly the arm intr API, there's arm CPUs with more than 32
interrupts.
- Implement teardown methods where appropriate.
2005-06-09 12:26:20 +00:00
Olivier Houchard 56e472e2b5 Add a new arm-specific option, ARM_USE_SMALL_ALLOC. If defined, it provides
an implementation of uma_small_alloc() which tries to preallocate memory
1MB per 1MB, and maps it into a section mapping.
2005-06-07 23:04:24 +00:00
Olivier Houchard 094df9739b Bring in bits I forgot while importing write back support for arm9. 2005-06-03 19:49:53 +00:00
Olivier Houchard c8a2d8f19c Remove a useless printf. 2005-06-03 15:15:26 +00:00
Marcel Moolenaar 470cd51ee6 Create nexus in configure_first() instead of in configure(). This
makes sure that sysinit tasks that run after configure_first(),
but before configure() have a nexus to hang devices off.
2005-05-29 23:44:22 +00:00
Marcel Moolenaar e085487fe8 Call cninit_finish() and set cold to 0 in configure_final() instead
of in configure(). Call cninit_finish() before setting cold to 0.
This is how it's done for other platforms. Be alike to avoid problems.
2005-05-29 22:45:36 +00:00
Yoshihiro Takahashi d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Olivier Houchard 2e2955f6f6 Remove pmap_deactivate(), we do not use it. 2005-05-27 00:45:39 +00:00
Olivier Houchard e59bc6b04e s/_KLD_MODULE/KLD_MODULE/ 2005-05-26 16:05:22 +00:00
Olivier Houchard c6ec1ba390 Don't enable interrupts in the dispatcher, there's no need to do so. 2005-05-26 15:02:47 +00:00
Olivier Houchard 9aeb6688ad Don't call vm_page_dirty() in pmap_nuke_pv(), it's not the place to do so, and
it leads to funny things, such as pmap_remove_all() marking the page as dirty.
2005-05-26 15:01:13 +00:00
Olivier Houchard 08a94fbcf9 Remove bits specific to CPUs we won't support (< armv4). 2005-05-25 13:46:32 +00:00
Olivier Houchard a0e94dd924 Increase the refresh rate. 2005-05-25 13:44:55 +00:00
Olivier Houchard 5b45c9f2a1 MFp4: Setup arm9 to write back by default.
Obtained from:	NetBSD
2005-05-24 23:57:22 +00:00
Olivier Houchard ef6f667f2e Remove kcopy(), we don't use it. 2005-05-24 23:55:09 +00:00
Olivier Houchard ad0557149f We need to decrease p->p_lock after vm_fault() has been called. 2005-05-24 23:06:02 +00:00
Olivier Houchard 47b3d09bb0 Correctly setup the UND stack in cpu_set_upcall(), and the trapframe in
cpu_thread_setup(), as done in cpu_fork().
2005-05-24 23:05:26 +00:00
Olivier Houchard 15ba408fd7 - Try to avoid calling malloc() in bus_dmamap_create() and bus_dmamem_alloc()
for the dmamap by using static dmamaps.
- Don't do anything for BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE in
bus_dmamap_sync(), it's not needed anymore.
2005-05-24 22:10:35 +00:00
Olivier Houchard f1f49518d4 Write back affected pages in pmap_qremove() as well. This removes the need
to change the DACR when switching to a kernel thread, thus making
userland thread => kernel thread => same userland thread switch cheaper by
totally avoiding data cache and TLB invalidation.
2005-05-24 21:47:10 +00:00
Olivier Houchard 04e48248ca Use a more sane value for HZ. 2005-05-24 21:45:26 +00:00
Olivier Houchard 0f18d3256d Use asm versions of in_cksum() and friends. 2005-05-24 21:44:34 +00:00
Olivier Houchard fdc05f7913 Asm version of bswap16().
Obtained from: 	NetBSD
2005-05-24 21:43:16 +00:00
Olivier Houchard fa7e20fdd4 Make sure we clean the RAS start address once we're done.
This fixes the random segfaults which occurs at high interrupts rate.
2005-05-24 21:42:31 +00:00
Olivier Houchard e85d3fc3c8 Don't forget to copy the TP when forking, or bad things will happen to the
child process if it tries to use threads.
2005-05-11 21:20:42 +00:00
Olivier Houchard a74efe926c Allocating the memory for the kernel stack one time is enough. 2005-04-27 13:29:54 +00:00
Olivier Houchard 42722183bf Don't use fusufault in casuptr(), as it assumes the current PCB will be
stored in r2, which can't be easily done with casuptr(). Introduce
casuptrfault instead.
2005-04-23 16:45:04 +00:00
David Xu 21fc316430 Change cpu_set_kse_upcall to more generic style, so we can reuse it
in other codes. Add cpu_set_user_tls, use it to tweak user register
and setup user TLS. I ever wanted to merge it into cpu_set_kse_upcall,
but since cpu_set_kse_upcall is also used by M:N threads which may
not need this feature, so I wrote a separated cpu_set_user_tls.
2005-04-23 02:32:32 +00:00
Marcel Moolenaar ff7125a623 Add empty header (except of the multiple-inclusion protection) to
get hwpmc(4) to compile on this platform.
2005-04-20 18:44:53 +00:00
Warner Losh 06db52b609 Break out the definition of bus_space_{tag,handle}_t and a few other types
into _bus.h to help with name space polution from including all of bus.h.
In a few days, I'll commit changes to the MI code to take advantage of thse
sepration (after I've made sure that these changes don't break anything in
the main tree, I've tested in my trees, but you never know...).

Suggested by: bde (in 2002 or 2003 I think)
Reviewed in principle by: jhb
2005-04-18 21:45:34 +00:00
Olivier Houchard 758e4f6878 Unbreak the vector_page == 0x00000000 case. Map the vector page L1PT into the
kernel domain for each pmap, as we don't update the page table when we're
switching to a kernel thread, but we do however update the DACR.
2005-04-14 14:32:32 +00:00
Olivier Houchard f5c4c316eb pmap_update() is gone. 2005-04-13 16:02:03 +00:00
John Baldwin aa9aa68d2f Use PCPU_LAZY_INC() for cnt.v_{intr,trap,syscalls} rather than atomic
operations in some places and simple non-per CPU math in others.
2005-04-12 23:18:54 +00:00
Olivier Houchard ec2b39b483 We have an asm version of bcmp(), so we could use it as well. 2005-04-12 22:46:09 +00:00
Olivier Houchard ebc58b7dbc Don't announce the range SDRAM_START-freemempos until I figure out what's
going on, it produces random memory corruption.
2005-04-07 22:04:18 +00:00
Olivier Houchard d4d0079826 pmap_update() is gone. 2005-04-07 22:03:34 +00:00
Olivier Houchard 2d93998b00 Import a basic implementation of the restartable atomic sequences to provide
atomic operations to userland (this is OK for UP only, but SMP is still so
far away).
2005-04-07 22:03:04 +00:00
Olivier Houchard 139e3f7c33 - Try harder to report dirty page.
- Garbage-collect pmap_update(), it became quite useless.
2005-04-07 22:01:53 +00:00
John Baldwin c6a37e8413 Divorce critical sections from spinlocks. Critical sections as denoted by
critical_enter() and critical_exit() are now solely a mechanism for
deferring kernel preemptions.  They no longer have any affect on
interrupts.  This means that standalone critical sections are now very
cheap as they are simply unlocked integer increments and decrements for the
common case.

Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter()
and spinlock_exit().  This KPI is responsible for providing whatever MD
guarantees are needed to ensure that a thread holding a spin lock won't
be preempted by any other code that will try to lock the same lock.  For
now all archs continue to block interrupts in a "spinlock section" as they
did formerly in all critical sections.  Note that I've also taken this
opportunity to push a few things into MD code rather than MI.  For example,
critical_fork_exit() no longer exists.  Instead, MD code ensures that new
threads have the correct state when they are created.  Also, we no longer
try to fixup the idlethreads for APs in MI code.  Instead, each arch sets
the initial curthread and adjusts the state of the idle thread it borrows
in order to perform the initial context switch.

This change is largely a big NOP, but the cleaner separation it provides
will allow for more efficient alternative locking schemes in other parts
of the kernel (bare critical sections rather than per-CPU spin mutexes
for per-CPU data for example).

Reviewed by:	grehan, cognet, arch@, others
Tested on:	i386, alpha, sparc64, powerpc, arm, possibly more
2005-04-04 21:53:56 +00:00
Olivier Houchard 7fc53c7b12 Bring in a version of float.h more correct for softfloat. 2005-03-20 00:34:24 +00:00
Olivier Houchard 3ea9d07445 Bring back some of the cleanups and fixes jmg did in the TS7200 port. 2005-03-17 23:01:15 +00:00
Olivier Houchard 4290208c24 Use PCIR_BARS instead of PCIR_MAPS. 2005-03-17 00:43:57 +00:00
Olivier Houchard 2eeafe13a6 Introduce a new function, pmap_wb_page(), which check all userland mappings for
a given page and, if the pmap is the current pmap, write back the associated
cache line.
Use pmap_wb_page in pmap_qenter() instead of inconditionally
write back/invalidating the data cache.
2005-03-16 23:56:29 +00:00
John-Mark Gurney 98c8f18cf0 MFp4: add in making fiq's work by coping to the correct page incase we have
the vectors relocated high..
2005-03-16 07:56:21 +00:00