All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gnttab: adjust unmap checking of dev_bus_addr
@ 2021-08-30 14:26 Jan Beulich
  2021-09-06 10:56 ` Julien Grall
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2021-08-30 14:26 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, George Dunlap, Ian Jackson, Julien Grall,
	Stefano Stabellini, Wei Liu

There's no point checking ->dev_bus_addr when GNTMAP_device_map isn't
set (and hence the field isn't going to be consumed). And if there is a
mismatch, use the so far unused GNTST_bad_dev_addr error indicator - if
not here, where else would this (so far unused) value be used?

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1450,9 +1450,9 @@ unmap_common(
 
     op->mfn = act->mfn;
 
-    if ( op->dev_bus_addr &&
+    if ( op->dev_bus_addr && (flags & GNTMAP_device_map) &&
          unlikely(op->dev_bus_addr != mfn_to_maddr(act->mfn)) )
-        PIN_FAIL(act_release_out, GNTST_general_error,
+        PIN_FAIL(act_release_out, GNTST_bad_dev_addr,
                  "Bus address doesn't match gntref (%"PRIx64" != %"PRIpaddr")\n",
                  op->dev_bus_addr, mfn_to_maddr(act->mfn));
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gnttab: adjust unmap checking of dev_bus_addr
  2021-08-30 14:26 [PATCH] gnttab: adjust unmap checking of dev_bus_addr Jan Beulich
@ 2021-09-06 10:56 ` Julien Grall
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2021-09-06 10:56 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Andrew Cooper, George Dunlap, Ian Jackson, Stefano Stabellini, Wei Liu

Hi Jan,

On 30/08/2021 15:26, Jan Beulich wrote:
> There's no point checking ->dev_bus_addr when GNTMAP_device_map isn't
> set (and hence the field isn't going to be consumed). And if there is a
> mismatch, use the so far unused GNTST_bad_dev_addr error indicator - if
> not here, where else would this (so far unused) value be used?
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Julien Grall <jgrall@amazon.com>

> 
> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -1450,9 +1450,9 @@ unmap_common(
>   
>       op->mfn = act->mfn;
>   
> -    if ( op->dev_bus_addr &&
> +    if ( op->dev_bus_addr && (flags & GNTMAP_device_map) &&
>            unlikely(op->dev_bus_addr != mfn_to_maddr(act->mfn)) )
> -        PIN_FAIL(act_release_out, GNTST_general_error,
> +        PIN_FAIL(act_release_out, GNTST_bad_dev_addr,
>                    "Bus address doesn't match gntref (%"PRIx64" != %"PRIpaddr")\n",
>                    op->dev_bus_addr, mfn_to_maddr(act->mfn));
>   
> 

Cheers,

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-06 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 14:26 [PATCH] gnttab: adjust unmap checking of dev_bus_addr Jan Beulich
2021-09-06 10:56 ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.