All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/testing/nvdimm: add virtual ramdisk range
@ 2016-07-15  5:28 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2016-07-15  5:28 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Lee, Chun-Yi, linux-acpi

Test the virtual disk ranges that platform firmware like EDK2/OVMF might
emit.

Cc: "Lee, Chun-Yi" <jlee@suse.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 tools/testing/nvdimm/test/nfit.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index ff09a28890ed..0a803f63307a 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -96,7 +96,7 @@
  *    reference an NVDIMM.
  */
 enum {
-	NUM_PM  = 3,
+	NUM_PM  = 4,
 	NUM_DCR = 5,
 	NUM_HINTS = 8,
 	NUM_BDW = NUM_DCR,
@@ -591,6 +591,10 @@ static int nfit_test0_alloc(struct nfit_test *t)
 	if (!t->spa_set[2])
 		return -ENOMEM;
 
+	t->spa_set[3] = test_alloc(t, SPA0_SIZE, &t->spa_set_dma[3]);
+	if (!t->spa_set[3])
+		return -ENOMEM;
+
 	for (i = 0; i < NUM_DCR; i++) {
 		t->dimm[i] = test_alloc(t, DIMM_SIZE, &t->dimm_dma[i]);
 		if (!t->dimm[i])
@@ -745,7 +749,16 @@ static void nfit_test0_setup(struct nfit_test *t)
 	spa->address = t->dimm_dma[3];
 	spa->length = DIMM_SIZE;
 
-	offset = sizeof(*spa) * 10;
+	/* virtual cd region */
+	spa = nfit_buf + sizeof(*spa) * 10;
+	spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
+	spa->header.length = sizeof(*spa);
+	memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_VCD), 16);
+	spa->range_index = 0;
+	spa->address = t->spa_set_dma[3];
+	spa->length = SPA0_SIZE;
+
+	offset = sizeof(*spa) * 11;
 	/* mem-region0 (spa0, dimm0) */
 	memdev = nfit_buf + offset;
 	memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP;

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] tools/testing/nvdimm: add virtual ramdisk range
@ 2016-07-15  5:28 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2016-07-15  5:28 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Lee, Chun-Yi, linux-acpi

Test the virtual disk ranges that platform firmware like EDK2/OVMF might
emit.

Cc: "Lee, Chun-Yi" <jlee@suse.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 tools/testing/nvdimm/test/nfit.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index ff09a28890ed..0a803f63307a 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -96,7 +96,7 @@
  *    reference an NVDIMM.
  */
 enum {
-	NUM_PM  = 3,
+	NUM_PM  = 4,
 	NUM_DCR = 5,
 	NUM_HINTS = 8,
 	NUM_BDW = NUM_DCR,
@@ -591,6 +591,10 @@ static int nfit_test0_alloc(struct nfit_test *t)
 	if (!t->spa_set[2])
 		return -ENOMEM;
 
+	t->spa_set[3] = test_alloc(t, SPA0_SIZE, &t->spa_set_dma[3]);
+	if (!t->spa_set[3])
+		return -ENOMEM;
+
 	for (i = 0; i < NUM_DCR; i++) {
 		t->dimm[i] = test_alloc(t, DIMM_SIZE, &t->dimm_dma[i]);
 		if (!t->dimm[i])
@@ -745,7 +749,16 @@ static void nfit_test0_setup(struct nfit_test *t)
 	spa->address = t->dimm_dma[3];
 	spa->length = DIMM_SIZE;
 
-	offset = sizeof(*spa) * 10;
+	/* virtual cd region */
+	spa = nfit_buf + sizeof(*spa) * 10;
+	spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
+	spa->header.length = sizeof(*spa);
+	memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_VCD), 16);
+	spa->range_index = 0;
+	spa->address = t->spa_set_dma[3];
+	spa->length = SPA0_SIZE;
+
+	offset = sizeof(*spa) * 11;
 	/* mem-region0 (spa0, dimm0) */
 	memdev = nfit_buf + offset;
 	memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-15  5:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  5:28 [PATCH] tools/testing/nvdimm: add virtual ramdisk range Dan Williams
2016-07-15  5:28 ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.