Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp1548613qtg; Tue, 21 Mar 2023 15:01:59 -0700 (PDT) X-Google-Smtp-Source: AK7set8V8yAtVXI0mQMqqSE+lLTR61qlXx/Lh8xu/yGNjagXaMGxOBdeSZvUcCUGWRbf+lIw1k9Q X-Received: by 2002:a05:6a00:80db:b0:627:e180:ac04 with SMTP id ei27-20020a056a0080db00b00627e180ac04mr3529810pfb.0.1679436119341; Tue, 21 Mar 2023 15:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679436119; cv=none; d=google.com; s=arc-20160816; b=JwqI8eQNCvc7AS7/KpBonVBNYXdYMoi35CIq+nbS8J3e+n5bf9aGRskPiUPUI0uh7H TCZRHXAaWB3WEDgIbyIlsNStLNtpysHAxrthGGACbrXcrVeBrI8UIUCX7QItal5c03qu 89WQ64sb5/jY1BZOYed6k8pCyd/cAWL0xUeD+5p4DztdPY6q+q74dy2kTuonXfdPUDtW Bm+n1lqiOcLRBXjm2qFs9RrU/HMseBfv/7VBZkxW+Q5UggxbmbFBkcS1GyYeUtMkgv0j nbGvLb3R342RVCm8JzMSDqFjgBdKcEI1abeBm3+KpFJ/F4LWelN84n7SHN+YSD8+Q693 C+Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=31NgJMjMJW7CSjSko12tKGd+dlWKG5Xzh4U0zIk6tlA=; b=DzCBatqv7bgLf+3TgLilCTEYvTeFTe/VoFMOATCa8tojMEgo8a20n6lZE9sFqVfjnT 173MDfENtNoqnXSTbXm2MMci26PEyJ0yu1qd2/euePukSM2625zsYPzzchfr1XNvx0fH naphfjTR8r9WS2TuyZrHngy9LlCLUXhBB+ZhbtxWMchu8KBlvBNq8GQA7GT+m0ky7cgt l1+Jg5JjcvjEJS2A4dE5kkERx7QYqOUKpyf/iCHBYqJyxibQ4Mf/9QOXFUY1B09RWOU+ tDkmJCBCE1w0+efTOv74wOjDNB0I9oV1oZQxngpcrJFo7+cKDh2zPDJeiq+mVWDbAM3j g55Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IB2gAfwr; 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 u3-20020a056a00098300b00627ec453561si9590519pfg.99.2023.03.21.15.01.44; Tue, 21 Mar 2023 15:01:59 -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=IB2gAfwr; 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 S230303AbjCUWAr (ORCPT + 99 others); Tue, 21 Mar 2023 18:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbjCUWAj (ORCPT ); Tue, 21 Mar 2023 18:00:39 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2059551FAB for ; Tue, 21 Mar 2023 15:00:33 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id p5-20020a17090a428500b0023b4776f0daso5311458pjg.7 for ; Tue, 21 Mar 2023 15:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679436032; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=31NgJMjMJW7CSjSko12tKGd+dlWKG5Xzh4U0zIk6tlA=; b=IB2gAfwr5yVRY7nH94N+NGMOeubdkqvhLL7Aw102uL8KAUo4EtZIiSOzmdoqk82CCD nxlWAMimTDK1t+giIs+UirPjyczFnJ3CAiPrE/D+K8MHL7SC7B26jKcP3qqx10p3fO8V fRAoSR6Sg5DrSZ+Kcz6WIULBnY/hejORQBZtdeBFL12p8rRdBx6tGcNJMj7VB6Wwb0Vg jMuR5d/qEOCbfTdvb42J8Qp9ibkLbAXst4X62GFKQHjs9j+QPbqJDquuN+pioC7fPGcL EAQAaRcxquKF4+Q8bz9TXagJNG/fNQ1funnN0WRVuA1tpUjwmBdmS9q38Y+eTVLNJU0x qc5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679436032; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=31NgJMjMJW7CSjSko12tKGd+dlWKG5Xzh4U0zIk6tlA=; b=lW1sgHj7CFyvOFTCnhLRRDpd+JKeHKsQ6Wp7ZcFBnqq+lHspv3KU3VQWSpsx4pS60R jqWRqbprH0Xp82RSbGZAMGqZrwyNFeKocsP+YaTssvLUH3Oab6ofgWia9KR29CKMD8Bb 1CMH7RaZyfuVRINb/sekwpeiNDgO2dF0aJ2uKn+OBtG1fvaEcN+PN9v9fAtR/H7rpKgt wBLXXchEFm6w2nj0YBBMiZQpvizQw0uDvJ5A9lwACa+YGzQ/4FFzPvurklft2JYqphZV /8OlUgSi6xxqaNnP/TEZWB7SVL8nu8YHNtPb0SRkhQM4SNaoUCa2IMbm3nJlpFs8zD4M Vi6Q== X-Gm-Message-State: AO0yUKUfTVoCtxSa0eicD9Ncy2B6Au+0BIAKmerXnYKNKGTUCKP/5Tsz tUmBHDmLGwtOSNM1DgDOQumpwbe7SJ4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:724b:b0:19f:2164:9b3b with SMTP id c11-20020a170902724b00b0019f21649b3bmr232120pll.13.1679436032611; Tue, 21 Mar 2023 15:00:32 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 21 Mar 2023 15:00:13 -0700 In-Reply-To: <20230321220021.2119033-1-seanjc@google.com> Mime-Version: 1.0 References: <20230321220021.2119033-1-seanjc@google.com> X-Mailer: git-send-email 2.40.0.rc2.332.ga46443480c-goog Message-ID: <20230321220021.2119033-6-seanjc@google.com> Subject: [PATCH v4 05/13] KVM: x86/mmu: Drop access tracking checks when clearing TDP MMU dirty bits From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vipin Sharma , David Matlack , Ben Gardon Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 From: Vipin Sharma Drop the unnecessary call to handle access-tracking changes when clearing the dirty status of TDP MMU SPTEs. Neither the Dirty bit nor the Writable bit has any impact on the accessed state of a page, i.e. clearing only the aforementioned bits doesn't make an accessed SPTE suddently not accessed. Signed-off-by: Vipin Sharma [sean: split to separate patch, write changelog] Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/tdp_mmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index a70cc1dae18a..950c5d23ecee 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -1691,8 +1691,6 @@ static void clear_dirty_pt_masked(struct kvm *kvm, struct kvm_mmu_page *root, __handle_changed_spte(kvm, iter.as_id, iter.gfn, iter.old_spte, iter.old_spte & ~dbit, iter.level, false); - handle_changed_spte_acc_track(iter.old_spte, iter.old_spte & ~dbit, - iter.level); } rcu_read_unlock(); -- 2.40.0.rc2.332.ga46443480c-goog