Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2531354rdb; Fri, 8 Dec 2023 10:42:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnqCBW/VD/m6W7nPW5sTJBcxs6AQu2UOWaMfBdeXD39TKt+pXjQPxwhTVRnqrFP0CG6Eys X-Received: by 2002:a17:90a:ab0b:b0:286:6cc0:62a6 with SMTP id m11-20020a17090aab0b00b002866cc062a6mr679733pjq.37.1702060959775; Fri, 08 Dec 2023 10:42:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702060959; cv=none; d=google.com; s=arc-20160816; b=txKc5gxhNltIKRY9EXGIEb9vZYbVhTJzgVvQIMWbcwKJJD3+5E5/aoLff7XWrHNsaI YlE/7iv9IDGdjOBEPKN1teWRdClhcXEgEzIf+S5r5A94S+Wjnmdx3TwwFlNJK+H2cr35 FayeJd33gAKhOvs51G1GQDn46f+zcjsEM7NuE1ZuuGsqbfO9pC6iEmgXumvwXXHEZmxX WlYdVilKRzCGbeFhmzsD5QfAHQGU6YyGz1SGvFLO71zVyjccCKJCp+ll6PcylV8z8PJC rp1HavpNG1MKCpWl2q2T9pakIn/TeNpiBsFtqsKOj9Bkc8rWC2hVi9H93t1fEzaSMB4F rzGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Z9+wgiQYw9MwXmDGl7oIki00XhYRzJER6P4/V/uuv24=; fh=6LYrjt2C8+n8oZJqh4UfKQQIbZx/uXWb++PjYthlam8=; b=ijT3vSI18xTyovS0C8JUFLKrfRWIIsCSTmiypnwRMo3NKBB7Lf+dTNvot8MTVsyLsX kg+msMOTNLswkD80ZETVI7HW2VB6VnQrLFzHdMVo15sWUopLE134xwqWtTQ+jj0WkA++ h0m/UsGyxL+BEFL79r+RYBdaK+luPGCos9OIGgzRkGlmGMkR/6aMRMYfkuGM303mm89d c5qb1Q8hfRp5dq/BLlMaxVv+g29s1tN5G0PrAzPCCSCU+e8FqcDHc+ntNvwfGA+kCQBA 6H7RMTgCYRILmccAhYwQcyY3hKnmRfMznCIk6AiVaV7LKYpUwLbmvMzPHcg2en/kVaub RKgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=V+osavE2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j9-20020a17090276c900b001d2e3004f98si1950811plt.593.2023.12.08.10.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 10:42:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=V+osavE2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3BBA98106527; Fri, 8 Dec 2023 10:42:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233846AbjLHSm1 (ORCPT + 99 others); Fri, 8 Dec 2023 13:42:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjLHSm0 (ORCPT ); Fri, 8 Dec 2023 13:42:26 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5139311F for ; Fri, 8 Dec 2023 10:42:32 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40c0a0d068bso24088555e9.3 for ; Fri, 08 Dec 2023 10:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1702060951; x=1702665751; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Z9+wgiQYw9MwXmDGl7oIki00XhYRzJER6P4/V/uuv24=; b=V+osavE2ssMAdN7t0ZkmhmU5lk8CJLugoeoMe4xRjSFUig+HQm57QmfNzGLLD+ydos sqMeomDicaQaVdBMp+F94ahgoSTORU+u0NSLvXjwit9JrOkee/MdKLsfqi76dvp3mgCN EBh6WymwFYJdm7GmGnLGkwexCNvbVucHi+kq2D69yb9k7tkZhqQpgZyq4rT/srV5uHz8 VGib50Ptf1mMQR01VgCDOAVSZl2K4MAfGgr6xXfakgDcD+xnR9qCSLVxq9uWav0qSWY7 jJJmyPWM25qzJnZJcKAC4ElSaj9n1bZgIEceT57PhMmL+iS7+At0koI+yqySYW56WYXE J/lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702060951; x=1702665751; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z9+wgiQYw9MwXmDGl7oIki00XhYRzJER6P4/V/uuv24=; b=gi18cHrCT0GT7ZIfQ/sBfptiauU4r/3yuiZR8bOKUf1I8QVkCfgbB7PK7IN35BcREL 1TFWKJrGnv6PtBLcaW6/3Nhi/N1ShxmLW5QBoPbESYtI8JVZE74jsi7N0RTJYFHpc4Ek jPxBksXHzfqpLk6atF3vWxMvufhxBs0CIv1sJNjgFgF/7BsmoiEw2K1jaqZA3ea+Zjtb a77DcSzCQxypJjvD72uWNM4EZtWmdXrXmzBNqHhDMYw3aQoVHCKHh5eYCU/4dMyQ5hAU +Aq4ZU96faaG1fPDKNIfCXmaqyVaTQkQ3OhEc2ApYcrpGC/9ucN//3T4paenlMqeG4hN kYVw== X-Gm-Message-State: AOJu0YyrkYAPqBAWRdDE4mvm2PqnMYXCF3/5dXIosFIP867WAyOoQ1jh UlFkiPyiCdbRsuG+s6aawshg1dP6ul8v2gAyi7WRlA== X-Received: by 2002:a7b:c44f:0:b0:40b:5e22:963 with SMTP id l15-20020a7bc44f000000b0040b5e220963mr223153wmi.82.1702060950715; Fri, 08 Dec 2023 10:42:30 -0800 (PST) Received: from ?IPV6:2a10:bac0:b000:731f:e6b0:e567:aab6:1db2? ([2a10:bac0:b000:731f:e6b0:e567:aab6:1db2]) by smtp.gmail.com with ESMTPSA id bd19-20020a05600c1f1300b0040839fcb217sm3708041wmb.8.2023.12.08.10.42.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Dec 2023 10:42:30 -0800 (PST) Message-ID: <4f232dfb-a112-4271-8f43-f85a02c4abeb@suse.com> Date: Fri, 8 Dec 2023 20:42:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH -v2] x86/ia32: State that IA32 emulation is disabled Content-Language: en-US To: Borislav Petkov , X86 ML Cc: LKML References: <20231130155213.1407-1-bp@alien8.de> <20231130160903.GJZWizn+dPaaViFVKN@fat_crate.local> <20231206172022.GCZXCtVoZtt4t2TLpe@fat_crate.local> From: Nikolay Borisov In-Reply-To: <20231206172022.GCZXCtVoZtt4t2TLpe@fat_crate.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 10:42:37 -0800 (PST) On 6.12.23 г. 19:20 ч., Borislav Petkov wrote: > From: "Borislav Petkov (AMD)" > Date: Thu, 30 Nov 2023 16:39:33 +0100 > > 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) > Cc: Nikolay Borisov LGTM: Reviewed-by: Nikolay Borisov > --- > 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 a0234dfd1031..1e16bd5ac781 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 5a2ae24b1204..094886a8717e 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) nit: But why check config_ia32_emulation explicitly, its state should already be accounted for in ia32_enabled's value? So this check can simply be 'if (!enabled)' > + pr_notice_once("32-bit emulation disabled. You can reenable with ia32_emulation=on\n"); > + > + return enabled; > +} > + > #endif /* _ASM_X86_IA32_H */