summaryrefslogtreecommitdiffstats
path: root/sys/ia64
Commit message (Collapse)AuthorAgeFilesLines
* Add the options DEADLKRES (introducing the deadlock resolver thread) inattilio2010-02-101-0/+1
| | | | | | | | | | the 'debugging' section of any HEAD kernel and enable for the mainstream ones, excluding the embedded architectures. It may, of course, enabled on a case-by-case basis. Sponsored by: Sandvine Incorporated Requested by: emaste Discussed with: kib
* Fix single-stepping when the kernel was entered through the EPC syscallmarcel2010-02-061-4/+5
| | | | | | | path. When the taken branch leaves the kernel and enters the process, we still need to execute the instruction at that address. Don't raise SIGTRAP when we branch into the process, but enable single-stepping instead.
* In pci_cfgregread() and pci_cfgregwrite(), validate the arguments and checkmarcel2010-01-281-14/+49
| | | | that the alignment matches the width of the read or write.
* In cpu_switch(), use an atomic operation to set the td_lockmarcel2010-01-271-1/+1
| | | | | | of the old thread to the mutex that's passed. Pointed out by: attilio, jhb
* Remove cpu_boot() and call efi_reset_system() directly frommarcel2010-01-231-8/+1
| | | | cpu_reset().
* Add ioctl requests to /dev/io on ia64 for reading and writingmarcel2010-01-142-0/+158
| | | | | | EFI variables. The primary reason for this is that it allows sysinstall(8) to add a boot menu item for the newly installed FreeBSD image.
* Fix previous commitr:. efi_var_set() was copied from efi_var_get(),marcel2010-01-142-4/+4
| | | | but wasn't actually changed.
* Add wrappers for the RT Variable Services. While here, translate themarcel2010-01-142-3/+74
| | | | | | | EFI status into a standard errno value and change efi_set_time() to return a standard error. MFC after: 1 week
* Use io(4) for I/O port access on ia64, rather than through sysarch(2).marcel2010-01-115-72/+212
| | | | | | | | | | | | | | | | | I/O port access is implemented on Itanium by reading and writing to a special region in memory. To hide details and avoid misaligned memory accesses, a process did I/O port reads and writes by making a MD system call. There's one fatal problem with this approach: unprivileged access was not being prevented. /dev/io serves that purpose on amd64/i386, so employ it on ia64 as well. Use an ioctl for doing the actual I/O and remove the sysarch(2) interface. Backward compatibility is not being considered. The sysarch(2) approach was added to support X11, but support for FreeBSD/ia64 was never fully implemented in X11. Thus, nothing gets broken that didn't need more work to begin with. MFC after: 1 week
* Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.imp2010-01-101-0/+1
| | | | | | # This is the resolution of removing it from DEFAULTS... MFC after: 5 days
* In sys/<arch>/conf/Makefile set TARGET to <arch>. That allowsbz2010-01-081-0/+2
| | | | | | | | | | | | | | | | sys/conf/makeLINT.mk to only do certain things for certain architectures. Note that neither arm nor mips have the Makefile there, thus essentially not (yet) supporting LINT. This would enable them do add special treatment to sys/conf/makeLINT.mk as well chosing one of the many configurations as LINT. This is a hack of doing this and keeping it in a separate commit will allow us to more easily identify and back it out. Discussed on/with: arch, jhb (as part of the LINT-VIMAGE thread) MFC after: 1 month
* Revert 200594. This file isn't intended for these sorts of things.imp2010-01-041-7/+0
|
* Add vlan(4) to all GENERIC kernels.brooks2010-01-031-0/+1
| | | | MFC after: 1 week
* Change BUS_SPACE_MAXADDR from 2^32-1 to 2^64-1. 2^32-1 is representativemarcel2010-01-021-1/+1
| | | | | | for its origin, more than for its accuracy. MFC after: 1 week
* Revamp bus_space access functions:marcel2009-12-307-531/+782
| | | | | | | | | | | | | | | | | | | | | | | | | | | o Optimize for memory mapped I/O by making all I/O port acceses function calls and marking the test for the IA64_BUS_SPACE_IO tag with __predict_false(). Implement the I/O port access functions in a new file, called bus_machdep.c. o Change the bus_space_handle_t for memory mapped I/O to the virtual address rather than the physical address. This eliminates the PA->VA translation for every I/O access. The handle for I/O port access is still the port number. o Move inb(), outb(), inw(), outw(), inl(), outl(), and their string variants from cpufunc.h and define them in bus.h. On ia64 these are not CPU functions at all. In bus.h they are merely aliases for the new I/O port access functions defined in bus_machdep.h. o Handle the ACPI resource bug in nexus_set_resource(). There we can do it once so that we don't have to worry about it whenever we need to write to an I/O port that is really a memory mapped address. The upshot of this change is that the KBI is better defined and that I/O port access always involves a function call, allowing us to change the actual implementation without breaking the KBI. For memory mapped I/O the virtual address is abstracted, so that we can change the VA->PA mapping in the kernel without causing an KBI breakage. The exception at this time is for bus_space_map() and bus_space_unmap(). MFC after: 1 week.
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.rnoland2009-12-291-1/+2
| | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime...
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.antoine2009-12-281-1/+1
| | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month
* Use unordered memory loads and stores for the in* and out*marcel2009-12-261-18/+12
| | | | family of functions.
* Export the bus, cpu and itc frequencies under the hw.freq sysctl node.marcel2009-12-234-27/+43
| | | | | | | | | | | | The frequencies are in MHz (i.e. a value of 1000 represents 1GHz). The frequencies are rounded to the nearest whole MHz. While here, rename and re-type bus_frequency, processor_frequency and itc_frequency to bus_freq, cpu_freq and itc_freq and make them static. As unsigned integers, the hw.freq.cpu sysctl can more easily be made generic (across all architectures) making porting easier. MFC after: 3 days
* Add a bit definition for invalid timestamp in the record header.marcel2009-12-231-0/+1
|
* Add INCLUDE_CONFIG_FILE, and a note in comments about how to alsodougb2009-12-161-0/+7
| | | | include the comments with CONFIGARGS
* In exception_save, write-back ar.rnat after switching the backing-marcel2009-12-081-14/+13
| | | | | | | store. Writing to ar.bspstore is defined to leave ar.rnat undefined. PR: ia64/120315 MFC after: 3 days
* Define struct pcpu_md as the only MD field of struct pcpu (pc_acpi_idmarcel2009-12-078-75/+81
| | | | | | | | | | excluded, as it's used by MI code) and mode the sysctl variables from pcpu_stats to pcpu_md. Adjust all references accordingly. While nearby, change the PCPU sysctl tree so that they match the CPU device sysctl tree -- they are now children of a static node called "machdep.cpu" and are named only with their cpu ID.
* Allocate the VHPT for each CPU in cpu_mp_start(), rather thanmarcel2009-12-075-77/+75
| | | | | | | | | | | | | | allocating MAXCPU VHPTs up-front. This allows us to max-out MAXCPU without memory waste -- MAXCPU is now 32 for SMP kernels. This change also eliminates the VHPT scaling based in the total memory in the system. It's the workload that determines the best size of the VHPT. The workload can be affected by the amount of memory, but not necessarily. For example, there's no performance difference between VHPT sizes of 256KB, 512KB and 1MB when building the LINT kernel. This was observed with a system that has 8GB of memory. By default the kernel will allocate a 1MB VHPT. The user can tune the system with the "machdep.vhpt.log2size" tunable.
* Make sure bus space accesses use unorder memory loads and stores.marcel2009-12-034-80/+148
| | | | | | | | | | | | Memory accesses are posted in program order by virtue of the uncacheable memory attribute. Since GCC, by default, adds acquire and release semantics to volatile memory loads and stores, we need to use inline assembly to guarantee it. With inline assembly, we don't need volatile pointers anymore. Itanium does not support semaphore instructions to uncacheable memory.
* Move the sysctl related fields to the end of the structure andmarcel2009-11-291-3/+5
| | | | | | make them conditional upon _KERNEL. libkvm includes <sys/pcpu.h> and <sys/sysctl.h> does not expose the structure definitions to userland.
* Eliminate teh use of MAXCPU in static arrays of interrupt counters bymarcel2009-11-283-34/+96
| | | | | | | | adding statistics counters to the PCPU structure. Export the counters through sysctl by giving each PCPU structure its own sysctl context. While here, fix cnt.v_intr by not just having it count clock interrupts, but every interrupt and add more counters for each interrupt source.
* Simplify the invocation of vm_fault(). Specifically, eliminate the flagalc2009-11-271-2/+1
| | | | | | | VM_FAULT_DIRTY. The information provided by this flag can be trivially inferred by vm_fault(). Discussed with: kib
* Improve upon revision 196196 by removing the newly added commentmarcel2009-11-241-2/+4
| | | | in the wrong place and instead add a KASSERT in the right place.
* Revert previous commit. The problem was not related to overrunningmarcel2009-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the kernel stack at all. The new USB stack simply caused a change in timing that triggered a firmware bug more often. The addition of PRINTF_BUFR_SIZE apparently triggered the same firmware bug even more reliably. But even with KSTACK_PAGES=5, one instance of the firmware bug remained: booting with a CD inserted. This problem was run into by accident after installing Debian and having to boot FreeBSD to fixup the GPT partitioning (Thanks... not). After bumping KSTACK_PAGES to 5, it was pretty unbelievable that the stack was still being too small. After updating the firmware we could boot with a CD inserted and KSTACK_PAGES could be lowered back to 4 pages without problems. Note: It is believed to be a timing related firmware bug, because the machine check information showed access to the serial console on one CPU and access to the EHCI HCD on the other CPU. Since both are devices on the management unit and thus virtualized in some way, any execution trace that does not include concurrent access to the BMC from both CPUs is fine. Note also that it's not understood exactly how increasing the kernel stack avoided hitting the firmware bug. A change in page faults does change timing, but it's not known if that's what's happening here. In any case: the problem is being monitored. Reverting back to 4 pages for the kernel stack is preferred, because it makes it easier to switch to 16K pages (double the page size) without wasting too much memory by not being able to half the number of pages...
* No need to include opt_kstack_pages.h, because KSTACK_PAGES ismarcel2009-11-201-1/+0
| | | | already defined through genassym.c
* Add a seatbelt to the Nested TLB Fault handler to give us a chancemarcel2009-11-202-25/+59
| | | | | | | | to panic when we have an unexpected TLB fault while interrupt collection is disabled. Use a token rather than the actual address of the restart point to avoid the need for the movl instruction. The token is arbitrary. For the drummers: it's based on a single paradiddle.
* opt_* headers are included using the quoted form.marcel2009-11-192-2/+2
|
* Extract the code that records syscall results in the frame into MDkib2009-11-102-20/+32
| | | | | | | | | | | function cpu_set_syscall_retval(). Suggested by: marcel Reviewed by: marcel, davidxu PowerPC, ARM, ia64 changes: marcel Sparc64 tested and reviewed by: marius, also sunv reviewed MIPS tested by: gonzo MFC after: 1 month
* Reimplement the lazy FP context switching:marcel2009-10-317-146/+189
| | | | | | | | | | | | | | | | | | | o Move all code into a single file for easier maintenance. o Use a single global lock to avoid having to handle either multiple locks or race conditions. o Make sure to disable the high FP registers after saving or dropping them. o use msleep() to wait for the other CPU to save the high FP registers. This change fixes the high FP inconsistency panics. A single global lock typically serializes too much, which may be noticable when a lot of threads use the high FP registers, but in that case it's probably better to switch the high FP context synchronuously. Put differently: cpu_switch() should switch the high FP registers if the incoming and outgoing threads both use the high FP registers.
* In r197963, a race with thread being selected for signal deliverykib2009-10-271-7/+1
| | | | | | | | | | | | | while in kernel mode, and later changing signal mask to block the signal, was fixed for sigprocmask(2) and ptread_exit(3). The same race exists for sigreturn(2), setcontext(2) and swapcontext(2) syscalls. Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals, closing the race. Reviewed by: davidxu Tested by: pho MFC after: 1 month
* Add PRINTF_BUFR_SIZE=128, since we have SMP by default.marcel2009-10-241-2/+3
| | | | While here, fix tabulation.
* A 32KB kernel stack is not quite enough. The new USB stack is a bitmarcel2009-10-241-1/+1
| | | | | | | | | | | | more stack hungry as compared to the old one that my RX2660 gets a machine check and spontaneously reboots at the time the USB DVD drive is found and attached to CAM as a mass storage device. This doesn't happen always, but definitely varies per kernel build. Likewise when using a 128-byte printf buffer. The additional 128 bytes that printf needs seems to be enough to have the memory stack and register stack collide and causing a machine check. Thus: Bump KSTACK_PAGES from 4 to 5.
* o Introduce vm_sync_icache() for making the I-cache coherent withmarcel2009-10-211-0/+27
| | | | | | | | | | | | | | | | | | | | | the memory or D-cache, depending on the semantics of the platform. vm_sync_icache() is basically a wrapper around pmap_sync_icache(), that translates the vm_map_t argumument to pmap_t. o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc it replaces the pmap_page_executable() function, added to solve the I-cache problem in uiomove_fromphys(). o In proc_rwmem() call vm_sync_icache() when writing to a page that has execute permissions. This assures that when breakpoints are written, the I-cache will be coherent and the process will actually hit the breakpoint. o This also fixes the Book-E PMAP implementation that was missing necessary locking while trying to deal with the I-cache coherency in pmap_enter() (read: mmu_booke_enter_locked). The key property of this change is that the I-cache is made coherent *after* writes have been done. Doing it in the PMAP layer when adding or changing a mapping means that the I-cache is made coherent *before* any writes happen. The difference is key when the I-cache prefetches.
* o Align function on a 32-byte boundary so that the core's front-endmarcel2009-10-211-3/+7
| | | | | | can deliver 2 bundles per cycle to the back-end. o Mark syscall stubs with a special unwind ABI tag so that unwind libraries know how to unwind.
* Define architectural load bases for PIE binaries. Addresses were selectedkib2009-10-101-0/+2
| | | | | | | | | | by looking at the bases used for non-relocatable executables by gnu ld(1), and adjusting it slightly. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time
* Make sure that the primary native brandinfo always gets addedbz2009-10-031-1/+1
| | | | | | | | | | | | | first and the native ia32 compat as middle (before other things). o(ld)brandinfo as well as third party like linux, kfreebsd, etc. stays on SI_ORDER_ANY coming last. The reason for this is only to make sure that even in case we would overflow the MAX_BRANDS sized array, the native FreeBSD brandinfo would still be there and the system would be operational. Reviewed by: kib MFC after: 1 month
* Add a new sysctl for reporting all of the supported page sizes.alc2009-09-181-0/+2
| | | | | Reviewed by: jhb MFC after: 3 weeks
* Get rid of the _NO_NAMESPACE_POLLUTION kludge by creating anphk2009-09-082-17/+58
| | | | | architecture specific include file containing the _ALIGN* stuff which <sys/socket.h> needs.
* Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can bemarcel2009-08-163-20/+19
| | | | | | sparse, which causes a kernel assert. Approved by: re (kensmith)
* * Completely Remove the option STOP_NMI from the kernel. This optionattilio2009-08-132-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has proven to have a good effect when entering KDB by using a NMI, but it completely violates all the good rules about interrupts disabled while holding a spinlock in other occasions. This can be the cause of deadlocks on events where a normal IPI_STOP is expected. * Adds an new IPI called IPI_STOP_HARD on all the supported architectures. This IPI is responsible for sending a stop message among CPUs using a privileged channel when disponible. In other cases it just does match a normal IPI_STOP. Right now the IPI_STOP_HARD functionality uses a NMI on ia32 and amd64 architectures, while on the other has a normal IPI_STOP effect. It is responsibility of maintainers to eventually implement an hard stop when necessary and possible. * Use the new IPI facility in order to implement a new userend SMP kernel function called stop_cpus_hard(). That is specular to stop_cpu() but it does use the privileged channel for the stopping facility. * Let KDB use the newly introduced function stop_cpus_hard() and leave stop_cpus() for all the other cases * Disable interrupts on CPU0 when starting the process of APs suspension. * Style cleanup and comments adding This patch should fix the reboot/shutdown deadlocks many users are constantly reporting on mailing lists. Please don't forget to update your config file with the STOP_NMI option removal Reviewed by: jhb Tested by: pho, bz, rink Approved by: re (kib)
* Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar tojhb2009-07-241-1/+1
| | | | | | | | | | | a device pager (OBJT_DEVICE) object in that it uses fictitious pages to provide aliases to other memory addresses. The primary difference is that it uses an sglist(9) to determine the physical addresses for a given offset into the object instead of invoking the d_mmap() method in a device driver. Reviewed by: alc Approved by: re (kensmith) MFC after: 2 weeks
* Add support to the virtual memory system for configuring machine-alc2009-07-122-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dependent memory attributes: Rename vm_cache_mode_t to vm_memattr_t. The new name reflects the fact that there are machine-dependent memory attributes that have nothing to do with controlling the cache's behavior. Introduce vm_object_set_memattr() for setting the default memory attributes that will be given to an object's pages. Introduce and use pmap_page_{get,set}_memattr() for getting and setting a page's machine-dependent memory attributes. Add full support for these functions on amd64 and i386 and stubs for them on the other architectures. The function pmap_page_set_memattr() is also responsible for any other machine-dependent aspects of changing a page's memory attributes, such as flushing the cache or updating the direct map. The uses include kmem_alloc_contig(), vm_page_alloc(), and the device pager: kmem_alloc_contig() can now be used to allocate kernel memory with non-default memory attributes on amd64 and i386. vm_page_alloc() and the device pager will set the memory attributes for the real or fictitious page according to the object's default memory attributes. Update the various pmap functions on amd64 and i386 that map pages to incorporate each page's memory attributes in the mapping. Notes: (1) Inherent to this design are safety features that prevent the specification of inconsistent memory attributes by different mappings on amd64 and i386. In addition, the device pager provides a warning when a device driver creates a fictitious page with memory attributes that are inconsistent with the real page that the fictitious page is an alias for. (2) Storing the machine-dependent memory attributes for amd64 and i386 as a dedicated "int" in "struct md_page" represents a compromise between space efficiency and the ease of MFCing these changes to RELENG_7. In collaboration with: jhb Approved by: re (kib)
* On exec(2), when loading the ELF image, pmap_enter_object() ismarcel2009-07-111-0/+3
| | | | | | | | | | | called to prefault pages. This is an obvious place for making sure the I-cache is coherent. It was missing though. As such, execution over NFS and ZFS file systems was failing. NFS was fixed the wrong way (by flushing the D-cache as part of the NFS code) in a previous commit. ZFS problems were encountered after that and indicated that something else was wrong... Approved by: re (kib)
* Cleanup ALIGNED_POINTER:sam2009-07-051-17/+3
| | | | | | | | | | | o add to platforms where it was missing (arm, i386, powerpc, sparc64, sun4v) o define as "1" on amd64 and i386 where there is no restriction o make the type returned consistent with ALIGN o remove _ALIGNED_POINTER o make associated comments consistent Reviewed by: bde, imp, marcel Approved by: re (kensmith)
OpenPOWER on IntegriCloud