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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB63AC4332F for ; Wed, 2 Nov 2022 17:18:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2D2934B837; Wed, 2 Nov 2022 13:18:51 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I9rR42iZotO0; Wed, 2 Nov 2022 13:18:50 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F33134B83D; Wed, 2 Nov 2022 13:18:49 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E23BB4B837 for ; Wed, 2 Nov 2022 13:18:48 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k9M0Ye3ijdXC for ; Wed, 2 Nov 2022 13:18:47 -0400 (EDT) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id D34324B826 for ; Wed, 2 Nov 2022 13:18:47 -0400 (EDT) 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 F311361AAC; Wed, 2 Nov 2022 17:18:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D25BC43470; Wed, 2 Nov 2022 17:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667409526; bh=t+XSBxtVm4q9uEvwXkO3w2nATlENacHRnZp9Kw64sVY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SJPUcexlv421RPT+uRVF0crG2rJQiWSpTV1vdBlet0+AtWLXczUGTXKN8LX7Js6cn DPb4xPebyXZ1YeRkNgP9UaxZc3xhJiSATVIlqb1EhuIwjH3H146Ozr5rBlaF849DjU QFJdZL7bcQgl1KelgspQQXuIOTmie2sWx9VysiZCS+KQaRBagHiMafBRpAUB9M2Ncc hUOOmNExwM5PGT68Vsvhs3jKw5fqharoRp/kqMGIDt8X623JPzoewufqUesK185lzx 2TWkDpAQ+IRcWsrcOm8Tji6cur065LjgqbHkDw6VCkRsaSe71BXKKl6NVlH03W4m01 kZSMzNHvRyEUw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1oqHO0-003H7v-4L; Wed, 02 Nov 2022 17:18:44 +0000 Date: Wed, 02 Nov 2022 17:18:13 +0000 Message-ID: <87y1stff6y.wl-maz@kernel.org> From: Marc Zyngier To: Gavin Shan Subject: Re: [PATCH v7 5/9] KVM: arm64: Improve no-running-vcpu report for dirty ring In-Reply-To: References: <20221031003621.164306-1-gshan@redhat.com> <20221031003621.164306-6-gshan@redhat.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/27.1 (x86_64-pc-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: gshan@redhat.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, andrew.jones@linux.dev, ajones@ventanamicro.com, bgardon@google.com, catalin.marinas@arm.com, dmatlack@google.com, will@kernel.org, pbonzini@redhat.com, peterx@redhat.com, seanjc@google.com, james.morse@arm.com, shuah@kernel.org, suzuki.poulose@arm.com, alexandru.elisei@arm.com, zhenyzha@redhat.com, shan.gavin@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: shuah@kernel.org, kvm@vger.kernel.org, catalin.marinas@arm.com, andrew.jones@linux.dev, dmatlack@google.com, shan.gavin@gmail.com, bgardon@google.com, kvmarm@lists.linux.dev, pbonzini@redhat.com, zhenyzha@redhat.com, will@kernel.org, kvmarm@lists.cs.columbia.edu, ajones@ventanamicro.com X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, 31 Oct 2022 23:08:32 +0000, Gavin Shan wrote: > > > In order to cover Marc's concern, I would introduce a different helper > kvm_vgic_save_its_tables_in_progress(), which simply returns > 'bool struct vgic_dist::save_its_tables_in_progress'. The newly added > field is set and cleared in vgic_its_ctrl(). All these changes will be > folded to PATCH[v7 6/9]. Oliver and Marc, could you please let me know > if the changes sounds good? > > static int vgic_its_ctrl(struct kvm *kvm, struct vgic_its *its, u64 attr) > { > const struct vgic_its_abi *abi = vgic_its_get_abi(its); > struct vgic_dist *dist = &kvm->arch.vgic; > int ret = 0; > : > switch (attr) { > case KVM_DEV_ARM_ITS_CTRL_RESET: > vgic_its_reset(kvm, its); > break; > case KVM_DEV_ARM_ITS_SAVE_TABLES: > dist->save_its_tables_in_progress = true; > ret = abi->save_tables(its); > dist->save_its_tables_in_progress = false; > break; > case KVM_DEV_ARM_ITS_RESTORE_TABLES: > ret = abi->restore_tables(its); > break; > } > : > } Yes, this is the sort of thing I had in mind. This should make the whole patch rather trivial, and you could implement kvm_arch_allow_write_without_running_vcpu() as returning this flag. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B95581EA01 for ; Wed, 2 Nov 2022 17:18:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D25BC43470; Wed, 2 Nov 2022 17:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667409526; bh=t+XSBxtVm4q9uEvwXkO3w2nATlENacHRnZp9Kw64sVY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SJPUcexlv421RPT+uRVF0crG2rJQiWSpTV1vdBlet0+AtWLXczUGTXKN8LX7Js6cn DPb4xPebyXZ1YeRkNgP9UaxZc3xhJiSATVIlqb1EhuIwjH3H146Ozr5rBlaF849DjU QFJdZL7bcQgl1KelgspQQXuIOTmie2sWx9VysiZCS+KQaRBagHiMafBRpAUB9M2Ncc hUOOmNExwM5PGT68Vsvhs3jKw5fqharoRp/kqMGIDt8X623JPzoewufqUesK185lzx 2TWkDpAQ+IRcWsrcOm8Tji6cur065LjgqbHkDw6VCkRsaSe71BXKKl6NVlH03W4m01 kZSMzNHvRyEUw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1oqHO0-003H7v-4L; Wed, 02 Nov 2022 17:18:44 +0000 Date: Wed, 02 Nov 2022 17:18:13 +0000 Message-ID: <87y1stff6y.wl-maz@kernel.org> From: Marc Zyngier To: Gavin Shan Cc: Oliver Upton , kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, andrew.jones@linux.dev, ajones@ventanamicro.com, bgardon@google.com, catalin.marinas@arm.com, dmatlack@google.com, will@kernel.org, pbonzini@redhat.com, peterx@redhat.com, seanjc@google.com, james.morse@arm.com, shuah@kernel.org, suzuki.poulose@arm.com, alexandru.elisei@arm.com, zhenyzha@redhat.com, shan.gavin@gmail.com Subject: Re: [PATCH v7 5/9] KVM: arm64: Improve no-running-vcpu report for dirty ring In-Reply-To: References: <20221031003621.164306-1-gshan@redhat.com> <20221031003621.164306-6-gshan@redhat.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/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: gshan@redhat.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, andrew.jones@linux.dev, ajones@ventanamicro.com, bgardon@google.com, catalin.marinas@arm.com, dmatlack@google.com, will@kernel.org, pbonzini@redhat.com, peterx@redhat.com, seanjc@google.com, james.morse@arm.com, shuah@kernel.org, suzuki.poulose@arm.com, alexandru.elisei@arm.com, zhenyzha@redhat.com, shan.gavin@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Message-ID: <20221102171813.tyk-pJ51QnAJQwoChw57-gr5oSXSKJQfx7NcQKfz2ww@z> On Mon, 31 Oct 2022 23:08:32 +0000, Gavin Shan wrote: > > > In order to cover Marc's concern, I would introduce a different helper > kvm_vgic_save_its_tables_in_progress(), which simply returns > 'bool struct vgic_dist::save_its_tables_in_progress'. The newly added > field is set and cleared in vgic_its_ctrl(). All these changes will be > folded to PATCH[v7 6/9]. Oliver and Marc, could you please let me know > if the changes sounds good? > > static int vgic_its_ctrl(struct kvm *kvm, struct vgic_its *its, u64 attr) > { > const struct vgic_its_abi *abi = vgic_its_get_abi(its); > struct vgic_dist *dist = &kvm->arch.vgic; > int ret = 0; > : > switch (attr) { > case KVM_DEV_ARM_ITS_CTRL_RESET: > vgic_its_reset(kvm, its); > break; > case KVM_DEV_ARM_ITS_SAVE_TABLES: > dist->save_its_tables_in_progress = true; > ret = abi->save_tables(its); > dist->save_its_tables_in_progress = false; > break; > case KVM_DEV_ARM_ITS_RESTORE_TABLES: > ret = abi->restore_tables(its); > break; > } > : > } Yes, this is the sort of thing I had in mind. This should make the whole patch rather trivial, and you could implement kvm_arch_allow_write_without_running_vcpu() as returning this flag. M. -- Without deviation from the norm, progress is not possible.