From patchwork Mon Aug 28 16:48:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej S. Szmigiero" X-Patchwork-Id: 13368140 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 ED36BC83F12 for ; Mon, 28 Aug 2023 16:49:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qafQB-00006A-5W; Mon, 28 Aug 2023 12:48:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qafQ9-00005j-E8 for qemu-devel@nongnu.org; Mon, 28 Aug 2023 12:48:57 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qafQ6-0000A1-MN for qemu-devel@nongnu.org; Mon, 28 Aug 2023 12:48:57 -0400 Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qafPk-0000fM-BJ; Mon, 28 Aug 2023 18:48:32 +0200 From: "Maciej S. Szmigiero" To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , David Hildenbrand Cc: "Michael S . Tsirkin" , Marcel Apfelbaum , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Eric Blake , Markus Armbruster , qemu-devel@nongnu.org Subject: =?utf-8?q?=5BPATCH_v7_0/7=5D_Hyper-V_Dynamic_Memory_Protocol_driver?= =?utf-8?q?_=28hv-balloon_=F0=9F=8E=88=EF=B8=8F=29?= Date: Mon, 28 Aug 2023 18:48:17 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=37.28.154.113; envelope-from=mail@maciej.szmigiero.name; helo=vps-vb.mhejs.net 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_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: "Maciej S. Szmigiero" This is a continuation of the v6 of the patch series located here: https://lore.kernel.org/qemu-devel/cover.1689786474.git.maciej.szmigiero@oracle.com/ Changes from v6: * Split the hv-balloon driver implementation into multiple files holding particular data structures and their methods in order to make the driver easier to understand. * Split out the PC machine necessary plumbing for the driver and its final activation into a separate patch. * Make sure that patches that bring QAPI-related changes also implement these in the driver in the same patch. * Add a "query-hv-balloon-status-report" QMP command to query the data from the last received HV_BALLOON_STATUS_REPORT event. * Rate limit the HV_BALLOON_STATUS_REPORT QMP event. * Replace "TBD" in QAPI changes with the actual targeted QEMU version. * Spelling and formatting fixes in QAPI changes. * Rebase onto the latest David's patch series. Based-on: <20230825132149.366064-1-david@redhat.com> Based-on-Repo-Commit: https://github.com/davidhildenbrand/qemu/tree/virtio-mem-memslots b65df116f8a8 David Hildenbrand (2): memory-device: Support empty memory devices memory-device: Drop size alignment check Maciej S. Szmigiero (5): Add Hyper-V Dynamic Memory Protocol definitions Add a Hyper-V Dynamic Memory Protocol driver (hv-balloon) qapi: Add query-memory-devices support to hv-balloon qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command hw/i386/pc: Support hv-balloon Kconfig.host | 3 + hw/core/machine-hmp-cmds.c | 15 + hw/hyperv/Kconfig | 10 + hw/hyperv/hv-balloon-internal.h | 33 + hw/hyperv/hv-balloon-our_range_memslots.c | 201 +++ hw/hyperv/hv-balloon-our_range_memslots.h | 110 ++ hw/hyperv/hv-balloon-page_range_tree.c | 228 +++ hw/hyperv/hv-balloon-page_range_tree.h | 118 ++ hw/hyperv/hv-balloon.c | 1767 +++++++++++++++++++++ hw/hyperv/meson.build | 1 + hw/hyperv/trace-events | 18 + hw/i386/Kconfig | 1 + hw/i386/pc.c | 22 + hw/mem/memory-device.c | 49 +- include/hw/hyperv/dynmem-proto.h | 423 +++++ include/hw/hyperv/hv-balloon.h | 18 + include/hw/mem/memory-device.h | 7 +- meson.build | 28 +- meson_options.txt | 2 + monitor/monitor.c | 1 + qapi/machine.json | 103 +- scripts/meson-buildoptions.sh | 3 + 22 files changed, 3148 insertions(+), 13 deletions(-) create mode 100644 hw/hyperv/hv-balloon-internal.h create mode 100644 hw/hyperv/hv-balloon-our_range_memslots.c create mode 100644 hw/hyperv/hv-balloon-our_range_memslots.h create mode 100644 hw/hyperv/hv-balloon-page_range_tree.c create mode 100644 hw/hyperv/hv-balloon-page_range_tree.h create mode 100644 hw/hyperv/hv-balloon.c create mode 100644 include/hw/hyperv/dynmem-proto.h create mode 100644 include/hw/hyperv/hv-balloon.h