lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Sep 2013 14:17:02 -0700
From:	Zach Brown <zab@...hat.com>
To:	Kent Overstreet <kmo@...erainc.com>
Cc:	hch@...radead.org, axboe@...nel.dk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] block: Introduce bio_for_each_page()

>  void zero_fill_bio(struct bio *bio)
>  {
> -	unsigned long flags;
>  	struct bio_vec bv;
>  	struct bvec_iter iter;
>  
> -	bio_for_each_segment(bv, bio, iter) {
> +#if defined(CONFIG_HIGHMEM) || defined(ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE)
> +	bio_for_each_page(bv, bio, iter) {
> +		unsigned long flags;
>  		char *data = bvec_kmap_irq(&bv, &flags);
>  		memset(data, 0, bv.bv_len);
>  		flush_dcache_page(bv.bv_page);
>  		bvec_kunmap_irq(data, &flags);
>  	}
> +#else
> +	bio_for_each_segment(bv, bio, iter)
> +		memset(page_address(bv.bv_page) + bv.bv_offset,
> +		       0, bv.bv_len);
> +#endif

This looks pretty sketchy.  I'd expect this to be doable with one loop
and that bvec_kmap_irq() and flush_dcache_page() would fall back to
page_address() and nops when they're not needed.

Where did this come from?

- z
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ