aboutsummaryrefslogtreecommitdiff
path: root/sys/ia64
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate need for __RMAN_RESOURCE_VISIBLEPoul-Henning Kamp2005-10-061-6/+4
| | | | | | | Reviewed by: marcel@ Notes: svn path=/head/; revision=151006
* Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57,Robert Watson2005-09-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | | osf1_signal.c:1.41, amd64/amd64/trap.c:1.291, linux_socket.c:1.60, svr4_fcntl.c:1.36, svr4_ioctl.c:1.23, svr4_ipc.c:1.18, svr4_misc.c:1.81, svr4_signal.c:1.34, svr4_stat.c:1.21, svr4_stream.c:1.55, svr4_termios.c:1.13, svr4_ttold.c:1.15, svr4_util.h:1.10, ext2_alloc.c:1.43, i386/i386/trap.c:1.279, vm86.c:1.58, unaligned.c:1.12, imgact_elf.c:1.164, ffs_alloc.c:1.133: Now that Giant is acquired in uprintf() and tprintf(), the caller no longer leads to acquire Giant unless it also holds another mutex that would generate a lock order reversal when calling into these functions. Specifically not backed out is the acquisition of Giant in nfs_socket.c and rpcclnt.c, where local mutexes are held and would otherwise violate the lock order with Giant. This aligns this code more with the eventual locking of ttys. Suggested by: bde Notes: svn path=/head/; revision=150663
* Implement 32 bit getcontext/setcontext/swapcontext on amd64. I've addedPeter Wemm2005-09-271-0/+21
| | | | | | | | stubs for ia64 to keep it compiling. These are used by 32 bit apps such as gdb. Notes: svn path=/head/; revision=150631
* Add a new atomic_fetchadd() primitive that atomically adds a value to aJohn Baldwin2005-09-271-0/+19
| | | | | | | | | | | | variable and returns the previous value of the variable. Tested on: i386, alpha, sparc64, arm (cognet) Reviewed by: arch@ Submitted by: cognet (arm) MFC after: 1 week Notes: svn path=/head/; revision=150627
* Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),Robert Watson2005-09-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment). Modify all consumers of uprintf() and tprintf() to hold Giant around calls into these functions. In most cases, this means adding an acquisition of Giant immediately around the function. In some cases (nfs_timer()), it means acquiring Giant higher up in the callout. With these changes, UFS no longer panics on SMP when either blocks are exhausted or inodes are exhausted under load due to races in the tty code when running without Giant. NB: Some reduction in calls to uprintf() in the svr4 code is probably desirable. NB: In the case of nfs_timer(), calling uprintf() while holding a mutex, or even in a callout at all, is a bad idea, and will generate warnings and potential upset. This needs to be fixed, but was a problem before this change. NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having non-MPSAFE tty code. MFC after: 1 week Notes: svn path=/head/; revision=150335
* Introduce a kernel config for the Mandatory Access Control framework.Christian S.J. Peron2005-09-181-0/+28
| | | | | | | | | | | This kernel config briefly describes some of the major MAC policies available on FreeBSD. The hope is that this will raise the awareness about MAC and get more people interested. Discussed with: scottl Notes: svn path=/head/; revision=150270
* Eliminate unused definitions.Alan Cox2005-09-112-8/+1
| | | | Notes: svn path=/head/; revision=150008
* Canonize the include of acpi.h.David E. O'Brien2005-09-114-4/+4
| | | | Notes: svn path=/head/; revision=150003
* Merge db_interface.c and db_trace.c into db_machdep.c.Marcel Moolenaar2005-09-102-337/+290
| | | | Notes: svn path=/head/; revision=149926
* Move the prototypes of db_md_set_watchpoint(), db_md_clr_watchpoint()Marcel Moolenaar2005-09-101-4/+0
| | | | | | | and db_md_list_watchpoints() to ddb/ddb.h. Notes: svn path=/head/; revision=149925
* Move the ia32_sigcode structure from ia32_sigtramp.c to ia32_signal.c.Marcel Moolenaar2005-09-102-44/+19
| | | | | | | It's a bit excessive to have it in a file of its own. Notes: svn path=/head/; revision=149924
* Remove redundant $FreeBSD$Marcel Moolenaar2005-09-101-2/+0
| | | | Notes: svn path=/head/; revision=149923
* Change the High FP lock from a sleep lock to a spin lock. We canMarcel Moolenaar2005-09-094-16/+16
| | | | | | | | | take the lock from interrupt context, which causes an implicit lock order reversal. We've been using the lock carefully enough that making it a spin lock should not be harmful. Notes: svn path=/head/; revision=149915
* Milestone: enable SMP by default.Marcel Moolenaar2005-09-051-1/+1
| | | | Notes: svn path=/head/; revision=149807
* o In pmap_remove_pte: always invalidate the page. Previously the pageMarcel Moolenaar2005-09-051-13/+11
| | | | | | | | | | | | | | | was not invalidated if the PTE was not actually being removed. In an UP kernel this didn't cause problems, because the new mapping would preempt the old one. In an SMP kernel this could lead to the use of stale translations when processes move between CPUs at the "right" moment. This fixes the last of the obvious SMP problems and it should be safe to enable SMP by default now. o In pmap_remove_pte: minor code refactoring to avoid duplication. o Test all PTE pointers against NULL. Don't use implicit boolean tests. Notes: svn path=/head/; revision=149806
* o s/vhpt_size/pmap_vhpt_log2size/gMarcel Moolenaar2005-09-033-48/+88
| | | | | | | | | | | | | | | | | o s/vhpt_base/pmap_vhpt_base/g o s/vhpt_bucket/pmap_vhpt_bucket/g o Declare the above in <machine/pmap.h> o Move the vm.stats.vhpt.* sysctls to machdep.vhpt.* o Create a tunable machdep.vhpt.log2size, with corresponding sysctl. The tunable allows the user to specify the VHPT size from the loader. o Don't keep track of the number of PTEs in the VHPT. Calculate the population when necessary by iterating the buckets and summing up the length of the buckets. o Don't perform the tpa instruction with a bucket lock held. The instruction can (theoretically) fault and locking is not needed. Notes: svn path=/head/; revision=149777
* Fix collision chain termination checks. The result of IA64_PHYS_TO_RR7Marcel Moolenaar2005-09-031-16/+18
| | | | | | | | | | | | | is never 0, so one cannot test for a NULL pointer after a physical address is translated into a virtual pointer with said macro. Instead, keep the physical address around and test it against 0. Note that this obviously implies that a PTE can never be allocated at physical address 0. This isn't exactly guaranteed, but hasn't been a problem so far. We test the physical address against 0 for as long as the ia64 port exists... Notes: svn path=/head/; revision=149770
* Pass a value of type vm_prot_t to pmap_enter_quick() so that it determineAlan Cox2005-09-031-3/+4
| | | | | | | whether the mapping should permit execute access. Notes: svn path=/head/; revision=149768
* Move MINSIGSTKSZ from <machine/signal.h> to <machine/_limits.h> and renameStefan Farfeleder2005-08-202-5/+3
| | | | | | | | | | | | | it to __MINSIGSTKSZ. Define MINSIGSTKSZ in <sys/signal.h>. This is done in order to use MINSIGSTKSZ for the macro PTHREAD_STACK_MIN in <pthread.h> (soon <limits.h>) without having to include the whole <sys/signal.h> header. Discussed with: bde Notes: svn path=/head/; revision=149337
* Remove the execute permission for stacks.Marcel Moolenaar2005-08-141-1/+1
| | | | Notes: svn path=/head/; revision=149062
* o s/pmap_lpte_/pmap_/gMarcel Moolenaar2005-08-131-80/+52
| | | | | | | o Remove pmap_is_referenced(). It was already compiled-out. Notes: svn path=/head/; revision=149037
* Fix the problem with the IPI for the lazy context switching of theMarcel Moolenaar2005-08-132-2/+5
| | | | | | | | | | | | | | high FP registers. It was not that the IPI got lost due to the perceived unreliability of the IPI delivery, but rather that the IPI was not assigned a vector (ugh). Sending a 0 vector to a CPU results in a stray external interrupt. Add a KASSERT to ipi_send() to catch this. The initialization of the IPIs could be better, but it's not at all sure what the future of the code is. Avoid wasting a lot of time on something that is going to be rewritten anyway. Notes: svn path=/head/; revision=149036
* Improve SMP support:Marcel Moolenaar2005-08-069-320/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Allocate a VHPT per CPU. The VHPT is a hash table that the CPU uses to look up translations it can't find in the TLB. As such, the VHPT serves as a level 1 cache (the TLB being a level 0 cache) and best results are obtained when it's not shared between CPUs. The collision chain (i.e. the hash bucket) is shared between CPUs, as all buckets together constitute our collection of PTEs. To achieve this, the collision chain does not point to the first PTE in the list anymore, but to a hash bucket head structure. The head structure contains the pointer to the first PTE in the list, as well as a mutex to lock the bucket. Thus, each bucket is locked independently of each other. With at least 1024 buckets in the VHPT, this provides for sufficiently finei-grained locking to make the ssolution scalable to large SMP machines. o Add synchronisation to the lazy FP context switching. We do this with a seperate per-thread lock. On SMP machines the lazy high FP context switching without synchronisation caused inconsistent state, which resulted in a panic. Since the use of the high FP registers is not common, it's possible that races exist. The ia64 package build has proven to be a good stress test, so this will get plenty of exercise in the near future. o Don't use the local ID of the processor we want to send the IPI to as the argument to ipi_send(). use the struct pcpu pointer instead. The reason for this is that IPI delivery is unreliable. It has been observed that sending an IPI to a CPU causes it to receive a stray external interrupt. As such, we need a way to make the delivery reliable. The intended solution is to queue requests in the target CPU's per-CPU structure and use a single IPI to inform the CPU that there's a new entry in the queue. If that IPI gets lost, the CPU can check it's queue at any convenient time (such as for each clock interrupt). This also allows us to send requests to a CPU without interrupting it, if such would be beneficial. With these changes SMP is almost working. There are still some random process crashes and the machine can hang due to having the IPI lost that deals with the high FP context switch. The overhead of introducing the hash bucket head structure results in a performance degradation of about 1% for UP (extra pointer indirection). This is surprisingly small and is offset by gaining reasonably/good scalable SMP support. Notes: svn path=/head/; revision=148807
* Reduce the default MAXCPU from 16 to 4. This is in preparation ofMarcel Moolenaar2005-08-061-1/+1
| | | | | | | | | | | allocating a VHPT per CPU. Since we don't yet know how many CPUs are actually in the system at the time we need to allocate the VHPTs, we allocate for MAXCPU processors. This can result in a lot of wasted space for 2-way machines. So, for now, limit MAXCPU to something smaller until we have something more dynamic. Notes: svn path=/head/; revision=148805
* For ia64_ptc_{e,g,ga,l}(), use instruction serialization. WeMarcel Moolenaar2005-08-061-4/+4
| | | | | | | | typically don't know what the TLB described and need to assume that it affects the fetching of instructions. Notes: svn path=/head/; revision=148804
* - Add support for saving stack traces and displaying them via printf(9)Jeff Roberson2005-08-031-0/+13
| | | | | | | | | | and KTR. Contributed by: Antoine Brodin <antoine.brodin@laposte.net> Concept code from: Neal Fachan <neal@isilon.com> Notes: svn path=/head/; revision=148666
* Convert the atomic_ptr() operations over to operating on uintptr_tJohn Baldwin2005-07-151-58/+19
| | | | | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm Notes: svn path=/head/; revision=148067
* Add recently invented COMPAT_FREEBSD5 option.Ken Smith2005-07-141-0/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=147991
* Validate if the value written into {FS,GS}.base is a canonicalDavid Xu2005-07-101-1/+2
| | | | | | | | | | | | address, writting non-canonical address can cause kernel a panic, by restricting base values to 0..VM_MAXUSER_ADDRESS, ensuring only canonical values get written to the registers. Reviewed by: peter, Josepha Koshy < joseph.koshy at gmail dot com > Approved by: re (scottl) Notes: svn path=/head/; revision=147889
* Enhance ia64_flush_dirty() to handle the case in which td != curthread.Marcel Moolenaar2005-07-052-23/+52
| | | | | | | | | | | This case is triggered with ptrace(2) and the PT_SETREGS function. Change the return type of the function to int so that errors can be passed on to the caller. Approved by: re (scottl) Notes: svn path=/head/; revision=147773
* Implement functions calls from within DDB on ia64. On ia64 a functionMarcel Moolenaar2005-07-022-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | pointer doesn't point to the first instruction of that function, but rather to a descriptor. The descriptor has the address of the first instruction, as well as the value of the global pointer. The symbol table doesn't know anything about descriptors, so if you lookup the name of a function you get the address of the first instruction. The cast from the address, which is the result of the symbol lookup, to a function pointer as is done in db_fncall is therefore invalid. Abstract this detail behind the DB_CALL macro. By default DB_CALL is defined as db_fncall_generic, which yields the old behaviour. On ia64 the macro is defined as db_fncall_ia64, in which a descriptor is constructed to yield a valid function pointer. While here, introduce DB_MAXARGS. DB_MAXARGS replaces the existing (local) MAXARGS. The DB_MAXARGS macro can be defined by platforms to create a convenient maximum. By default this will be the legacy 10. On ia64 we define this macro to be 8, for 8 is the maximum number of arguments that can be passed in registers. This avoids having to implement spilling of arguments on the memory stack. Approved by: re (dwhite) Notes: svn path=/head/; revision=147745
* Fix a buglet that was present in the ia64 code and that got inheritedMarcel Moolenaar2005-07-021-0/+1
| | | | | | | | | | | | | | | | | | | | | by amd64 and i386: For buffered writes we collect data and write it out a ${DEV_BSIZE}-sized block at a time. The fragsz variable is used to keep track of how much data we have collected in the buffer so far and it's reset to zero immediately after writing a block to the dump device. When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. Since we currently only need to do buffered writes once, this isn't a problem. However, when kernel dumps are made by hand (say by callling doadump from within DDB), the improperly cleared state from the first call to dumpsys causes the next call to dumpsys to create an invalid code file. This change resets fragsz after flushing the partially filled buffer so that it fixes the two problems at once. Approved by: re (scottl) Notes: svn path=/head/; revision=147740
* Jumbo-commit to enhance 32 bit application support on 64 bit kernels.Peter Wemm2005-06-301-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is good enough to be able to run a RELENG_4 gdb binary against a RELENG_4 application, along with various other tools (eg: 4.x gcore). We use this at work. ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace, procfs and core dumps. procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client and target application. procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their sscanf fails. They expect an unsigned long. imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps. sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note that 64 bit consumers can still debug 32 bit targets. IA64 has got stubs for ia32_reg.c. Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't implemented in the 32/64 wrapper yet. We also make a tiny patch to gdb pacify it over conflicting formats of ld-elf.so.1. Approved by: re Notes: svn path=/head/; revision=147692
* Handle B-unit break instructions. The break.b is unique in that theMarcel Moolenaar2005-06-271-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | immediate is not saved by the architecture. Any of the break.{mifx} instructions have their immediate saved in cr.iim on interruption. Consequently, when we handle the break interrupt, we end up with a break value of 0 when it was a break.b. The immediate is important because it distinguishes between different uses of the break and which are defined by the runtime specification. The bottomline is that when the GNU debugger replaces a B-unit instruction with a break instruction in the inferior, we would not send the process a SIGTRAP when we encounter it, because the value is not one we recognize as a debugger breakpoint. This change adds logic to decode the bundle in which the break instruction lives whenever the break value is 0. The assumption being that it's a break.b and we fetch the immediate directly out of the instruction. If the break instruction was not a break.b, but any of break.{mifx} with an immediate of 0, we would be doing unnecessary work. But since a break 0 is invalid, this is not a problem and it will still result in a SIGILL being sent to the process. Approved by: re (scottl) Notes: svn path=/head/; revision=147640
* Replace the existing copyright notice with my own. Over the years I'veMarcel Moolenaar2005-06-271-23/+19
| | | | | | | | | | changed this file so much that it's equivalent to a rewrite, and I'm not talking about any of the cosmetic changes of course. Approved by: re (scottl) Notes: svn path=/head/; revision=147639
* Cosmetic: s/u_int64_t/uint64_t/gMarcel Moolenaar2005-06-271-7/+7
| | | | | | | Approved by: re (scottl) Notes: svn path=/head/; revision=147638
* Add .cvsignore files just like in sys/<arch>/compiled, this keeps CVS fromDavid E. O'Brien2005-06-201-0/+1
| | | | | | | | | questing kernel config files not in CVS. Approved by: re(kensmith) Notes: svn path=/head/; revision=147504
* Define IPI_PREEMPT. Update a nearby comment while I'm here.Marcel Moolenaar2005-06-121-2/+3
| | | | Notes: svn path=/head/; revision=147322
* Introduce a procedure, pmap_page_init(), that initializes theAlan Cox2005-06-101-33/+20
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=147217
* MFP4:Joseph Koshy2005-06-091-0/+14
| | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=147191
* Create nexus in configure_first() instead of in configure(). ThisMarcel Moolenaar2005-05-291-2/+2
| | | | | | | | makes sure that sysinit tasks that run after configure_first(), but before configure() have a nexus to hang devices off. Notes: svn path=/head/; revision=146794
* Call cninit_finish() in configure_final().Marcel Moolenaar2005-05-291-0/+2
| | | | Notes: svn path=/head/; revision=146791
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-293-73/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* - Move bus dependent defines to {isa,cbus}_dmareg.h.Yoshihiro Takahashi2005-05-141-1/+1
| | | | | | | | | - Use isa/isareg.h rather than <arch>/isa/isa.h. Tested on: i386, pc98 Notes: svn path=/head/; revision=146214
* Don't define _MACHINE_BUS_MEMIO_H_ nor _MACHINE_BUS_PIO_H_.Marcel Moolenaar2005-05-101-3/+0
| | | | Notes: svn path=/head/; revision=146037
* Change cpu_set_kse_upcall to more generic style, so we can reuse itDavid Xu2005-04-231-13/+20
| | | | | | | | | | 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. Notes: svn path=/head/; revision=145433
* Sanity the RTC code:Marcel Moolenaar2005-04-224-398/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | o Remove the clock interface. Not only does it conflict with the MI version when device genclock is added to the kernel, it was also not possible to have more than 1 clock device. This of course would have been a problem if we actually had more than 1 clock device. In short: we don't need a clock interface and if we do eventually, we should be using the MI one. o Rewrite inittodr() and resettodr() to take into account that: 1) We use the EFI interface directly. 2) time_t is 64-bit and we do need to make sure we can determine leap years from year 2100 and on. Add a nice explanation of where leap years come from and why. 3) This rewrite happened in 2005 so any date prior to 1/1/2005 (either M/D/Y or D/M/Y) is bogus. Reprogram the EFI clock with 1/1/2005 in that case. 4) The EFI clock has a high probability of being correct, so only (further) correct the EFI clock when the file system time is larger. That should never happen in a time-synchronised world. Complain when EFI lost 2 days or more. Replace the copyright notice now that I (pretty much) rewrote all of this file. Notes: svn path=/head/; revision=145389
* Add empty header (except of the multiple-inclusion protection) toMarcel Moolenaar2005-04-201-0/+10
| | | | | | | get hwpmc(4) to compile on this platform. Notes: svn path=/head/; revision=145332
* Break out the definition of bus_space_{tag,handle}_t and a few other typesWarner Losh2005-04-182-13/+47
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=145253
* Add a kpte command to DDB. It dumps the PTE of a KVA. This helpsMarcel Moolenaar2005-04-161-0/+20
| | | | | | | to analyze faults and TLB/VHPT inconsistencies. Notes: svn path=/head/; revision=145173