From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F264C77B78 for ; Thu, 4 May 2023 15:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LdFxSjCIINdUfl4p1xvoaR8ck0rUygRpJIue4X2W5XU=; b=R9non2XrvaoFf/ 7IqEpxIKNloHEWKFp37zn8Ol3XR1nMxFoEzZAchck58KVpw/ZVf4Xbf73a1gtujNe6jdysBV7PnOh ULTeRkwwiXeXtdGKdOQcWfeimz45UHiySSbEusCM7H7P7iNVN7WDPSY5bFAUYDzORHizV5QghDKX7 xgZ7wFhBdQoFjQHW14B6vraG2bHZAZZqOT9fSj/8kMELnjvgvgz/AcXMxObIzB5M6oVrvYezUy0+T JjXaMKVHy7OIetJNzJV4CRS4eNvjVrjl5NO4gqu9YrDvCcDfmwK/UzuKgo50jBHQMrjUuiEcMj0Ou GGCwQEBU2KAlP/4u6RQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1puaZc-008B42-26; Thu, 04 May 2023 15:08:48 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1puaZZ-008B3X-2H for linux-arm-kernel@lists.infradead.org; Thu, 04 May 2023 15:08:47 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9EADC634FD; Thu, 4 May 2023 15:08:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09FD5C433D2; Thu, 4 May 2023 15:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683212924; bh=axENV78rQZpqfN8ChHqOHY0QRi+reeRgjbPExDDK+rI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ClC5Scz0FilRJcKHjsrN61BDZIyQi8wZY6luMlT8Nd0WfCIAsU8AtefBFKfDWYQel UkhpfizTeZkNJXhJ6HH/Qoor8knP72kIWfmd8MmNg4UOHuD+rURHuSj2BlJyILFyaS MoNfpuPKMniaMaj99PCdw6wJ1magbvuFeoU/Kj8urRreczQz/gOin4ZFbpccAeb7TZ kZLpekEgyAuv89jZWRfB0oK2c9yYEJrcFEvWVM3W8+ENUb/g3acBCb/J8PKEkjcwiS FSqR9Tj0dD6Z5UdTp0VeECd32LZYbLcGteJT+kauOFO4bH5KFmHsdpunLEt61kxX46 Wt52EUGr2MfbA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1puaZV-00CxWA-Lf; Thu, 04 May 2023 16:08:41 +0100 Date: Thu, 04 May 2023 16:08:41 +0100 Message-ID: <86mt2kgmme.wl-maz@kernel.org> From: Marc Zyngier To: Shivam Kumar Cc: pbonzini@redhat.com, seanjc@google.com, james.morse@arm.com, borntraeger@linux.ibm.com, aravind.retnakaran@nutanix.com, david@redhat.com, kvm@vger.kernel.org, Shaju Abraham , Manish Mishra , Anurag Madnawat , Suzuki K Poulose , Zenghui Yu , Oliver Upton , kvmarm , linux-arm-kernel Subject: Re: [PATCH v9 3/3] KVM: arm64: Dirty quota-based throttling of vcpus In-Reply-To: <20230504144328.139462-4-shivam.kumar1@nutanix.com> References: <20230504144328.139462-1-shivam.kumar1@nutanix.com> <20230504144328.139462-4-shivam.kumar1@nutanix.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: shivam.kumar1@nutanix.com, pbonzini@redhat.com, seanjc@google.com, james.morse@arm.com, borntraeger@linux.ibm.com, aravind.retnakaran@nutanix.com, david@redhat.com, kvm@vger.kernel.org, shaju.abraham@nutanix.com, manish.mishra@nutanix.com, anurag.madnawat@nutanix.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230504_080845_850036_5F87AE1D X-CRM114-Status: GOOD ( 25.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 04 May 2023 15:43:31 +0100, Shivam Kumar 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 > Suggested-by: Manish Mishra > Co-developed-by: Anurag Madnawat > Signed-off-by: Anurag Madnawat > Signed-off-by: Shivam Kumar > --- > 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