linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Sean Christopherson" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
	Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: core/headers] x86/ACPI/sleep: Move acpi_wakeup_address() definition into sleep.c, remove <asm/realmode.h> from <asm/acpi.h>
Date: Tue, 26 Nov 2019 08:00:10 -0000	[thread overview]
Message-ID: <157475521001.21853.838192988655814386.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20191119002121.4107-13-sean.j.christopherson@intel.com>

The following commit has been merged into the core/headers branch of tip:

Commit-ID:     7c8dfff8783bdc19696b563e01c588e81205ef15
Gitweb:        https://git.kernel.org/tip/7c8dfff8783bdc19696b563e01c588e81205ef15
Author:        Sean Christopherson <sean.j.christopherson@intel.com>
AuthorDate:    Mon, 18 Nov 2019 16:21:21 -08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 19 Nov 2019 17:50:27 +01:00

x86/ACPI/sleep: Move acpi_wakeup_address() definition into sleep.c, remove <asm/realmode.h> from <asm/acpi.h>

Move the definition of acpi_wakeup_address() into sleep.c to break
linux/acpi.h's dependency (by way of asm/acpi.h) on asm/realmode.h.
Everyone and their mother includes linux/acpi.h, i.e. modifying
realmode.h results in a full kernel rebuild, which makes the already
inscrutable real mode boot code even more difficult to understand and is
positively rage inducing when trying to make changes to x86's boot flow.

[ mingo: Renamed acpi_wakeup_address() to acpi_get_wakeup_address(), as suggested by Borislav Petkov. ]

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191119002121.4107-13-sean.j.christopherson@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/ia64/include/asm/acpi.h |  2 +-
 arch/x86/include/asm/acpi.h  |  6 +-----
 arch/x86/kernel/acpi/sleep.c | 11 +++++++++++
 drivers/acpi/sleep.c         |  4 ++--
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
index 36d7003..b66ba90 100644
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -38,7 +38,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 /* Low-level suspend routine. */
 extern int acpi_suspend_lowlevel(void);
 
-static inline unsigned long acpi_wakeup_address(void)
+static inline unsigned long acpi_get_wakeup_address(void)
 {
 	return 0;
 }
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 57788ec..ca09764 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -13,7 +13,6 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/mpspec.h>
-#include <asm/realmode.h>
 #include <asm/x86_init.h>
 
 #ifdef CONFIG_ACPI_APEI
@@ -62,10 +61,7 @@ static inline void acpi_disable_pci(void)
 extern int (*acpi_suspend_lowlevel)(void);
 
 /* Physical address to resume after wakeup */
-static inline unsigned long acpi_wakeup_address(void)
-{
-	return ((unsigned long)(real_mode_header->wakeup_start));
-}
+unsigned long acpi_get_wakeup_address(void);
 
 /*
  * Check if the CPU can handle C2 and deeper
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index ca13851..26b7256 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -27,6 +27,17 @@ static char temp_stack[4096];
 #endif
 
 /**
+ * acpi_get_wakeup_address - provide physical address for S3 wakeup
+ *
+ * Returns the physical address where the kernel should be resumed after the
+ * system awakes from S3, e.g. for programming into the firmware waking vector.
+ */
+unsigned long acpi_get_wakeup_address(void)
+{
+	return ((unsigned long)(real_mode_header->wakeup_start));
+}
+
+/**
  * x86_acpi_enter_sleep_state - enter sleep state
  * @state: Sleep state to enter.
  *
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index f5cca9f..6d3b2ea 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -63,9 +63,9 @@ static int acpi_sleep_prepare(u32 acpi_state)
 #ifdef CONFIG_ACPI_SLEEP
 	/* do we have a wakeup address for S2 and S3? */
 	if (acpi_state == ACPI_STATE_S3) {
-		if (!acpi_wakeup_address())
+		if (!acpi_get_wakeup_address())
 			return -EFAULT;
-		acpi_set_waking_vector(acpi_wakeup_address());
+		acpi_set_waking_vector(acpi_get_wakeup_address());
 
 	}
 	ACPI_FLUSH_CPU_CACHE();

  parent reply	other threads:[~2019-11-26  8:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  0:21 [PATCH 00/12] treewide: break dependencies on x86's RM header Sean Christopherson
2019-11-19  0:21 ` [PATCH 01/12] x86/efi: Explicitly include realmode.h to handle RM trampoline quirk Sean Christopherson
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 02/12] x86/boot: Explicitly include realmode.h to handle RM reservations Sean Christopherson
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 03/12] x86/ftrace: Explicitly include vmalloc.h for set_vm_flush_reset_perms() Sean Christopherson
2019-11-22  2:11   ` Steven Rostedt
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 04/12] x86/kprobes: " Sean Christopherson
2019-11-22  2:12   ` Steven Rostedt
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 05/12] perf/x86/intel: Explicitly include asm/io.h to use virt_to_phys() Sean Christopherson
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 06/12] efi/capsule-loader: Explicitly include linux/io.h for page_to_phys() Sean Christopherson
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 07/12] virt: vbox: Explicitly include linux/io.h to pick up various defs Sean Christopherson
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 08/12] vmw_balloon: Explicitly include linux/io.h for virt_to_phys() Sean Christopherson
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 09/12] ASoC: Intel: Skylake: " Sean Christopherson
2019-11-19 12:00   ` Mark Brown
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 10/12] x86/ACPI/sleep: Remove an unnecessary include of asm/realmode.h Sean Christopherson
2019-11-20 10:59   ` Rafael J. Wysocki
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 11/12] ACPI/sleep: Convert acpi_wakeup_address into a function Sean Christopherson
2019-11-20 10:58   ` Rafael J. Wysocki
2019-11-25 10:48     ` Pavel Machek
2019-11-25 17:00       ` Sean Christopherson
2019-11-26 11:16         ` Ingo Molnar
2019-11-26 11:25           ` Ingo Molnar
2019-11-26  8:00   ` [tip: core/headers] " tip-bot2 for Sean Christopherson
2019-11-19  0:21 ` [PATCH 12/12] x86/ACPI/sleep: Move acpi_wakeup_address() definition into sleep.c Sean Christopherson
2019-11-20 11:00   ` Rafael J. Wysocki
2019-11-26  8:00   ` tip-bot2 for Sean Christopherson [this message]
2019-11-19 11:10 ` [PATCH 00/12] treewide: break dependencies on x86's RM header Ingo Molnar
2019-11-19 12:06   ` [PATCH] x86/platform/intel/quark: Explicitly include linux/io.h for virt_to_phys() Ingo Molnar
2019-11-19 12:38     ` Andy Shevchenko
2019-11-19 12:09   ` [PATCH 00/12] treewide: break dependencies on x86's RM header Ard Biesheuvel
2019-11-19 12:22     ` Ingo Molnar
2019-11-19 12:33       ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157475521001.21853.838192988655814386.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).