aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica
Commit message (Collapse)AuthorAgeFilesLines
* power: Add stype parameter in power_suspend/resume eventhandlersAymeric Wibo2025-10-061-2/+2
| | | | | | | | | | Add enum sleep_type stype parameter in power_suspend/resume event handlers, as with the introduction of s2idle there are more than one type of suspend. Reviewed by: bz Approved by: bz Sponsored by: The FreeBSD Foundation
* amd64: Remove support for "nooptions SMP"Mark Johnston2025-07-211-18/+0
| | | | | | | | | | | It does not appear to get much, if any, testing, and doesn't seem to be worth the maintenance overhead. Virtually all amd64 hardware has multiple cores. The CPU and memory usage overhead of the SMP option in single-vCPU VMs is quite marginal and not worth maintaining. Reviewed by: alc (pmap.c), kib Differential Revision: https://reviews.freebsd.org/D51403 Differential Revision: https://reviews.freebsd.org/D51345
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* Replace calls to bus_generic_probe with bus_identify_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47674
* vmm: Correctly suspend and resume the vmm driver.Joshua Rogers2024-11-291-0/+3
| | | | | | | | | | | | | | | Previously, VMXON would be executed on a resume, contrary to proper initalization. The contents of MSR_IA32_FEATURE_CONTROL may be lost on suspension, therefore must be restored. Likewise, the VMX Enable bit may be cleared upon suspend, requiring it to be re-set. Concretely disable VMX on suspend, and re-enable it on resume. Note: any IOMMU context will remain lost for any enabled vmm devices. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: jhb,imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1419
* Deprecate contigfree(9) in favour of free(9)Bjoern A. Zeeb2024-07-261-2/+1
| | | | | | | | | | | | | | | As of 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b contigfree(9) is no longer needed and should not be used anymore. We leave a wrapper for 3rd party code in at least 15.x but remove (almost) all other cases from the tree. This leaves one use of contigfree(9) untouched; that was the original trigger for 9e6544dd6e02 and is handled in D45813 (to be committed seperately later). Sponsored by: The FreeBSD Foundation Reviewed by: markj, kib Tested by: pho (10h stress test run) Differential Revision: https://reviews.freebsd.org/D46099
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-272-2/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* x86: AMD Zen2: Zenbleed chicken bit mitigationOlivier Certner2023-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applies only to bare-metal Zen2 processors. The system currently automatically applies it to all of them. Tunable/sysctl 'machdep.mitigations.zenbleed.enable' can be used to forcibly enable or disable the mitigation at boot or run-time. Possible values are: 0: Mitigation disabled 1: Mitigation enabled 2: Run the automatic determination. Currently, value 2 is the default and has identical effect as value 1. This might change in the future if we choose to take into account microcode revisions in the automatic determination process. The tunable/sysctl value is simply ignored on non-applicable CPU models, which is useful to apply the same configuration on a set of machines that do not all have Zen2 processors. Trying to set it to any integer value not listed above is silently equivalent to setting it to value 2 (automatic determination). The current mitigation state can be queried through sysctl 'machdep.mitigations.zenbleed.state', which returns "Not applicable", "Mitigation enabled" or "Mitigation disabled". Note that this state is not guaranteed to be accurate in case of intervening modifications of the corresponding chicken bit directly via cpuctl(4) (this includes the cpucontrol(8) utility). Resetting the desired policy through 'machdep.mitigations.zenbleed.enable' (possibly to its current value) will reset the hardware state and ensure that the reported state is again coherent with it. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41817
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* x86: Move i386 timerreg.h to x86Dmitry Chagin2023-04-201-1/+1
| | | | | | Reviewed by: emaste, jhb Differential Revision: https://reviews.freebsd.org/D39656 MFC after: 1 month
* x86: Move i386 ppireg.h to x86Dmitry Chagin2023-04-201-1/+1
| | | | | Differential Revision: https://reviews.freebsd.org/D39655 MFC after: 1 month
* amd64 wakeup: recalculate mitigations after APICs are wokenKonstantin Belousov2023-03-291-5/+7
| | | | | | | | | | | APICs are needed to broadcast IPIs for MSR writes. PR: 270489 Reviewed by: dchagin, emaste, jhb Tested by: dchagin, manu Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39302
* acpi_wakeup.c: apply the reviewer' editorial corrections to the comment text.Konstantin Belousov2023-03-181-2/+2
| | | | | | Fixes: 02904a06c76be857307b78184863654b9e7b88ab MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39146
* amd64: properly recalculate mitigations knobs after resumeKonstantin Belousov2023-03-181-0/+14
| | | | | | | | | | | | | | | | | | Revision r333125 AKA 986c4ca38772f72 forced clear cpu_stdext_feature3 on suspend, since at that time microcode update was not reloaded early on resume. Then, revision 050f5a8405c63 started re-reading cpu_stdext_feature3 again. Since modern CPUs do not require mitigations from the Skylake era, this went unnoticed for some time. Keep zeroing cpu_stdext_feature3 on suspend, but re-read it in more controlled way on resume after microcode is reloaded, and recalculate active workarounds based on actual microcode capabilities. Reported and tested by: romain Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39146
* amd64 acpi_wakeup.c: fix typoKonstantin Belousov2023-03-171-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* acpica: Merge ACPICA 20221020Jung-uk Kim2022-10-281-2/+2
|
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-221-12/+9
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* acpi: Move some errors with RSDP and XSLT out from under bootverboseWarner Losh2022-09-011-8/+4
| | | | | | | | | | | Failure to map RSDP, XSLT and checksum failures are events that can't happen unless something has gone wrong. As such, they should be reported always, and not in bootverbose. This has been this way since it was originally brought in to parse APIC tables. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D36406
* acpi: Unmap RSDP in more error casesWarner Losh2022-09-011-0/+6
| | | | | | | | | Add missing pmap_unmapbios() calls for when we return 0. Otherwise we can leave the table mapped when it is of no use. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D36405
* amd64: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-2/+1
|
* amd64 wakeup: rework trampoline page allocationKonstantin Belousov2021-09-131-35/+44
| | | | | | | | | | | | | There is no need to restrict trampoline page table to low 1M, it should work with any pages below 4G. Only wakeup code itself should be below 1M. Do not waste level 5 page when LA48 mode is used. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31931
* x86: duplicate acpi_wakeup.c per i386 and amd64Konstantin Belousov2021-09-131-0/+440
| | | | | | | | | | | The file as is is the maze of #ifdef passages, all slightly different. Divorcing i386 and amd64 version actually makes changing the code easier, also no changes for i386 are planned. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31931
* acpi: Fix a repeated comment typoJessica Clarke2021-07-191-1/+1
|
* acpi: Fix a repeated vm_offset_t that should be a vm_size_tJessica Clarke2021-07-191-1/+1
| | | | | | The underlying types for both are the same so arguably this doesn't really matter, but using the wrong type is still confusing and technically incorrect.
* acpi: Make nexus_acpi quiet on amd64 and i386Mark Johnston2021-03-051-1/+1
| | | | | | | | | | Otherwise during attach newbus prints "nexus0", which is not very useful. The generic nexus device is already quiet, as is nexus_acpi on arm64. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* amd64: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365067
* 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
* Use pmap_mapbios() to map ACPI tables on amd64 and i386.Mark Johnston2020-08-201-92/+19
| | | | | | | | | | | | | | | | | | | The ACPI table-mapping code used pmap_kenter_temporary() to create mappings, which in turn uses the fixed-size crashdump map. Moreover, the code was not verifying that the table fits in this map, so when mapping large tables we could clobber adjacent mappings. This use of pmap_kenter_temporary() appears to predate support in pmap_mapbios() for creating early mappings, but that restriction no longer applies. PR: 248746 Reviewed by: kib, mav Tested by: gallatin, Curtis Villamizar <curtis@ipv6.occnc.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26125 Notes: svn path=/head/; revision=364411
* Remove some noisy ACPI tables messages from verbose dmesg.Alexander Motin2020-08-191-9/+1
| | | | | | | | | | | | Those messages were printed hundreds of times during boot, often multiple times for each table. We already print information about the tables in more organized form once to not duplicate it when random ACPI drivers are attaching. MFC after: 1 week Notes: svn path=/head/; revision=364399
* Merge ACPICA 20190329.Jung-uk Kim2019-03-291-2/+2
| | | | Notes: svn path=/head/; revision=345713
* 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
* Partially revert r197863 to reduce diff against i386.Jung-uk Kim2018-02-241-9/+3
| | | | | | | | | | | | | | | | When I wrote the patch, I wanted to remove SYSINIT() usage from amd64 code. There is no reason to keep the divergence any more because iwasaki merged most amd64 suspend/resume code to i386 with r235622. Note this also fixed an enge case reported by royger. [1] Suggested by: jhb Reviewed by: royger Tested by: royger [1] MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14400 [1] Notes: svn path=/head/; revision=329889
* sys/amd64: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326257
* 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
* If x86 CPU implementation of the MWAIT instruction reasonablyKonstantin Belousov2015-05-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | interacts with interrupts, query ACPI and use MWAIT for entrance into Cx sleep states. Support C1 "I/O then halt" mode. See Intel' document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface Specification" for description. Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use it instead of inlining "sti; hlt" sequence in several places. In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported} sysctls. Both jkim and avg have some other patches implementing the mwait functionality; this work is unrelated. Linux does not rely on the ACPI to provide correct tables describing Cx modes. Instead, the driver has pre-defined knowledge of the CPU models, it was supplied by Intel. Tested by: pho (previous versions) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282678
* 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
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-3/+2
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-2/+3
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There isJung-uk Kim2013-02-151-2/+2
| | | | | | | no functional change. Notes: svn path=/head/; revision=246855
* - 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-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@ Notes: svn path=/head/; revision=236772
* Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.Jung-uk Kim2012-06-011-2/+1
| | | | Notes: svn path=/head/; revision=236424
* Tidy up code clutter in SMP case a bit. No functional change.Jung-uk Kim2012-06-011-10/+6
| | | | Notes: svn path=/head/; revision=236419
* Call AcpiSetFirmwareWakingVector() with interrupt disabled for consistency.Jung-uk Kim2012-06-011-2/+2
| | | | Notes: svn path=/head/; revision=236414
* Improve style(9) in the previous commit.Jung-uk Kim2012-06-011-3/+3
| | | | Notes: svn path=/head/; revision=236409
* Call AcpiLeaveSleepStatePrep() in interrupt disabled contextMitsuru IWASAKI2012-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 Notes: svn path=/head/; revision=236403