Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DB1CC433F5 for ; Thu, 2 Dec 2021 18:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376612AbhLBSaU (ORCPT ); Thu, 2 Dec 2021 13:30:20 -0500 Received: from mail.skyhub.de ([5.9.137.197]:41436 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235498AbhLBSaS (ORCPT ); Thu, 2 Dec 2021 13:30:18 -0500 Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 51E8A1EC0545; Thu, 2 Dec 2021 19:26:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1638469610; h=from:from: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:in-reply-to:in-reply-to: references:references; bh=IKiIPj9jcXZHi0UaadNnk9AdT5NMb4JVaPkx3+dAlgc=; b=ODDDTkhuLtwubeaMu1DPHsJvlmG75MawdrrZN5W1je20MCKEdp64red03dptdOvs6roLDs LXfBQ8+9/wBgFJEMv608gARTegHNWRFK9N58AQtpgyRSMtgIhQjOtOF/fGs+L71jGd0xKQ C11Jbb4UpvgUKHvgFC1A13Lds0tw2wA= Date: Thu, 2 Dec 2021 19:26:58 +0100 From: Borislav Petkov To: Joerg Roedel Cc: Joerg Roedel , x86@kernel.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Mike Rapoport , Andrew Morton , Brijesh Singh , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/4] x86/mm: Flush global TLB when switching to trampoline page-table Message-ID: References: <20211001154817.29225-1-joro@8bytes.org> <20211001154817.29225-4-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 02, 2021 at 01:58:51PM +0100, Joerg Roedel wrote: > Okay, but in the caller it is not visible the CR4.PCID is disabled in > this function. I'd rather update the comment to tell that the function > is called before transitioning to real mode? Well, if something calls load_trampoline_pgtable(), it kinda assumes that if it wants that that function will do all the necessary steps to load it, including clearing PCIDE. Why does the caller even need to know that that function clears CR4.PCIDE? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette