From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v2 0/4] Balloon inhibit enhancements, vfio restriction Date: Tue, 31 Jul 2018 15:29:17 +0300 Message-ID: <20180731152716-mutt-send-email-mst@kernel.org> References: <153299204130.14411.11438396195753743913.stgit@gimli.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: peterx@redhat.com, cohuck@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, david@redhat.com To: Alex Williamson Return-path: Content-Disposition: inline In-Reply-To: <153299204130.14411.11438396195753743913.stgit@gimli.home> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org On Mon, Jul 30, 2018 at 05:13:26PM -0600, Alex Williamson wrote: > v2: > - Use atomic ops for balloon inhibit counter (Peter) > - Allow endpoint driver opt-in for ballooning, vfio-ccw opt-in by > default, vfio-pci opt-in by device option, only allowed for mdev > devices, no support added for platform as there are no platform > mdev devices. > > See patch 3/4 for detailed explanation why ballooning and device > assignment typically don't mix. If this eventually changes, flags > on the iommu info struct or perhaps device info struct can inform > us for automatic opt-in. Thanks, > > Alex So this patch seems to block ballooning when vfio is added. But what if balloon is added and inflated first? I'd suggest making qemu_balloon_inhibit fail in that case, and then vfio realize will fail as well. > --- > > Alex Williamson (4): > balloon: Allow nested inhibits > kvm: Use inhibit to prevent ballooning without synchronous mmu > vfio: Inhibit ballooning based on group attachment to a container > vfio/ccw/pci: Allow devices to opt-in for ballooning > > > accel/kvm/kvm-all.c | 4 ++++ > balloon.c | 13 ++++++++++--- > hw/vfio/ccw.c | 9 +++++++++ > hw/vfio/common.c | 26 ++++++++++++++++++++++++++ > hw/vfio/pci.c | 26 +++++++++++++++++++++++++- > hw/vfio/trace-events | 1 + > hw/virtio/virtio-balloon.c | 4 +--- > include/hw/vfio/vfio-common.h | 2 ++ > 8 files changed, 78 insertions(+), 7 deletions(-)