From: Sean Christopherson <seanjc@google.com>
To: Gavin Shan <gshan@redhat.com>
Cc: maz@kernel.org, kvm@vger.kernel.org, catalin.marinas@arm.com,
andrew.jones@linux.dev, dmatlack@google.com, will@kernel.org,
shan.gavin@gmail.com, bgardon@google.com, kvmarm@lists.linux.dev,
pbonzini@redhat.com, zhenyzha@redhat.com, shuah@kernel.org,
kvmarm@lists.cs.columbia.edu, ajones@ventanamicro.com
Subject: Re: [PATCH v9 3/7] KVM: Support dirty ring in conjunction with bitmap
Date: Wed, 9 Nov 2022 00:05:00 +0000 [thread overview]
Message-ID: <Y2rurDmCrXZaxY8F@google.com> (raw)
In-Reply-To: <49217b8f-ce53-c41b-98aa-ced34cd079cc@redhat.com>
On Wed, Nov 09, 2022, Gavin Shan wrote:
> Hi Sean,
>
> On 11/9/22 12:25 AM, Sean Christopherson wrote:
> > I have no objection to disallowing userspace from disabling the combo, but I
> > think it's worth requiring cap->args[0] to be '0' just in case we change our minds
> > in the future.
> >
>
> I assume you're suggesting to have non-zero value in cap->args[0] to enable the
> capability.
>
> if (!IS_ENABLED(CONFIG_HAVE_KVM_DIRTY_RING_WITH_BITMAP) ||
> !kvm->dirty_ring_size || !cap->args[0])
> return r;
I was actually thinking of taking the lazy route and requiring userspace to zero
the arg, i.e. treat it as a flags extensions. Oh, wait, that's silly. I always
forget that `cap->flags` exists.
Just this?
if (!IS_ENABLED(CONFIG_HAVE_KVM_DIRTY_RING_WITH_BITMAP) ||
!kvm->dirty_ring_size || cap->flags)
return r;
It'll be kinda awkward if KVM ever does add a flag to disable the bitmap, but
that's seems quite unlikely and not the end of the world if it does happen. And
on the other hand, requiring '0' is less weird and less annoying for userspace
_now_.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
WARNING: multiple messages have this Message-ID (diff)
From: Sean Christopherson <seanjc@google.com>
To: Gavin Shan <gshan@redhat.com>
Cc: kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu,
kvm@vger.kernel.org, shuah@kernel.org, catalin.marinas@arm.com,
andrew.jones@linux.dev, ajones@ventanamicro.com,
bgardon@google.com, dmatlack@google.com, will@kernel.org,
suzuki.poulose@arm.com, alexandru.elisei@arm.com,
pbonzini@redhat.com, maz@kernel.org, peterx@redhat.com,
oliver.upton@linux.dev, zhenyzha@redhat.com,
shan.gavin@gmail.com
Subject: Re: [PATCH v9 3/7] KVM: Support dirty ring in conjunction with bitmap
Date: Wed, 9 Nov 2022 00:05:00 +0000 [thread overview]
Message-ID: <Y2rurDmCrXZaxY8F@google.com> (raw)
Message-ID: <20221109000500.AYIAq7c76q4Li0l372TkwNqTk-1tUkw-Yhs3uGDYMI4@z> (raw)
In-Reply-To: <49217b8f-ce53-c41b-98aa-ced34cd079cc@redhat.com>
On Wed, Nov 09, 2022, Gavin Shan wrote:
> Hi Sean,
>
> On 11/9/22 12:25 AM, Sean Christopherson wrote:
> > I have no objection to disallowing userspace from disabling the combo, but I
> > think it's worth requiring cap->args[0] to be '0' just in case we change our minds
> > in the future.
> >
>
> I assume you're suggesting to have non-zero value in cap->args[0] to enable the
> capability.
>
> if (!IS_ENABLED(CONFIG_HAVE_KVM_DIRTY_RING_WITH_BITMAP) ||
> !kvm->dirty_ring_size || !cap->args[0])
> return r;
I was actually thinking of taking the lazy route and requiring userspace to zero
the arg, i.e. treat it as a flags extensions. Oh, wait, that's silly. I always
forget that `cap->flags` exists.
Just this?
if (!IS_ENABLED(CONFIG_HAVE_KVM_DIRTY_RING_WITH_BITMAP) ||
!kvm->dirty_ring_size || cap->flags)
return r;
It'll be kinda awkward if KVM ever does add a flag to disable the bitmap, but
that's seems quite unlikely and not the end of the world if it does happen. And
on the other hand, requiring '0' is less weird and less annoying for userspace
_now_.
next prev parent reply other threads:[~2022-11-09 0:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 4:10 [PATCH v9 0/7] KVM: arm64: Enable ring-based dirty memory tracking Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 1/7] KVM: x86: Introduce KVM_REQ_DIRTY_RING_SOFT_FULL Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 2/7] KVM: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 3/7] KVM: Support dirty ring in conjunction with bitmap Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 16:25 ` Sean Christopherson
2022-11-08 16:25 ` Sean Christopherson
2022-11-08 22:19 ` Gavin Shan
2022-11-08 22:19 ` Gavin Shan
2022-11-09 0:05 ` Sean Christopherson [this message]
2022-11-09 0:05 ` Sean Christopherson
2022-11-09 0:17 ` Gavin Shan
2022-11-09 0:17 ` Gavin Shan
2022-11-09 0:32 ` Sean Christopherson
2022-11-09 0:32 ` Sean Christopherson
2022-11-09 0:51 ` Gavin Shan
2022-11-09 0:51 ` Gavin Shan
2022-11-10 10:25 ` Marc Zyngier
2022-11-10 10:25 ` Marc Zyngier
2022-11-10 10:56 ` Gavin Shan
2022-11-10 10:56 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 4/7] KVM: arm64: Enable ring-based dirty memory tracking Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 5/7] KVM: selftests: Use host page size to map ring buffer in dirty_log_test Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 6/7] KVM: selftests: Clear dirty ring states between two modes " Gavin Shan
2022-11-08 4:10 ` Gavin Shan
2022-11-08 4:10 ` [PATCH v9 7/7] KVM: selftests: Automate choosing dirty ring size " Gavin Shan
2022-11-08 4:10 ` Gavin Shan
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=Y2rurDmCrXZaxY8F@google.com \
--to=seanjc@google.com \
--cc=ajones@ventanamicro.com \
--cc=andrew.jones@linux.dev \
--cc=bgardon@google.com \
--cc=catalin.marinas@arm.com \
--cc=dmatlack@google.com \
--cc=gshan@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=pbonzini@redhat.com \
--cc=shan.gavin@gmail.com \
--cc=shuah@kernel.org \
--cc=will@kernel.org \
--cc=zhenyzha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.