Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp881711pxb; Wed, 27 Oct 2021 14:23:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjuJH4GDaii/R1CHODDYD+SMznZR4Y7FR1+O0k2SrmVxRtX3w5XeBi+X5bXv6ShouBDBbd X-Received: by 2002:a17:906:c111:: with SMTP id do17mr107726ejc.48.1635369812287; Wed, 27 Oct 2021 14:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369812; cv=none; d=google.com; s=arc-20160816; b=S5rgSV0XhAQo4VJxvye2/XQTLQsgoZSXPYQ7KNkbpADxuaiowmmWYnwJ985S0ywGzZ tjo1CFWxvh0mpyDmYHS78FVJHy5EseazcXr+P7VdXtq5heoJ0tO48Tq3cBZFQDZW8K+h yXecDWzXujpUUxHQMrizcdheEfzGcRrBf3W9jwUqSB2m72fio2D8BPb3VSSs1rQ1f42j YEqSGC0BZ81nRQUYyySZg33xGFSA1cYVw+fQXMWVexcZ1ub9dGYfUYG0vaLpLs5fkITo 7VUp2j+0gZ/hTf7nl6c8mxMlfxivQ1eps8btV9KUrqTEdXSivrmcY/UiaOUN8uNYgkwC f0dg== 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:dkim-signature; bh=2wrxbVGiHtT+851EEfdKGyPl86mZcd8DuPl474V4X3A=; b=ZGkX7GEA02rV5XLTjQMZYMPl+RUfrOw2PZQaRBzpFYoeK+99TScChSiqMe85TZxbl1 5G2L18gLkFALsV1oGEsLbPIy9+6yUnV+Gvv5B4LZweYMOcvMknm2T4UbeSqpH+gy0iYC vfTw47DGGPbWciuzJX9m12o1Fd0BbDXcz9J0jCKhhCik6AOAs+vkieta3Q8KaYtQRtqN SIgk9Tiuz8GhksbRQ9OO1U5DFq2qsCDHQF1qb89eljluLKBF9CrhskZudbbGozUCHuJr bvCPS1/nHf5ubEt1APQY4Iqbd96U+CgUeRZ3eSsjawUxpnwxNFmxzvftjC2wCI2N24xl BntQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=V7pD81ya; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di14si1330383ejc.710.2021.10.27.14.23.03; Wed, 27 Oct 2021 14:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=V7pD81ya; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241361AbhJ0KCG (ORCPT + 97 others); Wed, 27 Oct 2021 06:02:06 -0400 Received: from mail.skyhub.de ([5.9.137.197]:36602 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241319AbhJ0KBQ (ORCPT ); Wed, 27 Oct 2021 06:01:16 -0400 Received: from zn.tnic (p200300ec2f1615002935f4cf24b5c3ba.dip0.t-ipconnect.de [IPv6:2003:ec:2f16:1500:2935:f4cf:24b5:c3ba]) (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 0AEA21EC0622; Wed, 27 Oct 2021 11:58:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1635328730; 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=2wrxbVGiHtT+851EEfdKGyPl86mZcd8DuPl474V4X3A=; b=V7pD81yavCzYcUTcnGLcrh8YBeGocCi04kKDc2MI44q3reuowzVOlm0LQLnXf6oDlZPooE sKvm1UlJ8e3qSoJXI15IRq406831yaL71wCPZEgWiAN/2qbSE+jT158c7wGpxWQ1HtgLI9 ZsnYQENEpleqVCsR4q2lEro/W2ullSg= Date: Wed, 27 Oct 2021 11:58:45 +0200 From: Borislav Petkov To: Joerg Roedel Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Joerg Roedel , 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: <20211001154817.29225-4-joro@8bytes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 01, 2021 at 05:48:16PM +0200, Joerg Roedel wrote: > diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c > index 31b5856010cb..b9802b18f504 100644 > --- a/arch/x86/realmode/init.c > +++ b/arch/x86/realmode/init.c > @@ -17,6 +17,29 @@ u32 *trampoline_cr4_features; > /* Hold the pgd entry used on booting additional CPUs */ > pgd_t trampoline_pgd_entry; > > +void load_trampoline_pgtable(void) > +{ > +#ifdef CONFIG_X86_32 > + load_cr3(initial_page_table); > +#else > + /* Exiting long mode will fail if CR4.PCIDE is set. */ So this comment is not valid anymore if this is a separate function - it is valid only when that function is called in reboot.c so I guess you should leave that comment there. > + if (boot_cpu_has(X86_FEATURE_PCID)) > + cr4_clear_bits(X86_CR4_PCIDE); > + > + write_cr3(real_mode_header->trampoline_pgd); Is there any significance to the reordering of those calls here? The commit message doesn't say... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette