Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1169872

[PATCH 02/12] x86/compat: Make mmap_is_ia32() common compat

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Brian Gerst <brgerst@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 02/12] x86/compat: Make mmap_is_ia32() common compat
Date Mon, 22 Jun 2015 14:00:02 +0200
Message-ID <pE8ym-2Mp-13@gated-at.bofh.it> (permalink)
References <pE8ym-2Mp-5@gated-at.bofh.it>
X-Original-To x86@kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BIF8Br5N3ttVxwEE58x9ptg1T9Nid2uJwT1VUeWDc5c=; b=RRh6k/anLtTjOQUubgPzspQg9I887Yqy+pbDI8qQQ04QdsA2LyznTJnbI5/m4Bbhgq 5GVtctb3V4XgOQ5eIZsvweRgbgxjPSWNvG6HJWPXqCiIS5DjummCdhTfM2Bg84+ypqtP 1I7qztzmr5IgW3fVf3xLrOf7YivkqetegkQs1A+lWtlE9BpDAbFRVhX0Dsth4TG6jl39 dF+tjw7rhxDYvz4Q1ASrmEiFSKwrLbxuG8NMuNrafsmYh9IhVf1wPiEJlZVF5kAkJ2BV Dd31YplJU0C9yu30vLAxCvNlkAuObtQvhIVr2hiF6lTv90cLGOdfr9ZsawWtn8jZ80AD vB6w==
X-Received by 10.13.217.147 with SMTP id b141mr16201800ywe.22.1434974143042; Mon, 22 Jun 2015 04:55:43 -0700 (PDT)
X-Mailer git-send-email 2.1.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 37
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>, Denys Vlasenko <dvlasenk@redhat.com>, Andy Lutomirski <luto@amacapital.net>
X-Original-Date Mon, 22 Jun 2015 07:55:11 -0400
X-Original-Message-ID <1434974121-32575-3-git-send-email-brgerst@gmail.com>
X-Original-References <1434974121-32575-1-git-send-email-brgerst@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1169872

Show key headers only | View raw


TIF_ADDR32 is set for both ia32 and x32 tasks, so change from
CONFIG_IA32_EMULATION to CONFIG_COMPAT.  Use config_enabled()
to make the function more readable.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
 arch/x86/include/asm/elf.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index f161c18..180b6fe 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -344,14 +344,9 @@ extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
  */
 static inline int mmap_is_ia32(void)
 {
-#ifdef CONFIG_X86_32
-	return 1;
-#endif
-#ifdef CONFIG_IA32_EMULATION
-	if (test_thread_flag(TIF_ADDR32))
-		return 1;
-#endif
-	return 0;
+	return config_enabled(CONFIG_X86_32) ||
+	       (config_enabled(CONFIG_COMPAT) &&
+		test_thread_flag(TIF_ADDR32));
 }
 
 /* Do not change the values. See get_align_mask() */
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 02/12] x86/compat: Make mmap_is_ia32() common compat Brian Gerst <brgerst@gmail.com> - 2015-06-22 14:00 +0200

csiph-web