From patchwork Mon Dec 11 09:28:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 176556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6924225vqy; Mon, 11 Dec 2023 01:28:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrCHj2ULjqyumVpQ8QPRTHA/Rsralt34rfoAfq29llzDncNzxgolqiKbxJ1E7k24SGiazI X-Received: by 2002:a05:6e02:1a46:b0:35d:5995:903b with SMTP id u6-20020a056e021a4600b0035d5995903bmr2911015ilv.46.1702286898136; Mon, 11 Dec 2023 01:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702286898; cv=none; d=google.com; s=arc-20160816; b=TE3W6TnZMc9tDxlsDxyFMNKtkK+z4g401NzsVRVucYc62nUBbd3CEA1tqcVgw6ePRj hm1K6T1PwM63vRQOvmwuikiyV0t0n3WdugAFmLcQKD30ts7x838gSqLx7bZDDOefH5mq VUEOKVEIojnxEAyJ8cJaE7mFVKmboLaXaxtKEWN/1nxzzDKGSn9KKsACRK2O7KC0bRKb 8dF+D0WqfAofBk+s/Y4F6tIQYtjHidZ38gTbjxEE9J1GdwSITRiAj7BD5zZiGEo9Smvt 3XnwVl60iKz4DlebIZzsU24hQ/8w/fXhVkLTjpsGo6LygONsHFD90mO4/FpQ/gVqy9DV S6Ew== 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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n8-20020a654508000000b005c690ba4078si5902664pgq.410.2023.12.11.01.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 01:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; 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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 63C9D80B19D9; Mon, 11 Dec 2023 01:28:14 -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 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:14 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784004798052446001 X-GMAIL-MSGID: 1784977186259999905 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 */