From patchwork Wed Jun 10 11:54:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11597603 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 C8967138C for ; Wed, 10 Jun 2020 11:54:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A625220760 for ; Wed, 10 Jun 2020 11:54:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VV0rwxwP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728740AbgFJLy5 (ORCPT ); Wed, 10 Jun 2020 07:54:57 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:27389 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728730AbgFJLy5 (ORCPT ); Wed, 10 Jun 2020 07:54:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591790096; 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=q5ARNUWTcyRA1N5fC9aAjQ1xopL6Yzibnqxs9roC3AQ=; b=VV0rwxwPqHrFpMQVlD+f0iKMYDswKoKKd1fru+otoG5Nq/j4Voywe/S1WP54huw6NmeJCc vbhocEd3Pn0jON0Ap7eX+CVey/dl0GWaDNwlIW1gQzYKnAknTpcTyQsyjIkzcQFEHzrS3r crtIvUf48+DrT38+eski41U39oIVl04= 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-286-paF5wbtsPCaRfoUBu8jcBA-1; Wed, 10 Jun 2020 07:54:54 -0400 X-MC-Unique: paF5wbtsPCaRfoUBu8jcBA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80570A0BD7; Wed, 10 Jun 2020 11:54:53 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-42.ams2.redhat.com [10.36.114.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 963A15D9D3; Wed, 10 Jun 2020 11:54:51 +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 v4 03/21] accel/kvm: Convert to ram_block_discard_disable() Date: Wed, 10 Jun 2020 13:54:01 +0200 Message-Id: <20200610115419.51688-4-david@redhat.com> In-Reply-To: <20200610115419.51688-1-david@redhat.com> References: <20200610115419.51688-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index d06cc04079..fa18b2caae 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,8 @@ 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); + ret = ram_block_discard_disable(true); + assert(!ret); } return 0;