From patchwork Wed May 20 12:31:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11560123 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B29E13B4 for ; Wed, 20 May 2020 12:32:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59D08207D3 for ; Wed, 20 May 2020 12:32:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IAr6A1MP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgETMc1 (ORCPT ); Wed, 20 May 2020 08:32:27 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:46268 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726785AbgETMc1 (ORCPT ); Wed, 20 May 2020 08:32:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589977945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NG0vPHohaFewMo5kIy5Kz+ptuosA4jrQTaOaChzyKGY=; b=IAr6A1MP2qC0UUSu7iAkU3Olx7e/IoF4MKHMwhVjCr6jiRPjZSL3kZEPNVcdGLC77mmbf/ YexJgsq18j/b/qskfTtfmYOcogH7yAgluwfXJiQnriIYaTdnPzZ6PFqKKW2Oaic1pLrlRZ 4YcmddJu9oxjNG7mKjpVbf920zMX4DI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-216-V2a6Qn7gNQy6YnptGaqThQ-1; Wed, 20 May 2020 08:32:23 -0400 X-MC-Unique: V2a6Qn7gNQy6YnptGaqThQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7EB7118FE860; Wed, 20 May 2020 12:32:22 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id E036B6E9EA; Wed, 20 May 2020 12:32:14 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, Richard Henderson , Paolo Bonzini , "Dr . David Alan Gilbert" , Eduardo Habkost , "Michael S . Tsirkin" , David Hildenbrand Subject: [PATCH v2 03/19] accel/kvm: Convert to ram_block_discard_disable() Date: Wed, 20 May 2020 14:31:36 +0200 Message-Id: <20200520123152.60527-4-david@redhat.com> In-Reply-To: <20200520123152.60527-1-david@redhat.com> References: <20200520123152.60527-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Discarding memory does not work as expected. At the time this is called, we cannot have anyone active that relies on discards to work properly. Reviewed-by: Dr. David Alan Gilbert Cc: Paolo Bonzini Signed-off-by: David Hildenbrand --- accel/kvm/kvm-all.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index d06cc04079..7a6158fb99 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -40,7 +40,6 @@ #include "trace.h" #include "hw/irq.h" #include "sysemu/sev.h" -#include "sysemu/balloon.h" #include "qapi/visitor.h" #include "qapi/qapi-types-common.h" #include "qapi/qapi-visit-common.h" @@ -2143,7 +2142,7 @@ static int kvm_init(MachineState *ms) s->sync_mmu = !!kvm_vm_check_extension(kvm_state, KVM_CAP_SYNC_MMU); if (!s->sync_mmu) { - qemu_balloon_inhibit(true); + g_assert(ram_block_discard_disable(true)); } return 0;