Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2395549pxk; Sat, 3 Oct 2020 20:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzITuMa9Rqtvtb9w3DfEWlvRQRxXD4ApjhGOdVB6YqAz6rs/Y1vPkAEtFP6eqWiWQYmEDhV X-Received: by 2002:a17:906:4bc4:: with SMTP id x4mr9316415ejv.240.1601782055061; Sat, 03 Oct 2020 20:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601782055; cv=none; d=google.com; s=arc-20160816; b=xpx1SdBN7IyeJnnNHW4zHxIfPWJlwa5GZ2tXUXtKslVCXwVoq96wDvPXvfuIJJYvGx wvvYc7VSAnMlOlDkEgDEWF/Spvud3i7XX7/+24Oze9JFiQ3eU4o+4BejEbphaV+v7Rzl iL9zmkDEjbW+Y54wTZWvHth2h1WUVVEpRGQjoZ73DU+eFsDAziQgEzsGsUD1AYsbNp6g teL5pSDh2p2RebAsabnE5dSLn9P/nLqgSVC5jz71lm8GccDcv4vsiS0f8wJ8lu154aCS VvfeoW+khBj+psPcT+y/ePf6MlI+9OyR81W8SlWtXMeEo6HdqZfzdyEJ2s0NiZpLUXmx klaw== 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=OYYSyekaaKD5HAWUx0sl9okBYBrMFg+f4Jjk7oV2tSY=; b=S4BiDOqaPcQRm0SahQCsT9ypGhYtakSHIYYt595eFANHN5tHNvogH9r3kODKh2EwGU QLtSpxLayGB8x9iLKqAZdNSl9cKP65wlTDiYiLxTinleu9cFay3hVDXLA54u/ynVVbs2 v4KpYyUeXcEfMf8eoiw6YBvlILABmwSYDCdsi17MzllJcLxl2hmWLtqmQXFUWgJsuUfv O65Lo6ST4UkSAqHO6dpf9inlITvsDzCpUvFtebIjTW2EXjt7P1jFP0+qftUKAvZ3aNfJ q3cacogq/I9k9Ssbr8TDVNlGg70yYnESodIwj1wcStwINH1S5tL1QzCjWIn8tgA3ACYO dFYg== 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 v2si4315303ejy.65.2020.10.03.20.27.13; Sat, 03 Oct 2020 20:27:35 -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 S1726573AbgJDD0B (ORCPT + 99 others); Sat, 3 Oct 2020 23:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbgJDD0A (ORCPT ); Sat, 3 Oct 2020 23:26:00 -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 77DD3C0613D0 for ; Sat, 3 Oct 2020 20:26:00 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 3705229B002 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, sean.j.christopherson@intel.com, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH v3 04/10] x86: elf: Use e_machine to choose DLINFO in compat Date: Sat, 3 Oct 2020 23:25:30 -0400 Message-Id: <20201004032536.1229030-5-krisman@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201004032536.1229030-1-krisman@collabora.com> References: <20201004032536.1229030-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 Reviewed-by: Andy Lutomirski --- 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