]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Remove memory regions check
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 7 Jan 2016 17:21:55 +0000 (18:21 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 15 Jan 2016 09:14:40 +0000 (10:14 +0100)
Most of the checks will be removed when adding sub-page memory region
support. We rather need some offline validation outside the hypervisor
eventually.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/control.c
hypervisor/include/jailhouse/cell-config.h
hypervisor/include/jailhouse/control.h
hypervisor/setup.c

index 3c7f91f148ee022ae02f6015c9446f0c7facc36b..3353db611549c95f9f623f64b1ca4ca38a6a8df8 100644 (file)
@@ -209,31 +209,6 @@ static void cell_exit(struct cell *cell)
                page_free(&mem_pool, cell->cpu_set, 1);
 }
 
-/**
- * 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;
-       unsigned int n;
-
-       for_each_mem_region(mem, config, n) {
-               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;
-}
-
 /**
  * Apply system configuration changes.
  * @param cell_added_removed   Cell that was added or removed to/from the
@@ -398,10 +373,6 @@ static int cell_create(struct per_cpu *cpu_data, unsigned long config_address)
                goto err_resume;
        }
 
-       err = check_mem_regions(cfg);
-       if (err)
-               goto err_resume;
-
        cell_pages = PAGES(sizeof(*cell) + cfg_total_size);
        cell = page_alloc(&mem_pool, cell_pages);
        if (!cell) {
index a522b8d6414036d36c88e22dbc2b279ddcac0b98..a6e896bab9d68f7df61a66642b45d5c501ac900e 100644 (file)
@@ -68,15 +68,6 @@ struct jailhouse_cell_desc {
 #define JAILHOUSE_MEM_LOADABLE         0x0040
 #define JAILHOUSE_MEM_ROOTSHARED       0x0080
 
-#define JAILHOUSE_MEM_VALID_FLAGS      (JAILHOUSE_MEM_READ | \
-                                        JAILHOUSE_MEM_WRITE | \
-                                        JAILHOUSE_MEM_EXECUTE | \
-                                        JAILHOUSE_MEM_DMA | \
-                                        JAILHOUSE_MEM_IO | \
-                                        JAILHOUSE_MEM_COMM_REGION | \
-                                        JAILHOUSE_MEM_LOADABLE | \
-                                        JAILHOUSE_MEM_ROOTSHARED)
-
 struct jailhouse_memory {
        __u64 phys_start;
        __u64 virt_start;
index 0986d774ad9bcd67bb18e34b982054cb79c316c0..b83553f64415351f3a248d5eb698126e75d90077 100644 (file)
@@ -112,7 +112,6 @@ static inline bool cell_owns_cpu(struct cell *cell, unsigned int cpu_id)
 
 bool cpu_id_valid(unsigned long cpu_id);
 
-int check_mem_regions(const struct jailhouse_cell_desc *config);
 int cell_init(struct cell *cell);
 
 void config_commit(struct cell *cell_added_removed);
index cb0131ced4a8fe2e4eb097a3a4359a3808c82cc6..671369d995af90e4b9ad992280d1f5f132765d84 100644 (file)
@@ -47,10 +47,6 @@ static void init_early(unsigned int cpu_id)
 
        root_cell.config = &system_config->root_cell;
 
-       error = check_mem_regions(&system_config->root_cell);
-       if (error)
-               return;
-
        root_cell.id = -1;
        error = cell_init(&root_cell);
        if (error)