@@ -87,6 +87,14 @@ OPTIONS
The size must be a multiple of the region alignment.
+-a::
+--align::
+ Applications that want to establish dax memory mappings with
+ page table entries greater than system base page size (4K on
+ x86) need a device that is sufficiently aligned. This defaults
+ to 2M. Note that "devdax" mode enforces all mappings to be
+ aligned to this value, i.e. it fails unaligned mapping attempts.
+
-u::
--human::
By default the command will output machine-friendly raw-integer
@@ -216,6 +216,8 @@ static const char *parse_device_options(int argc, const char **argv,
case ACTION_CREATE:
if (param.size)
size = __parse_size64(param.size, &units);
+ if (param.align)
+ align = __parse_size64(param.align, &units);
/* fall through */
case ACTION_ONLINE:
if (param.no_movable)
@@ -538,6 +540,12 @@ static int do_create(struct daxctl_region *region, long long val,
if (val <= 0)
return -ENOSPC;
+ if (align > 0) {
+ rc = daxctl_dev_set_align(dev, align);
+ if (rc < 0)
+ return rc;
+ }
+
rc = daxctl_dev_set_size(dev, val);
if (rc < 0)
return rc;
Allow changing devices alignment when creating a new child device. Signed-off-by: Joao Martins <joao.m.martins@oracle.com> --- Documentation/daxctl/daxctl-create-device.txt | 8 ++++++++ daxctl/device.c | 8 ++++++++ 2 files changed, 16 insertions(+)