Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp790506pxk; Thu, 1 Oct 2020 14:01:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp8JMHTyVHyEWYsBRLwk0OvwpTVQcQ6hXXOyiaJSFN7dropuI9O1YmE1ltdXGKpF23e7rM X-Received: by 2002:a17:906:354c:: with SMTP id s12mr10455256eja.370.1601586074608; Thu, 01 Oct 2020 14:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601586074; cv=none; d=google.com; s=arc-20160816; b=fPPgWQZDy+//l7jEMAnTxt5Dq87AP/TYzh6a1SUOhhf+7mMWwvYSdB3RD04OpabV/M Zkz7oILWqWyOu73zVBz0SSRhzUk72PPst971802CS6H1Yf1cnYP5tArXI2Y6xiH3mUJl F4ThC04PyKLktfV3XcsYkxQcKtyNt03uU9L7XsyPIF850dELixZB+L5xdLSRjHnUdiPX 8IQpZmxRPBidSlUy2cMMERer3Bt5EMEXPjRFlOh3LQon0UKndx9lSIjlXqyu8j1u/j+V +/nMv+3gH2AvcKs57EhxlVs3cVihcTt56+DXJ4fopb8T1fEkQ/3zbVvKg5hVkFim53CG 3lGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=26s0HPiSkO5F2enmBSNRLmPQsy9SIJsrGKcyhH6zYUc=; b=pcSPimRqMbZ48pdOKhLGHjeFhAY/6JP2w8DbuLvND5aJnYpcljC2nJG8vpQJMtKj7m b+++CPcPjuSH7Scep+ANwPY5JIahg0h+BWxzXJ/K+YieGAcA0IQZSijkvKs8YoSzM/yQ 3GBz/CPD+14XUVBWJVpgbH6eyEsrzUhFwA4HSYOByGJmmpVdAq5SqzVefo10J/QVxOK6 zxlrYd6o65dKmJwFgK/5S4YNzm5gVb7Y8BadGXC2AkuhL9czj1cvxCU2BzyZEYOkiUup VK+zZEbxbul9MzPiW/RfF6FoTohb1jQniqC0W1694VW5Zpy2IlVe43pKzdc020aDo4l9 m7kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z26si4278977ejr.489.2020.10.01.14.00.51; Thu, 01 Oct 2020 14:01:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733062AbgJAU7k (ORCPT + 99 others); Thu, 1 Oct 2020 16:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbgJAU7j (ORCPT ); Thu, 1 Oct 2020 16:59:39 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C142C0613D0 for ; Thu, 1 Oct 2020 13:59:39 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 5D3A329D101 From: Gabriel Krisman Bertazi To: luto@kernel.org, tglx@linutronix.de Cc: hch@lst.de, hpa@zytor.com, bp@alien8.de, rric@kernel.org, peterz@infradead.org, mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH v2 4/9] x86: elf: Use e_machine to choose DLINFO in compat Date: Thu, 1 Oct 2020 16:58:14 -0400 Message-Id: <20201001205819.27879-5-krisman@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201001205819.27879-1-krisman@collabora.com> References: <20201001205819.27879-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since TIF_X32 is going away, avoid using it to find the ELF type on ARCH_DLINFO. According to SysV AMD64 ABI Draft, an AMD64 ELF object using ILP32 must have ELFCLASS32 with (E_MACHINE == EM_X86_64), so use that ELF field to differentiate a x32 object from a IA32 object when loading ARCH_DLINFO in compat mode. Signed-off-by: Gabriel Krisman Bertazi --- arch/x86/include/asm/elf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index b9a5d488f1a5..9220efc65d78 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -361,7 +361,7 @@ do { \ #define AT_SYSINFO 32 #define COMPAT_ARCH_DLINFO \ -if (test_thread_flag(TIF_X32)) \ +if (exec->e_machine == EM_X86_64) \ ARCH_DLINFO_X32; \ else \ ARCH_DLINFO_IA32 -- 2.28.0