Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2075601rda; Tue, 24 Oct 2023 11:29:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzA2Ta6bWjinzNq/D87LO4yKXyUcvUoTRNqPB+RLiev9JxLvbrbVNJnxttDt1aFOWV3kPm X-Received: by 2002:a05:6359:2e88:b0:168:dc03:5b90 with SMTP id rp8-20020a0563592e8800b00168dc035b90mr6273708rwb.23.1698172154164; Tue, 24 Oct 2023 11:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698172154; cv=none; d=google.com; s=arc-20160816; b=utGFN4ZcketRc3aZH/yt7RwBOi3FhqFf5IzBSHdkaSH10lIeEpUGf0x/UIFv3jyYrX fa7iFYBltORCFgEckY9V1ROZTwY0RAesAbG+dDswklZtvcQ/LkzhIo1HSqLjLHJIgkS3 v9SswXgQQJeSph50N6F3ckQf0U8NPPmTXIMLm04ECcPw0aERRtkBgBfKn+KRqXxrV0Cw vtkXwVQykv/yqawaWBjBHdAwmj93b2TF337Paxitt6YynfewJpkTYjD72guK3G9i1nod 1ut5uH8kAx4Q8/9Xcjjr5boStCbp7enyynqJgstLGaCj7NYfsKsbYCkq4pG6iMcf8dSL P8wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature:dkim-filter; bh=oroAbK7jVyJ1hEsK6EWzfojE3csZE571ESfRCsIkU3g=; fh=M9f3wr0AAYcuO/3PqgosztaNVpXPL/ot/gf7YH82wQI=; b=BxZeLf6DIZM6bw4VduOI7gCoS1Wu6Qs8jTrg97Orb/Dl8u+sGISe/AZEmhCPUMVpRi mp3kkSr8mBhc6ZhmDzBLmcqrSQWTdq/4F0UQmhjDqLyn8007jW8H/dCJPJxUPq8n4Efs cuL3fhoAwlEIHVv/FTiDgcPiBQZJQ+Yea841Iyp4/25BiaNwrSlKikEXQLCRPENnfUkR RrO8uFftt/9sBZiMpwsto4MTrkzhHD+2217b+s75BsqqqrY4cyl3Fj3vqTa6YOuDX2D7 mGNupsj/Sipq1x0o8KIwnESI+KGmrfmtGgDWV2O0Nvx8CYpyJI25nYZJO4BgcItjtLhJ Btog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2023101201 header.b=B8BTElvt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bz39-20020a056a02062700b0056da0ae25a2si9018256pgb.32.2023.10.24.11.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 11:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2023101201 header.b=B8BTElvt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F3A868029AD0; Tue, 24 Oct 2023 11:29:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344130AbjJXS26 (ORCPT + 99 others); Tue, 24 Oct 2023 14:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344117AbjJXS2z (ORCPT ); Tue, 24 Oct 2023 14:28:55 -0400 Received: from mail.zytor.com (unknown [IPv6:2607:7c80:54:3::138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F39B9; Tue, 24 Oct 2023 11:28:53 -0700 (PDT) Received: from [127.0.0.1] ([98.35.210.218]) (authenticated bits=0) by mail.zytor.com (8.17.1/8.17.1) with ESMTPSA id 39OIRcVA3383411 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 24 Oct 2023 11:27:38 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 39OIRcVA3383411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2023101201; t=1698172060; bh=oroAbK7jVyJ1hEsK6EWzfojE3csZE571ESfRCsIkU3g=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=B8BTElvtiP1+hIe3f629T3y7gl9CjCEdpQHCxMzh3kj7A+HWfpncPZeWtsJqUBTJJ N0B6uD+17VWHv3W/v5pWNYmoJEgugY0P9vyf7Xr5nQ/sfFss9v96oQR1fjs4wfrznB V9d3M5czrx2IRLCHZqBnO/GwsIaIlBZiaIz0qhpv1rXjQJYTONbBF+KLUt+yPYa+04 DZ+q2lVOiU2iNj1UBv2mQbNkrvjO0nOOxltztSuqUrwx7NaeMON5kSerM3pibiHVaS jkZ+iqoguLfD/M3C14MUCHzGhenjuirZGyPRePTDrEmsT+wnhKiFTmLs7RDwRLGwGz NzowXbqpBrXjQ== Date: Tue, 24 Oct 2023 11:27:36 -0700 From: "H. Peter Anvin" To: Peter Zijlstra , Pawan Gupta CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Josh Poimboeuf , Andy Lutomirski , Jonathan Corbet , Sean Christopherson , Paolo Bonzini , tony.luck@intel.com, ak@linux.intel.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, Alyssa Milburn , Daniel Sneddon , antonio.gomez.iglesias@linux.intel.com, Alyssa Milburn Subject: Re: [PATCH v2 1/6] x86/bugs: Add asm helpers for executing VERW User-Agent: K-9 Mail for Android In-Reply-To: <20231024170248.GE40044@noisy.programming.kicks-ass.net> References: <20231024-delay-verw-v2-0-f1881340c807@linux.intel.com> <20231024-delay-verw-v2-1-f1881340c807@linux.intel.com> <20231024103601.GH31411@noisy.programming.kicks-ass.net> <20231024163515.aivo2xfmwmbmlm7z@desk> <20231024163621.GD40044@noisy.programming.kicks-ass.net> <20231024164520.osvqo2dja2xhb7kn@desk> <20231024170248.GE40044@noisy.programming.kicks-ass.net> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 11:29:13 -0700 (PDT) On October 24, 2023 10:02:48 AM PDT, Peter Zijlstra wrote: >On Tue, Oct 24, 2023 at 09:45:20AM -0700, Pawan Gupta wrote: > >> > > modules being within 4GB of kernel=2E > >FWIW, it's 2G, it's a s32 displacement, the highest most address can >jump 2g down, while the lowest most address can jump 2g up=2E Leaving a 2= G >directly addressable range=2E > >And yeah, we ensure kernel text and modules are inside that 2G range=2E To be specific, we don't require that it is located at any particular *phy= sical* addresses, but all modules including the root module are remapped in= to the [-2GiB,0) range=2E If we didn't do that, modules would have to be co= mpiled with the pic memory model rather than the kernel memory model which = is what they currently are=2E This would add substantial overhead due to th= e need for a GOT (the PLT is optional if all symbols are resolved at load t= ime=2E) The kernel is different from user space objects since it is always fully l= oaded into physical memory and is never paged or shared=2E Therefore, inlin= e relocations, which break sharing and create dirty pages in user space, ha= ve zero execution cost in the kernel; the only overhead to modules other th= an load time (including the runtime linking) is that modules can't realisti= cally be mapped using large page entries=2E