From: Gavin Shan <gshan@redhat.com>
To: Zenghui Yu <yuzenghui@huawei.com>
Cc: kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu,
kvm@vger.kernel.org, maz@kernel.org, seanjc@google.com,
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, peterx@redhat.com, oliver.upton@linux.dev,
zhenyzha@redhat.com, shan.gavin@gmail.com
Subject: Re: [PATCH v10 4/7] KVM: arm64: Enable ring-based dirty memory tracking
Date: Sun, 15 Jan 2023 22:56:13 +1100 [thread overview]
Message-ID: <e3414ca2-c4a6-07b5-df41-9999fdb2445a@redhat.com> (raw)
In-Reply-To: <e28ede67-1bc4-fb1e-9bea-60cc9bd85190@huawei.com>
Hi Zenghui,
On 1/15/23 10:20 PM, Zenghui Yu wrote:
> On 2022/11/10 18:49, Gavin Shan wrote:
>> Enable ring-based dirty memory tracking on ARM64:
>>
>> - Enable CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL.
>>
>> - Enable CONFIG_NEED_KVM_DIRTY_RING_WITH_BITMAP.
>>
>> - Set KVM_DIRTY_LOG_PAGE_OFFSET for the ring buffer's physical page
>> offset.
>>
>> - Add ARM64 specific kvm_arch_allow_write_without_running_vcpu() to
>> keep the site of saving vgic/its tables out of the no-running-vcpu
>> radar.
>
> And we have KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES.. On receiving it, the
> emulated VGIC will write all pending bits (if any) into pending tables
> (which reside in guest memory) and doesn't require a running vcpu
> context.
>
> The no-running-vcpu WARN can be triggered with the
> kvm-unit-tests/its-pending-migration case. I run it using QEMU, which
> has nothing to do with the dirty ring atm.
>
> Or are there already discussions about it that I haven't noticed?
>
> |void mark_page_dirty_in_slot(struct kvm *kvm,
> | const struct kvm_memory_slot *memslot,
> | gfn_t gfn)
> |{
> | WARN_ON_ONCE(!vcpu && !kvm_arch_allow_write_without_running_vcpu(kvm));
>
It's a new case we never noticed. Could you please share the QEMU command lines
to start the guest? I need to reproduce the issue on my side firstly.
The fix would be simply to extending kvm->arch.vgic.save_its_tables_in_progress
from 'bool' to a bit map (e.g. kvm->arch.vgic.dirty_guest_memory_flags) and introduce
two separate flags for ITS table and VGIC3 pending bits separately. Alternatively,
we can also introduce another 'bool kvm->arch.vgic.save_vgic_v3_tables_in_progress'
to cover the new case.
Thanks,
Gavin
next prev parent reply other threads:[~2023-01-15 11:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 10:49 [PATCH v10 0/7] KVM: arm64: Enable ring-based dirty memory tracking Gavin Shan
2022-11-10 10:49 ` [PATCH v10 1/7] KVM: x86: Introduce KVM_REQ_DIRTY_RING_SOFT_FULL Gavin Shan
2022-11-10 10:49 ` [PATCH v10 2/7] KVM: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h Gavin Shan
2022-11-10 10:49 ` [PATCH v10 3/7] KVM: Support dirty ring in conjunction with bitmap Gavin Shan
2022-11-10 16:46 ` Sean Christopherson
2022-11-10 23:47 ` Gavin Shan
2022-11-11 15:19 ` Marc Zyngier
2022-11-11 22:19 ` Gavin Shan
2022-11-11 23:00 ` Sean Christopherson
2022-11-11 23:43 ` Gavin Shan
2022-11-12 0:18 ` Sean Christopherson
2022-11-12 9:50 ` Gavin Shan
2022-11-11 23:02 ` Marc Zyngier
2022-11-10 10:49 ` [PATCH v10 4/7] KVM: arm64: Enable ring-based dirty memory tracking Gavin Shan
2023-01-15 11:20 ` Zenghui Yu
2023-01-15 11:56 ` Gavin Shan [this message]
2023-01-15 23:55 ` Gavin Shan
2023-01-16 4:09 ` Gavin Shan
2023-01-16 4:54 ` Zenghui Yu
2023-01-16 4:51 ` Zenghui Yu
2022-11-10 10:49 ` [PATCH v10 5/7] KVM: selftests: Use host page size to map ring buffer in dirty_log_test Gavin Shan
2022-11-10 10:49 ` [PATCH v10 6/7] KVM: selftests: Clear dirty ring states between two modes " Gavin Shan
2022-11-10 10:49 ` [PATCH v10 7/7] KVM: selftests: Automate choosing dirty ring size " Gavin Shan
2022-11-10 13:21 ` [PATCH v10 0/7] KVM: arm64: Enable ring-based dirty memory tracking Marc Zyngier
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=e3414ca2-c4a6-07b5-df41-9999fdb2445a@redhat.com \
--to=gshan@redhat.com \
--cc=ajones@ventanamicro.com \
--cc=alexandru.elisei@arm.com \
--cc=andrew.jones@linux.dev \
--cc=bgardon@google.com \
--cc=catalin.marinas@arm.com \
--cc=dmatlack@google.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=seanjc@google.com \
--cc=shan.gavin@gmail.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox