-/**
- * Perform basic validation of cell memory regions.
- * @param config Cell configuration description.
- *
- * @return 0 if the regions are valid, @c -EINVAL if the validation failed.
- *
- * Checks performed on the memory regions are:
- * \li Page alignment of physical and virtual address and the size.
- * \li Use of supported flags only.
- */
-int check_mem_regions(const struct jailhouse_cell_desc *config)
-{
- const struct jailhouse_memory *mem =
- jailhouse_cell_mem_regions(config);
- unsigned int n;
-
- for (n = 0; n < config->num_memory_regions; n++, mem++) {
- if (mem->phys_start & ~PAGE_MASK ||
- mem->virt_start & ~PAGE_MASK ||
- mem->size & ~PAGE_MASK ||
- mem->flags & ~JAILHOUSE_MEM_VALID_FLAGS)
- return trace_error(-EINVAL);
- }
- return 0;
-}
-