As a follow up to commit
cb1ddafdc573 ("xen/arm/static-shmem: Static-shmem
should be direct-mapped for direct-mapped domains") add a check to
request that both host and guest physical address must be supplied for
direct mapped domains. Otherwise return an error to prevent unwanted
behavior.
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Fixes: 988f1c7e1f40 ("xen/arm: static-shmem: fix "gbase/pbase used uninitialized" build failure")
Reviewed-by: Julien Grall <jgrall@amazon.com>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
const struct membank *alloc_bank =
find_shm_bank_by_id(get_shmem_heap_banks(), shm_id);
+ if ( is_domain_direct_mapped(d) )
+ {
+ printk("%pd: host and guest physical address must be supplied for direct-mapped domains\n",
+ d);
+ return -EINVAL;
+ }
+
/* guest phys address is right at the beginning */
gbase = dt_read_paddr(cells, addr_cells);