From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH] kvm tools: Support virtio indirect buffers Date: Tue, 29 Nov 2011 17:06:10 +0400 Message-ID: <20111129130610.GA1775@moon> References: <1322502867-28812-1-git-send-email-levinsasha928@gmail.com> <20111129063105.GR1775@moon> <1322552749.3644.3.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com To: Pekka Enberg Return-path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:55187 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796Ab1K2NGP (ORCPT ); Tue, 29 Nov 2011 08:06:15 -0500 Received: by bkas6 with SMTP id s6so491796bka.19 for ; Tue, 29 Nov 2011 05:06:14 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Nov 29, 2011 at 03:01:59PM +0200, Pekka Enberg wrote: > >> > >>Hi Sasha, where the rmb() then? Or maybe you wanted plain barrier() here? > > > >On the kernel side. > >Theres a mb there which happens there during the kick. > > I guess we need to improve the comment in next_desc()? > Kernel's code has pretty good aliases for virtio barriers I think #ifdef CONFIG_SMP /* Where possible, use SMP barriers which are more lightweight than mandatory * barriers, because mandatory barriers control MMIO effects on accesses * through relaxed memory I/O windows (which virtio does not use). */ #define virtio_mb() smp_mb() #define virtio_rmb() smp_rmb() #define virtio_wmb() smp_wmb() #else /* We must force memory ordering even if guest is UP since host could be * running on another CPU, but SMP barriers are defined to barrier() in that * configuration. So fall back to mandatory barriers instead. */ #define virtio_mb() mb() #define virtio_rmb() rmb() #define virtio_wmb() wmb() #endif Maybe we could use somethig similar?