]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/entry/entry_64.S
Merge tag 'char-misc-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[linux.git] / arch / x86 / entry / entry_64.S
index f19b43e77028eedbf666b9dbcf803c87ba8fe9a2..b0a4649e55ce8185d4cd0f5c8b778750ff067f90 100644 (file)
@@ -260,8 +260,13 @@ GLOBAL(entry_SYSCALL_64_after_hwframe)
         * Change top bits to match most significant bit (47th or 56th bit
         * depending on paging mode) in the address.
         */
+#ifdef CONFIG_X86_5LEVEL
+       ALTERNATIVE "shl $(64 - 48), %rcx; sar $(64 - 48), %rcx", \
+               "shl $(64 - 57), %rcx; sar $(64 - 57), %rcx", X86_FEATURE_LA57
+#else
        shl     $(64 - (__VIRTUAL_MASK_SHIFT+1)), %rcx
        sar     $(64 - (__VIRTUAL_MASK_SHIFT+1)), %rcx
+#endif
 
        /* If this changed %rcx, it was not canonical */
        cmpq    %rcx, %r11