From nobody Mon Feb 9 15:09:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605801480; cv=none; d=zohomail.com; s=zohoarc; b=R/CgW3xZY+p4B2h0Se0ePlmyufzdMd2V+lrWGvsfaP2ZXdPa64MXAtwxTRItogIRi99yZqNjGP6unWYoTM6FRB2P+hYKoUyzrOQ276Q0EPN1ALYiNB1sB/iLHICb16VL7X/l8A0PgWoIMbD1S2zFwgbl/Asi5/wyNTcIfdOwhK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605801480; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5nitbM+7c7GiR2oxC/3bNNRVqjQXvjXPwI7pJO/ckQQ=; b=kF+K8TFk1Nk+FmikKLG+eUKkcADgx9zz+wy5j3M3Fc8Vq99xDoUnB4FkNVCWIu2mrjgf0w/jgR6pjvk77MfUl3L7QT05uHtEHGp1TNeca2EE5gqUhQiiz2RXT3/ahK8wCjNuaQIslkexVSqpTqjMKTkJyQPT6J+L4FBTadQeIZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605801480716150.38525464215456; Thu, 19 Nov 2020 07:58:00 -0800 (PST) Received: from localhost ([::1]:43486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfmJr-0003bO-JF for importer@patchew.org; Thu, 19 Nov 2020 10:57:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfm4S-0001xU-MK for qemu-devel@nongnu.org; Thu, 19 Nov 2020 10:42:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kfm4P-0002Eo-Uu for qemu-devel@nongnu.org; Thu, 19 Nov 2020 10:42:04 -0500 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-534-e7KfNTpQNoeIAArjtki3_w-1; Thu, 19 Nov 2020 10:41:58 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E89E8042C9; Thu, 19 Nov 2020 15:41:57 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-158.ams2.redhat.com [10.36.114.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA1375C1A1; Thu, 19 Nov 2020 15:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605800520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5nitbM+7c7GiR2oxC/3bNNRVqjQXvjXPwI7pJO/ckQQ=; b=LHGTxgJ1QV9dCJ0DJOPmf0l/iKWfoAzaYmVFVQNBCZ1ZFs5a3tLGS14rhJVvoRaCOrRHxA owS6d7Lpl0lrvjNPSd0wF9npmqO4xcDdSZKMtIbaaVhGBWpUWaYQmlaP5QFZ4JN5h861Td ydnnG4j+GchEWTte4oD/fZi1A6e6l1Q= X-MC-Unique: e7KfNTpQNoeIAArjtki3_w-1 From: David Hildenbrand To: qemu-devel@nongnu.org Subject: [PATCH v1 8/9] virtio-mem: Require only coordinated discards Date: Thu, 19 Nov 2020 16:39:17 +0100 Message-Id: <20201119153918.120976-9-david@redhat.com> In-Reply-To: <20201119153918.120976-1-david@redhat.com> References: <20201119153918.120976-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=david@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/18 23:36:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pankaj Gupta , Wei Yang , David Hildenbrand , "Michael S. Tsirkin" , "Dr . David Alan Gilbert" , Peter Xu , Luiz Capitulino , Auger Eric , Alex Williamson , teawater , Igor Mammedov , Paolo Bonzini , Marek Kedzierski Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We implement the RamDiscardMgr interface and only require coordinated discarding of RAM to work. Cc: Paolo Bonzini Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Dr. David Alan Gilbert Cc: Igor Mammedov Cc: Pankaj Gupta Cc: Peter Xu Cc: Auger Eric Cc: Wei Yang Cc: teawater Cc: Marek Kedzierski Signed-off-by: David Hildenbrand Reviewed-by: Dr. David Alan Gilbert --- hw/virtio/virtio-mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 93257b6c26..932d386c37 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -687,7 +687,7 @@ static void virtio_mem_device_realize(DeviceState *dev,= Error **errp) return; } =20 - if (ram_block_discard_require(true)) { + if (ram_block_coordinated_discard_require(true)) { error_setg(errp, "Discarding RAM is disabled"); return; } @@ -695,7 +695,7 @@ static void virtio_mem_device_realize(DeviceState *dev,= Error **errp) ret =3D ram_block_discard_range(rb, 0, qemu_ram_get_used_length(rb)); if (ret) { error_setg_errno(errp, -ret, "Unexpected error discarding RAM"); - ram_block_discard_require(false); + ram_block_coordinated_discard_require(false); return; } =20 @@ -738,7 +738,7 @@ static void virtio_mem_device_unrealize(DeviceState *de= v) virtio_del_queue(vdev, 0); virtio_cleanup(vdev); g_free(vmem->bitmap); - ram_block_discard_require(false); + ram_block_coordinated_discard_require(false); } =20 static int virtio_mem_discard_range_cb(const VirtIOMEM *vmem, void *arg, --=20 2.26.2