Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp875345rdb; Fri, 23 Feb 2024 02:57:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW4Z9eC5HLgmwPFRoo0btT7kWrwSH4SJjOU+dzb96clejwMQyADZf3cLQH+e9vzYLE+JSyeiWWGhQOrJozBfuTmyTm0DBn4RsxA9dbNAg== X-Google-Smtp-Source: AGHT+IHVU+s+CwxY9RA+09xj8i1rhOL6JBdCcMyBNxN5mTCV31GqzFWz67Dgm7uVBFgApuryi3Vj X-Received: by 2002:a0c:e247:0:b0:68f:5325:7544 with SMTP id x7-20020a0ce247000000b0068f53257544mr1582685qvl.42.1708685862434; Fri, 23 Feb 2024 02:57:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708685862; cv=pass; d=google.com; s=arc-20160816; b=Ydc8Ge3+Aoy+JkoLbsHHqE8kWGIajsgf8Zq5AFRG+2JrEzkSAJu8PIsfr15IBOpL6H 2kQaNBLUtnGuzIYvyfYIYR9AOlFmMOMlZ7oizLTawHPgqPoXWjX8tfB5Ed/ca1tzlFpY cN3rdnDnv9GBp8OfJc89olOilsxI/kui1UtvXKGevJtc9905NB8Vw3DZcog/ftu+LAWM xqDefgd7BUjclhufcYd1RudXxHaV6m3U6ioO78CZqtTCjEVsgSbFncd/UyaVmKmGYxi6 WiwVLwTRjiJzBqEIEVB+UYedKv0yCiWqfEAHn1c4o5pOqFJfbufh/eBgXbDxj8Vd1Ij8 OT4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PLbBMkLjbMUw1Ke4kRxaeaohDG/ocoAPZSASkwUf0OU=; fh=CCKac6+UkTPK3NJRJTRNKsNim81cyApKJ9CIqxmTL8A=; b=InRwmTGgSFEfhlj3DAyorkGpOI01ZraRHg7ADjWXHHBXUJ6ggE7iBNGvzogbyM3TfE hvjKp2xg9IU/12y9iGMJARsyukQKscf06cqAKoY+KgACjJxApW9n9BGaCskxsO2AHwQp whp1asXy0k41zRZuJGxuJWM+vZiS0gEc/vymBzYyr3Rfg6IpfC4TUOABiAzeEQCkq+mA Sv82RpcRJyQj9UUk/2UitcWHwdxdLrlV3tfnLIe+5+bsTotAzS3MCg/ZT0Qmqr3YrBJh e2sPklh9HTYS90rvXOf/78ui5Phz8a4X2b2IJmWCjJMgamO4VlUgq1xh/jwPw4Y3sqyh skBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ii7AfXXi; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-78187-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jo13-20020a056214500d00b0068cab7f4d3bsi14906040qvb.181.2024.02.23.02.57.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 02:57:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78187-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ii7AfXXi; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-78187-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 29A111C23DA4 for ; Fri, 23 Feb 2024 10:57:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E54835D485; Fri, 23 Feb 2024 10:57:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ii7AfXXi" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 75426405F2 for ; Fri, 23 Feb 2024 10:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708685858; cv=none; b=JbXnUUQKshjKP6xbMnZWDeOOXQePG5+8/IEG5iIRDVtsDc4Jdm50xHL/nx4hdq7tr7bpSxybo0+bgd3h0qtWaidlynYbL2m2DC7+SFXAuyaS5Ui6lcjmj62wcK3L+mwCfFENlImrVdZfhgVGsjw1WTht67ZycGIJkZBdYEDkfJw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708685858; c=relaxed/simple; bh=gVeS+e41svOWH+sCq6XotOZ0nJF2LgZImj6VEqx+JvQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UEL4yTYCvwqF8kIbrohKeElyfSh0c3U3uYLaIBMWM6h78d9huYiboWQ45Ua5M/Q4PCjDBRr++FNN/CZeW2m4ou22UG2fVNnmA4QaMebL0Qv3RsKworTLHo0DkwBeeEFr7UCvTgGad2wmypAYj1MDx6zKiYa83jzg9k7R1jCXppg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ii7AfXXi; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708685857; x=1740221857; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=gVeS+e41svOWH+sCq6XotOZ0nJF2LgZImj6VEqx+JvQ=; b=ii7AfXXiRaar7Ft2CLrplbOxDP7U99PEIFGu+MrNJGOeLSKZOni5NlTa sjOIoV4GcsWzwHB6nr1Qr3OwDxfzXaIiJIhsYOW481bSonOA3FkNz5GDe Q0mSvAgZMyTjklvLHh9JdvtDQ0N7An4mDQ+pGLolpJpDD1fDZIt8RrSv+ VQl+2tyZ9fij2qMSwbBEFfouCHg8kalwkSEnrzyno/gaF0Z266i5LdeRN rffVb6LnTqoZZjP1p6JNs9Ru3vrjnysC82fkn0wdNZ0g5IvahmAyMOu5K RniPX5dqmONhMtyVVkHskCKdapPCXQUEfD+cF0gXzFE1ACx9XbZ/WohJz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="6807231" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="6807231" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 02:57:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="937024610" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="937024610" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 23 Feb 2024 02:57:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id B30631FD; Fri, 23 Feb 2024 12:57:31 +0200 (EET) Date: Fri, 23 Feb 2024 12:57:31 +0200 From: "Kirill A. Shutemov" To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Cc: x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Andi Kleen , Kai Huang , Sean Christopherson Subject: Re: [PATCHv4] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed Message-ID: References: <20240126100101.689090-1-kirill.shutemov@linux.intel.com> <2qfzbafedurgpsnlbrrfcwed4kij5kbz6txaacp3fy73anfk3g@r75kdg6byw4b> 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=us-ascii Content-Disposition: inline In-Reply-To: <2qfzbafedurgpsnlbrrfcwed4kij5kbz6txaacp3fy73anfk3g@r75kdg6byw4b> On Wed, Jan 31, 2024 at 03:04:03PM +0200, Kirill A. Shutemov wrote: > On Fri, Jan 26, 2024 at 12:01:01PM +0200, Kirill A. Shutemov wrote: > > The trampoline_start64() vector is used when a secondary CPU starts in > > 64-bit mode. The current implementation directly enters compatibility > > mode. It is necessary to disable paging and re-enable it in the correct > > paging mode: either 4- or 5-level, depending on the configuration. > > > > The X86S[1] ISA does not support compatibility mode in ring 0, and > > paging cannot be disabled. > > > > The trampoline_start64() function is reworked to only enter compatibility > > mode if it is necessary to change the paging mode. If the CPU is already > > in the desired paging mode, it will proceed in long mode. > > > > This change will allow a secondary CPU to boot on an X86S machine as > > long as the CPU is already in the correct paging mode. > > > > In the future, there will be a mechanism to switch between paging modes > > without disabling paging. > > > > [1] https://www.intel.com/content/www/us/en/developer/articles/technical/envisioning-future-simplified-architecture.html > > > > Signed-off-by: Kirill A. Shutemov > > Reviewed-by: Andi Kleen > > Reviewed-by: Kai Huang > > Cc: Sean Christopherson > > Any feedback? Anybody? -- Kiryl Shutsemau / Kirill A. Shutemov