From patchwork Tue Aug 7 19:31:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 10559093 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 CB6A513B4 for ; Tue, 7 Aug 2018 19:31:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBCC029EEC for ; Tue, 7 Aug 2018 19:31:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE2FA2A673; Tue, 7 Aug 2018 19:31:40 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5941F29EEC for ; Tue, 7 Aug 2018 19:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389263AbeHGVrb (ORCPT ); Tue, 7 Aug 2018 17:47:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388913AbeHGVrb (ORCPT ); Tue, 7 Aug 2018 17:47:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B44C5C047B63; Tue, 7 Aug 2018 19:31:38 +0000 (UTC) Received: from gimli.home (ovpn-116-35.phx2.redhat.com [10.3.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 826AD82776; Tue, 7 Aug 2018 19:31:25 +0000 (UTC) From: Alex Williamson To: alex.williamson@redhat.com, qemu-devel@nongnu.org Cc: peterx@redhat.com, Cornelia Huck , "Michael S. Tsirkin" , kvm@vger.kernel.org, david@redhat.com Subject: [PATCH v3 0/4] Balloon inhibit enhancements, vfio restriction Date: Tue, 7 Aug 2018 13:31:21 -0600 Message-Id: <20180807193125.30378-1-alex.williamson@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 07 Aug 2018 19:31:38 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP v3: - Drop "nested" term in commit log (David) - Adopt suggested wording in ccw code (Cornelia) - Explain balloon inhibitor usage in vfio common (Peter) - Fix to call inhibitor prior to re-using existing containers to avoid gap that pinning may have occurred in set container ioctl (self) - Peter, this change is the reason I didn't include your R-b. - Add R-b to patches 1 & 2 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 Alex Williamson (4): balloon: Allow multiple inhibit users 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 | 51 +++++++++++++++++++++++++++++++++++ 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, 103 insertions(+), 7 deletions(-)