aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica
Commit message (Collapse)AuthorAgeFilesLines
...
* Centralize declaration of the debug.acpi sysctl node.John Baldwin2012-05-171-2/+0
| | | | Notes: svn path=/head/; revision=235556
* Re-initialize model-specific MSRs when we resume CPUs.Jung-uk Kim2012-03-301-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=233704
* Merge ACPICA 20120320.Jung-uk Kim2012-03-201-1/+1
| | | | Notes: svn path=/head/; revision=233250
* Fix another witness panic. We cannot enter critical section at all becauseJung-uk Kim2012-03-201-2/+3
| | | | | | | | | | | AcpiEnterSleepState() executes (optional) _GTS method since ACPICA 20120215 (r231844). To evaluate the method, we need malloc(9), which may sleep. Reported by: bschmidt MFC after: 3 days Notes: svn path=/head/; revision=233249
* Fix a witness panic introduced in r231797.Jung-uk Kim2012-03-191-2/+2
| | | | | | | | | | Reported by: bschmidt Reviewed by: jhb Pointy hat to: jkim MFC after: 3 days Notes: svn path=/head/; revision=233208
* Refine r231791. Install the resume event handler unconditionally.Jung-uk Kim2012-02-161-18/+11
| | | | Notes: svn path=/head/; revision=231840
* Clean up RFLAG and CR3 register handling and nearby comments. For BSP, useJung-uk Kim2012-02-151-13/+4
| | | | | | | | | | | spinlock_enter()/spinlock_exit() to save/restore RFLAGS. We know interrupt is disabled when returning from S3. For AP, we do not have to save/restore it because IRET will do it for us any way. Do not save CR3 locally because savectx() does it and BSP does not have to switch to kernel map for amd64. Change contigmalloc(9) flag while I am in the neighborhood. Notes: svn path=/head/; revision=231797
* Set up an event handler to turn off speaker if user requested it. SpeakerJung-uk Kim2012-02-151-7/+22
| | | | | | | | will stop beeping after all device drivers are resumed. Use proper API to "acquire" and "release" PIC timer2 for consistency and correctness. Notes: svn path=/head/; revision=231791
* Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly.Jung-uk Kim2012-02-151-7/+17
| | | | Notes: svn path=/head/; revision=231787
* Reset clock after atrtc(4) is properly resumed.Jung-uk Kim2012-02-081-1/+0
| | | | Notes: svn path=/head/; revision=231227
* Restore callee saved registers later and micro-optimize.Jung-uk Kim2012-02-031-14/+13
| | | | Notes: svn path=/head/; revision=230958
* Fix a function prototype to reflect reality. No functional change.Jung-uk Kim2012-02-031-1/+1
| | | | Notes: svn path=/head/; revision=230957
* - Restore XCR0 before restoring extended FPU states.Jung-uk Kim2012-01-313-15/+22
| | | | | | | | | - Update my copyright dates. Reviewed by: kib Notes: svn path=/head/; revision=230830
* Naturally align a newly added wakeup_fpusave.Jung-uk Kim2012-01-301-2/+2
| | | | Notes: svn path=/head/; revision=230777
* Add support for the extended FPU states on amd64, both for nativeKonstantin Belousov2012-01-213-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64bit and 32bit ABIs. As a side-effect, it enables AVX on capable CPUs. In particular: - Query the CPU support for XSAVE, list of the supported extensions and the required size of FPU save area. The hw.use_xsave tunable is provided for disabling XSAVE, and hw.xsave_mask may be used to select the enabled extensions. - Remove the FPU save area from PCB and dynamically allocate the (run-time sized) user save area on the top of the kernel stack, right above the PCB. Reorganize the thread0 PCB initialization to postpone it after BSP is queried for save area size. - The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as well. FPU state is only useful for suspend, where it is saved in dynamically allocated suspfpusave area. - Use XSAVE and XRSTOR to save/restore FPU state, if supported and enabled. - Define new mcontext_t flag _MC_HASFPXSTATE, indicating that mcontext_t has a valid pointer to out-of-struct extended FPU state. Signal handlers are supplied with stack-allocated fpu state. The sigreturn(2) and setcontext(2) syscall honour the flag, allowing the signal handlers to inspect and manipilate extended state in the interrupted context. - The getcontext(2) never returns extended state, since there is no place in the fixed-sized mcontext_t to place variable-sized save area. And, since mcontext_t is embedded into ucontext_t, makes it impossible to fix in a reasonable way. Instead of extending getcontext(2) syscall, provide a sysarch(2) facility to query extended FPU state. - Add ptrace(2) support for getting and setting extended state; while there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries. - Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to consumers, making it opaque. Internally, struct fpu_kern_ctx now contains a space for the extended state. Convert in-kernel consumers of fpu_kern KPI both on i386 and amd64. First version of the support for AVX was submitted by Tim Bird <tim.bird am sony com> on behalf of Sony. This version was written from scratch. Tested by: pho (previous version), Yamagi Burmeister <lists yamagi org> MFC after: 1 month Notes: svn path=/head/; revision=230426
* Remove the usage of pc_other_cpus from amd64.Attilio Rao2011-06-211-1/+2
| | | | | | | Tested by: pluknet Notes: svn path=/projects/largeSMP/; revision=223363
* Commit the support for removing cpumask_t and replacing it directly withAttilio Rao2011-05-051-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cpuset_t objects. That is going to offer the underlying support for a simple bump of MAXCPU and then support for number of cpus > 32 (as it is today). Right now, cpumask_t is an int, 32 bits on all our supported architecture. cpumask_t on the other side is implemented as an array of longs, and easilly extendible by definition. The architectures touched by this commit are the following: - amd64 - i386 - pc98 - arm - ia64 - XEN while the others are still missing. Userland is believed to be fully converted with the changes contained here. Some technical notes: - This commit may be considered an ABI nop for all the architectures different from amd64 and ia64 (and sparc64 in the future) - per-cpu members, which are now converted to cpuset_t, needs to be accessed avoiding migration, because the size of cpuset_t should be considered unknown - size of cpuset_t objects is different from kernel and userland (this is primirally done in order to leave some more space in userland to cope with KBI extensions). If you need to access kernel cpuset_t from the userland please refer to example in this patch on how to do that correctly (kgdb may be a good source, for example). - Support for other architectures is going to be added soon - Only MAXCPU for amd64 is bumped now The patch has been tested by sbruno and Nicholas Esborn on opteron 4 x 12 pack CPUs. More testing on big SMP is expected to came soon. pluknet tested the patch with his 8-ways on both amd64 and i386. Tested by: pluknet, sbruno, gianni, Nicholas Esborn Reviewed by: jeff, jhb, sbruno Notes: svn path=/projects/largeSMP/; revision=221499
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.Matthew D Fleming2011-01-121-1/+1
| | | | | | | Commit the kernel changes. Notes: svn path=/head/; revision=217326
* Reinitialize PAT MSR via pmap_init_pat() while resuming. This function doesJung-uk Kim2010-11-233-9/+1
| | | | | | | better job since r215703 and it is safer now. Notes: svn path=/head/; revision=215753
* Make APM emulation look more closer to its origin. Use device_get_softc(9)Jung-uk Kim2010-11-101-3/+2
| | | | | | | instead of hardcoding acpi(4) unit number as we have device_t for it. Notes: svn path=/head/; revision=215097
* Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a newJung-uk Kim2010-11-101-449/+4
| | | | | | | file acpi_apm.c, and place it on sys/x86/acpica. Notes: svn path=/head/; revision=215072
* Now OsdEnvironment.c is identical on amd64 and i386. Move it to a new home.Jung-uk Kim2010-11-091-91/+0
| | | | Notes: svn path=/head/; revision=215024
* Reduce diff between platforms and fix style(9) bugs.Jung-uk Kim2010-11-091-15/+35
| | | | Notes: svn path=/head/; revision=215023
* Move the MADT parser for amd64 and i386 to sys/x86/acpica now that it isJohn Baldwin2010-11-081-572/+0
| | | | | | | identical on both platforms. Notes: svn path=/head/; revision=215012
* A few small style and whitespace fixes.John Baldwin2010-11-081-2/+1
| | | | Notes: svn path=/head/; revision=215002
* Move <machine/apicreg.h> to <x86/apicreg.h>.John Baldwin2010-11-012-2/+2
| | | | Notes: svn path=/head/; revision=214631
* Move the <machine/mca.h> header to <x86/mca.h>.John Baldwin2010-11-011-1/+1
| | | | Notes: svn path=/head/; revision=214630
* Reset switchtime to zero rather than the current CPU ticker (TSC) value.Jung-uk Kim2010-08-131-2/+2
| | | | | | | | | It is more appropriate in this context because TSC MSR is reset to zero when the CPU is restarted from S3 and above. Move acpi_resync_clock() back to where it was before r211202. It does not make a difference any more. Notes: svn path=/head/; revision=211292
* Reset switchtime and switchticks after resynchronizing the system clock.Jung-uk Kim2010-08-121-1/+3
| | | | | | | | This should fix weird runtime problem after resume on amd64. It also fixes "calcru: runtime went backwards" warnings with bootverbose. Notes: svn path=/head/; revision=211202
* Remove unnecessary casting and simplify code. We are not there yet. ;-)Jung-uk Kim2010-08-061-3/+1
| | | | Notes: svn path=/head/; revision=210942
* Correct argument order of acpi_restorecpu(), which was forgotten in r210804.Jung-uk Kim2010-08-061-1/+1
| | | | Notes: svn path=/head/; revision=210940
* Remove an unnecessary register load.Jung-uk Kim2010-08-031-2/+1
| | | | Notes: svn path=/head/; revision=210810
* savectx() has not been used for fork(2) for about 15 years. [1]Jung-uk Kim2010-08-032-47/+33
| | | | | | | | | | 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] Notes: svn path=/head/; revision=210804
* - Merge savectx2() with savectx() and struct xpcb with struct pcb. [1]Jung-uk Kim2010-08-023-67/+59
| | | | | | | | | | | | | | | | | 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] Notes: svn path=/head/; revision=210777
* Rename PCB_USER_FPU to PCB_USERFPU not to clash with a macro from fpu.h.Jung-uk Kim2010-07-291-1/+1
| | | | Notes: svn path=/head/; revision=210614
* Re-implement FPU suspend/resume for amd64. This removes superfluous usesJung-uk Kim2010-07-262-6/+15
| | | | | | | | | | 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 Notes: svn path=/head/; revision=210514
* Move i386-inherited logic of building ACPI headers for acpi_wakeup.c intoJung-uk Kim2010-07-124-50/+0
| | | | | | | | better places and remove intermediate makefile and shell scripts. This makes parallel kernel build little bit safer for amd64. Notes: svn path=/head/; revision=209957
* Restore the machine check register banks on resume. For banks beingJohn Baldwin2010-06-151-0/+2
| | | | | | | | | | monitored via CMCI, reset the interrupt threshold to 1 on resume. Reviewed by: jkim MFC after: 2 weeks Notes: svn path=/head/; revision=209212
* Fix ACPI suspend/resume on amd64, which was broken since r208833.Jung-uk Kim2010-06-141-1/+1
| | | | | | | We need actual storage for FPU state to save and restore. Notes: svn path=/head/; revision=209174
* Update several places that iterate over CPUs to use CPU_FOREACH().John Baldwin2010-06-111-3/+1
| | | | Notes: svn path=/head/; revision=209059
* Introduce the x86 kernel interfaces to allow kernel code to useKonstantin Belousov2010-06-051-1/+1
| | | | | | | | | | | | | | | | | | | FPU/SSE hardware. Caller should provide a save area that is chained into the stack of the areas; pcb save_area for usermode FPU state is on top. The pcb now contains a pointer to the current FPU saved area, used during FPUDNA handling and context switches. There is also a facility to allow the kernel thread to use pcb save_area. Change the dreaded warnings "npxdna in kernel mode!" into the panics when FPU usage is not registered. KPI discussed with: fabient Tested by: pho, fabient Hardware provided by: Sentex Communications MFC after: 1 month Notes: svn path=/head/; revision=208833
* Use the same policy for rejecting / not-reject ACPI tables with incorrectJohn Baldwin2010-03-191-0/+2
| | | | | | | | | | | | | checksums as the base acpi(4) driver. This fixes a problem where the MADT parser would reject the MADT table during early boot causing the MP Table to be, but then the acpi(4) driver would attach and use non-SMP interrupt routing. Tested by: Alastair Hogge agh of coolrhaug com MFC after: 1 week Notes: svn path=/head/; revision=205332
* Simplify a macro not to generate unncessary symbols.Jung-uk Kim2009-12-081-14/+1
| | | | Notes: svn path=/head/; revision=200280
* Tweak memory allocation for amd64 suspend/resume CPU context.Jung-uk Kim2009-11-041-16/+14
| | | | Notes: svn path=/head/; revision=198931
* Try hiding annoying text cursor after the video controller is reset.Jung-uk Kim2009-10-231-0/+5
| | | | Notes: svn path=/head/; revision=198422
* Clean up amd64 suspend/resume code.Jung-uk Kim2009-10-083-33/+35
| | | | | | | | | | | - Allocate memory for wakeup code after ACPI bus is attached. The early memory allocation hack was inherited from i386 but amd64 does not need it. - Exclude real mode IVT and BDA explicitly. Improve comments about memory allocation and reason for the exclusions. It is a no-op in reality, though. - Remove an unnecessary CLD from wakeup code and re-align. Notes: svn path=/head/; revision=197863
* Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c andJung-uk Kim2009-09-271-8/+448
| | | | | | | install apm(8) and apm_bios.h on amd64. Notes: svn path=/head/; revision=197536
* Extract the code to find and map the MADT ACPI table during early kernelJohn Baldwin2009-09-232-223/+254
| | | | | | | | | | | | startup and genericize it so it can be reused to map other tables as well: - Add a routine to walk a list of ACPI subtables such as those used in the APIC and SRAT tables in the MI acpi(4) driver. - Move the routines for mapping and unmapping an ACPI table as well as mapping the RSDT or XSDT and searching for a table with a given signature out into acpica_machdep.c for both amd64 and i386. Notes: svn path=/head/; revision=197439
* Import ACPICA 20090521.Jung-uk Kim2009-06-054-7/+11
| | | | Notes: svn path=/head/; revision=193530
* Reduce code duplcations from r190620. While I am here, tweak a comment.Jung-uk Kim2009-04-021-3/+1
| | | | Notes: svn path=/head/; revision=190636