* Re: [PATCH v9 3/3] KVM: arm64: Dirty quota-based throttling of vcpus
[not found] ` <20230504144328.139462-4-shivam.kumar1@nutanix.com>
@ 2023-05-04 15:08 ` Marc Zyngier
0 siblings, 0 replies; only message in thread
From: Marc Zyngier @ 2023-05-04 15:08 UTC (permalink / raw)
To: Shivam Kumar
Cc: pbonzini, seanjc, james.morse, borntraeger, aravind.retnakaran,
david, kvm, Shaju Abraham, Manish Mishra, Anurag Madnawat,
Suzuki K Poulose, Zenghui Yu, Oliver Upton, kvmarm,
linux-arm-kernel
On Thu, 04 May 2023 15:43:31 +0100,
Shivam Kumar <shivam.kumar1@nutanix.com> wrote:
>
> Call update_dirty_quota whenever a page is marked dirty with
> appropriate arch-specific page size. Process the KVM request
> KVM_REQ_DIRTY_QUOTA_EXIT (raised by update_dirty_quota) to exit to
> userspace with exit reason KVM_EXIT_DIRTY_QUOTA_EXHAUSTED.
>
> Suggested-by: Shaju Abraham <shaju.abraham@nutanix.com>
> Suggested-by: Manish Mishra <manish.mishra@nutanix.com>
> Co-developed-by: Anurag Madnawat <anurag.madnawat@nutanix.com>
> Signed-off-by: Anurag Madnawat <anurag.madnawat@nutanix.com>
> Signed-off-by: Shivam Kumar <shivam.kumar1@nutanix.com>
> ---
> arch/arm64/kvm/Kconfig | 1 +
> arch/arm64/kvm/arm.c | 5 +++++
> arch/arm64/kvm/mmu.c | 1 +
> 3 files changed, 7 insertions(+)
>
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index f531da6b362e..06144ad3cfae 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -43,6 +43,7 @@ menuconfig KVM
> select SCHED_INFO
> select GUEST_PERF_EVENTS if PERF_EVENTS
> select INTERVAL_TREE
> + select HAVE_KVM_DIRTY_QUOTA
> help
> Support hosting virtualized guest machines.
>
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 14391826241c..f0280c1c1c06 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -792,6 +792,11 @@ static int check_vcpu_requests(struct kvm_vcpu *vcpu)
>
> if (kvm_dirty_ring_check_request(vcpu))
> return 0;
> +
> + if (kvm_check_request(KVM_REQ_DIRTY_QUOTA_EXIT, vcpu)) {
> + vcpu->run->exit_reason = KVM_EXIT_DIRTY_QUOTA_EXHAUSTED;
> + return 0;
> + }
> }
>
> return 1;
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 3b9d4d24c361..93c52f7464c9 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -1419,6 +1419,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
> /* Mark the page dirty only if the fault is handled successfully */
> if (writable && !ret) {
> kvm_set_pfn_dirty(pfn);
> + update_dirty_quota(kvm, fault_granule);
> mark_page_dirty_in_slot(kvm, memslot, gfn);
> }
>
I already raised this against the previous version of series:
fault_granule isn't the amount of memory that gets mapped. I urge you
to actually read the code you're modifying. Ignoring reviewer comments
is not going to help merging this series. And yes, I ignored your
reply because it didn't make any sense...
It is also basic courtesy to Cc the maintainers and reviewers of that
code, as well as the relevant MLs (get_maintainers.pl is, as usual,
your friend).
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-04 15:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230504144328.139462-1-shivam.kumar1@nutanix.com>
[not found] ` <20230504144328.139462-4-shivam.kumar1@nutanix.com>
2023-05-04 15:08 ` [PATCH v9 3/3] KVM: arm64: Dirty quota-based throttling of vcpus Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).