Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2508132rwb; Mon, 15 Aug 2022 06:43:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UN7NdwXXFm6Hegve1JzvjxS6TderjQd2Ey/Ju37soBGpVLBCx+hxXemZMPZyRF+Q/iojR X-Received: by 2002:a05:6402:4446:b0:43b:e1f4:8525 with SMTP id o6-20020a056402444600b0043be1f48525mr14846137edb.236.1660571018259; Mon, 15 Aug 2022 06:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660571018; cv=none; d=google.com; s=arc-20160816; b=JuB64yVSXkI7oPK6ByMKnLKn9RJUfcskY3juJBjExsJAj5g52yLpJ/dd0PmxwAz3yw taGHTZPft2rMLcTNRMyKBXVq1i+zcIPyzSakBG6dhUBNJMdPZ3mVv9nN/stMUFsQXNmh 34HCR8PeSj851YMEqAqzsl/ajX5gWDXkKB5YdrUojkA/GQoGfWiSXeqtfgZ5TFI2nwgS /medjCvpdaWxpWqcZa9eweFpnlZew0Hqyb0Fs3Qa2YReG/ZlJW1uCxi26Zl4ynTHEyoO S9rottKor/URNOXoQnRpK4APxB3hlgEBFVyGA4/04ZNSqXoZA//fu+CWtTKma3vVI9lw HQuQ== 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=2tb0w40Fu2zdCcFs6ZUVcbW7rTOPIDoybVJIh3ibvtw=; b=dcgtimmQ8crgpyBR4bRMvmS0UvzPyS/yQ2CCY0ei8g3ar4EJOrpuUUpt9Wyp9z/+fj cc6C5SeVvVfnkAqFaNLYTCf05NRvgrxGSvJT/V27WdwInK1LByntenShgnhAlcuqF2gL sZp79RKxPmT61RqFRudTf1W88OUs0MjmjMwIAYkItzuYTBEqhwRZ6M7oc15vRnRTvgi6 LP2l9Jy63zT8iKmNwb/4AF4e9af4j0ALW+ZwGp1maIyQNIb1+2ROWrEEmFIY1aMSDwpn RXoDYlo0eQacBIT/rPYEXi1pQGSB7V3UdauZiBkHBJO4xVlvexrDZDFTL0tDGWd26E6v WtNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ax+Wmnu+; 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 hc34-20020a17090716a200b0073832e13344si6022737ejc.86.2022.08.15.06.43.11; Mon, 15 Aug 2022 06:43:38 -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=@infradead.org header.s=casper.20170209 header.b=ax+Wmnu+; 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 S232547AbiHONeS (ORCPT + 99 others); Mon, 15 Aug 2022 09:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbiHONdr (ORCPT ); Mon, 15 Aug 2022 09:33:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BCC201B7 for ; Mon, 15 Aug 2022 06:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2tb0w40Fu2zdCcFs6ZUVcbW7rTOPIDoybVJIh3ibvtw=; b=ax+Wmnu+H069bkg0E2OOoboZVV Yhf2AhlnLFbvpIEs1VEenljURmrHzR6KISLtipuGpRZECX+cNYLgVUaCQqMs3Rhe63sWHx0C1E4EZ p2eK+C0haavPK72ewv/LS8vfvsudJXL9/tFaN9zMn5E+qPxcZswkA0MKOhwt61ARHb8GK5YSTNfQ3 G7wclSvc6cJr1jwPzOyiJdxnN48fm5a5s7JuVPxbLGnomHSwrCJ4A2++0qJjf5bF/QsNfAlOOLayN PMMeMD1uTGBJluyjd/46WaE6LGHKrVhyIfmdNzRrgXIVpyFH+MQIXta/+zS5kcs3+0XPSJdDGd1gK Xrw6eJYQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNaDg-005kle-SG; Mon, 15 Aug 2022 13:33:28 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 168DE980153; Mon, 15 Aug 2022 15:33:28 +0200 (CEST) Date: Mon, 15 Aug 2022 15:33:27 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv6 04/11] x86/mm: Handle LAM on context switch Message-ID: References: <20220815041803.17954-1-kirill.shutemov@linux.intel.com> <20220815041803.17954-5-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220815041803.17954-5-kirill.shutemov@linux.intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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, Aug 15, 2022 at 07:17:56AM +0300, Kirill A. Shutemov wrote: > @@ -1071,8 +1082,10 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end) > */ > unsigned long __get_current_cr3_fast(void) > { > - unsigned long cr3 = build_cr3(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd, > - this_cpu_read(cpu_tlbstate.loaded_mm_asid)); > + unsigned long cr3 = > + build_cr3(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd, > + this_cpu_read(cpu_tlbstate.loaded_mm_asid), > + tlbstate_lam_cr3_mask()); My editor auto indents this as: unsigned long cr3 = build_cr3(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd, this_cpu_read(cpu_tlbstate.loaded_mm_asid), tlbstate_lam_cr3_mask()); which (to me) is *much* clearer.