Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3775650pxu; Mon, 19 Oct 2020 23:21:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw65U3ATZAh3CCW4Oy9JuMmXLPktrJrlZTE6M3S1KFzLR4UKBJxzH0HbUp8FJh0HDpHOOa6 X-Received: by 2002:a05:6402:21fd:: with SMTP id ce29mr1118216edb.383.1603174872884; Mon, 19 Oct 2020 23:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603174872; cv=none; d=google.com; s=arc-20160816; b=rV/YOaECZsf7EI+mmo0qJJ5PF6lpNURX3NpInP0/xwvSVxcFTtIjW59LOmhj3W3uTn 70xNBhRlawhNzTI+2mvRnYXrXMI+00hEMKHDGWC2n4b9ajjxtMV0+ilWfxFJsBx5daai BXeeDVF7n0U27T6wEGyS09KSPZKq5Zem+WZpXN2iFJtaOD8YiTZDeGD0/H1bVjGSfueI pBVB4TQN1OmX8psffzdNgm+u+hFCg1Y0aedFGk4Rr3ZgueT7ZMgxTHKbMjV1Wu7D+5jh 6a93N0Sox8KEkspuH2heZeG5wBWO6vCAEdrfY20E2EX8k+dpa9dSC7lMTmw+7OVlVOJS sumA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HZILooKL2gY95V+6lOTyR2vnqSZKR9zVUyigLpIo2P4=; b=mfRlQxHiD84wi/igQf1uCVrcxRB1HNnXLi8rNw9zKwLFWO2hv4yOToEYQtXJhHfe3p 9Sp8rLKySghJK5HRKWKPvoHuVe7CJcHFNHqQBdr7Z1OFxAvE5bA55C+5VlplQ+KT4X8i /vDqPjiZQzROoNKj1nRNxl9EY8pXmg9cWhBrPjyOsNLEENUDbAAUD2mZxfiZ6yv6erH3 2aM8VEqlPxe+0hfEI0mDaW46yIFj+AAzRYNMeWgMscMykGvFvsbJIYlL4Zm1nENJCpDA gMS4gVpTK3LJ+8dGh0o7xuVioEPlFiFmwaJkZEnOqkvexenuxmd8zvOMVjQmA/VZ8hAq SNVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h4KCavmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si641275eje.363.2020.10.19.23.20.36; Mon, 19 Oct 2020 23:21:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h4KCavmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730950AbgJSRHu (ORCPT + 99 others); Mon, 19 Oct 2020 13:07:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730498AbgJSRHu (ORCPT ); Mon, 19 Oct 2020 13:07:50 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39782C0613CE for ; Mon, 19 Oct 2020 10:07:49 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id 67so471769iob.8 for ; Mon, 19 Oct 2020 10:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HZILooKL2gY95V+6lOTyR2vnqSZKR9zVUyigLpIo2P4=; b=h4KCavmCnbr2GfebRzkZm4hUgsAoh0GHrDdPOH7uIzzR7wdYBc3pyvPs87fKOawa9A UDdZ5LMgksk8Vu+ujzkuGXpnW1sWlHXY/fb49M1f4Bdj8S5rl0dblZkgsRI5luuDfXbb XVID4xs1kkNcHFi5lJL5g1lwdBxhU3npBKrKFG1UU++toiDz/RhKnKXWMCmWhDu3xPQh u+gf/hGRkjQkbmDQmUUKmHkrE0UGP6a/qzir40lEjlVx07GOMj03B8Xhn9oGhfY+UtHG s6hF0574jV6PsM1kftclcJ4t8+NB2PHM0vbnVhShCiTmsGllZCejZIXovLqRw5fhlxre w1jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HZILooKL2gY95V+6lOTyR2vnqSZKR9zVUyigLpIo2P4=; b=gP5hUS7hNizmDDuWtafOPMf7uuRYnOu/pJjmu5OiQj8Kp9IN6eBBIolGjsEXPhnRaz ayLYdQLRFTadUtWmRWFZwjNp1qFa+Yqf664tAgoUxXsI/nvebssmkYYvXv3CxUb2QRug p/RbwqlK53IdSoEA8Vc2aMRp5OkvEhmFSfPupvQi+bxgplxfJCETBPRmNSBwucDhUYZr GjTlO4Aviw3R2AdZ/1fte5P+eAbEzth4DHMcT2USFLx8SGfXEs7sjdacwALeGYyezAuQ XIRclWQDYMbSdidPn1lvLSoeDOHu8oLykwI/snHZWxV5hFue05vUfUl2LMwIct+AXhRu RSPw== X-Gm-Message-State: AOAM533HoulWsQ+3Un0/lepJw7ZaddQWvqydypsrdaUs6MiNlKp5y4T/ vjVCgH2owkNcIQjZxYEViqyZND5qk9M0J2GEPgW26Q== X-Received: by 2002:a6b:1646:: with SMTP id 67mr309841iow.189.1603127268427; Mon, 19 Oct 2020 10:07:48 -0700 (PDT) MIME-Version: 1.0 References: <20201014182700.2888246-1-bgardon@google.com> <20201014182700.2888246-16-bgardon@google.com> In-Reply-To: From: Ben Gardon Date: Mon, 19 Oct 2020 10:07:37 -0700 Message-ID: Subject: Re: [PATCH v2 15/20] kvm: x86/mmu: Support dirty logging for the TDP MMU To: Paolo Bonzini Cc: LKML , kvm , Cannon Matthews , Peter Xu , Sean Christopherson , Peter Shier , Peter Feiner , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 16, 2020 at 9:18 AM Paolo Bonzini wrote: > > On 14/10/20 20:26, Ben Gardon wrote: > > > > + if (kvm->arch.tdp_mmu_enabled) > > + kvm_tdp_mmu_clear_dirty_pt_masked(kvm, slot, > > + slot->base_gfn + gfn_offset, mask, true); > > This was "false" in v1, I need --verbose for this change. :) I don't think this changed from v1. Note that there are two callers in mmu.c - kvm_mmu_write_protect_pt_masked and kvm_mmu_clear_dirty_pt_masked. One calls with wrprot = true and the other with wrprot = false. > > > while (mask) { > > rmap_head = __gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask), > > > + spte_set = wrprot_gfn_range(kvm, root, slot->base_gfn, > > + slot->base_gfn + slot->npages, min_level) || > > + spte_set; > > A few remaining instances of ||. Gah, I thought I had gotten all of them. Thanks for catching these. > > Paolo >