WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH RFC V4 09/10] x86/jump_label: use GENERIC_NOP5_AT

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH RFC V4 09/10] x86/jump_label: use GENERIC_NOP5_ATOMIC instead of jmp5 +0
From: "H. Peter Anvin" <hpa@xxxxxxxxx>
Date: Fri, 14 Oct 2011 14:53:35 -0700
Cc: the arch/x86 maintainers <x86@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Jan Glauber <jang@xxxxxxxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Jason Baron <jbaron@xxxxxxxxxx>, David Daney <david.daney@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Michael Ellerman <michael@xxxxxxxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>
Delivery-date: Fri, 14 Oct 2011 14:55:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E97188A.6040400@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <cover.1318464169.git.jeremy.fitzhardinge@xxxxxxxxxx> <34ede5db1571d541a5c3fc49923bb353a37dd431.1318464413.git.jeremy.fitzhardinge@xxxxxxxxxx> <4E97067A.2070305@xxxxxxxxx> <4E97188A.6040400@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0
On 10/13/2011 09:57 AM, Jeremy Fitzhardinge wrote:
> 
> Something like this?
> 
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> Date: Thu, 13 Oct 2011 09:55:25 -0700
> Subject: [PATCH] x86/nop: we can use P6 as generic NOP on 64-bit
> 
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> 
> diff --git a/arch/x86/include/asm/nops.h b/arch/x86/include/asm/nops.h
> index 405b403..f9fead9 100644
> --- a/arch/x86/include/asm/nops.h
> +++ b/arch/x86/include/asm/nops.h
> @@ -19,15 +19,15 @@
>     6: leal 0x00000000(%esi),%esi
>     7: leal 0x00000000(,%esi,1),%esi
>  */
> -#define GENERIC_NOP1 0x90
> -#define GENERIC_NOP2 0x89,0xf6
> -#define GENERIC_NOP3 0x8d,0x76,0x00
> -#define GENERIC_NOP4 0x8d,0x74,0x26,0x00
> -#define GENERIC_NOP5 GENERIC_NOP1,GENERIC_NOP4
> -#define GENERIC_NOP6 0x8d,0xb6,0x00,0x00,0x00,0x00
> -#define GENERIC_NOP7 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00
> -#define GENERIC_NOP8 GENERIC_NOP1,GENERIC_NOP7
> -#define GENERIC_NOP5_ATOMIC NOP_DS_PREFIX,GENERIC_NOP4
> +#define GAS_NOP1 0x90
> +#define GAS_NOP2 0x89,0xf6
> +#define GAS_NOP3 0x8d,0x76,0x00
> +#define GAS_NOP4 0x8d,0x74,0x26,0x00
> +#define GAS_NOP5 GENERIC_NOP1,GENERIC_NOP4
> +#define GAS_NOP6 0x8d,0xb6,0x00,0x00,0x00,0x00
> +#define GAS_NOP7 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00
> +#define GAS_NOP8 GENERIC_NOP1,GENERIC_NOP7
> +#define GAS_NOP5_ATOMIC NOP_DS_PREFIX,GENERIC_NOP4
>  

They're not really the gas nops, either.  If you want to rename them I
would suggest GENERIC32_*

>  /* Opteron 64bit nops
>     1: nop
> @@ -87,6 +87,28 @@
>  #define P6_NOP8      0x0f,0x1f,0x84,0x00,0,0,0,0
>  #define P6_NOP5_ATOMIC P6_NOP5
>  
> +#ifdef CONFIG_X86_32
> +#define GENERIC_NOP1         GAS_NOP1
> +#define GENERIC_NOP2         GAS_NOP2
> +#define GENERIC_NOP3         GAS_NOP3
> +#define GENERIC_NOP4         GAS_NOP4
> +#define GENERIC_NOP5         GAS_NOP5
> +#define GENERIC_NOP6         GAS_NOP6
> +#define GENERIC_NOP7         GAS_NOP7
> +#define GENERIC_NOP8         GAS_NOP8
> +#define GENERIC_NOP5_ATOMIC  GAS_NOP5_ATOMIC
> +#else
> +#define GENERIC_NOP1         P6_NOP1
> +#define GENERIC_NOP2         P6_NOP2
> +#define GENERIC_NOP3         P6_NOP3
> +#define GENERIC_NOP4         P6_NOP4
> +#define GENERIC_NOP5         P6_NOP5
> +#define GENERIC_NOP6         P6_NOP6
> +#define GENERIC_NOP7         P6_NOP7
> +#define GENERIC_NOP8         P6_NOP8
> +#define GENERIC_NOP5_ATOMIC  P6_NOP5_ATOMIC
> +#endif
> +

Make sure you change all the downstream users too.

        -hpa


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel