Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1920132rdb; Wed, 31 Jan 2024 13:16:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtmlFr4m5bcfzN055oYfWpid6wxytsRt8LtiSA4xQyqIxlY1XM59Zm4Mz7m75ICg0TTgoQ X-Received: by 2002:a05:6808:1985:b0:3bd:cbf2:8f09 with SMTP id bj5-20020a056808198500b003bdcbf28f09mr366582oib.16.1706735776643; Wed, 31 Jan 2024 13:16:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706735776; cv=pass; d=google.com; s=arc-20160816; b=lsRZfoq7fbG2RxPLjbaU74woYEX+rU/j/wn+iSFzDttToeGdgnnUcbEZSa2dk/rIVh LpiIo5vcAgHCmW6Oon/x9XHi9yhcB8WXL7u4WLOrwJszpoFrBZPiP2e0q18iJaAuk2oP QQSAVfIGUXnURpRhp11k2BNg3eF0SL47616jRR5oBXI8OxuaYzcEQVpb3CSQekpREEkI 4nFIZrTp+jnKLEgW5fYO3z0Rleyr78d8Sr1F7vNBHWRedsoggB512Um+HImlpjoKLAgU P1mIoUKmBtLOwwwKNXwsf0OaKwmCU3Q09QbBGOrwLNCh9xhFyoIuSZt7RZR4wNRY+up9 vvLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=Q6qCoPTML8h57sp9oE2AUKoqeoqQdIRMSvCJ/ZD1qmw=; fh=7ErtAsgxkEBbKydG9OZXWwCSv4LI1sTBY4tEJclqMe4=; b=cIvLx6HUFpo0q77hXTDCHHK/CwcW51hmgZ7ggy39k3qlpHWb6jh6Z4bPSSW74rWXqh ZSI5SI2w89TDTiobBhON45QCjlEJ7r4aM9hRfyoKsjVA5VvPow/vDppwE6I6CzWVAej1 BhhZ4/iQJNDq890LJ72pY7GhMP6Ib07PHkCCwJwKxIyx63r3bZI0oxqr0DpklQRMh78n /XN0IMktP2aeleIK3PHXtsXn0jLaNn9zlrSGpy/xaLqQmaqTuoXriuDwJTUCuuRHNCZi bttkCEmCIrq4tiP3ujgCbxWD61mvqMBD845dWPQXyItqJO0zdyqpkPdEG7Q627CTLPZN +AAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vkBlf001; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=f1FRmEVt; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-47123-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=1; AJvYcCVxWfb/RXh/3S7QvKV6ok/tm395171nOOyW/NPowj9QtHQPdho1AHLLjyBjGJpUBNtYLPLxtabQqUEZGg2IRAhrcfW+VRER1QZfMPLVig== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z6-20020a05622a060600b0042a46344f9bsi12689815qta.674.2024.01.31.13.16.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 13:16:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47123-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vkBlf001; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=f1FRmEVt; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-47123-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5648F1C2248B for ; Wed, 31 Jan 2024 21:16:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58AB93A1DB; Wed, 31 Jan 2024 21:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vkBlf001"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="f1FRmEVt" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A48A739FC0; Wed, 31 Jan 2024 21:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706735687; cv=none; b=u0zyEvSlFZchawL2dYTkfAxTpJpbX14w+Hjn5c4iknP6MZE/HjjiCceoaEV/NFd1lDusCXnxymTkYl3NpuOEeZ5xaHGsIwA+IbHrFdZL4ATgOU9Y1SOor0Oa/IRo93L81mDdOra/Q9kUY6GEzSoH0m/M69y/CeUm4DF4LhYB1U4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706735687; c=relaxed/simple; bh=3z4c8NO4/2R13Yelyydbzr9ZVNwLoneQ4Xa1c16NM3U=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=McqJlxcFL6xiLcX0AElcpLxXaczDnlTX3nY8HYdVMsPSPfw4/gqaSCoKHht6O4l+H4W9+d9NhHcqkUqcrmSwbiCBNE7PSfFKfkZXsmY0lHPfrpQE4PrxiaBJQAeeL0k5MGMvIKlgfQXvZH6laBikgA3d0aaq4VnGiUClzrURP6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vkBlf001; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=f1FRmEVt; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 31 Jan 2024 21:14:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706735684; 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=Q6qCoPTML8h57sp9oE2AUKoqeoqQdIRMSvCJ/ZD1qmw=; b=vkBlf0012Qi0FmwSzpEy1H+VSBXnLrfcppB68n9ADdkK1oOThVhDCIOpi0gUYY5uME7AIG J3pPfhRudXFslbD4riSmqOAZ8YfzK9e1FsQCnMR9HtyNAXCB4gbWmd7p09SYRJ7o9sW9BV HbOPPTHL68Ja2MoFwPYuTmS+PEO1yoD80PrcTZFfeZEb5Pc6sh/tbM4dTBJyrjUm2S15kM K85YFJ3JZ9dNaJ8qARWAav0THOFJZ9nxqhi8aJH0BzwWR4sThIj3kxJb6mlYv0Y79wMa6N VdZfJvqby34jN5zgkyJ++JI4T1QJ1Y9Gkm7ZY+urX071J1ImvH903PYLxlKOHQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706735684; 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=Q6qCoPTML8h57sp9oE2AUKoqeoqQdIRMSvCJ/ZD1qmw=; b=f1FRmEVtgWgdmUZwhyiGYkufPFPVY8K+Jayh6CcWRoNppBJlG3PoXpgbT8TMaLrWSDDs9/ EDhVYgEHpFVW50CQ== From: "tip-bot2 for H. Peter Anvin (Intel)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fred] x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled Cc: "H. Peter Anvin (Intel)" , Xin Li , Thomas Gleixner , "Borislav Petkov (AMD)" , Shan Kang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231205105030.8698-29-xin3.li@intel.com> References: <20231205105030.8698-29-xin3.li@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170673568329.398.1021316577676211303.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/fred branch of tip: Commit-ID: 51ef2a4da7ec347e3315af69a426ac36fab98a6c Gitweb: https://git.kernel.org/tip/51ef2a4da7ec347e3315af69a426ac36fab98a6c Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:17 -08:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 31 Jan 2024 22:02:59 +01:00 x86/fred: Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled Let ret_from_fork_asm() jmp to asm_fred_exit_user when FRED is enabled, otherwise the existing IDT code is chosen. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Tested-by: Shan Kang Link: https://lore.kernel.org/r/20231205105030.8698-29-xin3.li@intel.com --- arch/x86/entry/entry_64.S | 6 ++++++ arch/x86/entry/entry_64_fred.S | 1 + 2 files changed, 7 insertions(+) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 29ce68f..7c4b726 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -247,7 +247,13 @@ SYM_CODE_START(ret_from_fork_asm) * and unwind should work normally. */ UNWIND_HINT_REGS + +#ifdef CONFIG_X86_FRED + ALTERNATIVE "jmp swapgs_restore_regs_and_return_to_usermode", \ + "jmp asm_fred_exit_user", X86_FEATURE_FRED +#else jmp swapgs_restore_regs_and_return_to_usermode +#endif SYM_CODE_END(ret_from_fork_asm) .popsection diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S index c1ddaf6..2271a1c 100644 --- a/arch/x86/entry/entry_64_fred.S +++ b/arch/x86/entry/entry_64_fred.S @@ -32,6 +32,7 @@ SYM_CODE_START_NOALIGN(asm_fred_entrypoint_user) FRED_ENTER call fred_entry_from_user +SYM_INNER_LABEL(asm_fred_exit_user, SYM_L_GLOBAL) FRED_EXIT ERETU SYM_CODE_END(asm_fred_entrypoint_user)