From: Dan Williams <dan.j.williams@intel.com> To: linux-nvdimm@lists.01.org Cc: "Lee, Chun-Yi" <jlee@suse.com>, linux-acpi@vger.kernel.org Subject: [PATCH] tools/testing/nvdimm: add virtual ramdisk range Date: Thu, 14 Jul 2016 22:28:40 -0700 [thread overview] Message-ID: <146856052024.34333.9532520454252164419.stgit@dwillia2-desk3.amr.corp.intel.com> (raw) 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
WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com> To: linux-nvdimm@lists.01.org Cc: "Lee, Chun-Yi" <jlee@suse.com>, linux-acpi@vger.kernel.org Subject: [PATCH] tools/testing/nvdimm: add virtual ramdisk range Date: Thu, 14 Jul 2016 22:28:40 -0700 [thread overview] Message-ID: <146856052024.34333.9532520454252164419.stgit@dwillia2-desk3.amr.corp.intel.com> (raw) 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;
next reply other threads:[~2016-07-15 5:31 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-07-15 5:28 Dan Williams [this message] 2016-07-15 5:28 ` [PATCH] tools/testing/nvdimm: add virtual ramdisk range Dan Williams
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=146856052024.34333.9532520454252164419.stgit@dwillia2-desk3.amr.corp.intel.com \ --to=dan.j.williams@intel.com \ --cc=jlee@suse.com \ --cc=linux-acpi@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.