From nobody Mon Feb 9 12:18:10 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1610133849; cv=none; d=zohomail.com; s=zohoarc; b=Jdz7+WtzSoY2TMdBuMNGNJHK7LzZA4nEbvhFNWpgjSGWyJPQPfw6xMxQ58XSZFjLdG4xA3NfiT2l7YC8aRLxw3/ODROxwI4BXuCqnekao0pD5NxuugLBOWhB7xOHFF/urO8fmhekWhAVeQcNTTjm6f8r6xgYqG9IvCEp58qaehM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610133849; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=zPk7gRpbMsYM224FaIOgm92GOnvYLMOuM0Hbfp+7jSI=; b=OnQkFLw0bztTt4jojPnrg6RDpUwWEqqgJfxBxBHyMhNrxsuTq0pkAs5e9dTVgEolkYC4lG4/E2Koz3GUDDtQcC5S3xAS7WDZa/lucoGTgceFwguFPp9T/CMRZnmf1mKUzhVFyVSwd3wiHCQODztXuFbi96wmwwRlKPZfWGbbEu0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610133849318497.855660111333; Fri, 8 Jan 2021 11:24:09 -0800 (PST) Received: from localhost ([::1]:35662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxxMl-0001yv-TN for importer@patchew.org; Fri, 08 Jan 2021 14:24:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxx7w-0000le-SK for qemu-devel@nongnu.org; Fri, 08 Jan 2021 14:08:48 -0500 Received: from prt-mail.chinatelecom.cn ([42.123.76.220]:50846 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxx7s-0006fx-DW for qemu-devel@nongnu.org; Fri, 08 Jan 2021 14:08:48 -0500 Received: from clientip-203.57.249.251?logid-4904171397564a909bb6e26728d4a894 (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id 02260280072; Sat, 9 Jan 2021 03:08:34 +0800 (CST) Received: from ([172.18.0.48]) by App0024 with ESMTP id 4904171397564a909bb6e26728d4a894 for qemu-devel@nongnu.org; Sat Jan 9 03:08:36 2021 HMM_SOURCE_IP: 172.18.0.48:17829.1062543948 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: 4904171397564a909bb6e26728d4a894 X-filter-score: filter<0> X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: qemu-devel Subject: [PATCH] kvm: mirror "-machine dirty_gfn_count" to the accelerator property Date: Sat, 9 Jan 2021 03:08:31 +0800 Message-Id: <1610132911-33839-1-git-send-email-huangy81@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=42.123.76.220; envelope-from=huangy81@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 08 Jan 2021 14:20:53 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Hyman , peterx Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" QEMU enable the dirty ring feature by specifing the "-accel" sub-parameter. https://lore.kernel.org/qemu-devel/20210108165050.406906-10-peterx@redhat.c= om/ Libvirt use "-machine accel=3Dkvm" option to specify the accelerator by def= ault, which is incompatible with above option. This patch introduce the "dirty_gfn_count" sub-parameter of the "-machine" in the way that the commit "23b089" has done. So that Libvirt can enable th= is feature by adding "-machine dirty_gfn_count=3Dxxx" to the QEMU command line. Signed-off-by: Hyman --- softmmu/vl.c | 3 ++- util/qemu-config.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 7ddf405..d8e3dec 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1666,7 +1666,8 @@ static int machine_set_property(void *opaque, object_register_sugar_prop(ACCEL_CLASS_NAME("xen"), qom_name, valu= e); return 0; } - if (g_str_equal(qom_name, "kvm-shadow-mem")) { + if (g_str_equal(qom_name, "kvm-shadow-mem") || + g_str_equal(qom_name, "dirty-gfn-count")) { object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), qom_name, valu= e); return 0; } diff --git a/util/qemu-config.c b/util/qemu-config.c index e2a700b..70f1b50 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -234,6 +234,10 @@ static QemuOptsList machine_opts =3D { .help =3D "Up to 8 chars in set of [A-Za-z0-9. ](lower case ch= ars" " converted to upper case) to pass to machine" " loader, boot manager, and guest kernel", + },{ + .name =3D "dirty_gfn_count", + .type =3D QEMU_OPT_NUMBER, + .help =3D "KVM dirty ring GFN count", }, { /* End of list */ } } --=20 1.8.3.1