Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1954351rwd; Fri, 9 Jun 2023 04:51:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QQEuSpFakmJvVIGiWvyZmqjiWfVLMfVeZKuF0d256kdHXwbtWN2ovECOzkue5EM1OuycN X-Received: by 2002:a17:902:dac4:b0:1a1:cb18:7f99 with SMTP id q4-20020a170902dac400b001a1cb187f99mr2034601plx.30.1686311490761; Fri, 09 Jun 2023 04:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686311490; cv=none; d=google.com; s=arc-20160816; b=DzO2ivfDbPu0grGDvbRpzW5332c06NK+aaWLFrYYlE1xexYv1AvuvSyTAm9+seMg86 bOXYkx6UlANhJF8iO6SA1k+vHWm5MaAUxL52BBtGFSD3M3n5520gfbEPSQxF2oarKV1l D/n0V61VdeMeQNsGuXwmaTAB5R2BGYPvE/DhYVxnz8vOG/axmWXxfOAQcXZcrSIInzYt T/ZmO748ZdAoNmS75HBPKLZqnqDTby/dIxSvi9Iuqh8PGgFXV8yQVyMDUMi0P/gI4urQ uV4D17gAQVql7iKeQ62lH9LQFWhzvyyMl2mPleuLexzcbj7sLaROlcQGLcqrq6K2ClNh FG8w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=sARbpKkak15x0b93ZKVWPSJ4prKaBLUd7mvhcGT/ls8=; b=UyYL2+k5DxvCOSPLX/7HTe7gBovuQ+5ATDSXSpgQW+uxY9QNX7uuXbEopIncTgWfXi Ex0mUklmuxaMtA4yQ2FzUD2TuhhWLLSbCwCvKeiCBpqWWwwtvExNgakMHvTfeW5I7J1i FZwupg5z2VNfk/yEor/XtC2B0fRfV72OdM82ym+ZzPN4/0KzjEdO5z5TDd2d2oF7kUi4 h61jI0KDxq+dhJJRtHwusabOikti95ljhr5rMtpDkKHE5FajvNHSLf6+CJwb/TsA78fM 9Qphe2lAkFUOCFE7vSdaB398G6yRiUd/KO2mCwNE6NNTnQwyvUqx+5ZvXGdTmudjTuBm K58w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="f4/AvFTM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m15-20020a170902db0f00b001b00ae4ad57si2599008plx.369.2023.06.09.04.51.19; Fri, 09 Jun 2023 04:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="f4/AvFTM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239135AbjFILNT (ORCPT + 99 others); Fri, 9 Jun 2023 07:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231324AbjFILNR (ORCPT ); Fri, 9 Jun 2023 07:13:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250511FDC for ; Fri, 9 Jun 2023 04:13:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C95CB21A13; Fri, 9 Jun 2023 11:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686309194; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sARbpKkak15x0b93ZKVWPSJ4prKaBLUd7mvhcGT/ls8=; b=f4/AvFTMHtSbNbHRPcs5Fc8PBbKoqiLDgOp/ehr4KIeKJmTnQJ3Jm15NsXJqYAHkG6yNre FAhPaSp5Skuq8zdY2+yoZ22Zd0GPpaD6PGxAcSw9wijr3ktfDpn7TtX7oLZ5JChHgY+2wB pFsq8D4MkVUb8fqyV7v1kZT0M3F2CXU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 711B0139C8; Fri, 9 Jun 2023 11:13:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CgHGGEoJg2ReIwAAMHmgww (envelope-from ); Fri, 09 Jun 2023 11:13:14 +0000 From: Nikolay Borisov To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, mhocko@suse.com, jslaby@suse.cz, Nikolay Borisov Subject: [PATCH v2 0/4] Make IA32_EMULATION boot time overridable Date: Fri, 9 Jun 2023 14:13:07 +0300 Message-Id: <20230609111311.4110901-1-nik.borisov@suse.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Here's the 2nd version of the patch which aims to make IA32_EMULATION essentially a boot time option. The changes in this posting are: * Introduced a compile-time option CONFIG_IA32_EMULATION_DEFAULT_DISABLED which can be set during compile time and can be overriden at boot time via a new parameter 'ia32_mode'. * Documented the new parameter as per Thomas' suggestion * Added a new patch which renames ignore_sysret as per Andrew Cooper's suggestion * Fixed compat_elf_check_arch condition check to only affect compat process loading and leave x32 abi processes alone * Dropped GDT modification as this was deemed a separate change. Likely I'd need to follow up with a more complete solution. Nikolay Borisov (4): x86: Introduce CONFIG_IA32_EMULATION_DEFAULT_DISABLED Kconfig option x86/entry: Rename ignore_sysret and compile it unconditionally x86/entry: Disable IA32 syscall if ia32_disabled is true x86: Disable laoding 32bit processes if ia32_disabled is true .../admin-guide/kernel-parameters.txt | 4 ++ arch/x86/Kconfig | 5 +++ arch/x86/entry/common.c | 16 ++++++++ arch/x86/entry/entry_64.S | 6 +-- arch/x86/include/asm/desc.h | 1 + arch/x86/include/asm/elf.h | 9 ++++- arch/x86/include/asm/processor.h | 2 +- arch/x86/include/asm/traps.h | 4 ++ arch/x86/kernel/cpu/common.c | 37 ++++++++++--------- arch/x86/kernel/idt.c | 7 ++++ 10 files changed, 67 insertions(+), 24 deletions(-) -- 2.34.1