Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3252269imm; Fri, 24 Aug 2018 13:27:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdahH3mILoREsd3YXj7SBMkKGy27qEf4GUZKgj9196+sjOLbZzpWvLte35bmqpx3/v+W3YPn X-Received: by 2002:a17:902:b401:: with SMTP id x1-v6mr3042967plr.310.1535142422399; Fri, 24 Aug 2018 13:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535142422; cv=none; d=google.com; s=arc-20160816; b=JGtnpLrT0kW1+Thm3K0Zg9pPWjNFK+6JDC3KB+TIgG6pXP3GQsPQAAFhb+PsbCGunN AvMTqwVROHnuexW90U0LXPt6Wi48H9OTgucAQcpCCHoXybYuqjDAiKBxmFC3MOVz4/1B p0vyVa+bL4SF3A+enwkfKSdGJ1/V9XWtaLCDXzlASYeT2ZQoRAd9uwjLTCwYXJE0L5MU rjEX9SaewoGGoNAdc8Jalg3Wrg+ei+s1sVw5gV7YzkKGwAgdMLjHzBdKqWJNj1Ok7aPm PrJWvNfIkgXAn09jPxELYUppjghQjlL5dTEC5iOG79tjeRYHmTva5WwwfexSjdnKNEd+ f4ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=vQ7YkvZDBEk0QYXp/hSQnQMhPW+zEyToXWO8rFBSm/w=; b=GV3T91vT2CYN/yEzBLf9+vgz+i7UnB2IJxIQPQ+QDvz8y+an/8pp8s11wqk3LnBUPB ha5XnTn5YtVgMlzeVnG0iWpeMhnL9QTbzkeD2fqWht3EDVgBUfzSYw8KXqz72zOoAznQ K76pT5euGb3h1o38+5YsyLtexptwl84+zi4eG1XPgndt6TiNWOCM1KPc2JjB85bsrlal w8yvzm+JcG/XFKw/qfT1BCnM8CS2/a8BrlMHLss5pNB3q6yVyoujrIxCEO5j/PLloOyB uaVpodOgEoSJfxKimWLrc8KheVvoQuD98lQcd0vZ9q7KgAjySdArYaFaBzMzGni/7g3F 76YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kECkC1co; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si7805014ply.483.2018.08.24.13.26.47; Fri, 24 Aug 2018 13:27:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kECkC1co; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727993AbeHYABH (ORCPT + 99 others); Fri, 24 Aug 2018 20:01:07 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:39208 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbeHYABH (ORCPT ); Fri, 24 Aug 2018 20:01:07 -0400 Received: by mail-pg1-f180.google.com with SMTP id m3-v6so3868899pgp.6 for ; Fri, 24 Aug 2018 13:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vQ7YkvZDBEk0QYXp/hSQnQMhPW+zEyToXWO8rFBSm/w=; b=kECkC1coZk5PSz64P+ABtgtOtZ0yGc+W+gYyO/rfNUqE+pBxIBANswdQ94W3ExPHYt AZatevfqSYmAig6DlzB1GaQ8S2TiTbgrCb7C7UXc/0ztaT2CjqlHTIhg0LgJt4fX+Z4u 6NLTgjX/5RwcSgtAkG705ePbR/wX1XLMTskYg7O2xBAfI2DZAfaab2/30PafoMMRfZZU 3IpWogJMqEIPqYwi/mFPz0eoufRxzO//Is2SU+fZB8QpaRnSc6AhBRjIOKzvBsUEAcYm 56lAbIm5050e+ufj0QTVLROhoVy6GB8WLSDEnuvwoCOLL4HWvDXtzTgxyZPvVsEYhcvT aegw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vQ7YkvZDBEk0QYXp/hSQnQMhPW+zEyToXWO8rFBSm/w=; b=IA7Iz+q3pT0XhMB7MDbItoJtINwPAyviUYtWvqjUJRRHeIQ1BNTNqMuaKOQVd2WgnU WvTgfEfBpLPmIKVXmkKYCReYWc55qQc5Pm9NDF5E/o7oFmg/1ON4QVG98A0Un2zTzPRX ZJmhDdLt3fYPGJ4JLE6sRyTG518i50dd2uDaRxsk6TyC+l5qxtTJQpqUBMeDWIQjo4RL 4ctWITAea3WulRY8OR6iY4hA17DLkfCcbwvYieghFVUpiZsj8iMv7vzpRnTwW4KQd7qL h1txR+h0GqgZeOZaw4qMHCks1i+WD/dfVh3qUW0tzE9Yry7aO6YNzoSMCZCwly1Fcssf 8BsQ== X-Gm-Message-State: APzg51ByTasJWGyEXBQNo4YKTZxup3fG7A/z4abbDAsigeCL0vv010y/ aqE3xw3n/A9Jj2OlTBd7Lb8= X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr3034600pgu.260.1535142297361; Fri, 24 Aug 2018 13:24:57 -0700 (PDT) Received: from [10.33.114.204] ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id c128-v6sm7854662pfa.177.2018.08.24.13.24.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 13:24:56 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: TLB flushes on fixmap changes From: Nadav Amit In-Reply-To: Date: Fri, 24 Aug 2018 13:24:54 -0700 Cc: Peter Zijlstra , Will Deacon , Benjamin Herrenschmidt , Nick Piggin , Andrew Lutomirski , the arch/x86 maintainers , Borislav Petkov , Rik van Riel , Jann Horn , Adin Scannell , Dave Hansen , Linux Kernel Mailing List , linux-mm , David Miller , Martin Schwidefsky , Michael Ellerman Content-Transfer-Encoding: 7bit Message-Id: <9A38D3F4-2F75-401D-8B4D-83A844C9061B@gmail.com> References: <20180822153012.173508681@infradead.org> <20180822154046.823850812@infradead.org> <20180822155527.GF24124@hirez.programming.kicks-ass.net> <20180823134525.5f12b0d3@roar.ozlabs.ibm.com> <776104d4c8e4fc680004d69e3a4c2594b638b6d1.camel@au1.ibm.com> <20180823133958.GA1496@brain-police> <20180824084717.GK24124@hirez.programming.kicks-ass.net> <20180824180438.GS24124@hirez.programming.kicks-ass.net> <56A9902F-44BE-4520-A17C-26650FCC3A11@gmail.com> To: Linus Torvalds X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org at 12:31 PM, Linus Torvalds wrote: > On Fri, Aug 24, 2018 at 11:36 AM Nadav Amit wrote: >>> Urgh.. weren't the fixmaps per cpu? Bah, I remember looking at this >>> during PTI, but I seem to have forgotten everything again. >> >> [ Changed the title. Sorry for hijacking the thread. ] >> >> Since: >> >> native_set_fixmap()->set_pte_vaddr()->pgd_offset_k() > > The fixmaps should be entirely fixed after bootup to constant > mappings, except for the KMAP ones, and they are indexed per-cpu. > > That's what my mental model is, at least. > > Can you actually find something that changes the fixmaps after boot > (again, ignoring kmap)? At least the alternatives mechanism appears to do so. IIUC the following path is possible when adding a module: jump_label_add_module() ->__jump_label_update() ->arch_jump_label_transform() ->__jump_label_transform() ->text_poke_bp() ->text_poke() ->set_fixmap() And a similar path can happen when static_key_enable/disable() is called.