From: Vlastimil Babka <vbabka@suse.cz>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>
Cc: "H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Dave Hansen <dave.hansen@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Tomas Pruzina <pruzinat@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>,
stable@vger.kernel.org
Subject: [PATCH] x86/init: fix build with CONFIG_SWAP=n
Date: Tue, 14 Aug 2018 20:50:47 +0200 [thread overview]
Message-ID: <20180814185047.21139-1-vbabka@suse.cz> (raw)
The introduction of generic_max_swapfile_size and arch-specific versions has
broken linking on x86 with CONFIG_SWAP=n due to undefined reference to
'generic_max_swapfile_size'. Fix it by compiling the x86-specific
max_swapfile_size() only with CONFIG_SWAP=y.
Reported-by: Tomas Pruzina <pruzinat@gmail.com>
Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2")
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: stable@vger.kernel.org
---
arch/x86/mm/init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 156ed8154af8..acfab322fbe0 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -914,6 +914,7 @@ void update_cache_mode_entry(unsigned entry, enum page_cache_mode cache)
__pte2cachemode_tbl[entry] = cache;
}
+#ifdef CONFIG_SWAP
unsigned long max_swapfile_size(void)
{
unsigned long pages;
@@ -934,3 +935,4 @@ unsigned long max_swapfile_size(void)
}
return pages;
}
+#endif
--
2.18.0
next reply other threads:[~2018-08-14 18:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 18:50 Vlastimil Babka [this message]
2018-08-14 18:59 ` [PATCH] x86/init: fix build with CONFIG_SWAP=n Linus Torvalds
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=20180814185047.21139-1-vbabka@suse.cz \
--to=vbabka@suse.cz \
--cc=ak@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pruzinat@gmail.com \
--cc=stable@vger.kernel.org \
--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).