Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3375959pxf; Mon, 5 Apr 2021 10:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpVUVmnZlnywEwGGQReXjTM3OTesOQKcWrkz79qpb0P1WT4QLSmSNoPya1zcQ5HSVhT1Ty X-Received: by 2002:a17:906:c142:: with SMTP id dp2mr3616929ejc.189.1617643318810; Mon, 05 Apr 2021 10:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617643318; cv=none; d=google.com; s=arc-20160816; b=TwFrDb6BzhLgYEuYi2+9wzNTHTlgfFeyMNQfPK8G9IKxl+6qeposmd9ukM18Y3bpV0 YQtA7jdvhPS4UI72O85DCjddiAE8sYXjKJpl9/j0dv1IohorTrjOlMySIZwpCtzsSUk9 LfKgycyIJMr+87yBc/ifVWG5Mk7leXybK+bddJ9Kwpe6B8JaDFPiu9KxtRyeJMpegHkd NsTlYZg/4O8fkjkb5Z5Y+qkE7FQ9c4fJnGH0QneYLvUOu0FfP5ou8NRc/YRjQLK1BXM1 GEnXqLlJrIYlp7a8xBkj/8DFDEFf1xN6wQ6+cXDDqXXY/Ad2JkevebHmpmYKiw2vZ+eJ Nhjw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bkr6l6sTRD/asFFk5BaEWuwYxlseTAclGChplY0PYy4=; b=PoX3gb0KzKWbksYxXSeeTMOkG8drVLhLSOf8Zpqi+gvslTqu//KEu7sUlh5pVaDIZz rwbIBu0/3CYmHKKE3P2GfCjLcC2gr35MVe2UuaCXyvoxGiOPVheO+bDOQyfASqgfSWzr AC+XxwXxBUrlm0qPCKRlPD1ZvTJIhFwGyx0JlYP9ziJyvssanmOqQn/U1IF2BfOTDB4r luJqPcXDAYyEE9koIFvJ3J/1TZigULkNHG4m9jv/VPVmCvCiP2DiTz88KeK7I7RAOnCY M9837B5t6nIYlnoCg3IhhKlwkNleHincMlcQsF1WcTM0aGcmOLVbKiXloYc8RmH+F8dT naDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZkSM/iim"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si14255998edy.444.2021.04.05.10.21.35; Mon, 05 Apr 2021 10:21:58 -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=@linuxfoundation.org header.s=korg header.b="ZkSM/iim"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240262AbhDEJVH (ORCPT + 99 others); Mon, 5 Apr 2021 05:21:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:37800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240712AbhDEJQ2 (ORCPT ); Mon, 5 Apr 2021 05:16:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AB7F611C1; Mon, 5 Apr 2021 09:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617614180; bh=kVsF96abuP0OzUERjUb8kIL678DFIhMhESEgmnrB8XE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkSM/iim9mgd7OFlZE4lrkH28KsqUVm7vqjZbC/8j+mK8rWg4YcWvt+wNZqVZKOgh 5EsK2/FsNzfz3ZYZF74Qb0R/fNwcR8ZqAxg68B5RE4wFHCjBlig1Y2jx1Q7OP9rqEV V+wCc6EC9Dg460Tyqk/VbhYdCy4JrofR8142a5Wg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Feiner , Paolo Bonzini , Ben Gardon , Sasha Levin Subject: [PATCH 5.11 114/152] KVM: x86/mmu: Add comment on __tdp_mmu_set_spte Date: Mon, 5 Apr 2021 10:54:23 +0200 Message-Id: <20210405085037.940673331@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085034.233917714@linuxfoundation.org> References: <20210405085034.233917714@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Gardon [ Upstream commit fe43fa2f407b9d513f7bcf18142e14e1bf1508d6 ] __tdp_mmu_set_spte is a very important function in the TDP MMU which already accepts several arguments and will take more in future commits. To offset this complexity, add a comment to the function describing each of the arguemnts. No functional change intended. Reviewed-by: Peter Feiner Acked-by: Paolo Bonzini Signed-off-by: Ben Gardon Message-Id: <20210202185734.1680553-3-bgardon@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/mmu/tdp_mmu.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index 50c088a41dee..6bd86bb4c089 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -397,6 +397,22 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, new_spte, level); } +/* + * __tdp_mmu_set_spte - Set a TDP MMU SPTE and handle the associated bookkeeping + * @kvm: kvm instance + * @iter: a tdp_iter instance currently on the SPTE that should be set + * @new_spte: The value the SPTE should be set to + * @record_acc_track: Notify the MM subsystem of changes to the accessed state + * of the page. Should be set unless handling an MMU + * notifier for access tracking. Leaving record_acc_track + * unset in that case prevents page accesses from being + * double counted. + * @record_dirty_log: Record the page as dirty in the dirty bitmap if + * appropriate for the change being made. Should be set + * unless performing certain dirty logging operations. + * Leaving record_dirty_log unset in that case prevents page + * writes from being double counted. + */ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, u64 new_spte, bool record_acc_track, bool record_dirty_log) -- 2.30.1