Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3847659rdb; Mon, 11 Dec 2023 01:28:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdKyHYTCJqNI9+nSlNY9C+nly+mr7AOv95PAYMczZ84MHoWSk/SKNkmjU86L205VOxk5Vl X-Received: by 2002:a17:902:eb4c:b0:1d1:cdb2:a93a with SMTP id i12-20020a170902eb4c00b001d1cdb2a93amr3930668pli.31.1702286901983; Mon, 11 Dec 2023 01:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702286901; cv=none; d=google.com; s=arc-20160816; b=plVMXr/Zh2YjT77l3aKV9TKQHMjJhvqTdOgIOOYWu/VPWEzONYLELr5gygfTpZ5JjZ GryV1mtUfWvSTSGpAVrUGlVlE9T46o3SG6E/UlpuGgv9wGG85cJ7+hqW3rvCvh9MzDQk pPNwZlKQV9sc9dOukoLnambFuk5VKhhaCiN2cy9yTafjAk0YcLVtjGC6cDejzgNBFFRz s2TNPFcbOnUen4r7zys/VEPTdKvhEQmHko1PZtHE8BWeT6n9AHZ1gqIm4nPrfQdLjfLN kcSCW5Edm1A4mvdpveGvpvffIB15XWRFqAr3uC53lK05ax4JGbjpN0Jy8/XyCX5IWVQ+ vReQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=FUnc38wqNzJtCDmoCJjliKfhEmieVjL/tDIDenaAD9c=; fh=UD1ZRCSS/l4PYbuMk1gSsIJwAKOC33PKfkYvw4GUlo4=; b=Aj7TE/GglXs+/hfAr1N1RcbMcNNZL1VaD/F0dUlS0aEUQN1QpqGcfSUgQLnufr8Ams y2SEtM94oUI64qYjn+xleeiLN87PPTQgfSpGo5IOW5oLYS3GoW2SfIMobXdzZrOOr2k7 4EmhzmNJETfuzq5VVBjJI96GZGKXTSNqqilnleXSSDxW0F3mqjpRnboi3DbZgPU9OrGm Nu8/VlGAcp5dnIRx3vkGiHF3RmQrWs2SWD1SbGOrmSL0qrFrk7f7Hr1CM48JcFd+p4vP 3EcllYuxkjVAevvz5XDjtC5CHgBItvSDFDVuSyoFeqn0ZfsBhs4WugLOn42tcpR4k3jh 1MPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LbDYXTz9; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=geoHrtc7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b1-20020a170903228100b001d1d1ef8be7si5916448plh.153.2023.12.11.01.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 01:28:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LbDYXTz9; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=geoHrtc7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 537ED80B19D7; Mon, 11 Dec 2023 01:28:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232273AbjLKJ2G (ORCPT + 99 others); Mon, 11 Dec 2023 04:28:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbjLKJ2F (ORCPT ); Mon, 11 Dec 2023 04:28:05 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B21FF3; Mon, 11 Dec 2023 01:28:11 -0800 (PST) Date: Mon, 11 Dec 2023 09:28:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702286887; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FUnc38wqNzJtCDmoCJjliKfhEmieVjL/tDIDenaAD9c=; b=LbDYXTz9XrqPK0id7GTb72EfrKR/fabeIfrzE3VFDWdP3OCKHQtv4beNdiRWm+f6PFtTqE TmGrqJZyTsU9KmV2N/DGTcB4WCw8LiN2X2SChdthD9gWqXnY6lkSFKIvATcdzQk1XGPV6I c9CK5DcbGsVUo1mBBD/TfjrzVViNuoQPQzkC8d8rS8wqnVolyDAOzOC7fuQwi8C1EROS7E gdcnKYz7JFXrXR+QOwFNWJjYHGLNqVrkM1DeKpma0Nlc7nS693vZcBUJp/l5O0AdaMFHEw RkIXwwqk5JANXDkCkMzsF8QCE1WjOkB6YojZGxIx4yfybDyh2bOVlqwesUIrCA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702286887; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FUnc38wqNzJtCDmoCJjliKfhEmieVjL/tDIDenaAD9c=; b=geoHrtc7AzqC6QqJxv19wl4hwq11/+p/KP6YmMQou9eSzQWg9XNawRSYgVwb4mfdPmGj/K 6gmFtAuQu5uDwoBA== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/misc] x86/ia32: State that IA32 emulation is disabled Cc: "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231130155213.1407-1-bp@alien8.de> References: <20231130155213.1407-1-bp@alien8.de> MIME-Version: 1.0 Message-ID: <170228688659.398.10301092120327382196.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 01:28:19 -0800 (PST) The following commit has been merged into the x86/misc branch of tip: Commit-ID: f789383fa34a266d0c1a76f272043a15a8edf733 Gitweb: https://git.kernel.org/tip/f789383fa34a266d0c1a76f272043a15a8edf733 Author: Borislav Petkov (AMD) AuthorDate: Thu, 30 Nov 2023 16:39:33 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 11 Dec 2023 10:14:28 +01:00 x86/ia32: State that IA32 emulation is disabled Issue a short message once, on the first try to load a 32-bit process to save people time when wondering why it won't load and trying to execute it, would say: -bash: ./strsep32: cannot execute binary file: Exec format error Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: https://lore.kernel.org/r/20231130155213.1407-1-bp@alien8.de --- arch/x86/include/asm/elf.h | 2 +- arch/x86/include/asm/ia32.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index a0234df..1e16bd5 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -150,7 +150,7 @@ do { \ ((x)->e_machine == EM_X86_64) #define compat_elf_check_arch(x) \ - ((elf_check_arch_ia32(x) && ia32_enabled()) || \ + ((elf_check_arch_ia32(x) && ia32_enabled_verbose()) || \ (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64)) static inline void elf_common_init(struct thread_struct *t, diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h index 5a2ae24..094886a 100644 --- a/arch/x86/include/asm/ia32.h +++ b/arch/x86/include/asm/ia32.h @@ -2,7 +2,6 @@ #ifndef _ASM_X86_IA32_H #define _ASM_X86_IA32_H - #ifdef CONFIG_IA32_EMULATION #include @@ -84,4 +83,14 @@ static inline bool ia32_enabled(void) #endif +static inline bool ia32_enabled_verbose(void) +{ + bool enabled = ia32_enabled(); + + if (IS_ENABLED(CONFIG_IA32_EMULATION) && !enabled) + pr_notice_once("32-bit emulation disabled. You can reenable with ia32_emulation=on\n"); + + return enabled; +} + #endif /* _ASM_X86_IA32_H */