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:	Mon, 02 Nov 2015 08:30:54 -0800
From:	Joe Perches <joe@...ches.com>
To:	Dan Williams <dan.j.williams@...el.com>
Cc:	axboe@...com, Dave Hansen <dave@...1.net>, jack@...e.cz,
	linux-nvdimm@...ts.01.org, david@...morbit.com,
	linux-kernel@...r.kernel.org, ross.zwisler@...ux.intel.com,
	Andrew Morton <akpm@...ux-foundation.org>, hch@....de
Subject: Re: [PATCH v3 08/15] mm, dax, pmem: introduce pfn_t

On Sun, 2015-11-01 at 23:30 -0500, Dan Williams wrote:
> For the purpose of communicating the optional presence of a 'struct
> page' for the pfn returned from ->direct_access(), introduce a type that
> encapsulates a page-frame-number plus flags.  These flags contain the
> historical "page_link" encoding for a scatterlist entry, but can also
> denote "device memory".  Where "device memory" is a set of pfns that are
> not part of the kernel's linear mapping by default, but are accessed via
> the same memory controller as ram.
> 
> The motivation for this new type is large capacity persistent memory
> that needs struct page entries in the 'memmap' to support 3rd party DMA
> (i.e. O_DIRECT I/O with a persistent memory source/target).  However, we
> also need it in support of maintaining a list of mapped inodes which
> need to be unmapped at driver teardown or freeze_bdev() time.
[]
> diff --git a/include/linux/mm.h b/include/linux/mm.h
[]
> +#define PFN_FLAGS_MASK (~PAGE_MASK << (BITS_PER_LONG - PAGE_SHIFT))
> +#define PFN_SG_CHAIN (1UL << (BITS_PER_LONG - 1))
> +#define PFN_SG_LAST (1UL << (BITS_PER_LONG - 2))
> +#define PFN_DEV (1UL << (BITS_PER_LONG - 3))
> +#define PFN_MAP (1UL << (BITS_PER_LONG - 4))
[]
> diff --git a/include/linux/pfn.h b/include/linux/pfn.h
[]
> @@ -3,6 +3,15 @@
[]
> + * pfn_t: encapsulates a page-frame number that is optionally backed
> + * by memmap (struct page).  Whether a pfn_t has a 'struct page'
> + * backing is indicated by flags in the high bits of the value.
> + */
> +typedef struct {
> +	unsigned long val;
> +} pfn_t;
>  #endif

Perhaps this would be more intelligible as an
anonymous union of bit-fields and unsigned long.


--
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