From patchwork Thu Jan 26 23:54:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 13117924 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 F390FC54EAA for ; Thu, 26 Jan 2023 23:58:15 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WPKol1y/2CZC7mIOhoNj1tygWeed6Jui7j3ZjfCynJY=; b=4klRRrNBCif79m AcLo0HeLDyiNyVki89vshT/a6n41IEnGrn1R5QIWU2s71tKK5JyqsdaZIfesj/AJXm7i4cXan6KKc TfO0bQwTe77TS/BgchRxeBB1OZNOIpzEdXSdw0mPm3dvh+WYTwV+KvlqAsaiqJ+HjGLEaXqsJKqA0 avB4UFyVpEZPPUjLsQP1wBEgTJRYg6FBA/nPEgd309i4yHxxeu4cJRZEBrp98B8vLdQVHT/uekUMN K+1RH4byXCTL4SUmuksb7l9FyL4cB56fDhYDqKPfQAPs8T4yn/CStyEhKusP+UOoQiNFIZrDSbGWh dyd1AcgU+AVJqQkK9eHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLC7F-00CrOl-Ko; Thu, 26 Jan 2023 23:57:13 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLC73-00CrLU-Vo for linux-arm-kernel@lists.infradead.org; Thu, 26 Jan 2023 23:57:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674777421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJZfNQFxxVstI8H1j3XkMVugmKRsdIV8JBMybkB1kW4=; b=FOzmg7pMUQHhtv9PvRHEsVK0VMpR/lt2DTZFX5dp3BMpHbOuIQha3f8M/TYqGWi89TAF/T wUJTBeBNLfu3sth9/HyJJwob92szrvOmPqpNcIA9yvyoGoZBfVMO5ssJQ41aEarbCxR20V 46fC6MCx4kHN0oBEsfoxpUlljNxY7xc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-AUDX19oQNx-EySF2tOJP5w-1; Thu, 26 Jan 2023 18:55:06 -0500 X-MC-Unique: AUDX19oQNx-EySF2tOJP5w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA1BA185A78B; Thu, 26 Jan 2023 23:55:04 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-98.bne.redhat.com [10.64.54.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E5792166B29; Thu, 26 Jan 2023 23:54:55 +0000 (UTC) From: Gavin Shan To: kvmarm@lists.linux.dev Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, pbonzini@redhat.com, corbet@lwn.net, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, yuzhe@nfschina.com, isaku.yamahata@intel.com, seanjc@google.com, ricarkol@google.com, eric.auger@redhat.com, renzhengeek@gmail.com, reijiw@google.com, shan.gavin@gmail.com Subject: [PATCH v3 0/4] Improve dirty ring warning report Date: Fri, 27 Jan 2023 07:54:47 +0800 Message-Id: <20230126235451.469087-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230126_155702_186167_7BEB4F2E X-CRM114-Status: GOOD ( 10.51 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It has been known case where no running VCPU context exists when the vgic/its tables are saved. There are other two unknown cases where we don't have the running VCPU context: (a) restore vgic3 LPI pending status. (b) restoring vgic3 pending tables. PATCH[1] includes 'kvm_mmu.h' to 'vgic.h' PATCH[2] adds unified helper vgic_write_guest_lock() PATCH[3 - 4] allows no-running-vcpu context for (a) and (b) v2: https://lore.kernel.org/kvmarm/Y9Lg1ESUVJov0WpH@google.com/T/#t v1: https://lore.kernel.org/kvmarm/20230116040405.260935-1-gshan@redhat.com/T/#t Changelog ========= v3: * Pick Oliver's r-bs * Include 'kvm_mmu.h' to 'vgic.h' (Oliver) v2: * Add unified helper vgic_write_guest_lock() (Oliver) * Dropped two patches to refactor mark_page_dirty_in_slot() (Sean) Gavin Shan (4): KVM: arm64: Include kvm_mmu.h from vgic.h KVM: arm64: Add helper vgic_write_guest_lock() KVM: arm64: Allow no running vcpu on restoring vgic3 LPI pending status KVM: arm64: Allow no running vcpu on saving vgic3 pending table Documentation/virt/kvm/api.rst | 10 +++++++--- arch/arm64/kvm/vgic/vgic-debug.c | 1 - arch/arm64/kvm/vgic/vgic-init.c | 1 - arch/arm64/kvm/vgic/vgic-its.c | 14 +++++--------- arch/arm64/kvm/vgic/vgic-kvm-device.c | 1 - arch/arm64/kvm/vgic/vgic-mmio-v3.c | 1 - arch/arm64/kvm/vgic/vgic-v2.c | 1 - arch/arm64/kvm/vgic/vgic-v3.c | 5 ++--- arch/arm64/kvm/vgic/vgic.h | 14 ++++++++++++++ include/kvm/arm_vgic.h | 2 +- 10 files changed, 29 insertions(+), 21 deletions(-)