linux-stable/drivers/virt/nitro_enclaves
Longpeng fbf3443f77 nitro_enclaves: Add KUnit tests for contiguous physical memory regions merging
Add KUnit tests for the contiguous physical memory regions merging
functionality from the Nitro Enclaves misc device logic.

We can build the test binary with the following configuration:
  CONFIG_KUNIT=y
  CONFIG_NITRO_ENCLAVES=m
  CONFIG_NITRO_ENCLAVES_MISC_DEV_TEST=y
and install the nitro_enclaves module to run the testcases.

We'll see the following message using dmesg if everything goes well:

[...]     # Subtest: ne_misc_dev_test
[...]     1..1
[...] (NULL device *): Physical mem region address is not 2 MiB aligned
[...] (NULL device *): Physical mem region size is not multiple of 2 MiB
[...] (NULL device *): Physical mem region address is not 2 MiB aligned
[...]     ok 1 - ne_misc_dev_test_merge_phys_contig_memory_regions
[...] ok 1 - ne_misc_dev_test

Reviewed-by: Andra Paraschiv <andraprs@amazon.com>
Signed-off-by: Longpeng <longpeng2@huawei.com>
Link: https://lore.kernel.org/r/20211107140918.2106-5-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-17 16:11:09 +01:00
..
Kconfig nitro_enclaves: Add KUnit tests setup for the misc device functionality 2021-11-17 16:11:09 +01:00
Makefile nitro_enclaves: Add Makefile for the Nitro Enclaves driver 2020-09-22 13:58:41 +02:00
ne_misc_dev.c nitro_enclaves: Add KUnit tests setup for the misc device functionality 2021-11-17 16:11:09 +01:00
ne_misc_dev.h
ne_misc_dev_test.c nitro_enclaves: Add KUnit tests for contiguous physical memory regions merging 2021-11-17 16:11:09 +01:00
ne_pci_dev.c nitro_enclaves: Remove redundant 'flush_workqueue()' calls 2021-11-17 16:10:26 +01:00
ne_pci_dev.h nitro_enclaves: Add fix for the kernel-doc report 2021-09-14 11:11:20 +02:00