Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3327193pxf; Mon, 5 Apr 2021 09:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPsi8YBuovzfGExAR6CGjznCN/DMtYOhMLxm9g2KnD2Ay1m0+AmOpBePGAeRd91Yafkh4h X-Received: by 2002:a50:ef0a:: with SMTP id m10mr32278634eds.261.1617638840175; Mon, 05 Apr 2021 09:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617638840; cv=none; d=google.com; s=arc-20160816; b=tfW0Ap4C2/pzNIAVqreh1dJxOmWFUPPfQBVetdoSqRe1dBALRbjjFVPg1OtLHjG/bL 239ePZ4MBn0NgCSHaTdt3SC0UgQGrKvvwBJMz0r5AoQn2Edw1LT7/HV7dEtaweyV/pks I7Hx648/GZsARbziU+fVDpiDa5uMAbjZpiZOYS0n+f9oUKGJ79HK287QbYw0FdLlxN5G IWwFAhdwkPl1aic5oxZ4JDHHWmok0ZlL2sM2eY1cCg2n1NC2YQ3CX9Ev5cXSFMSwvaPT Cw3kR3leiGqKOLkkW4Zp1xkuhIRjUtEVKSzqzKjpLdSRy4fHlHfvxJquThCnzHQzZ3mM fLTg== 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=O8OWxRDvFFKyW/doipy7BFP/HGP4l0SaTw0RjbMxz8E=; b=ZUwccFOyJmZmXxNt46KD+euaYq7idix+D6lnFeIrMgpG3W6ziYJr29k0jkujmrbj1t dWQTmFNtQCBVwu8a9GT9nwyDpr8hIU01fEMeXqLoqnMMxoJCb+LypsNGYIvhY9586Bd6 PHucMNWDpT5evMyoTOp5nOdKqyPWu6VvK9yKwPKgi8wQsUcsF0eDzRaz/PWi0J22vRZy G9LIrTwWzvlSCcAJyiwsjpRf4BacCAGYa0PGOwtKD3XWMYKCiJ1kTV+PHEnPdk9ed/lg PmYyrA0oNFk7c+0LIs+JYcuSnaDlY3VusEo3yCyT1yuazBtOc9lt4vgexrZRDO3nmsm5 5UeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i0kecx+K; 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 h4si14374956ede.481.2021.04.05.09.06.56; Mon, 05 Apr 2021 09:07:20 -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=i0kecx+K; 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 S239485AbhDEJNe (ORCPT + 99 others); Mon, 5 Apr 2021 05:13:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:55470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237885AbhDEJJ6 (ORCPT ); Mon, 5 Apr 2021 05:09:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B2C3D61393; Mon, 5 Apr 2021 09:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617613791; bh=cfMris8vDpaqtpyVFY6ATGCUw6OG4h5XS7YFeNG16YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i0kecx+K8tZZCtJ6Dkb6dIbyEg6B/v4aieGFPI+2HqsYpcK3424O3uySUGRvtbyXZ ULoP+ALkJ4yYWHn0Py6/2GCl/BaLRA1Zsi06525TFpkv5+wiDDajngID0vLkCVr37c 3nMQWEoLttSJkqslAum0NsZoOuKuMMsNaEI13jFM= 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.10 092/126] KVM: x86/mmu: Add comment on __tdp_mmu_set_spte Date: Mon, 5 Apr 2021 10:54:14 +0200 Message-Id: <20210405085034.104001747@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085031.040238881@linuxfoundation.org> References: <20210405085031.040238881@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 34ef3e1a0f84..f88404033e0c 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -395,6 +395,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