Received: by 10.223.176.5 with SMTP id f5csp215596wra; Thu, 1 Feb 2018 18:50:57 -0800 (PST) X-Google-Smtp-Source: AH8x2245Dpj+A/vU5vsDG6DuyEMmHUsO1yk1jSta8Za2AcL+xIBHNnqIQ1x/fliHw2kE1y3iKiLW X-Received: by 10.99.107.200 with SMTP id g191mr407799pgc.165.1517539857171; Thu, 01 Feb 2018 18:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517539857; cv=none; d=google.com; s=arc-20160816; b=sXdNzYcRNhlSQP7U8unHHeU4GlzHThLk396RaSOLkBQ9I5LR1JBlIvrMijszYSCxTD wO6jZRZNn3jvY6WOpxUa656M2pD1qjkvQGTy0VMBoIOz6dXn75/sWtgGK5I0zVLs/RA4 mSOCB2bBi4ckr27/sxB41BUkPd7BwBkBo5PhKtfFDD+eKyBMexAxOwHm6iwLPneUQ36p RTQacdUL9px0c7afrIaKfIoJaOTfxyin/e34/Q/l7FiWw+BhZNzrLdOmp8hYsqSWx8HI oEsr2DouTQkkx8H8UaasxY7nkir2kYhVhg3YG1oTvVx5fp3LKG2J3Mfk60Txe6ydO5+/ igpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=aiPqUOCeN4IKZd7vy88pobFl6jU44JOmHP/R4j22jlA=; b=TFfZrWO6s3j0H0Rgj6otitUXXHXNuHCe7oXezbx+uyqOrISyCFfbx28290dzA5d5x0 oMznP8qKJD9kfbdxBq7ChLoKL6oPNR9owZKnqcZpt2i+ZmnTrlv5d0PNsFj1bppz6N4L 5B82xyl7m8GEulbDLtwP/udGqjYPQD3OWF2OZcyMiQBBsV1y0Nb54gF9GTKYs35sgNrB xTgffLob5SaTP2/ZyXRCy4dKEOQr8ZG3MnLmtJ9b5l2VotBxQzaXb/Vukq0UJehhiTNs HqJ5FKKNZrB4//FwRQShhXT8fHoiDCtqOVP17zpcFuYCjaqeckQJl8Pw8cvppSDAFTDA kg1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si677776pgc.587.2018.02.01.18.50.41; Thu, 01 Feb 2018 18:50:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751729AbeBBCsI (ORCPT + 99 others); Thu, 1 Feb 2018 21:48:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55248 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521AbeBBCsC (ORCPT ); Thu, 1 Feb 2018 21:48:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B1B8C04AC50; Fri, 2 Feb 2018 02:48:02 +0000 (UTC) Received: from redhat.com (ovpn-121-50.rdu2.redhat.com [10.10.121.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD8EB63F89; Fri, 2 Feb 2018 02:47:54 +0000 (UTC) Date: Fri, 2 Feb 2018 04:47:54 +0200 From: "Michael S. Tsirkin" To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau Cc: linux-kernel@vger.kernel.org, slp@redhat.com, bhe@redhat.com, somlo@cmu.edu, xiaolong.ye@intel.com Subject: Re: [PATCH v11 2/4] fw_cfg: do DMA read operation Message-ID: <20180202044433-mutt-send-email-mst@kernel.org> References: <20180201130300.9962-1-marcandre.lureau@redhat.com> <20180201130300.9962-3-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180201130300.9962-3-marcandre.lureau@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 02 Feb 2018 02:48:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 01, 2018 at 02:02:58PM +0100, Marc-Andr? Lureau wrote: > Modify fw_cfg_read_blob() to use DMA if the device supports it. > Return errors, because the operation may fail. > > The DMA operation is expected to run synchronously with today qemu, > but the specification states that it may become async, so we run > "control" field check in a loop for eventual changes. > > We may want to switch all the *buf addresses to use only kmalloc'ed > buffers (instead of using stack/image addresses with dma=false). > > Signed-off-by: Marc-Andr? Lureau This seems to cause no end of pain. I see no reason to keep pushing this patch until it's all much more stable. Something like the below would disable it temporarily. commit 05054fca8b96900f6b54ab0056458f92b616d74c Author: Michael S. Tsirkin Date: Fri Feb 2 04:29:59 2018 +0200 fixup! fw_cfg: do DMA read operation diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index d86ad92..33e0256 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -41,6 +41,9 @@ MODULE_AUTHOR("Gabriel L. Somlo "); MODULE_DESCRIPTION("QEMU fw_cfg sysfs support"); MODULE_LICENSE("GPL"); +/* enable DMA for all accesses */ +#define FW_CFG_DMA_READ_ENABLE 0 + /* selector key values for "well-known" fw_cfg entries */ #define FW_CFG_SIGNATURE 0x00 #define FW_CFG_ID 0x01 @@ -171,7 +174,7 @@ static ssize_t fw_cfg_read_blob(struct device *dev, u16 key, } mutex_lock(&fw_cfg_dev_lock); - if (dma && fw_cfg_dma_enabled()) { + if (FW_CFG_DMA_READ_ENABLE && dma && fw_cfg_dma_enabled()) { if (pos == 0) { ret = fw_cfg_dma_transfer(dev, buf, count, key << 16 | FW_CFG_DMA_CTL_SELECT