From patchwork Fri Jan 27 23:51:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 4660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1106197wrn; Fri, 27 Jan 2023 15:57:21 -0800 (PST) X-Google-Smtp-Source: AK7set8sER6NJLE220dK5d/Y9xr2bmAzLQuio7mrnHY0wPe/2bwT5c9K7GQOBQdfFe2X2/FbRZw1 X-Received: by 2002:a17:902:f684:b0:196:3232:f495 with SMTP id l4-20020a170902f68400b001963232f495mr13275442plg.16.1674863840904; Fri, 27 Jan 2023 15:57:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674863840; cv=none; d=google.com; s=arc-20160816; b=Vb5NHe5yNwfMiS02J4zDA/Xs0mgiGRKXlejFSTU1/HyDIO8iPU4PCfRSpm0hcfKvdG joouIxuHZ/AaBosyorduFArfL1+S2E4We6k2dibeqRJnRrJD8Czh8aQFGdLOkp8wrvv5 V1WuY4cwAAB2+VTWWereUTkCeNGrCTPCjfvgF+UKdxQ6k9zLODPI1CkKNdh4Q6symjJy H6GPbBQ+fmVGY9MdoRP9lnEh4IKIuZ0cQHcs9/gdmAkCBr783pw9w2hqtHMpKPt4KpqC q5mDO1/eQzZuwdRK9nzmQFw2eHcpI9LtF29qgByT5bv7TrNKeK0D1opWCD4f33w9D2hg 0Z2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BQMEZRsgVM2HSFe9NijBSKPEa568wzbl1o/5iMJMWGk=; b=LvoWHQHFkem9AzdPHlzh7Ixwg91H61aFAaQbi+7hlpNwkaciP2uvinnQJn+9sTUaz6 9KCaSCzk1EliGQs9F8Q6+jWxvWxvlEOZPsOmcW0EpfhRd/CmoGLRhlnCzsbOGw7kbjb0 VJNNr8Wp/OnUXqTDYTUdBmhFQyThXZ1bPUojC8sb4DxjVjVu1mNpnx6FudBKbQFKSJm8 6zzS6TQYKP9SnESqEJDIaZtfpYboe8614pYjBSpu0tGHamE4vfCcS+aJ83Dqmb0tm3k8 XU0yawRmJOtV5VM+OCUgkFqBXANKwWznNwl13ECBquxL+Kjoo3RAEFQCsdftfuJF0l8N 0qig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h0yBBSEI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a63360b000000b004b70012f4e7si5519231pga.169.2023.01.27.15.57.08; Fri, 27 Jan 2023 15:57:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h0yBBSEI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232036AbjA0XxU (ORCPT + 99 others); Fri, 27 Jan 2023 18:53:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjA0XxT (ORCPT ); Fri, 27 Jan 2023 18:53:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C87A684FA5 for ; Fri, 27 Jan 2023 15:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674863551; 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=BQMEZRsgVM2HSFe9NijBSKPEa568wzbl1o/5iMJMWGk=; b=h0yBBSEIjjGAcgHawIP7zwtvxe8MFc/u6BYvZSCrl0WPyiOsLIu18J4jGZCg3iM7I9GFAS aNvJmQDTIVT8FAhyG8twLQd1/wZOuXs+vas2UbH609nqggBtu4GxBmmt3n5HBweEKnj9EC PfB3Js8HzUSz30KG0qU5lBaiLojDJ/Y= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-JnfRbcj7PrW6L-U2dOC3tA-1; Fri, 27 Jan 2023 18:52:28 -0500 X-MC-Unique: JnfRbcj7PrW6L-U2dOC3tA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BF8F29AA3B9; Fri, 27 Jan 2023 23:52:27 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-64.bne.redhat.com [10.64.54.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F259240C141B; Fri, 27 Jan 2023 23:52:18 +0000 (UTC) From: Gavin Shan To: kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu Cc: 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, gshan@redhat.com, seanjc@google.com, isaku.yamahata@intel.com, ricarkol@google.com, eric.auger@redhat.com, renzhengeek@gmail.com, reijiw@google.com, shan.gavin@gmail.com Subject: [PATCH v4 0/4] Improve dirty ring warning report Date: Sat, 28 Jan 2023 07:51:46 +0800 Message-Id: <20230127235150.17025-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756222026991258850?= X-GMAIL-MSGID: =?utf-8?q?1756222026991258850?= 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 VGICv3 LPI pending status. (b) restoring VGICv3 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) v3: https://lore.kernel.org/kvmarm/20230126235451.469087-1-gshan@redhat.com/T/#t 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 ========= v4: * s/vgic3/VGICv3 (Zenghui) * s/save_tables_in_progress/write_tables_in_progress (Zenghui) 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 VGICv3 LPI pending status KVM: arm64: Allow no running vcpu on saving VGICv3 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(-)