Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315527 > unrolled thread

[PATCH] x86/head_64.S: do not use temporary register to check alignment

Started byAlexander Kuleshov <kuleshovmail@gmail.com>
First post2016-01-23 08:00 +0100
Last post2016-01-26 10:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/head_64.S: do not use temporary register to check alignment Alexander Kuleshov <kuleshovmail@gmail.com> - 2016-01-23 08:00 +0100
    Re: [PATCH] x86/head_64.S: do not use temporary register to check  alignment Borislav Petkov <bp@suse.de> - 2016-01-26 10:40 +0100

#1315527 — [PATCH] x86/head_64.S: do not use temporary register to check alignment

FromAlexander Kuleshov <kuleshovmail@gmail.com>
Date2016-01-23 08:00 +0100
Subject[PATCH] x86/head_64.S: do not use temporary register to check alignment
Message-ID<qU0l4-7kW-11@gated-at.bofh.it>
We are using temporary %rax register during checking of kernel address
alignment. We can ged rid of it since testl instruction is safe and does
not change value of the rbp register.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Suggested-by: Brian Gerst <brgerst@gmail.com>
---
 arch/x86/kernel/head_64.S | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index ffdc0e8..7c21029 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -76,9 +76,7 @@ startup_64:
 	subq	$_text - __START_KERNEL_map, %rbp
 
 	/* Is the address not 2M aligned? */
-	movq	%rbp, %rax
-	andl	$~PMD_PAGE_MASK, %eax
-	testl	%eax, %eax
+	testl	$~PMD_PAGE_MASK, %ebp
 	jnz	bad_address
 
 	/*
-- 
2.7.0.25.gfc10eb5

[toc] | [next] | [standalone]


#1317674 — Re: [PATCH] x86/head_64.S: do not use temporary register to check alignment

FromBorislav Petkov <bp@suse.de>
Date2016-01-26 10:40 +0100
SubjectRe: [PATCH] x86/head_64.S: do not use temporary register to check alignment
Message-ID<qV8gq-28S-9@gated-at.bofh.it>
In reply to#1315527
On Sat, Jan 23, 2016 at 12:50:28PM +0600, Alexander Kuleshov wrote:
> We are using temporary %rax register during checking of kernel address
> alignment. We can ged rid of it since testl instruction is safe and does
> not change value of the rbp register.
> 
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> Suggested-by: Brian Gerst <brgerst@gmail.com>
> ---
>  arch/x86/kernel/head_64.S | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
> index ffdc0e8..7c21029 100644
> --- a/arch/x86/kernel/head_64.S
> +++ b/arch/x86/kernel/head_64.S
> @@ -76,9 +76,7 @@ startup_64:
>  	subq	$_text - __START_KERNEL_map, %rbp
>  
>  	/* Is the address not 2M aligned? */
> -	movq	%rbp, %rax
> -	andl	$~PMD_PAGE_MASK, %eax
> -	testl	%eax, %eax
> +	testl	$~PMD_PAGE_MASK, %ebp
>  	jnz	bad_address
>  
>  	/*
> --

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web