diff mbox

[v5,2/3] x86/asm: add _ASM_ARG* constants for argument registers to <asm/asm.h>

Message ID 20180613210518.113983-3-ndesaulniers@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nick Desaulniers June 13, 2018, 9:05 p.m. UTC
From: "H. Peter Anvin" <hpa@linux.intel.com>

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.

Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/x86/include/asm/asm.h | 59 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

Comments

H. Peter Anvin June 14, 2018, 8:47 p.m. UTC | #1
On 06/13/18 14:05, Nick Desaulniers wrote:
> From: "H. Peter Anvin" <hpa@linux.intel.com>
> 
> 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.
> 
> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

I still object to Suggested-by: here.  Sedat did a correction, which is
a Reviewed-by:, but unless I'm completely out to sea, there was no
suggestion on Sedat's part of this; and I had certainly not seen it when
I wrote the code.

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nick Desaulniers June 14, 2018, 8:59 p.m. UTC | #2
On Thu, Jun 14, 2018 at 1:48 PM H. Peter Anvin <hpa@zytor.com> wrote:
>
> On 06/13/18 14:05, Nick Desaulniers wrote:
> > From: "H. Peter Anvin" <hpa@linux.intel.com>
> >
> > 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.
> >
> > Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
> I still object to Suggested-by: here.  Sedat did a correction, which is
> a Reviewed-by:, but unless I'm completely out to sea, there was no
> suggestion on Sedat's part of this; and I had certainly not seen it when
> I wrote the code.

I'm fine with changing it from a Suggested-by to a Reviewed-by.  Can
you do that when you apply the set, or should I send a v6?
H. Peter Anvin June 15, 2018, 12:17 a.m. UTC | #3
On 06/14/18 13:59, Nick Desaulniers wrote:
> On Thu, Jun 14, 2018 at 1:48 PM H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> On 06/13/18 14:05, Nick Desaulniers wrote:
>>> From: "H. Peter Anvin" <hpa@linux.intel.com>
>>>
>>> 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.
>>>
>>> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
>>> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
>>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>>
>> I still object to Suggested-by: here.  Sedat did a correction, which is
>> a Reviewed-by:, but unless I'm completely out to sea, there was no
>> suggestion on Sedat's part of this; and I had certainly not seen it when
>> I wrote the code.
> 
> I'm fine with changing it from a Suggested-by to a Reviewed-by.  Can
> you do that when you apply the set, or should I send a v6?
> 

I'm not handling patch mechanics for x86 at the moment.

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sedat Dilek June 15, 2018, 4:04 a.m. UTC | #4
On Thu, Jun 14, 2018 at 10:59 PM, Nick Desaulniers
<ndesaulniers@google.com> wrote:
> On Thu, Jun 14, 2018 at 1:48 PM H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> On 06/13/18 14:05, Nick Desaulniers wrote:
>> > From: "H. Peter Anvin" <hpa@linux.intel.com>
>> >
>> > 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.
>> >
>> > Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
>> > Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
>> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>>
>> I still object to Suggested-by: here.  Sedat did a correction, which is
>> a Reviewed-by:, but unless I'm completely out to sea, there was no
>> suggestion on Sedat's part of this; and I had certainly not seen it when
>> I wrote the code.
>
> I'm fine with changing it from a Suggested-by to a Reviewed-by.  Can
> you do that when you apply the set, or should I send a v6?
>

Hi,

this issue with Clang and Paravirt is such an ancient issue.
Back to the days in 2011 before LLVMlinux was born, the project was
called lll-project.
Fact is the issue is today fixed.
Not sure about the credits Suggested-by/Reviewed-by in the
Linux-kernel development process.
I did not count the number of compiler runs here.
A Tested-by is OK for me.
Anyway, the beast is dead, this counts for me.

Regards,
- Sedat -
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nick Desaulniers June 20, 2018, 4:40 p.m. UTC | #5
On Thu, Jun 14, 2018 at 5:17 PM H. Peter Anvin <hpa@zytor.com> wrote:
>
> On 06/14/18 13:59, Nick Desaulniers wrote:
> > On Thu, Jun 14, 2018 at 1:48 PM H. Peter Anvin <hpa@zytor.com> wrote:
> >>
> >> On 06/13/18 14:05, Nick Desaulniers wrote:
> >>> From: "H. Peter Anvin" <hpa@linux.intel.com>
> >>>
> >>> 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.
> >>>
> >>> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> >>> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> >>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> >>
> >> I still object to Suggested-by: here.  Sedat did a correction, which is
> >> a Reviewed-by:, but unless I'm completely out to sea, there was no
> >> suggestion on Sedat's part of this; and I had certainly not seen it when
> >> I wrote the code.
> >
> > I'm fine with changing it from a Suggested-by to a Reviewed-by.  Can
> > you do that when you apply the set, or should I send a v6?
> >
>
> I'm not handling patch mechanics for x86 at the moment.

Hi Ingo and Thomas,
Have you had a chance to review this patch series for application?

Note that Juergen (the paravirt maintainer) acked the series:
https://bugs.llvm.org/show_bug.cgi?id=37880
The only issue being swapping a Suggested-by for a Reviewed-by tag for
one commit, as above.

--
Thanks,
~Nick Desaulniers
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ingo Molnar June 21, 2018, 12:28 p.m. UTC | #6
* Nick Desaulniers <ndesaulniers@google.com> wrote:

> On Thu, Jun 14, 2018 at 5:17 PM H. Peter Anvin <hpa@zytor.com> wrote:
> >
> > On 06/14/18 13:59, Nick Desaulniers wrote:
> > > On Thu, Jun 14, 2018 at 1:48 PM H. Peter Anvin <hpa@zytor.com> wrote:
> > >>
> > >> On 06/13/18 14:05, Nick Desaulniers wrote:
> > >>> From: "H. Peter Anvin" <hpa@linux.intel.com>
> > >>>
> > >>> 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.
> > >>>
> > >>> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > >>> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> > >>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> > >>
> > >> I still object to Suggested-by: here.  Sedat did a correction, which is
> > >> a Reviewed-by:, but unless I'm completely out to sea, there was no
> > >> suggestion on Sedat's part of this; and I had certainly not seen it when
> > >> I wrote the code.
> > >
> > > I'm fine with changing it from a Suggested-by to a Reviewed-by.  Can
> > > you do that when you apply the set, or should I send a v6?
> > >
> >
> > I'm not handling patch mechanics for x86 at the moment.
> 
> Hi Ingo and Thomas,
> Have you had a chance to review this patch series for application?
> 
> Note that Juergen (the paravirt maintainer) acked the series:
> https://bugs.llvm.org/show_bug.cgi?id=37880
> The only issue being swapping a Suggested-by for a Reviewed-by tag for
> one commit, as above.

Could you please update the series with all suggestions and tags and send a new 
series?

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 219faaec51df..990770f9e76b 100644
--- 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".