summaryrefslogtreecommitdiffstats
path: root/sys/amd64/acpica
Commit message (Collapse)AuthorAgeFilesLines
* Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There isjkim2013-02-151-2/+2
| | | | no functional change.
* - Remove unused code for CR3 and CR4.jkim2012-06-131-5/+0
| | | | - Fix few style(9) nits while I am here.
* Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference ofiwasaki2012-06-093-627/+12
| | | | | | | | | | | | | | | | | | | | | | suspend/resume procedures are minimized among them. common: - Add global cpuset suspended_cpus to indicate APs are suspended/resumed. - Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used). - Add some variables in acpi_wakecode.S in order to minimize the difference among amd64 and i386. - Disable load_cr3() because now CR3 is restored in resumectx(). amd64: - Add suspend/resume related members (such as MSR) in PCB. - Modify savectx() for above new PCB members. - Merge acpi_switch.S into cpu_switch.S as resumectx(). i386: - Merge(and remove) suspendctx() into savectx() in order to match with amd64 code. Reviewed by: attilio@, acpi@
* Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.jkim2012-06-011-2/+1
|
* Tidy up code clutter in SMP case a bit. No functional change.jkim2012-06-011-10/+6
|
* Call AcpiSetFirmwareWakingVector() with interrupt disabled for consistency.jkim2012-06-011-2/+2
|
* Improve style(9) in the previous commit.jkim2012-06-011-3/+3
|
* Call AcpiLeaveSleepStatePrep() in interrupt disabled contextiwasaki2012-06-011-38/+47
| | | | | | | | | | | | | | | | | | (described in ACPICA source code). - Move intr_disable() and intr_restore() from acpi_wakeup.c to acpi.c and call AcpiLeaveSleepStatePrep() in interrupt disabled context. - Add acpi_wakeup_machdep() to execute wakeup MD procedures and call it twice in interrupt disabled/enabled context (ia64 version is just dummy). - Rename wakeup_cpus variable in acpi_sleep_machdep() to suspcpus in order to be shared by acpi_sleep_machdep() and acpi_wakeup_machdep(). - Move identity mapping related code to acpi_install_wakeup_handler() (i386 version) for preparation of x86/acpica/acpi_wakeup.c (MFC candidate). Reviewed by: jkim@ MFC after: 2 days
* Centralize declaration of the debug.acpi sysctl node.jhb2012-05-171-2/+0
|
* Re-initialize model-specific MSRs when we resume CPUs.jkim2012-03-301-0/+1
| | | | MFC after: 1 week
* Merge ACPICA 20120320.jkim2012-03-201-1/+1
|
* Fix another witness panic. We cannot enter critical section at all becausejkim2012-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
* Fix a witness panic introduced in r231797.jkim2012-03-191-2/+2
| | | | | | | Reported by: bschmidt Reviewed by: jhb Pointy hat to: jkim MFC after: 3 days
* Refine r231791. Install the resume event handler unconditionally.jkim2012-02-161-18/+11
|
* Clean up RFLAG and CR3 register handling and nearby comments. For BSP, usejkim2012-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.
* Set up an event handler to turn off speaker if user requested it. Speakerjkim2012-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.
* Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly.jkim2012-02-151-7/+17
|
* Reset clock after atrtc(4) is properly resumed.jkim2012-02-081-1/+0
|
* Restore callee saved registers later and micro-optimize.jkim2012-02-031-14/+13
|
* Fix a function prototype to reflect reality. No functional change.jkim2012-02-031-1/+1
|
* - Restore XCR0 before restoring extended FPU states.jkim2012-01-313-15/+22
| | | | | | - Update my copyright dates. Reviewed by: kib
* Naturally align a newly added wakeup_fpusave.jkim2012-01-301-2/+2
|
* Add support for the extended FPU states on amd64, both for nativekib2012-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
* With retirement of cpumask_t and usage of cpuset_t for representing aattilio2011-07-041-1/+2
| | | | | | | | | | | | | | | mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
* Commit the support for removing cpumask_t and replacing it directly withattilio2011-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
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-121-1/+1
| | | | Commit the kernel changes.
* Reinitialize PAT MSR via pmap_init_pat() while resuming. This function doesjkim2010-11-233-9/+1
| | | | better job since r215703 and it is safer now.
* Make APM emulation look more closer to its origin. Use device_get_softc(9)jkim2010-11-101-3/+2
| | | | instead of hardcoding acpi(4) unit number as we have device_t for it.
* Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a newjkim2010-11-101-449/+4
| | | | file acpi_apm.c, and place it on sys/x86/acpica.
* Now OsdEnvironment.c is identical on amd64 and i386. Move it to a new home.jkim2010-11-091-91/+0
|
* Reduce diff between platforms and fix style(9) bugs.jkim2010-11-091-15/+35
|
* Move the MADT parser for amd64 and i386 to sys/x86/acpica now that it isjhb2010-11-081-572/+0
| | | | identical on both platforms.
* A few small style and whitespace fixes.jhb2010-11-081-2/+1
|
* Move <machine/apicreg.h> to <x86/apicreg.h>.jhb2010-11-012-2/+2
|
* Move the <machine/mca.h> header to <x86/mca.h>.jhb2010-11-011-1/+1
|
* Reset switchtime to zero rather than the current CPU ticker (TSC) value.jkim2010-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.
* Reset switchtime and switchticks after resynchronizing the system clock.jkim2010-08-121-1/+3
| | | | | This should fix weird runtime problem after resume on amd64. It also fixes "calcru: runtime went backwards" warnings with bootverbose.
* 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
|
* 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-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]
* - Merge savectx2() with savectx() and struct xpcb with struct pcb. [1]jkim2010-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]
* Rename PCB_USER_FPU to PCB_USERFPU not to clash with a macro from fpu.h.jkim2010-07-291-1/+1
|
* Re-implement FPU suspend/resume for amd64. This removes superfluous usesjkim2010-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
* 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.
* Restore the machine check register banks on resume. For banks beingjhb2010-06-151-0/+2
| | | | | | | monitored via CMCI, reset the interrupt threshold to 1 on resume. Reviewed by: jkim MFC after: 2 weeks
* Fix ACPI suspend/resume on amd64, which was broken since r208833.jkim2010-06-141-1/+1
| | | | We need actual storage for FPU state to save and restore.
* Update several places that iterate over CPUs to use CPU_FOREACH().jhb2010-06-111-3/+1
|
* Introduce the x86 kernel interfaces to allow kernel code to usekib2010-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
* Use the same policy for rejecting / not-reject ACPI tables with incorrectjhb2010-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
OpenPOWER on IntegriCloud