Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2620052rwd; Fri, 16 Jun 2023 06:13:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dItxEluBcc86Z1kOVIcMf6x/x/xIHtQzZMh2JjBBIj3WK5/f8he53ZfEAvbEBGE3x3Vee X-Received: by 2002:a05:6a00:21d6:b0:666:5fc4:36ca with SMTP id t22-20020a056a0021d600b006665fc436camr2037481pfj.26.1686921233393; Fri, 16 Jun 2023 06:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686921233; cv=none; d=google.com; s=arc-20160816; b=DFqJyfxa9MC8ZZYUVRjvCX4TBvAqnZVM+JTFQUnmV5FDgO0+Ew11ai7/RIs3+bdhze 4E5jQ8IGJ4ilC/EmgVs3CwrrW8uds4hDnFVAcbBO3hW3IB0VWbaovWGRUmL0nzxnh1Q3 go2Uc6Ujc0F49y76+zcp9x2T1bAHyXzrvw/0kj2jMIkv6nqOlfnKenldtzJ6FQQiwUMw uYzrkyNouU31QboyhtQPDe4wT21Vn/X8RasVfTJ/n4H8GuNBKhu/3uLsrSyYMfjVM3Wp 8UkOQHJztes4/vR9Fx+sjME95cTTlnJaAmFYg5d2g3vukwnIA0Zrnl0HtTLGGSgdyJJ9 MMiA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UjZMXe7XUwr7XJBQb9D0eQ2WRPP3zvIKg1MTtxvQAMk=; b=xE5P5qVEUojvLkUEFySfh1jCwAWcY7rcfdLe02rW64fz43bWxTtr/ew1OdxTEECtpG K8h8ek67AhrlglhOv+PX/I7g/wXycCDMWtvifJTodM+FYraLj94EtKvldNyJLqDNK2pJ V09rEDi4EsWf2Px7GghWoqqdb9hZI9y7SBgaqcHRSyWYHmU0RKYLhH/jNeBy5l+/p/68 PaxoajRGIAvNr2i8QfPzPg0g5xuJc2uEAMvG/5/k7WTeSGDkkXsOvKAlBij1/NlmtjWx QbVN08EftfWyROl4k+u486unRScAvU9r4H/tXmOyDIxEBU4Wh8i/JwGXRiV5ai8JvKIf Y6Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rb5KhNTx; 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 x26-20020aa7941a000000b006536902d31fsi15189800pfo.185.2023.06.16.06.13.40; Fri, 16 Jun 2023 06:13:53 -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=rb5KhNTx; 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 S1345503AbjFPM6B (ORCPT + 99 others); Fri, 16 Jun 2023 08:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345509AbjFPM5x (ORCPT ); Fri, 16 Jun 2023 08:57:53 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD1C26BA for ; Fri, 16 Jun 2023 05:57:52 -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 3C05E22052; Fri, 16 Jun 2023 12:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686920271; 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: in-reply-to:in-reply-to:references:references; bh=UjZMXe7XUwr7XJBQb9D0eQ2WRPP3zvIKg1MTtxvQAMk=; b=rb5KhNTxBde2R2mBz/01edW3FHloIJGcvecNUE4im6kB3saGCS1WGLr4MZDhvWU56ERYig L/J7EWs0r1XiP80fUfrzEpfFRH7O5/iqcnPvGYw6ckc8vO4tyWmmxOs0G+AQSFS1fJez6U 6J0+5h3ItST2hK5GkOni2nShFJFr5FY= 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 CB3E51330B; Fri, 16 Jun 2023 12:57:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2AbZLk5cjGTjNwAAMHmgww (envelope-from ); Fri, 16 Jun 2023 12:57:50 +0000 From: Nikolay Borisov To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, mhocko@suse.com, jslaby@suse.cz, Nikolay Borisov Subject: [PATCH v3 2/5] x86/entry: Rename ignore_sysret Date: Fri, 16 Jun 2023 15:57:27 +0300 Message-Id: <20230616125730.1164989-3-nik.borisov@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616125730.1164989-1-nik.borisov@suse.com> References: <20230616125730.1164989-1-nik.borisov@suse.com> 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 Give ignore_sysret() a more descriptive name as it's actually used to make 32bit syscalls return ENOSYS, rather than doing anything specific with regards to sysret. Signed-off-by: Nikolay Borisov --- arch/x86/entry/entry_64.S | 4 ++-- arch/x86/include/asm/processor.h | 2 +- arch/x86/kernel/cpu/common.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index f31e286c2977..ccce0ccd8589 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -1519,12 +1519,12 @@ SYM_CODE_END(asm_exc_nmi) * This handles SYSCALL from 32-bit code. There is no way to program * MSRs to fully disable 32-bit SYSCALL. */ -SYM_CODE_START(ignore_sysret) +SYM_CODE_START(entry_SYSCALL32_ignore) UNWIND_HINT_END_OF_STACK ENDBR mov $-ENOSYS, %eax sysretl -SYM_CODE_END(ignore_sysret) +SYM_CODE_END(entry_SYSCALL32_ignore) #endif .pushsection .text, "ax" diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index a1e4fa58b357..61c10b4e3e35 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -399,7 +399,7 @@ static inline unsigned long cpu_kernelmode_gs_base(int cpu) return (unsigned long)per_cpu(fixed_percpu_data.gs_base, cpu); } -extern asmlinkage void ignore_sysret(void); +extern asmlinkage void entry_SYSCALL32_ignore(void); /* Save actual FS/GS selectors and bases to current->thread */ void current_save_fsgs(void); diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 80710a68ef7d..b20774181e1a 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -2066,7 +2066,7 @@ void syscall_init(void) (unsigned long)(cpu_entry_stack(smp_processor_id()) + 1)); wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat); #else - wrmsrl_cstar((unsigned long)ignore_sysret); + wrmsrl_cstar((unsigned long)entry_SYSCALL32_ignore); wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG); wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL); wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL); -- 2.34.1