Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 4102db3

Browse files
committed
add dax support
Signed-off-by: Lai Jiangshan <[email protected]>
1 parent faef420 commit 4102db3

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

Diff for: build/kernel

72.9 KB
Binary file not shown.

Diff for: build/kernel_config

+22-7
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,17 @@ CONFIG_HAVE_MEMORY_PRESENT=y
460460
CONFIG_SPARSEMEM_EXTREME=y
461461
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
462462
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
463-
# CONFIG_SPARSEMEM_VMEMMAP is not set
463+
CONFIG_SPARSEMEM_VMEMMAP=y
464464
CONFIG_HAVE_MEMBLOCK=y
465465
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
466466
CONFIG_ARCH_DISCARD_MEMBLOCK=y
467+
CONFIG_MEMORY_ISOLATION=y
467468
# CONFIG_MOVABLE_NODE is not set
468-
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
469+
CONFIG_HAVE_BOOTMEM_INFO_NODE=y
469470
CONFIG_MEMORY_HOTPLUG=y
470471
CONFIG_MEMORY_HOTPLUG_SPARSE=y
471472
# CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set
472-
# CONFIG_MEMORY_HOTREMOVE is not set
473+
CONFIG_MEMORY_HOTREMOVE=y
473474
CONFIG_SPLIT_PTLOCK_CPUS=4
474475
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
475476
CONFIG_MEMORY_BALLOON=y
@@ -496,6 +497,7 @@ CONFIG_GENERIC_EARLY_IOREMAP=y
496497
CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y
497498
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
498499
# CONFIG_IDLE_PAGE_TRACKING is not set
500+
CONFIG_ZONE_DEVICE=y
499501
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
500502
CONFIG_ARCH_HAS_PKEYS=y
501503
# CONFIG_X86_PMEM_LEGACY is not set
@@ -585,7 +587,7 @@ CONFIG_ACPI_HOTPLUG_IOAPIC=y
585587
# CONFIG_ACPI_SBS is not set
586588
# CONFIG_ACPI_HED is not set
587589
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
588-
# CONFIG_ACPI_NFIT is not set
590+
CONFIG_ACPI_NFIT=y
589591
CONFIG_HAVE_ACPI_APEI=y
590592
CONFIG_HAVE_ACPI_APEI_NMI=y
591593
# CONFIG_ACPI_APEI is not set
@@ -1359,6 +1361,7 @@ CONFIG_BLK_DEV_LOOP_MIN_COUNT=0
13591361
CONFIG_BLK_DEV_RAM=y
13601362
CONFIG_BLK_DEV_RAM_COUNT=16
13611363
CONFIG_BLK_DEV_RAM_SIZE=16384
1364+
# CONFIG_BLK_DEV_RAM_DAX is not set
13621365
# CONFIG_CDROM_PKTCDVD is not set
13631366
# CONFIG_ATA_OVER_ETH is not set
13641367
CONFIG_XEN_BLKDEV_FRONTEND=y
@@ -2072,8 +2075,18 @@ CONFIG_ARM_GIC_MAX_NR=1
20722075
# Android
20732076
#
20742077
# CONFIG_ANDROID is not set
2075-
# CONFIG_LIBNVDIMM is not set
2076-
# CONFIG_DEV_DAX is not set
2078+
CONFIG_LIBNVDIMM=y
2079+
CONFIG_BLK_DEV_PMEM=y
2080+
CONFIG_ND_BLK=y
2081+
CONFIG_ND_CLAIM=y
2082+
CONFIG_ND_BTT=y
2083+
CONFIG_BTT=y
2084+
CONFIG_ND_PFN=y
2085+
CONFIG_NVDIMM_PFN=y
2086+
CONFIG_NVDIMM_DAX=y
2087+
CONFIG_DEV_DAX=y
2088+
CONFIG_DEV_DAX_PMEM=y
2089+
CONFIG_NR_DEV_DAX=32768
20772090
# CONFIG_NVMEM is not set
20782091
# CONFIG_STM is not set
20792092
# CONFIG_INTEL_TH is not set
@@ -2125,7 +2138,7 @@ CONFIG_XFS_POSIX_ACL=y
21252138
# CONFIG_BTRFS_FS is not set
21262139
# CONFIG_NILFS2_FS is not set
21272140
# CONFIG_F2FS_FS is not set
2128-
# CONFIG_FS_DAX is not set
2141+
CONFIG_FS_DAX=y
21292142
CONFIG_FS_POSIX_ACL=y
21302143
CONFIG_EXPORTFS=y
21312144
# CONFIG_EXPORTFS_BLOCK_OPS is not set
@@ -2294,6 +2307,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
22942307
CONFIG_DEBUG_MEMORY_INIT=y
22952308
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
22962309
CONFIG_HAVE_ARCH_KMEMCHECK=y
2310+
CONFIG_HAVE_ARCH_KASAN=y
2311+
# CONFIG_KASAN is not set
22972312
CONFIG_ARCH_HAS_KCOV=y
22982313
# CONFIG_KCOV is not set
22992314

Diff for: build/modules.tar

10 KB
Binary file not shown.

Diff for: src/container.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static int hyper_setup_container_rootfs(void *data)
574574

575575
if (container->fstype) {
576576
char dev[128];
577-
char *options = NULL;
577+
char options[128];
578578

579579
if (container->scsiaddr) {
580580
free(container->image);
@@ -585,8 +585,11 @@ static int hyper_setup_container_rootfs(void *data)
585585
sprintf(dev, "/dev/%s", container->image);
586586
fprintf(stdout, "device %s\n", dev);
587587

588+
memset(options, 0, sizeof(options));
589+
if (strncmp(container->image, "pmem", 4) == 0)
590+
strcat(options, ",dax");
588591
if (!strncmp(container->fstype, "xfs", strlen("xfs")))
589-
options = "nouuid";
592+
strcat(options, ",nouuid");
590593

591594
if (hyper_mount_blockdev(dev, root, container->fstype, options) < 0) {
592595
perror("mount device failed");

0 commit comments

Comments
 (0)