[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180720121417.337640444@linuxfoundation.org>
Date: Fri, 20 Jul 2018 14:13:06 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, "H. Peter Anvin" <hpa@...ux.intel.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Sedat Dilek <sedat.dilek@...il.com>,
Juergen Gross <jgross@...e.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>, acme@...hat.com,
akataria@...are.com, akpm@...ux-foundation.org,
andrea.parri@...rulasolutions.com, ard.biesheuvel@...aro.org,
arnd@...db.de, aryabinin@...tuozzo.com, astrachan@...gle.com,
boris.ostrovsky@...cle.com, brijesh.singh@....com,
caoj.fnst@...fujitsu.com, geert@...ux-m68k.org,
ghackmann@...gle.com, jan.kiszka@...mens.com,
jarkko.sakkinen@...ux.intel.com, joe@...ches.com,
jpoimboe@...hat.com, keescook@...gle.com,
kirill.shutemov@...ux.intel.com, kstewart@...uxfoundation.org,
linux-efi@...r.kernel.org, linux-kbuild@...r.kernel.org,
manojgupta@...gle.com, mawilcox@...rosoft.com,
michal.lkml@...kovi.net, mjg59@...gle.com, mka@...omium.org,
pombredanne@...b.com, rientjes@...gle.com, rostedt@...dmis.org,
thomas.lendacky@....com, tstellar@...hat.com, tweek@...gle.com,
virtualization@...ts.linux-foundation.org, will.deacon@....com,
yamada.masahiro@...ionext.com, Ingo Molnar <mingo@...nel.org>
Subject: [PATCH 4.14 02/92] x86/asm: Add _ASM_ARG* constants for argument registers to <asm/asm.h>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: H. Peter Anvin <hpa@...ux.intel.com>
commit 0e2e160033283e20f688d8bad5b89460cc5bfcc4 upstream.
i386 and x86-64 uses different registers for arguments; make them
available so we don't have to #ifdef in the actual code.
Native size and specified size (q, l, w, b) versions are provided.
Signed-off-by: H. Peter Anvin <hpa@...ux.intel.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Reviewed-by: Sedat Dilek <sedat.dilek@...il.com>
Acked-by: Juergen Gross <jgross@...e.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: acme@...hat.com
Cc: akataria@...are.com
Cc: akpm@...ux-foundation.org
Cc: andrea.parri@...rulasolutions.com
Cc: ard.biesheuvel@...aro.org
Cc: arnd@...db.de
Cc: aryabinin@...tuozzo.com
Cc: astrachan@...gle.com
Cc: boris.ostrovsky@...cle.com
Cc: brijesh.singh@....com
Cc: caoj.fnst@...fujitsu.com
Cc: geert@...ux-m68k.org
Cc: ghackmann@...gle.com
Cc: gregkh@...uxfoundation.org
Cc: jan.kiszka@...mens.com
Cc: jarkko.sakkinen@...ux.intel.com
Cc: joe@...ches.com
Cc: jpoimboe@...hat.com
Cc: keescook@...gle.com
Cc: kirill.shutemov@...ux.intel.com
Cc: kstewart@...uxfoundation.org
Cc: linux-efi@...r.kernel.org
Cc: linux-kbuild@...r.kernel.org
Cc: manojgupta@...gle.com
Cc: mawilcox@...rosoft.com
Cc: michal.lkml@...kovi.net
Cc: mjg59@...gle.com
Cc: mka@...omium.org
Cc: pombredanne@...b.com
Cc: rientjes@...gle.com
Cc: rostedt@...dmis.org
Cc: thomas.lendacky@....com
Cc: tstellar@...hat.com
Cc: tweek@...gle.com
Cc: virtualization@...ts.linux-foundation.org
Cc: will.deacon@....com
Cc: yamada.masahiro@...ionext.com
Link: http://lkml.kernel.org/r/20180621162324.36656-3-ndesaulniers@google.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
arch/x86/include/asm/asm.h | 59 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -46,6 +46,65 @@
#define _ASM_SI __ASM_REG(si)
#define _ASM_DI __ASM_REG(di)
+#ifndef __x86_64__
+/* 32 bit */
+
+#define _ASM_ARG1 _ASM_AX
+#define _ASM_ARG2 _ASM_DX
+#define _ASM_ARG3 _ASM_CX
+
+#define _ASM_ARG1L eax
+#define _ASM_ARG2L edx
+#define _ASM_ARG3L ecx
+
+#define _ASM_ARG1W ax
+#define _ASM_ARG2W dx
+#define _ASM_ARG3W cx
+
+#define _ASM_ARG1B al
+#define _ASM_ARG2B dl
+#define _ASM_ARG3B cl
+
+#else
+/* 64 bit */
+
+#define _ASM_ARG1 _ASM_DI
+#define _ASM_ARG2 _ASM_SI
+#define _ASM_ARG3 _ASM_DX
+#define _ASM_ARG4 _ASM_CX
+#define _ASM_ARG5 r8
+#define _ASM_ARG6 r9
+
+#define _ASM_ARG1Q rdi
+#define _ASM_ARG2Q rsi
+#define _ASM_ARG3Q rdx
+#define _ASM_ARG4Q rcx
+#define _ASM_ARG5Q r8
+#define _ASM_ARG6Q r9
+
+#define _ASM_ARG1L edi
+#define _ASM_ARG2L esi
+#define _ASM_ARG3L edx
+#define _ASM_ARG4L ecx
+#define _ASM_ARG5L r8d
+#define _ASM_ARG6L r9d
+
+#define _ASM_ARG1W di
+#define _ASM_ARG2W si
+#define _ASM_ARG3W dx
+#define _ASM_ARG4W cx
+#define _ASM_ARG5W r8w
+#define _ASM_ARG6W r9w
+
+#define _ASM_ARG1B dil
+#define _ASM_ARG2B sil
+#define _ASM_ARG3B dl
+#define _ASM_ARG4B cl
+#define _ASM_ARG5B r8b
+#define _ASM_ARG6B r9b
+
+#endif
+
/*
* Macros to generate condition code outputs from inline assembly,
* The output operand must be type "bool".
Powered by blists - more mailing lists