Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp872424iog; Fri, 24 Jun 2022 16:44:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u9HQ40KHV7Up/30qI/VTU4ETU5j1z0fLvQflWOmqa7tiXPI2ldIgWSgcn56FhHaYhnBehO X-Received: by 2002:a17:90b:4d88:b0:1ec:aa96:ac92 with SMTP id oj8-20020a17090b4d8800b001ecaa96ac92mr6782425pjb.196.1656114265154; Fri, 24 Jun 2022 16:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656114265; cv=none; d=google.com; s=arc-20160816; b=b5HpKYZ04pC23rlf9HmYzkPHt/smZhMcs9+YpvDQ8oakkGEG7zqmdK/MtWe6JveMdX nbqltep1ftSjVc3Z2tKNT9bcuBBhDZatVkIFWlsSWvO/bmVQ4y0dteF5lEDVbMWDBsJt +Gvm5J81xeAN2XOtE93zIJ5EMGKsvIBUlNj169Ng0jRe3g1E5gXS4eFF5ttlZi8XGnCu IAol/y9jxuBKsAAGeKtbB6cN8lDrYpIJzBV9jjHniH0Gq0UPNLl5BM0VQODlIu0RPMxj Nc734Cb6DJ65CiECzrzNPPI3k8KzHTQTmbK7SIgaQTD/20pgOen775x1XnllHrZgrclu HUVQ== 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=3xnBvzrRmX/ejhmjRn6AoNfZ6p3RCpkOG+Vy08xprps=; b=Km9OlqTm3C0lFsgYARf7Fd0l/5EkKUvi+f43Keysq2fLYIH+Dz2I1gY3UNkaIIWylj E13j2xCw9RVPQlTuFjOiKcivSkyMXoUs/svl3Ac07Ri5uYI5s5DPjCxh4aSMIe0B3CDa rkn5xgXZp8GplGRO4RDFkQnXuxYHEpW2OYKbYsn+7yTYHz61LY5HBgz4N2uCegF4Ah51 TIAy1NwV5QSjMfatQ8K3AcvXG/o2reI3CLdhNkoHH5B6oCSb/HkLy+SGzaoQStfhimDj 7AIU2H66cZIIDxI0xl20nfJeslEuEMQN0Led81FrwP4n/zSFgOdf81pg1lL4jWrYNUYI vv1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AS3DaGG6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a17090a6a0500b001dc47313186si8602719pjj.68.2022.06.24.16.44.13; Fri, 24 Jun 2022 16:44:25 -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=@google.com header.s=20210112 header.b=AS3DaGG6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231583AbiFXXlm (ORCPT + 99 others); Fri, 24 Jun 2022 19:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiFXXll (ORCPT ); Fri, 24 Jun 2022 19:41:41 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A393489D33 for ; Fri, 24 Jun 2022 16:41:40 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id jb13so3334541plb.9 for ; Fri, 24 Jun 2022 16:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3xnBvzrRmX/ejhmjRn6AoNfZ6p3RCpkOG+Vy08xprps=; b=AS3DaGG61PYQBaU/p+BC2EOrkBhfu3MaqbJkNmutFIQKb6hE58NVV2T2HN5MPwWFKa cRf7njThcQFyvGXySMvrsvwCo02+qfboGW1pVKbYwZ24zTxDlM4SdkOlaaDFVJvDXPIL OetXbsRtBoPDnOt5HdCQ3Q5JqWpf8ZVwSOnb3+xYio8ZK4/NjtBacXonZ1fqjV8WXYXl WU3NZOiVBo3AsoXU3X5dmZemrU+NDtUm4b9Yn4FBO/V9W87+Q3OJ5LZc/Nwe2iFLrDsE ZinA615CpiS5kp60zPU5bVWNiOI19/qMTyJP5t7KTw/k98Pz4cOoPF8LyMsswOMQr1cy oMiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3xnBvzrRmX/ejhmjRn6AoNfZ6p3RCpkOG+Vy08xprps=; b=lVpKbKdfBIsnJs3tvcbgLIcIRuAdB5wLmchBHi9UvhuM2VADlETjrl1wZ4JU62n9A6 rD1jCGjVcR8Fg2EvBwGiIMkMXvt+eHfthVf2UOGxJpk0CldBt3DrAHZHrav50nph4I0U Q0pJ9rY4Fs7PIYPTYk0WAAwN/vZQgZkiNN5k15sCij1agvQCaabgQ+SH5vG6Qm1Pli5S Y3cLXrwspoZdJfJSSZYdd5sXHQ2st/awiRHfjh/zyRnhBTmtdLgdMDBEbbPC9y5wh2Yv 3kqutMeNuaYUdCyi5hpkRmfg7x6ij/F9C9CPXyg52cTvgleEoDp7jTJul8UwlYp8SToe Ke2w== X-Gm-Message-State: AJIora/8D0/LLMUqZxqrqN7eTxrlaTa1wJD8MaLwHmhjhHKF8wBYFsQP DPKnXdMSTK7cgaKxISFJDtUZsg== X-Received: by 2002:a17:902:d712:b0:167:757c:a6f4 with SMTP id w18-20020a170902d71200b00167757ca6f4mr1476590ply.5.1656114100011; Fri, 24 Jun 2022 16:41:40 -0700 (PDT) Received: from google.com (223.103.125.34.bc.googleusercontent.com. [34.125.103.223]) by smtp.gmail.com with ESMTPSA id 2-20020a170902c24200b0016a6130128bsm2352299plg.211.2022.06.24.16.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:41:39 -0700 (PDT) Date: Fri, 24 Jun 2022 23:41:34 +0000 From: David Matlack To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] KVM: x86/mmu: Add optimized helper to retrieve an SPTE's index Message-ID: References: <20220624213039.2872507-1-seanjc@google.com> <20220624213039.2872507-2-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220624213039.2872507-2-seanjc@google.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Fri, Jun 24, 2022 at 09:30:36PM +0000, Sean Christopherson wrote: > Add spte_index() to dedup all the code that calculates a SPTE's index > into its parent's page table and/or spt array. Opportunistically tweak > the calculation to avoid pointer arithmetic, which is subtle (subtract in > 8-byte chunks) and less performant (requires the compiler to generate the > subtraction). > > Suggested-by: David Matlack > Signed-off-by: Sean Christopherson Thanks for the cleanup. I did a git-grep to look for any other users to convert to spte_index() and didn't find any. Reviewed-by: David Matlack