From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjNnl-0007Kd-Tg for qemu-devel@nongnu.org; Tue, 06 Oct 2015 04:40:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjNng-0001rS-T8 for qemu-devel@nongnu.org; Tue, 06 Oct 2015 04:40:49 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:37620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjNng-0001qd-Lb for qemu-devel@nongnu.org; Tue, 06 Oct 2015 04:40:44 -0400 Received: by wicfx3 with SMTP id fx3so148116588wic.0 for ; Tue, 06 Oct 2015 01:40:44 -0700 (PDT) Date: Tue, 6 Oct 2015 09:40:42 +0100 From: Stefan Hajnoczi Message-ID: <20151006084042.GC19089@stefanha-thinkpad> References: <1443914889-9619-1-git-send-email-somlo@cmu.edu> <1443914889-9619-2-git-send-email-somlo@cmu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443914889-9619-2-git-send-email-somlo@cmu.edu> Subject: Re: [Qemu-devel] [PATCH v3 1/4] firmware: introduce sysfs driver for QEMU's fw_cfg device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: mark.rutland@arm.com, peter.maydell@linaro.org, mst@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, qemu-devel@nongnu.org, kraxel@redhat.com, linux-api@vger.kernel.org, kernelnewbies@kernelnewbies.org, zajec5@gmail.com, lersek@redhat.com, jordan.l.justen@intel.com, agross@codeaurora.org, leif.lindholm@linaro.org, paul@pwsan.com, matt.fleming@intel.com, ard.biesheuvel@linaro.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, hanjun.guo@linaro.org, galak@codeaurora.org, pbonzini@redhat.com On Sat, Oct 03, 2015 at 07:28:06PM -0400, Gabriel L. Somlo wrote: > +/* read chunk of given fw_cfg blob (caller responsible for sanity-check) */ > +static inline void fw_cfg_read_blob(u16 key, > + void *buf, loff_t pos, size_t count) > +{ > + mutex_lock(&fw_cfg_dev_lock); > + iowrite16(fw_cfg_sel_endianness(key), fw_cfg_reg_ctrl); > + while (pos-- > 0) > + ioread8(fw_cfg_reg_data); > + ioread8_rep(fw_cfg_reg_data, buf, count); > + mutex_unlock(&fw_cfg_dev_lock); > +} Have you had a chance to play with Marc Mari's fw_cfg DMA interface patches? They should make this operation much faster. https://www.mail-archive.com/qemu-devel@nongnu.org/msg325541.html Stefan