linux-next: manual merge of the tip tree with the crypto tree
Subsystems (3)
Hi all,
Today's linux-next merge of the tip tree got a conflict in:
arch/x86/include/asm/inst.h
between commit:
d7866e503bdc ("crypto: x86 - Remove include/asm/inst.h")
from the crypto tree and commit:
eaad981291ee ("x86/entry/64: Introduce the FIND_PERCPU_BASE macro")
from the tip tree.
I fixed it up (I brought the file back but removed what the crypto tree no longer needed - see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
I think if the crypto tree brought back this file as well (even without the RDPID macro, it would make this conflict much more manageable.
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Generate .byte code for some instructions not supported by old
* binutils.
*/
#ifndef X86_ASM_INST_H
#define X86_ASM_INST_H
#ifdef __ASSEMBLY__
#define REG_NUM_INVALID 100
#define REG_TYPE_R32 0
#define REG_TYPE_R64 1
#define REG_TYPE_XMM 2
#define REG_TYPE_INVALID 100
.macro R32_NUM opd r32 \opd = REG_NUM_INVALID .ifc \r32,%eax \opd = 0 .endif .ifc \r32,%ecx \opd = 1 .endif .ifc \r32,%edx \opd = 2 .endif .ifc \r32,%ebx \opd = 3 .endif .ifc \r32,%esp \opd = 4 .endif .ifc \r32,%ebp \opd = 5 .endif .ifc \r32,%esi \opd = 6 .endif .ifc \r32,%edi \opd = 7 .endif #ifdef CONFIG_X86_64 .ifc \r32,%r8d \opd = 8 .endif .ifc \r32,%r9d \opd = 9 .endif .ifc \r32,%r10d \opd = 10 .endif .ifc \r32,%r11d \opd = 11 .endif .ifc \r32,%r12d \opd = 12 .endif .ifc \r32,%r13d \opd = 13 .endif .ifc \r32,%r14d \opd = 14 .endif .ifc \r32,%r15d \opd = 15 .endif #endif .endm .macro R64_NUM opd r64 \opd = REG_NUM_INVALID #ifdef CONFIG_X86_64 .ifc \r64,%rax \opd = 0 .endif .ifc \r64,%rcx \opd = 1 .endif .ifc \r64,%rdx \opd = 2 .endif .ifc \r64,%rbx \opd = 3 .endif .ifc \r64,%rsp \opd = 4 .endif .ifc \r64,%rbp \opd = 5 .endif .ifc \r64,%rsi \opd = 6 .endif .ifc \r64,%rdi \opd = 7 .endif .ifc \r64,%r8 \opd = 8 .endif .ifc \r64,%r9 \opd = 9 .endif .ifc \r64,%r10 \opd = 10 .endif .ifc \r64,%r11 \opd = 11 .endif .ifc \r64,%r12 \opd = 12 .endif .ifc \r64,%r13 \opd = 13 .endif .ifc \r64,%r14 \opd = 14 .endif .ifc \r64,%r15 \opd = 15 .endif #endif .endm .macro XMM_NUM opd xmm \opd = REG_NUM_INVALID .ifc \xmm,%xmm0 \opd = 0 .endif .ifc \xmm,%xmm1 \opd = 1 .endif .ifc \xmm,%xmm2 \opd = 2 .endif .ifc \xmm,%xmm3 \opd = 3 .endif .ifc \xmm,%xmm4 \opd = 4 .endif .ifc \xmm,%xmm5 \opd = 5 .endif .ifc \xmm,%xmm6 \opd = 6 .endif .ifc \xmm,%xmm7 \opd = 7 .endif .ifc \xmm,%xmm8 \opd = 8 .endif .ifc \xmm,%xmm9 \opd = 9 .endif .ifc \xmm,%xmm10 \opd = 10 .endif .ifc \xmm,%xmm11 \opd = 11 .endif .ifc \xmm,%xmm12 \opd = 12 .endif .ifc \xmm,%xmm13 \opd = 13 .endif .ifc \xmm,%xmm14 \opd = 14 .endif .ifc \xmm,%xmm15 \opd = 15 .endif .endm .macro REG_TYPE type reg R32_NUM reg_type_r32 \reg R64_NUM reg_type_r64 \reg XMM_NUM reg_type_xmm \reg .if reg_type_r64 <> REG_NUM_INVALID \type = REG_TYPE_R64 .elseif reg_type_r32 <> REG_NUM_INVALID \type = REG_TYPE_R32 .elseif reg_type_xmm <> REG_NUM_INVALID \type = REG_TYPE_XMM .else \type = REG_TYPE_INVALID .endif .endm .macro PFX_OPD_SIZE .byte 0x66 .endm .macro PFX_REX opd1 opd2 W=0 .if ((\opd1 | \opd2) & 8) || \W .byte 0x40 | ((\opd1 & 8) >> 3) | ((\opd2 & 8) >> 1) | (\W << 3) .endif .endm .macro MODRM mod opd1 opd2 .byte \mod | (\opd1 & 7) | ((\opd2 & 7) << 3) .endm
.macro RDPID opd
REG_TYPE rdpid_opd_type \opd
.if rdpid_opd_type == REG_TYPE_R64
R64_NUM rdpid_opd \opd
.else
R32_NUM rdpid_opd \opd
.endif
.byte 0xf3
.if rdpid_opd > 7
PFX_REX rdpid_opd 0
.endif
.byte 0x0f, 0xc7
MODRM 0xc0 rdpid_opd 0x7
.endm
#endif
#endif
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 25 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the tip tree got a conflict in:
arch/x86/include/asm/inst.hbetween commit:
d7866e503bdc("crypto: x86 - Removeinclude/asm/inst.h")from the crypto tree and commit:
eaad981291ee("x86/entry/64: Introduce theFIND_PERCPU_BASEmacro")from the tip tree.
I fixed it up (I brought the file back but removed what the crypto tree no longer needed - see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Quoted 2 lines
I think if the crypto tree brought back this file as well (even without the RDPID macro, it would make this conflict much more manageable.
I will prepare a v2 that leaves needed part of inst.h.
Uros.
Quoted 227 lines
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Generate .byte code for some instructions not supported by old
* binutils.
*/
#ifndefX86_ASM_INST_H
#defineX86_ASM_INST_H#ifdef
__ASSEMBLY__#define
REG_NUM_INVALID100#define REG_TYPE_R32 0 #define REG_TYPE_R64 1 #define REG_TYPE_XMM 2 #define REG_TYPE_INVALID 100.macro R32_NUM opd r32 \opd = REG_NUM_INVALID .ifc \r32,%eax \opd = 0 .endif .ifc \r32,%ecx \opd = 1 .endif .ifc \r32,%edx \opd = 2 .endif .ifc \r32,%ebx \opd = 3 .endif .ifc \r32,%esp \opd = 4 .endif .ifc \r32,%ebp \opd = 5 .endif .ifc \r32,%esi \opd = 6 .endif .ifc \r32,%edi \opd = 7 .endif #ifdef CONFIG_X86_64 .ifc \r32,%r8d \opd = 8 .endif .ifc \r32,%r9d \opd = 9 .endif .ifc \r32,%r10d \opd = 10 .endif .ifc \r32,%r11d \opd = 11 .endif .ifc \r32,%r12d \opd = 12 .endif .ifc \r32,%r13d \opd = 13 .endif .ifc \r32,%r14d \opd = 14 .endif .ifc \r32,%r15d \opd = 15 .endif#endif
.endm.macro
R64_NUMopd r64
\opd =REG_NUM_INVALID#ifdef CONFIG_X86_64 .ifc \r64,%rax \opd = 0 .endif .ifc \r64,%rcx \opd = 1 .endif .ifc \r64,%rdx \opd = 2 .endif .ifc \r64,%rbx \opd = 3 .endif .ifc \r64,%rsp \opd = 4 .endif .ifc \r64,%rbp \opd = 5 .endif .ifc \r64,%rsi \opd = 6 .endif .ifc \r64,%rdi \opd = 7 .endif .ifc \r64,%r8 \opd = 8 .endif .ifc \r64,%r9 \opd = 9 .endif .ifc \r64,%r10 \opd = 10 .endif .ifc \r64,%r11 \opd = 11 .endif .ifc \r64,%r12 \opd = 12 .endif .ifc \r64,%r13 \opd = 13 .endif .ifc \r64,%r14 \opd = 14 .endif .ifc \r64,%r15 \opd = 15 .endif #endif .endm .macro XMM_NUM opd xmm \opd = REG_NUM_INVALID .ifc \xmm,%xmm0 \opd = 0 .endif .ifc \xmm,%xmm1 \opd = 1 .endif .ifc \xmm,%xmm2 \opd = 2 .endif .ifc \xmm,%xmm3 \opd = 3 .endif .ifc \xmm,%xmm4 \opd = 4 .endif .ifc \xmm,%xmm5 \opd = 5 .endif .ifc \xmm,%xmm6 \opd = 6 .endif .ifc \xmm,%xmm7 \opd = 7 .endif .ifc \xmm,%xmm8 \opd = 8 .endif .ifc \xmm,%xmm9 \opd = 9 .endif .ifc \xmm,%xmm10 \opd = 10 .endif .ifc \xmm,%xmm11 \opd = 11 .endif .ifc \xmm,%xmm12 \opd = 12 .endif .ifc \xmm,%xmm13 \opd = 13 .endif .ifc \xmm,%xmm14 \opd = 14 .endif .ifc \xmm,%xmm15 \opd = 15 .endif .endm .macro REG_TYPE type reg R32_NUM reg_type_r32 \reg R64_NUM reg_type_r64 \reg XMM_NUM reg_type_xmm \reg .if reg_type_r64 <> REG_NUM_INVALID \type = REG_TYPE_R64 .elseif reg_type_r32 <> REG_NUM_INVALID \type = REG_TYPE_R32 .elseif reg_type_xmm <> REG_NUM_INVALID \type = REG_TYPE_XMM .else \type = REG_TYPE_INVALID .endif .endm .macro PFX_OPD_SIZE .byte 0x66 .endm .macro PFX_REX opd1 opd2 W=0 .if ((\opd1 | \opd2) & 8) || \W .byte 0x40 | ((\opd1 & 8) >> 3) | ((\opd2 & 8) >> 1) | (\W << 3) .endif .endm .macro MODRM mod opd1 opd2 .byte \mod | (\opd1 & 7) | ((\opd2 & 7) << 3) .endm.macro RDPID opd
REG_TYPErdpid_opd_type\opd
.ifrdpid_opd_type==REG_TYPE_R64
R64_NUMrdpid_opd\opd
.else
R32_NUMrdpid_opd\opd
.endif
.byte0xf3
.ifrdpid_opd> 7
PFX_REXrdpid_opd0
.endif
.byte0x0f,0xc7
MODRM0xc0rdpid_opd0x7
.endm
#endif#endif
--
Cheers,
Stephen Rothwell
Herbert Xu
maintainerQuoted 2 lines · Uros Bizjak
I will prepare a v2 that leaves needed part of
inst.h.
Your patch has already been applied. So please make it an incremental patch.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Hi Herbert,
Quoted 7 lines · On Fri, 17 Jul 2020 16:44:01 +1000 Herbert Xu <[email protected]>…
Quoted 2 lines · Uros Bizjak
I will prepare a v2 that leaves needed part of
inst.h.Your patch has already been applied. So please make it an incremental patch.
Thank you both.
Signature · 2 lines
Cheers, Stephen Rothwell
Please find attached the incremental patch that puts back integer parts of inst.h. This resolves the conflict with the tip tree.
Uros.
Quoted 5 lines · Herbert Xu
Quoted 2 lines · Uros Bizjak
I will prepare a v2 that leaves needed part of
inst.h.
Quoted 8 lines
Your patch has already been applied. So please make it an incremental patch.
Thanks,
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
From 2aed6d5ac4b561093921ffb0d1e4a31d9ad15d9d Mon Sep 17 00:00:00 2001
From: Uros Bizjak <[email protected]>
Date: Fri, 17 Jul 2020 09:24:53 +0200
Subject: [PATCH] crypto: x86 - Put back integer parts of include/asm/inst.h
Resolves conflict with the tip tree.
--- arch/x86/include/asm/inst.h | 148 ++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 arch/x86/include/asm/inst.h
arch/x86/include/asm/inst.h new file +148 -0
@@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Generate .byte code for some instructions not supported by old +* binutils. +*/ +#ifndef X86_ASM_INST_H +#define X86_ASM_INST_H + +#ifdef __ASSEMBLY__ + +#define REG_NUM_INVALID 100 + +#define REG_TYPE_R32 0 +#define REG_TYPE_R64 1 +#define REG_TYPE_INVALID 100 + + .macro R32_NUM opd r32 + \opd = REG_NUM_INVALID + .ifc \r32,%eax + \opd = 0 + .endif + .ifc \r32,%ecx + \opd = 1 + .endif + .ifc \r32,%edx + \opd = 2 + .endif + .ifc \r32,%ebx + \opd = 3 + .endif + .ifc \r32,%esp + \opd = 4 + .endif + .ifc \r32,%ebp + \opd = 5 + .endif + .ifc \r32,%esi + \opd = 6 + .endif + .ifc \r32,%edi + \opd = 7 + .endif +#ifdef CONFIG_X86_64 + .ifc \r32,%r8d + \opd = 8 + .endif + .ifc \r32,%r9d + \opd = 9 + .endif + .ifc \r32,%r10d + \opd = 10 + .endif + .ifc \r32,%r11d + \opd = 11 + .endif + .ifc \r32,%r12d + \opd = 12 + .endif + .ifc \r32,%r13d + \opd = 13 + .endif + .ifc \r32,%r14d + \opd = 14 + .endif + .ifc \r32,%r15d + \opd = 15 + .endif +#endif + .endm + + .macro R64_NUM opd r64 + \opd = REG_NUM_INVALID +#ifdef CONFIG_X86_64 + .ifc \r64,%rax + \opd = 0 + .endif + .ifc \r64,%rcx + \opd = 1 + .endif + .ifc \r64,%rdx + \opd = 2 + .endif + .ifc \r64,%rbx + \opd = 3 + .endif + .ifc \r64,%rsp + \opd = 4 + .endif + .ifc \r64,%rbp + \opd = 5 + .endif + .ifc \r64,%rsi + \opd = 6 + .endif + .ifc \r64,%rdi + \opd = 7 + .endif + .ifc \r64,%r8 + \opd = 8 + .endif + .ifc \r64,%r9 + \opd = 9 + .endif + .ifc \r64,%r10 + \opd = 10 + .endif + .ifc \r64,%r11 + \opd = 11 + .endif + .ifc \r64,%r12 + \opd = 12 + .endif + .ifc \r64,%r13 + \opd = 13 + .endif + .ifc \r64,%r14 + \opd = 14 + .endif + .ifc \r64,%r15 + \opd = 15 + .endif +#endif + .endm + + .macro REG_TYPE type reg + R32_NUM reg_type_r32 \reg + R64_NUM reg_type_r64 \reg + .if reg_type_r64 <> REG_NUM_INVALID + \type = REG_TYPE_R64 + .elseif reg_type_r32 <> REG_NUM_INVALID + \type = REG_TYPE_R32 + .else + \type = REG_TYPE_INVALID + .endif + .endm + + .macro PFX_REX opd1 opd2 W=0 + .if ((\opd1 | \opd2) & 8) || \W + .byte 0x40 | ((\opd1 & 8) >> 3) | ((\opd2 & 8) >> 1) | (\W << 3) + .endif + .endm + + .macro MODRM mod opd1 opd2 + .byte \mod | (\opd1 & 7) | ((\opd2 & 7) << 3) + .endm +#endif + +#endif
Signature · 1 line
2.26.2
Hi Uros,
Quoted 3 lines · On Fri, 17 Jul 2020 09:31:18 +0200 Uros Bizjak <[email protected]> wrote:
Please find attached the incremental patch that puts back integer parts of
inst.h. This resolves the conflict with the tip tree.
The tip tree change needs the XMM parts kept as well, sorry.
So I ended up just removing the actual now unused crypto instruction macros.
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 4 lines · Stephen Rothwell
Quoted 2 lines
Please find attached the incremental patch that puts back integer parts of
inst.h. This resolves the conflict with the tip tree.The tip tree change needs the XMM parts kept as well, sorry.
Strange, because I did test my patch with the tip tree from 'origin/master' at commit a282cddefe90c4b21ef2c22a76a7c3ebd3ec6b86 and the compilation produced the same lonely rdpid %eax in .altinstr_replacement section. AFAICS, the header is included only for RDPID macro, where XMM registers are unused.
Quoted 2 lines
So I ended up just removing the actual now unused crypto instruction macros.
To avoid any further troubles, this is also OK with me.
Uros.
Hi Uros,
Quoted 14 lines · On Mon, 20 Jul 2020 08:13:51 +0200 Uros Bizjak <[email protected]> wrote:
Quoted 4 lines · Stephen Rothwell
Quoted 2 lines
Please find attached the incremental patch that puts back integer parts of
inst.h. This resolves the conflict with the tip tree.The tip tree change needs the XMM parts kept as well, sorry.
Strange, because I did test my patch with the tip tree from 'origin/master' at commit
a282cddefe90c4b21ef2c22a76a7c3ebd3ec6b86and the compilation produced the same lonely rdpid %eax in .altinstr_replacement section. AFAICS, the header is included only for RDPID macro, where XMM registers are unused.
Quoted 4 lines
Quoted 2 lines
So I ended up just removing the actual now unused crypto instruction macros.
To avoid any further troubles, this is also OK with me.
Sorry, I see what happened now. Since your patch was not in the crypto tree yet, I did a fixup to the tip tree merge based on your patch, but did it by hand and didn't remove the XMM bits from the REG_TYPE macro ...
So your original patch is probably all good (especially since you actually tested it :-))
Signature · 2 lines
Cheers, Stephen Rothwell
Herbert Xu
maintainerQuoted 2 lines · Uros Bizjak
Please find attached the incremental patch that puts back integer parts of
inst.h. This resolves the conflict with the tip tree.
Sorry but you can't send a patch without changing the Subject line as otherwise patchwork will simply treat it as a comment or just ignore it.
Please resend.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt