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]
Message-ID: <20150817191016.GC6752@lst.de>
Date:	Mon, 17 Aug 2015 21:10:16 +0200
From:	Christoph Hellwig <hch@....de>
To:	Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org, linux-nvdimm@...ts.01.org,
	Dan Williams <dan.j.williams@...el.com>,
	Christoph Hellwig <hch@....de>,
	Matthew Wilcox <matthew.r.wilcox@...el.com>,
	Dave Chinner <david@...morbit.com>,
	"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org
Subject: Re: [PATCH v3 5/7] pmem: add copy_from_iter_pmem() and clear_pmem()

>  #include <linux/uaccess.h>
> +#include <linux/uio.h>
> +

Can we keep this in linux/pmem.h?  I'm pretty sure the stubs would need
it as well, and even if they don't it'll keep the includes consistent.

> +{
> +	size_t len;
> +
> +	len = copy_from_iter_nocache((void __force *)addr, bytes, i);
> +
> +	/*
> +	 * copy_from_iter_nocache() on x86 only uses non-temporal stores for
> +	 * iovec iterators, so for other types (bvec & kvec) we must do a
> +	 * cache write-back.

Shouldn't we fi that?

> +	 */
> +	if (iter_is_iovec(i) == false)
> +		__arch_wb_cache_pmem(addr, bytes);

And if not and iter_needs_pmem_wb helper to encode this knowledge would
be useful.

> +static inline void arch_clear_pmem(void __pmem *addr, size_t size)
> +{
> +	/* TODO: implement the zeroing via non-temporal writes */
> +	if (size == PAGE_SIZE && ((unsigned long)addr & ~PAGE_MASK) == 0)
> +		clear_page((void __force *)addr);
> +	else
> +		memset((void __force *)addr, 0, size);
> +
> +	__arch_wb_cache_pmem(addr, size);

Please add a local vaiable so that the __force casting is only needed
once.  Same for other functions with this pattern.
--
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