Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2121065rwd; Mon, 15 May 2023 07:32:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5KENydGgNHsKDAKmn3gox9DE3ximAhX5XepVFF615O0eaUAHot6jDQdXbtK1eW2FDNcsT/ X-Received: by 2002:a05:6a20:9183:b0:fc:8dfb:318b with SMTP id v3-20020a056a20918300b000fc8dfb318bmr44230584pzd.0.1684161146728; Mon, 15 May 2023 07:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684161146; cv=none; d=google.com; s=arc-20160816; b=QzZsqYpKFD4U8quV+x3VPC737CqNiSg7RDnvdgUPmOSbw0DfkFA/j8YOnU0b5qnlYZ PN7K4PBgjGdFzX1JWw3r1NOJUaOiSMUj9cJkX9yMBpkShzIX9Pvxfaz7j86vCpIBQC04 +JxyYEbgGpO32c3ifod9fa0u14LUK4+IUevptu1aXTQ8eMMk82s3Egsvy86G100YVDvF 3UpDODg8w+IcTEr0gHdCQYjTgH70fOL/q46pIN8bI+qRTS8AI9GGC2uku61Qh3DYaaEN 6CXjkgcSqH8JrEk5p9htZRj0MexGErYO2gKHPARzjjzUbpkgijktSbIq2rGouIy7a88I Ts9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=DBCloPEnq7GrVWUv77/f546gFZlvf4mfkR+6V2XWZpQ=; b=l96LFmk2nl9Mi545Tsoakw66zNZTw/hOvubAuYCTheU+PDwco+Wqgzrk95JblA1mgq bPHr99xEOM0VzB7Mv1tYRVcniy/8chOqoe8gz7H2zySvAyEtCT9r0uCO+nlSDU5toErL Qo5XdJgT6krZPm1UkTp82nueV3vb9Oq8wjqnnZk5MKpGrbpUWMk/J/rOKukMjfRanCln i/IAFy8Nn0v5LuWRMpWgqmY9WCQ/4sUszJSbttIV8EmBhw2VhwcLnpX6rBoLmsAhMrJ4 p9zr958IoZ5qPWg939ImL/yRwyQ1v00OriPVru/e9Yo7u8qAX2Ls+KemQcd/BUlwIvtL O4RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm2 header.b=dEYIYxnE; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jttTDMkg; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020aa7970d000000b006281ec442absi17576991pfg.309.2023.05.15.07.31.54; Mon, 15 May 2023 07:32:26 -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=@shutemov.name header.s=fm2 header.b=dEYIYxnE; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jttTDMkg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240307AbjEOOHr (ORCPT + 99 others); Mon, 15 May 2023 10:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240107AbjEOOHj (ORCPT ); Mon, 15 May 2023 10:07:39 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E74392688; Mon, 15 May 2023 07:07:37 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5077A5C00CF; Mon, 15 May 2023 10:07:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 15 May 2023 10:07:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684159657; x= 1684246057; bh=DBCloPEnq7GrVWUv77/f546gFZlvf4mfkR+6V2XWZpQ=; b=d EYIYxnEmXdn3LvuypvjbS4ADcgzkr5tqEmLBnSNWcUARtv9Hmluw2x5vLlRJCtPe MHpMdRBP+xIYz/6aoCDYTACOvO0rE3myoSdBpcPmBpO68LrBdd/viT7UKw9LPgeB i/LAV/JuMpS17zclIzuPL88BvOwmqPzKT0zRdVmU4Ffx0t+IopnpLmYWakdrFxEr nQurXEJa3eT/x3S+ADMTDq0tAuLIafi6H0Ax1oxgHeCVuLHXVO0asLGBCi0nc1gR 7WHEm3Y2Rb/IYEgjvKW26PKm4O6wBfHrEvsVl2jb0O80FIuBXy9V+YVoX2IxjMq+ OzjrI8i9Rq8BkRQiGi8cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1684159657; x=1684246057; bh=DBCloPEnq7GrV WUv77/f546gFZlvf4mfkR+6V2XWZpQ=; b=jttTDMkglQhSBoGAKUcq2GrzQuFze HMoUOO5iphm/dMVq7W6eAeFUckUAdWLcIxd8FpvkzX2AzUDuQENwwG6e4/NtuBUg mF3IbiuXrP1YtHaGonWWfhIVPoynnzKUw8dGcbZwWATG2D47Kx3mDEUrTwwnyy7B xu3+5D+hZew+SWLqZg5w75BLccnSA5BkCFOfATU/YggIy7OrUQ/bs528hfX2d4HD S4dBf+641KNnK5uEKTOhSJb/1a0pE3IG6bnMo+HV4oqb/OHpJFOaHLHe6lXjhjCH 60LKYt+FjN+KJs48NS5gN1vMKZ1YEEdo+GMjAYsxPAXEhaWlokJiEm1sw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeehjedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 May 2023 10:07:36 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 13B2C10D1DE; Mon, 15 May 2023 17:07:35 +0300 (+03) Date: Mon, 15 May 2023 17:07:35 +0300 From: "Kirill A. Shutemov" To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Evgeniy Baskov , Borislav Petkov , Andy Lutomirski , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexey Khoroshilov , Peter Jones , Gerd Hoffmann , Dave Young , Mario Limonciello , Kees Cook , Tom Lendacky , "Kirill A . Shutemov" , Linus Torvalds Subject: Re: [PATCH v2 07/20] x86: decompressor: Only call the trampoline when changing paging levels Message-ID: <20230515140735.lw7vjxiv4wsj7pk3@box.shutemov.name> References: <20230508070330.582131-1-ardb@kernel.org> <20230508070330.582131-8-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230508070330.582131-8-ardb@kernel.org> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Mon, May 08, 2023 at 09:03:17AM +0200, Ard Biesheuvel wrote: > Since we know the current and desired number of paging levels when > preparing the trampoline, let's not call the trampoline at all when we > know that calling it is not going to result in a change to the number of > paging levels. Given that we are already running in long mode, the PAE > and LA57 settings are necessarily consistent with the currently active > page tables - the only difference is that we will always preserve > CR4.MCE in this case, but this will be cleared by the real kernel > startup code if CONFIG_X86_MCE is not enabled. > > Signed-off-by: Ard Biesheuvel Acked-by: Kirill A. Shutemov -- Kiryl Shutsemau / Kirill A. Shutemov