public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Lilit Janpoladyan <lilitj@amazon.com>
Cc: kvm@vger.kernel.org, maz@kernel.org, oliver.upton@linux.dev,
	 james.morse@arm.com, suzuki.poulose@arm.com,
	yuzenghui@huawei.com,  nh-open-source@amazon.com
Subject: Re: [PATCH 3/8] KVM: arm64: use page tracking interface to enable dirty logging
Date: Sun, 22 Sep 2024 00:31:40 -0700	[thread overview]
Message-ID: <Zu_HqRaVnJyKpgpR@google.com> (raw)
In-Reply-To: <20240918152807.25135-4-lilitj@amazon.com>

On Wed, Sep 18, 2024, Lilit Janpoladyan wrote:
> +static int kvm_commit_memory_region(struct kvm *kvm,
> +				    struct kvm_memory_slot *old,
> +				    const struct kvm_memory_slot *new,
> +				    enum kvm_mr_change change)
>  {
> +	int r;
>  	int old_flags = old ? old->flags : 0;
>  	int new_flags = new ? new->flags : 0;
>  	/*
> @@ -1709,6 +1710,10 @@ static void kvm_commit_memory_region(struct kvm *kvm,
>  		int change = (new_flags & KVM_MEM_LOG_DIRTY_PAGES) ? 1 : -1;
>  		atomic_set(&kvm->nr_memslots_dirty_logging,
>  			   atomic_read(&kvm->nr_memslots_dirty_logging) + change);
> +		if (change > 0)
> +			r = kvm_arch_enable_dirty_logging(kvm, new);
> +		else
> +			r = kvm_arch_disable_dirty_logging(kvm, new);

There's zero reason to add new arch callbacks, the entire reason
kvm_arch_commit_memory_region() exists is to let arch code react to memslot
changes.  As evidenced by the fact that multiple architectures already handle
dirty logging changes in their commit hooks, it's trivial to detect changes, i.e.
not worth moving to generic code.

  reply	other threads:[~2024-09-22  7:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 15:27 [PATCH 0/8] *** RFC: ARM KVM dirty tracking device *** Lilit Janpoladyan
2024-09-18 15:28 ` [PATCH 1/8] arm64: add an interface for stage-2 page tracking Lilit Janpoladyan
2024-09-18 15:28 ` [PATCH 2/8] KVM: arm64: add page tracking device as a capability Lilit Janpoladyan
2024-09-18 15:28 ` [PATCH 3/8] KVM: arm64: use page tracking interface to enable dirty logging Lilit Janpoladyan
2024-09-22  7:31   ` Sean Christopherson [this message]
2024-09-18 15:28 ` [PATCH 4/8] KVM: return value from kvm_arch_sync_dirty_log Lilit Janpoladyan
2024-09-19  1:50   ` kernel test robot
2024-09-19  2:32   ` kernel test robot
2024-09-18 15:28 ` [PATCH 5/8] KVM: arm64: get dirty pages from the page tracking device Lilit Janpoladyan
2024-09-18 15:28 ` [PATCH 6/8] KVM: arm64: flush dirty logging data Lilit Janpoladyan
2024-09-18 15:28 ` [PATCH 7/8] KVM: arm64: enable hardware dirty state management for stage-2 Lilit Janpoladyan
2024-09-18 15:28 ` [PATCH 8/8] KVM: arm64: make hardware manage dirty state after write faults Lilit Janpoladyan
2024-09-19  9:11 ` [PATCH 0/8] *** RFC: ARM KVM dirty tracking device *** Oliver Upton
2024-09-20 10:12   ` Janpoladyan, Lilit
2024-09-26 10:00   ` David Woodhouse
2024-09-30 17:33     ` Oliver Upton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zu_HqRaVnJyKpgpR@google.com \
    --to=seanjc@google.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=lilitj@amazon.com \
    --cc=maz@kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox