From patchwork Thu Jan 19 23:44:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 4276 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp606155wrn; Thu, 19 Jan 2023 15:52:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXsS9qXaeb0ttch2lqXN+s6RJP0ynWHRrD7T3oPUm59hpYJp/0802E19q0NxeM665NQjAOhy X-Received: by 2002:a17:906:af13:b0:86d:f370:19ab with SMTP id lx19-20020a170906af1300b0086df37019abmr12682594ejb.5.1674172337397; Thu, 19 Jan 2023 15:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674172337; cv=none; d=google.com; s=arc-20160816; b=LMnJzMV6lHo0Ep95w9lpssNvktiEwEFiMaUEFMbdoBoAnPv62eW50lPzrkZTobk0ua +hcBPROxahACD02y5TmGpD1PbCqUNmTfolig3ei4Rs4yRBiLjoe15JN/byhOv1M0Sg8m gDg7hFb1cAq47uKCOBCPw+WDYXdXRldoUdiRRcWOEUYyCBSYjBZytdQztDG1URV4Q4am GXML+0WrDJpyMssLtmSHlTctJRHbMIHz1iOKsNPdZonnJ3ZsX0oLEVQFZkmC+tfhSSC6 Yp51iIt9ybQFyPHQB+sNLKgh1d+odTZm9aomL1myzahPEdQYtZlzmiar69KwsQcvwArI GLLQ== 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=O26wXFwfbNKvM1Y0zBYnBKMX3ek+hLU/5IsgmYQVXCM=; b=t7uI8ktmyk5Fzjcx35C3IypHtxh4LrrMesFNeJheOLY3yBsv77cCZ3Ph8C8iM5GY9N WTSQY7DinmwI9K+6zLh6UXp9icHKyuUnCckHn4n2Vkz4RBB9HViRVchL9tlQDZFLAe0I BZn5OL5JTTQqxqCIUmI5lkpHl1HiHeZmekpbQ0Ur4IVAt4L99U8C2aZ8q0SdSZO2HTej vxqCytg7z98S8b4MWmarebtt05D9UusuYE7Fw1L6PfIrL5klO70jUM2ufpfdiXBKa6rk wN5L5OGhWb2KVf3vAbUzvXXnPnBmTYQq+ReJpFM97spMto2X/Yf8RBtOoEOf90zU0o9H z47A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q+jfpO1u; 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 xg3-20020a170907320300b007c109e62bfdsi40594491ejb.984.2023.01.19.15.51.53; Thu, 19 Jan 2023 15:52:17 -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=Q+jfpO1u; 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 S229947AbjASXpq (ORCPT + 99 others); Thu, 19 Jan 2023 18:45:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjASXpn (ORCPT ); Thu, 19 Jan 2023 18:45:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC4719F39A for ; Thu, 19 Jan 2023 15:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674171899; 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=O26wXFwfbNKvM1Y0zBYnBKMX3ek+hLU/5IsgmYQVXCM=; b=Q+jfpO1upTbXnMkFLvBN7CxbfA+Dwoa5IK/lFegi4mvUJcrTx5c1scMZPAJoB4VqkopDRI 31AgSNZb/f+vOK22ogHE2nKaBFxsv+2a7fsfzWsxN5S9bod0E8UafbDkSX3Uh4R/9TZnki s4KoEiQUf1e5gV8wZ+TJCrdqYoZHJgk= 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-647-X1kbE4T6MuiqRklvwNWn7Q-1; Thu, 19 Jan 2023 18:44:56 -0500 X-MC-Unique: X1kbE4T6MuiqRklvwNWn7Q-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 161D63806104; Thu, 19 Jan 2023 23:44:55 +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 CABE72166B2A; Thu, 19 Jan 2023 23:44:47 +0000 (UTC) From: Gavin Shan To: kvmarm@lists.linux.dev Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, pbonzini@redhat.com, corbet@lwn.net, maz@kernel.org, oliver.upton@linux.dev, will@kernel.org, gshan@redhat.com, ricarkol@google.com, eric.auger@redhat.com, yuzhe@nfschina.com, renzhengeek@gmail.com, reijiw@google.com, ardb@kernel.org, Julia.Lawall@inria.fr, yuzenghui@huawei.com, seanjc@google.com, shan.gavin@gmail.com Subject: [PATCH v2 0/3] Improve dirty ring warning report Date: Fri, 20 Jan 2023 07:44:02 +0800 Message-Id: <20230119234405.349644-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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?1755496932832371102?= X-GMAIL-MSGID: =?utf-8?q?1755496932832371102?= 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] adds unified helper vgic_write_guest_lock() PATCH[2 - 3] allows no-running-vcpu context for (a) and (b) v1: https://lore.kernel.org/kvmarm/20230116040405.260935-1-gshan@redhat.com/T/#t Changelog ========= v2: * Add unified helper vgic_write_guest_lock() (Oliver) * Dropped two patches to refactor mark_page_dirty_in_slot() (Sean) Gavin Shan (3): 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-sys-reg-v3.c | 1 + arch/arm64/kvm/vgic/vgic-irqfd.c | 1 + arch/arm64/kvm/vgic/vgic-its.c | 13 +++++-------- arch/arm64/kvm/vgic/vgic-mmio-v2.c | 1 + arch/arm64/kvm/vgic/vgic-mmio.c | 1 + arch/arm64/kvm/vgic/vgic-v3.c | 4 ++-- arch/arm64/kvm/vgic/vgic-v4.c | 1 + arch/arm64/kvm/vgic/vgic.c | 1 + arch/arm64/kvm/vgic/vgic.h | 13 +++++++++++++ include/kvm/arm_vgic.h | 2 +- 11 files changed, 34 insertions(+), 14 deletions(-) Reviewed-by: Oliver Upton