@@ -591,6 +591,9 @@ communication.
shared memory region in host physical address space, a size, and a guest
physical address, as the target address of the mapping.
e.g. xen,shared-mem = < [host physical address] [guest address] [size] >
+ Note that if a domain is direct-mapped, i.e. the Dom0 and the Dom0less
+ DomUs with `direct-map` device tree property, the static shared memory
+ should also be direct-mapped (host physical address == guest address).
It shall also meet the following criteria:
1) If the SHM ID matches with an existing region, the address range of the
@@ -235,6 +235,12 @@ int __init process_shm(struct domain *d, struct kernel_info *kinfo,
d, psize);
return -EINVAL;
}
+ if ( is_domain_direct_mapped(d) && (pbase != gbase) )
+ {
+ printk("%pd: physical address 0x%"PRIpaddr" and guest address 0x%"PRIpaddr" are not direct-mapped.\n",
+ d, pbase, gbase);
+ return -EINVAL;
+ }
for ( i = 0; i < PFN_DOWN(psize); i++ )
if ( !mfn_valid(mfn_add(maddr_to_mfn(pbase), i)) )