From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: virtio-rng only returns zeros with CONFIG_HW_RANDOM=m Date: Thu, 28 Feb 2013 13:30:21 +1030 Message-ID: <8738whdtx6.fsf@rustcorp.com.au> References: <20130224231154.GA30477@hall.aurel32.net> <8738wifwb2.fsf@rustcorp.com.au> <20130227132213.GF4615@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Aurelien Jarno , kvm@vger.kernel.org, Ian Molton , Matt Mackall , Herbert Xu , Ben Hutchings To: Jens Axboe Return-path: Received: from ozlabs.org ([203.10.76.45]:40933 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888Ab3B1DVV (ORCPT ); Wed, 27 Feb 2013 22:21:21 -0500 In-Reply-To: <20130227132213.GF4615@kernel.dk> Sender: kvm-owner@vger.kernel.org List-ID: Jens Axboe writes: > On Wed, Feb 27 2013, Rusty Russell wrote: >> Subject: scatterlist: sg_set_buf() argument must be in linear mapping. >> >> Signed-off-by: Rusty Russell >> >> diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h >> index 4bd6c06..9365375 100644 >> --- a/include/linux/scatterlist.h >> +++ b/include/linux/scatterlist.h >> @@ -111,6 +111,9 @@ static inline struct page *sg_page(struct scatterlist *sg) >> static inline void sg_set_buf(struct scatterlist *sg, const void *buf, >> unsigned int buflen) >> { >> +#ifdef CONFIG_DEBUG_SG >> + BUG_ON(!virt_addr_valid(buf)); >> +#endif >> sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); >> } > > Looks good to me, in lieu of being able to return an error. Want me to > queue it up? Please... it'll catch me the next time I make the same mistake :) (Though the static-definitions-in-modules-on-most-archs is a pretty nasty corner case). Thanks, Rusty.