From: Borislav Petkov <bp@alien8.de>
To: X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 05/10] x86/cpufeature: Kill cpu_has_gbpages
Date: Tue, 29 Mar 2016 17:41:58 +0200 [thread overview]
Message-ID: <1459266123-21878-6-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1459266123-21878-1-git-send-email-bp@alien8.de>
From: Borislav Petkov <bp@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
arch/x86/include/asm/cpufeature.h | 1 -
arch/x86/kvm/mmu.c | 3 ++-
arch/x86/mm/hugetlbpage.c | 4 ++--
arch/x86/mm/init.c | 2 +-
arch/x86/mm/ioremap.c | 2 +-
arch/x86/mm/pageattr.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 3da7aec9fca1..693b4aa43908 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -130,7 +130,6 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
#define cpu_has_avx boot_cpu_has(X86_FEATURE_AVX)
#define cpu_has_avx2 boot_cpu_has(X86_FEATURE_AVX2)
#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLUSH)
-#define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES)
#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT)
#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE)
#define cpu_has_xsaves boot_cpu_has(X86_FEATURE_XSAVES)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 70e95d097ef1..bc1e0b65909e 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3836,7 +3836,8 @@ reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu,
__reset_rsvds_bits_mask(vcpu, &context->shadow_zero_check,
boot_cpu_data.x86_phys_bits,
context->shadow_root_level, false,
- cpu_has_gbpages, true, true);
+ boot_cpu_has(X86_FEATURE_GBPAGES),
+ true, true);
else
__reset_rsvds_bits_mask_ept(&context->shadow_zero_check,
boot_cpu_data.x86_phys_bits,
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 740d7ac03a55..14a95054d4e0 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -162,7 +162,7 @@ static __init int setup_hugepagesz(char *opt)
unsigned long ps = memparse(opt, &opt);
if (ps == PMD_SIZE) {
hugetlb_add_hstate(PMD_SHIFT - PAGE_SHIFT);
- } else if (ps == PUD_SIZE && cpu_has_gbpages) {
+ } else if (ps == PUD_SIZE && boot_cpu_has(X86_FEATURE_GBPAGES)) {
hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
} else {
printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n",
@@ -177,7 +177,7 @@ __setup("hugepagesz=", setup_hugepagesz);
static __init int gigantic_pages_init(void)
{
/* With compaction or CMA we can allocate gigantic pages at runtime */
- if (cpu_has_gbpages && !size_to_hstate(1UL << PUD_SHIFT))
+ if (boot_cpu_has(X86_FEATURE_GBPAGES) && !size_to_hstate(1UL << PUD_SHIFT))
hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
return 0;
}
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 9d56f271d519..14377e98f279 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -173,7 +173,7 @@ static void __init probe_page_size_mask(void)
__supported_pte_mask &= ~_PAGE_GLOBAL;
/* Enable 1 GB linear kernel mappings if available: */
- if (direct_gbpages && cpu_has_gbpages) {
+ if (direct_gbpages && boot_cpu_has(X86_FEATURE_GBPAGES)) {
printk(KERN_INFO "Using GB pages for direct mapping\n");
page_size_mask |= 1 << PG_LEVEL_1G;
} else {
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 0d8d53d1f5cc..5a116ace9cbb 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -378,7 +378,7 @@ EXPORT_SYMBOL(iounmap);
int __init arch_ioremap_pud_supported(void)
{
#ifdef CONFIG_X86_64
- return cpu_has_gbpages;
+ return boot_cpu_has(X86_FEATURE_GBPAGES);
#else
return 0;
#endif
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 01be9ec3bf79..fb20c2ee0092 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -1055,7 +1055,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
/*
* Map everything starting from the Gb boundary, possibly with 1G pages
*/
- while (cpu_has_gbpages && end - start >= PUD_SIZE) {
+ while (boot_cpu_has(X86_FEATURE_GBPAGES) && end - start >= PUD_SIZE) {
set_pud(pud, __pud(cpa->pfn << PAGE_SHIFT | _PAGE_PSE |
massage_pgprot(pud_pgprot)));
--
2.7.3
next prev parent reply other threads:[~2016-03-29 15:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-29 15:41 [PATCH 00/10] x86/cpu: Some more cpu_has_YYY removal Borislav Petkov
2016-03-29 15:41 ` [PATCH 01/10] x86/cpufeature: Kill cpu_has_arch_perfmon Borislav Petkov
2016-03-31 13:01 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_arch_perfmon tip-bot for Borislav Petkov
2016-03-29 15:41 ` [PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor Borislav Petkov
2016-03-29 18:03 ` Kershner, David A
2016-03-31 13:01 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_hypervisor tip-bot for Borislav Petkov
2016-04-01 7:40 ` [tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor tip-bot for Ingo Molnar
2016-04-01 7:51 ` Borislav Petkov
2016-03-29 15:41 ` [PATCH 03/10] x86/cpufeature: Kill cpu_has_osxsave Borislav Petkov
2016-03-31 13:01 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_osxsave tip-bot for Borislav Petkov
2016-03-29 15:41 ` [PATCH 04/10] x86/cpufeature: Kill cpu_has_x2apic Borislav Petkov
2016-03-29 16:16 ` Luck, Tony
2016-03-31 13:02 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_x2apic tip-bot for Borislav Petkov
2016-03-29 15:41 ` Borislav Petkov [this message]
2016-03-31 13:02 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_gbpages tip-bot for Borislav Petkov
2016-03-29 15:41 ` [PATCH 06/10] x86/cpufeature: Kill cpu_has_clflush Borislav Petkov
2016-03-31 13:03 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_clflush tip-bot for Borislav Petkov
2016-03-29 15:42 ` [PATCH 07/10] x86/cpufeature: Kill cpu_has_xmm2 Borislav Petkov
2016-03-31 13:03 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_xmm2 tip-bot for Borislav Petkov
2016-03-29 15:42 ` [PATCH 08/10] x86/cpufeature: Kill cpu_has_pat Borislav Petkov
2016-03-30 11:28 ` [Intel-gfx] " Daniel Vetter
2016-03-31 13:00 ` [tip:x86/mm] x86/mm/pat, x86/cpufeature: Remove cpu_has_pat tip-bot for Borislav Petkov
2016-03-29 15:42 ` [PATCH 09/10] x86/cpufeature: Kill cpu_has_pge Borislav Petkov
2016-03-31 13:03 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_pge tip-bot for Borislav Petkov
2016-03-29 15:42 ` [PATCH 10/10] x86/cpufeature: Kill cpu_has_pse Borislav Petkov
2016-03-31 13:04 ` [tip:x86/cpu] x86/cpufeature: Remove cpu_has_pse tip-bot for Borislav Petkov
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=1459266123-21878-6-git-send-email-bp@alien8.de \
--to=bp@alien8.de \
--cc=linux-kernel@vger.kernel.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).