From mboxrd@z Thu Jan 1 00:00:00 1970 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 9ABB8C433EF for ; Thu, 2 Dec 2021 12:50:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358094AbhLBMxj (ORCPT ); Thu, 2 Dec 2021 07:53:39 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:51024 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346795AbhLBMxa (ORCPT ); Thu, 2 Dec 2021 07:53:30 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 73B871FD39; Thu, 2 Dec 2021 12:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1638449407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Y7BJ1F/LQe8l899ADV5Sd9TXoNbnVvjjvi+5r9Zj5o=; b=rfiCiImXZOU2QRJ9i8JMzr19XMYG92EWa21my5ObPn/oZcD5rxVrPbMy8N38L9pmLonrcb aHVfvdY5azbxl2Ilxr4MdTC1s5krlU6pAD7gcV2nXwhlMnZlqx22D4qNU1UaRgrg1LgHXJ M+q1iJmbRX9rMRZNNp6G33WkdsRBTPw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1638449407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Y7BJ1F/LQe8l899ADV5Sd9TXoNbnVvjjvi+5r9Zj5o=; b=APwMaGnEtZ5o8YJB6llvVzlfUA1jmcN+3PsphKLf0x5jeGbMh43dyOi3LihyjRSIaFTN7g 4pj++2UGg0XgMsCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0E05A1330B; Thu, 2 Dec 2021 12:50:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bSpxAf/AqGHxLgAAMHmgww (envelope-from ); Thu, 02 Dec 2021 12:50:07 +0000 Date: Thu, 2 Dec 2021 13:50:05 +0100 From: Joerg Roedel To: Borislav Petkov 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 2/4] x86/mm/64: Flush global TLB on boot and AP bringup Message-ID: References: <20211001154817.29225-1-joro@8bytes.org> <20211001154817.29225-3-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 02:58:44PM +0200, Borislav Petkov wrote: > On Tue, Oct 26, 2021 at 11:55:44AM +0200, Borislav Petkov wrote: > > > + movq %cr4, %rcx > > > + movq %rcx, %rax > > > + xorq $X86_CR4_PGE, %rcx > > > + movq %rcx, %cr4 > > > + movq %rax, %cr4 > > Also, I'm wondering if you could compact this even more by defining a > function toggling the PGE bit and calling it from everywhere, even from > asm. Yeah, that would make sense, but is probably worth its own patch-set. Unifying this across arch/x86/ needs to touch a couple more places and needs special care so that the function is safe to call from early asm. Regards, -- Jörg Rödel jroedel@suse.de SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev