Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1706514
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCHv4 06/14] x86/boot/compressed/64: Detect and handle 5-level paging at boot-time |
| Date | Tue, 08 Aug 2017 15:00:02 +0200 |
| Message-ID | <ucch4-8wk-19@gated-at.bofh.it> (permalink) |
| References | <ucch3-8wk-3@gated-at.bofh.it> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.41,343,1498546800"; d="scan'208";a="887795612" |
| X-Mailer | git-send-email 2.13.2 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 52 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Andi Kleen <ak@linux.intel.com>, Dave Hansen <dave.hansen@intel.com>, Andy Lutomirski <luto@amacapital.net>, Michal Hocko <mhocko@kernel.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> |
| X-Original-Date | Tue, 8 Aug 2017 15:54:07 +0300 |
| X-Original-Message-ID | <20170808125415.78842-7-kirill.shutemov@linux.intel.com> |
| X-Original-References | <20170808125415.78842-1-kirill.shutemov@linux.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1706514 |
Show key headers only | View raw
This patch prepare decompression code to boot-time switching between 4- and 5-level paging. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> --- arch/x86/boot/compressed/head_64.S | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index fbf4c32d0b62..2e362aea3319 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -347,6 +347,28 @@ preferred_addr: leaq boot_stack_end(%rbx), %rsp #ifdef CONFIG_X86_5LEVEL + /* Preserve rbx across cpuid */ + movq %rbx, %r8 + + /* Check if leaf 7 is supported */ + movl $0, %eax + cpuid + cmpl $7, %eax + jb lvl5 + + /* + * Check if la57 is supported. + * The feature is enumerated with CPUID.(EAX=07H, ECX=0):ECX[bit 16] + */ + movl $7, %eax + movl $0, %ecx + cpuid + andl $(1 << 16), %ecx + jz lvl5 + + /* Restore rbx */ + movq %r8, %rbx + /* Check if 5-level paging has already enabled */ movq %cr4, %rax testl $X86_CR4_LA57, %eax @@ -386,6 +408,8 @@ preferred_addr: pushq %rax lretq lvl5: + /* Restore rbx */ + movq %r8, %rbx #endif /* Zero EFLAGS */ -- 2.13.2
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCHv4 06/14] x86/boot/compressed/64: Detect and handle 5-level paging at boot-time "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-08-08 15:00 +0200
csiph-web