Page MenuHomeFreeBSD

Allocate non-contiguous pages for the ACPI wakeup handler
ClosedPublic

Authored by markj on Jul 8 2016, 12:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 7:32 PM
Unknown Object (File)
Mar 25 2024, 2:47 PM
Unknown Object (File)
Feb 4 2024, 12:47 PM
Unknown Object (File)
Dec 24 2023, 7:19 AM
Unknown Object (File)
Dec 24 2023, 2:20 AM
Unknown Object (File)
Dec 10 2023, 6:21 AM
Unknown Object (File)
Nov 27 2023, 5:19 AM
Unknown Object (File)
Nov 27 2023, 5:19 AM
Subscribers

Details

Summary

This implements the suggestion in D6945. With this change, we allocate
four pages. The first is used for the wakeup code, and on amd64 the last
three are used for page tables. This change makes it easier for the kernel
to satisfy the allocation request(s), without adding much complexity.

Test Plan

ACPI S3 suspend/resume on my Lenovo G580 laptop

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to Allocate non-contiguous pages for the ACPI wakeup handler.
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj edited the test plan for this revision. (Show Details)
markj added reviewers: kib, jkim.
kib edited edge metadata.
kib added inline comments.
sys/x86/acpica/acpi_wakeup.c
346 ↗(On Diff #18216)

For this to work, you should clear all pages in array before doing contigmalloc() loop.

This revision is now accepted and ready to land.Jul 8 2016, 2:11 AM
sys/x86/acpica/acpi_wakeup.c
346 ↗(On Diff #18216)

Yikes, thanks. This array was static in an earlier revision, so I didn't bother.

markj edited edge metadata.
  • Zero out the page array to fix cleanup code.
This revision now requires review to proceed.Jul 8 2016, 2:27 AM
jkim requested changes to this revision.EditedJul 8 2016, 4:11 PM
jkim edited edge metadata.

WAKECODE_PADDR() and WAKECODE_VADDR() macros do nothing now. Please replace them with sc->acpi_wakephys and sc->acpi_wakeaddr.

This revision now requires changes to proceed.Jul 8 2016, 4:11 PM

ACPI_PAGETABLES does nothing now. Please replace it with ACPI_WAKEPAGES, e.g.,

#ifdef __amd64__
#define ACPI_WAKEPAGES       4
#else
#define ACPI_WAKEPAGES       1
#endif
markj edited edge metadata.
  • Remove WAKECODE_{P,V}ADDR and ACPI_PAGETABLES.

Are there any further comments?

In D7154#149808, @markj wrote:

Are there any further comments?

I am not sure the page tables are correct. I'll take a closer look when I find some free time today.

jkim edited edge metadata.

Looks good. Please commit.

This revision is now accepted and ready to land.Jul 13 2016, 5:57 PM
This revision was automatically updated to reflect the committed changes.