From patchwork Thu Feb 14 04:39:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 10811789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BF18746 for ; Thu, 14 Feb 2019 04:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38AB7289D5 for ; Thu, 14 Feb 2019 04:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D3F928BC1; Thu, 14 Feb 2019 04:43:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D32DD289D5 for ; Thu, 14 Feb 2019 04:43:57 +0000 (UTC) Received: from localhost ([127.0.0.1]:39983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gu8sP-00050p-6V for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Feb 2019 23:43:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gu8p7-0002G7-3K for qemu-devel@nongnu.org; Wed, 13 Feb 2019 23:40:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gu8os-0006yj-NF for qemu-devel@nongnu.org; Wed, 13 Feb 2019 23:40:26 -0500 Received: from ozlabs.org ([203.11.71.1]:50441) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gu8oh-0006OE-2s; Wed, 13 Feb 2019 23:40:09 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 440Nvr0H2Tz9sMr; Thu, 14 Feb 2019 15:39:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550119160; bh=PMNFhyLU7Wdz/kNyRKw1c3SBNE1hcGKUfOayXlliCMU=; h=From:To:Cc:Subject:Date:From; b=ifSgUY3PRjYuf+k/K8aUtcBI0pijV1qPjMNXATY77SDTTK+qCWY9KvRkKSyrQ4S9Z wuONSmuBAVod2iI5jhYov2SqqTbDp7ggRmUreRUvtHMfX5ewgUx3eDjljJgEdYjqpU fKviFyToakfSG3pMXmYLFT1Dec07I6ETCj23G3qw= From: David Gibson To: mst@redhat.com, qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 15:39:11 +1100 Message-Id: <20190214043916.22128-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PATCH 0/5] Improve balloon handling of pagesizes other than 4kiB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP I posted some RFCs for this back in December, but didn't wrap it up in time for 3.1. Posting again for inclusion in 4.0. The virtio-balloon devices was never really thought out for cases other than 4kiB pagesize on both guest and host. It works in some cases, but in others can be ineffectual or even cause guest memory corruption. This series makes a handful of preliminary cleanups, then makes a change to safely, though not perfectly, handle cases with non 4kiB pagesizes. Changes since RFC: * Further refinement of when to issue warnings in 5/5 David Gibson (5): virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate virtio-balloon: Corrections to address verification virtio-balloon: Rework ballon_page() interface virtio-balloon: Use ram_block_discard_range() instead of raw madvise() virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size hw/virtio/virtio-balloon.c | 102 ++++++++++++++++++++++++----- include/hw/virtio/virtio-balloon.h | 3 + 2 files changed, 89 insertions(+), 16 deletions(-)