summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Fix whitespace nits.bschmidt2010-08-061-1/+1
| | | | | | PR: conf/148989 Submitted by: pluknet <pluknet at gmail.com> MFC after: 3 days
* Remove unnecessary casting and simplify code. We are not there yet. ;-)jkim2010-08-061-3/+1
|
* Correct argument order of acpi_restorecpu(), which was forgotten in r210804.jkim2010-08-061-1/+1
|
* Add a new ipi_cpu() function to the MI IPI API that can be used to send anjhb2010-08-062-5/+42
| | | | | | | | | | | | IPI to a specific CPU by its cpuid. Replace calls to ipi_selected() that constructed a mask for a single CPU with calls to ipi_cpu() instead. This will matter more in the future when we transition from cpumask_t to cpuset_t for CPU masks in which case building a CPU mask is more expensive. Submitted by: peter, sbruno Reviewed by: rookie Obtained from: Yahoo! (x86) MFC after: 1 month
* Change the MPTable and $PIR PCI-PCI bridge drivers to inherit from thejhb2010-08-051-25/+2
| | | | | generic PCI-PCI bridge driver and only override specific methods. This should fix suspend/resume of PCI-PCI bridges using these drivers.
* Remove an unnecessary register load.jkim2010-08-031-2/+1
|
* savectx() has not been used for fork(2) for about 15 years. [1]jkim2010-08-033-107/+65
| | | | | | | Do not clobber FPU thread's PCB as it is more harmful. When we resume CPU, unconditionally reload FPU state. Pointed out by: bde [1]
* Rearrange struct pcb. r177532 (CVS r1.64 of pcb.h) moved pcb_flags to makejkim2010-08-022-10/+10
| | | | | better use of cache lines by placing it before pcb_save (now pcb_user_save), which is moved to the end of pcb since r210777.
* - Merge savectx2() with savectx() and struct xpcb with struct pcb. [1]jkim2010-08-027-203/+152
| | | | | | | | | | | | | | savectx() is only used for panic dump (dumppcb) and kdb (stoppcbs). Thus, saving additional information does not hurt and it may be even beneficial. Unfortunately, struct pcb has grown larger to accommodate more data. Move 512-byte long pcb_user_save to the end of struct pcb while I am here. - savectx() now saves FPU state unconditionally and copy it to the PCB of FPU thread if necessary. This gives panic dump and kdb a chance to take a look at the current FPU state even if the FPU is "supposedly" not used. - Resuming CPU now unconditionally reinitializes FPU. If the saved FPU state was irrelevant, it could be in an unknown state. Suggested by: bde [1]
* Tweak the logic to disable CLFLUSH in virtual environments to work aroundjhb2010-08-021-6/+6
| | | | | | | | problems with flushing the local APIC register range so that it checks vm_guest directly. Reviewed by: kib, alc MFC after: 2 weeks
* In rdmsr_safe, use zero extend (by doing a 32-bit movl overdelphij2010-07-301-1/+1
| | | | | | | eax to itself) instead of a sign extend. Discussed with: stas MFC after: 1 month
* Improve cputemp(4) driver wrt newer Intel processors, especiallydelphij2010-07-291-0/+1
| | | | | | | | | | | | | | | Xeon 5500/5600 series: - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place of Tj(max) when a sane value is available, as documented in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane value we mean 70C - 100C for now); - Print the probe results when booting verbose; - Replace cpu_mask with cpu_stepping; - Use CPUID_* macros instead of rolling our own. Approved by: rpaulo MFC after: 1 month
* Mark the __curthread() functions as __pure2 and remove the volatile keywordjhb2010-07-291-2/+2
| | | | | | | | from the inline assembly. This allows the compiler to cache invocations of curthread since it's value does not change within a thread context. Submitted by: zec (i386) MFC after: 1 week
* Fix another fallout from r208833. savectx() is used to save CPU contextjkim2010-07-291-1/+1
| | | | | | for crash dump (dumppcb) and kdb (stoppcbs). For both cases, there cannot have a valid pointer in pcb_save. This should restore the previous behaviour.
* Rename PCB_USER_FPU to PCB_USERFPU not to clash with a macro from fpu.h.jkim2010-07-293-3/+3
|
* The corrected error count field is dependent on CMCI, not TES.jhb2010-07-281-3/+3
| | | | MFC after: 1 week
* Add MALLOC_DEBUG_MAXZONES debug malloc(9) option to use multiple umamdf2010-07-281-0/+1
| | | | | | | | | | | | | | | | | | | | | zones for each malloc bucket size. The purpose is to isolate different malloc types into hash classes, so that any buffer overruns or use-after-free will usually only affect memory from malloc types in that hash class. This is purely a debugging tool; by varying the hash function and tracking which hash class was corrupted, the intersection of the hash classes from each instance will point to a single malloc type that is being misused. At this point inspection or memguard(9) can be used to catch the offending code. Add MALLOC_DEBUG_MAXZONES=8 to -current GENERIC configuration files. The suggestion to have this on by default came from Kostik Belousov on -arch. This code is based on work by Ron Steinke at Isilon Systems. Reviewed by: -arch (mostly silence) Reviewed by: zml Approved by: zml (mentor)
* The interpreter name should no longer be treated as a buffer that can bealc2010-07-281-11/+5
| | | | | | overwritten. (This change should have been included in r210545.) Submitted by: kib
* Very rough first cut at NUMA support for the physical page allocator. Forjhb2010-07-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | now it uses a very dumb first-touch allocation policy. This will change in the future. - Each architecture indicates the maximum number of supported memory domains via a new VM_NDOMAIN parameter in <machine/vmparam.h>. - Each cpu now has a PCPU_GET(domain) member to indicate the memory domain a CPU belongs to. Domain values are dense and numbered from 0. - When a platform supports multiple domains, the default freelist (VM_FREELIST_DEFAULT) is split up into N freelists, one for each domain. The MD code is required to populate an array of mem_affinity structures. Each entry in the array defines a range of memory (start and end) and a domain for the range. Multiple entries may be present for a single domain. The list is terminated by an entry where all fields are zero. This array of structures is used to split up phys_avail[] regions that fall in VM_FREELIST_DEFAULT into per-domain freelists. - Each memory domain has a separate lookup-array of freelists that is used when fulfulling a physical memory allocation. Right now the per-domain freelists are listed in a round-robin order for each domain. In the future a table such as the ACPI SLIT table may be used to order the per-domain lookup lists based on the penalty for each memory domain relative to a specific domain. The lookup lists may be examined via a new vm.phys.lookup_lists sysctl. - The first-touch policy is implemented by using PCPU_GET(domain) to pick a lookup list when allocating memory. Reviewed by: alc
* Simplify fldcw() macro. There is no reason to use pointer here. No objectjkim2010-07-261-4/+4
| | | | file change after this commit (verified with md5).
* Add missing ldmxcsr() prototype for lint case.jkim2010-07-261-1/+2
|
* Reduce diff against fenv.h:jkim2010-07-261-7/+8
| | | | | Mark all inline asms as volatile for safety. No object file change after this commit (verified with md5).
* FNSTSW instruction can use AX register as an operand.jkim2010-07-261-1/+1
| | | | Obtained from: fenv.h
* Re-implement FPU suspend/resume for amd64. This removes superfluous usesjkim2010-07-265-11/+25
| | | | | | | of critical_enter(9) and critical_exit(9) by fpugetregs() and fpusetregs(). Also, we do not touch PCB flags any more. MFC after: 1 month
* Remove unneeded includes.kib2010-07-261-2/+0
| | | | | Submitted by: alc MFC after: 1 week
* Regenkib2010-07-233-5/+5
|
* Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() maykib2010-07-232-101/+5
| | | | | | | server as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32. Reviewed by: alc MFC after: 3 weeks
* Eliminate a little bit of duplicated code.alc2010-07-231-3/+1
|
* When compat32 binary asks for the value of hw.machine_arch, report thekib2010-07-222-2/+27
| | | | | | | | | | | name of 32bit sibling architecture instead of the host one. Do the same for hw.machine on amd64. Add a safety belt debug.adaptive_machine_arch sysctl, to turn the substitution off. Reviewed by: jhb, nwhitehorn MFC after: 2 weeks
* Add hints for i8254 timer on i386 and amd64. Some people report aboutmav2010-07-161-0/+3
| | | | | | | | systems with PnP/ACPI not reporting i8254 timer. In some cases it can be fatal, as i8254 can be the only available time counter hardware. From other side we are now heavily depend on i8254 timer and till the last time it's init/usage was completely hardcoded. So this change just restores previous behavior in more regular fashion.
* Move functions declaration to MI code, following implementation.mav2010-07-151-5/+0
|
* Optimize pmap_remove()'s handling of PG_G mappings. Specifically,alc2010-07-151-14/+15
| | | | | | | | | | | | | instead of calling pmap_invalidate_page() for each PG_G mapping, call pmap_invalidate_range() for each range of PG_G mappings. In addition, eliminate a redundant call to pmap_invalidate_page(). Both pmap_remove_pte() and pmap_remove_page() called pmap_invalidate_page() when the mapping had the PG_G attribute. Now, only pmap_remove_page() calls pmap_invalidate_page(). Altogether, these changes eliminate 53% of the TLB shootdowns for a "buildworld" on a ZFS file system. On FFS, the reduction is 3%. MFC after: 6 weeks
* - Update 6000 firmware to 9.221.4.1bschmidt2010-07-151-0/+2
| | | | | | - Add 6050 firmware MFC after: 2 weeks
* Remove obsolete undef of COPY_SIGCODE. It appears to have not beenimp2010-07-131-6/+0
| | | | | | used in FreeBSD in quite some time (maybe since before 4.4-lite :) Submitted by: bde
* Move i386-inherited logic of building ACPI headers for acpi_wakeup.c intojkim2010-07-124-50/+0
| | | | | better places and remove intermediate makefile and shell scripts. This makes parallel kernel build little bit safer for amd64.
* Remove a dead test. We already exclude NMI traps from this code in anjhb2010-07-121-2/+2
| | | | | | earlier condition. MFC after: 1 week
* When switching the thread from the processor, store %dr7 contentkib2010-07-121-1/+1
| | | | | | | | | into the pcb before disabling watchpoints. Otherwise, when the thread is restored on a processor, watchpoints are still disabled. Submitted by: Tijl Coosemans <tijl coosemans org> (I would be much happier if Tijl commited this himself) MFC after: 1 week
* Reduce the number of global TLB shootdowns generated by pmap_qenter().alc2010-07-101-6/+9
| | | | | | | | | | | | | | | | | | Specifically, teach pmap_qenter() to recognize the case when it is being asked to replace a mapping with the very same mapping and not generate a shootdown. Unfortunately, the buffer cache commonly passes an entire buffer to pmap_qenter() when only a subset of the mappings are changing. For the extension of buffers in allocbuf() this was resulting in unnecessary shootdowns. The addition of new pages to the end of the buffer need not and did not trigger a shootdown, but overwriting the initial mappings with the very same mappings was seen as a change that necessitated a shootdown. With this change, that is no longer so. For a "buildworld" on amd64, this change eliminates 14-15% of the pmap_invalidate_range() shootdowns, and about 4% of the overall shootdowns. MFC after: 3 weeks
* For both i386 and amd64 pmap,kib2010-07-092-4/+2
| | | | | | | | | | | | | - change the type of pm_active to cpumask_t, which it is; - in pmap_remove_pages(), compare with PCPU(curpmap), instead of dereferencing the long chain of pointers [1]. For amd64 pmap, remove the unneeded checks for validity of curpmap in pmap_activate(), since curpmap should be always valid after r209789. Submitted by: alc [1] Reviewed by: alc MFC after: 3 weeks
* Correctly maintain the per-cpu field "curpmap" on amd64 just like wealc2010-07-082-12/+12
| | | | | | | | | | | | | | | | | do on i386. The consequences of not doing so on amd64 became apparent with the introduction of the COUNT_IPIS and COUNT_XINVLTLB_HITS options. Specifically, single-threaded applications were generating unnecessary IPIs to shoot-down the TLB on other processors. However, this is clearly nonsensical because a single-threaded application is only running on the current processor. The reason that this happens is that pmap_activate() is unable to properly update the old pmap's field "pm_active" without the correct "curpmap". So, in effect, stale bits in "pm_active" were leading pmap_protect(), pmap_remove(), pmap_remove_pages(), etc. to flush the TLB contents on some arbitrary processor that wasn't even running the same application. Reviewed by: kib MFC after: 3 weeks
* Fix style issues with the previous commit, namelyrpaulo2010-07-071-6/+6
| | | | | | use-tab-instead-of-space and don't use underscores in macro variables. Pointed out by: bde
* Add the u3g(4) driver. I can't find any reason why it's not here.kevlo2010-07-071-0/+1
|
* Introduce USD_{SET,GET}{BASE,LIMIT}. These help setting up the userrpaulo2010-07-061-0/+7
| | | | | | segment descriptor hi and lo values. Idea from Solaris. Reviewed by: kib
* Revert r209638. After commit, there appeared to be more people who likedmav2010-07-021-2/+2
| | | | previous name of stray interrupt counters, then responded to the list.
* Make stray irq counters have format alike to other counters. Unified formatmav2010-07-011-2/+2
| | | | makes string processing (for example by `systat -vm`) easier.
* Move prototypes for kern_sigtimedwait() and kern_sigprocmask() tojhb2010-06-302-0/+2
| | | | <sys/syscallsubr.h> where all other kern_<syscall> prototypes live.
* Regeneratekib2010-06-281-317/+317
|
* Clear DF bit in eflags/rflags on the kernel entry. The i386 and amd64kib2010-06-233-1/+7
| | | | | | | | | ABI specifies the DF should be zero, and newer compilers do not clear DF before using DF-sensitive instructions. The DF clearing for signal handlers was done some time ago. MFC after: 1 week
* Fix bugs on pc98, use npxgetuserregs() instead of npxgetregs() forkib2010-06-231-2/+2
| | | | | | | | | | get_fpcontext(), and npxsetuserregs() for set_fpcontext). Also, note that usercontext is not initialized anymore in fpstate_drop(). Systematically replace references to npxgetregs() and npxsetregs() by npxgetuserregs() and npxsetuserregs() in comments. Noted by: bde
* Some style fixes for r209371.mav2010-06-221-1/+3
| | | | Submitted by: jhb@
OpenPOWER on IntegriCloud