From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 580742F39B5 for ; Mon, 8 Jun 2026 20:05:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949158; cv=none; b=o9cssCZuhS41y+0/nitNdX4laayz8IjkugDA8lnkGKsymVWfzxDZnlgjfZrJjmN72NUb4/RNFuw6wj2gZYFtirVG3ETfa7GSYxJQAdteobt66dNJJmZLxAMKWsKC9u5Q7/OhkUQeygtr78ON6QULoU6B6vBJ8mjJMQuCNXXrpis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949158; c=relaxed/simple; bh=0Ko2DoXipMSHtG3jNRvX5bcFFDZrQMtlnDL2sz5rBz4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hZ043G7f3gLTib1qvvT+Vt14FL+Vi9OaK+tcxVobQ4p9THQUVMnQfL9TWaa0TcL1dNmU6vXPbI7Lk2PTLntyESsGXUacwVpYh0xqTV97HM4LVv87dQy5kaVhBRHlp4FBQiITANPyKMc5yD4S1jTnIqhU/NWfCJc1wgmqiJ9Unvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=Gumbgs9V; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="Gumbgs9V" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 43EA740E0031; Mon, 8 Jun 2026 20:05:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BC0ExZv7Si1j; Mon, 8 Jun 2026 20:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1780949136; bh=DdlvkGbFJqlwcrbmd3s6YBLQhmBHTHv5iTeT2ZJJa80=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gumbgs9VCJZhwlVkMftyfiRYD/cVMoDyYRQFEcGIn1XmHWZUaLbVLBSLpp01prlGG pU9Fngctc0M3/qcwRgMvC2Lm/u87Hs+0P308gutTO2qGnenyXCk8q0eMpZb/p03opK 2o35vAHQdKNJ31QXmtUs4Llv3Pv/ZUAc5LuHj3wga9TQKkEmZxew9K1O87zuQ1CKnY 15lWwGqfndAITAr776X+EiwFPqTZ88KZI9Foob6pfPy8gy4v2NylY6hmzcRI5F3gUN QcPkOW397vEqCyJKW394su9tSe6WOAM4vR7VOAnFTfiJ4E42n8pDuDXvuoj133Qozf L14lAwrGYL2n5JzCCtnYgfgxzqN6QiFZO9BMStr/MThe5mMioUZM0HBbeXOX9AQdcy UTFDgUxrUCbYEcP+LWvn2nkXWeg3TfunuktfPyJPJZ1BqXr0EWJYfaTDaUTzV3Nnml FmnpwDAVzdgls9PsvP1jqBBozlVryCsqW+ht+NV+yig1huw1DSmo1/bvnYcOUgrxAZ ZZsBXXhFP9b6ECD3PE2eruDQH37FKTA0jLn1jQy+Rbio1rbS+kG37/GiVJ4VgtGvEB cEix3ZcaWi7NAbtQ1FisA6mnxmSlquuwH5nf9ls7ubfgicE1bxKvdmYD/nAOn4QfLf ZzzQTWpuLWFVS8VvaIrJdHds= Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 53D9240E015B; Mon, 8 Jun 2026 20:05:32 +0000 (UTC) Date: Mon, 8 Jun 2026 13:05:28 -0700 From: Borislav Petkov To: "H. Peter Anvin" Cc: Andrew Cooper , x86-ML , LKML Subject: Re: Save a WRMSR GS.base? Message-ID: <20260608200528.GDaicgiFydU8LVUGL2@fat_crate.local> References: <20260605043846.GCaiJS1iXH8A6Cb3Vy@fat_crate.local> <0F905129-3447-4173-A88B-98EAC8C18E4C@zytor.com> <1E2599FB-0A39-4637-B042-EE36DA224264@zytor.com> <2f297456-d6c6-4cc8-95d8-2dac6bea99ec@citrix.com> <20260605171711.GAaiMEl_CahU4oHpMk@fat_crate.local> <079850DB-52FE-4545-825F-E01E918B085D@zytor.com> <20260608143835.GAaibT6_Ypd2OzVkWD@fat_crate.local> <87cfce38-4b5a-4014-a098-2c43e3067df1@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87cfce38-4b5a-4014-a098-2c43e3067df1@zytor.com> On Mon, Jun 08, 2026 at 10:30:36AM -0700, H. Peter Anvin wrote: > Without REX.W (e.g. wrgsbase %eax as opposed to wrgsbase %rax). I see. > It means that in kernel mode, it is the currently active GS.base that is > written (or read with rdgsbase), that is, the one that belongs to kernel, > not the user space one in what is confusingly enough called > MSR_KERNEL_GS_BASE. > > In other words, not the one we want to task switch, *unless* you are in IDT > mode and can surround it with SWAPGS. Uff, what a mess this stuff is. Brain is in a knot. I think this is begging to be written down somewhere. Lemme point AI to it and see what it would generate. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette