Make sure rxtx buffers provided in PM are of same size
SPM/hafnium currently allows only same size rx/tx buffers, if different
sizes are provided in Partition's manifest throw an error.
Also, add a unit test to verify it.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I8bab13375b8f62b60caea6384fcd4125fc9eedb0
diff --git a/src/manifest_test.cc b/src/manifest_test.cc
index 7b039f9..98caf85 100644
--- a/src/manifest_test.cc
+++ b/src/manifest_test.cc
@@ -894,6 +894,37 @@
/* clang-format on */
ASSERT_EQ(ffa_manifest_from_vec(&m, dtb),
MANIFEST_ERROR_PROPERTY_NOT_FOUND);
+
+ /* Different RXTX buffer sizes */
+ /* clang-format off */
+ dtb = ManifestDtBuilder()
+ .FfaValidManifest()
+ .StartChild("memory-regions")
+ .Compatible({ "arm,ffa-manifest-memory-regions" })
+ .Label("rx")
+ .StartChild("rx")
+ .Description("rx-buffer")
+ .Property("base-address", "<0x7300000>")
+ .Property("pages-count", "<1>")
+ .Property("attributes", "<1>")
+ .EndChild()
+ .Label("tx")
+ .StartChild("tx")
+ .Description("tx-buffer")
+ .Property("base-address", "<0x7310000>")
+ .Property("pages-count", "<2>")
+ .Property("attributes", "<3>")
+ .EndChild()
+ .EndChild()
+ .StartChild("rx_tx-info")
+ .Compatible({ "arm,ffa-manifest-rx_tx-buffer" })
+ .Property("rx-buffer", "<&rx>")
+ .Property("tx-buffer", "<&tx>")
+ .EndChild()
+ .Build();
+ /* clang-format on */
+ ASSERT_EQ(ffa_manifest_from_vec(&m, dtb),
+ MANIFEST_ERROR_RXTX_SIZE_MISMATCH);
}
TEST(manifest, ffa_validate_dev_regions)