aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica/acpi_wakecode.S
Commit message (Collapse)AuthorAgeFilesLines
* amd64: Handle 5-level paging on wakeup.Konstantin Belousov2020-08-231-2/+11
| | | | | | | | | | We can switch into long mode directly with LA57 enabled. Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Notes: svn path=/head/; revision=364534
* Rename assym.s to assym.incEd Maste2018-03-201-1/+1
| | | | | | | | | | | | assym is only to be included by other .s files, and should never actually be assembled by itself. Reviewed by: imp, bdrewery (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14180 Notes: svn path=/head/; revision=331254
* Ensure that resume path on amd64 only accesses page tables for normalKonstantin Belousov2017-05-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | operation after processor is configured to allow all required features. In particular, NX must be enabled in EFER, otherwise load of page table element with nx bit set causes reserved bit page fault. Since malloc uses direct mapping for small allocations, in particular for the suspension pcbs, and DMAP is nx after r316767, this commit tripped fault on resume path. Restore complete state of EFER while wakeup code is still executing with custom page table, before calling resumectx, instead of trying to guess which features might be needed before resumectx restored EFER on its own. Bisected and tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=318318
* sys/amd64: Small spelling fixes.Pedro F. Giffuni2016-05-031-2/+2
| | | | | | | No functional change. Notes: svn path=/head/; revision=299010
* don't set CR4 PSE bit on amd64Roger Pau Monné2014-07-231-2/+2
| | | | | | | | | | | Setting PSE together with PAE or in long mode just makes the PSE bit completely ignored, so don't set it. Sponsored by: Citrix Systems R&D Reviewed by: kib Notes: svn path=/head/; revision=269017
* - Remove unused code for CR3 and CR4.Jung-uk Kim2012-06-131-5/+0
| | | | | | | - Fix few style(9) nits while I am here. Notes: svn path=/head/; revision=237037
* Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference ofMitsuru IWASAKI2012-06-091-26/+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@ Notes: svn path=/head/; revision=236772
* Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly.Jung-uk Kim2012-02-151-7/+17
| | | | Notes: svn path=/head/; revision=231787
* - Restore XCR0 before restoring extended FPU states.Jung-uk Kim2012-01-311-1/+3
| | | | | | | | | - 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-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reinitialize PAT MSR via pmap_init_pat() while resuming. This function doesJung-uk Kim2010-11-231-2/+0
| | | | | | | better job since r215703 and it is safer now. Notes: svn path=/head/; revision=215753
* savectx() has not been used for fork(2) for about 15 years. [1]Jung-uk Kim2010-08-031-2/+2
| | | | | | | | | | 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-021-2/+2
| | | | | | | | | | | | | | | | | 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
* Move i386-inherited logic of building ACPI headers for acpi_wakeup.c intoJung-uk Kim2010-07-121-2/+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
* 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-081-3/+3
| | | | | | | | | | | - 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
* Chase GDT layout changes and unbreak suspend/resume on amd64.Jung-uk Kim2009-04-021-0/+8
| | | | Notes: svn path=/head/; revision=190635
* - Clean up suspend/resume code for amd64.Jung-uk Kim2009-03-231-19/+19
| | | | | | | | | | | - Call acpi_resync_clock() to reset system time before hardclock is ready to tick. Note we assume the current timecounter hardware and RTC are already available for read operation. Tested by: mav Notes: svn path=/head/; revision=190341
* Initial suspend/resume support for amd64.Jung-uk Kim2009-03-171-0/+278
This code is heavily inspired by Takanori Watanabe's experimental SMP patch for i386 and large portion was shamelessly cut and pasted from Peter Wemm's AP boot code. Notes: svn path=/head/; revision=189903