mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/arm: domctl: Use typesafe gfn in XEN_DOMCTL_cacheflush
This will make changes in a follow-up patch easier. Signed-off-by: Julien Grall <julien.grall@arm.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
8d6e1fe4a7
commit
9c35572f35
1 file changed
+4
-4
@@ -52,16 +52,16 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
|
||||
{
|
||||
case XEN_DOMCTL_cacheflush:
|
||||
{
|
||||
unsigned long s = domctl->u.cacheflush.start_pfn;
|
||||
unsigned long e = s + domctl->u.cacheflush.nr_pfns;
|
||||
gfn_t s = _gfn(domctl->u.cacheflush.start_pfn);
|
||||
gfn_t e = gfn_add(s, domctl->u.cacheflush.nr_pfns);
|
||||
|
||||
if ( domctl->u.cacheflush.nr_pfns > (1U<<MAX_ORDER) )
|
||||
return -EINVAL;
|
||||
|
||||
if ( e < s )
|
||||
if ( gfn_x(e) < gfn_x(s) )
|
||||
return -EINVAL;
|
||||
|
||||
return p2m_cache_flush_range(d, _gfn(s), _gfn(e));
|
||||
return p2m_cache_flush_range(d, s, e);
|
||||
}
|
||||
case XEN_DOMCTL_bind_pt_irq:
|
||||
{
|
||||
|
||||