* [dpdk-dev] [PATCH] vfio: fix boundary check in region search
@ 2018-04-20 15:10 Xiao Wang
2018-04-20 15:23 ` Burakov, Anatoly
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Wang @ 2018-04-20 15:10 UTC (permalink / raw)
To: anatoly.burakov; +Cc: dev, Xiao Wang
A previously mapped region is skipped during the search, leading to
DMA unmap fails.
This patch fixes it and rewords the comment.
Fixes: 73a639085938 ("vfio: allow to map other memory regions")
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
lib/librte_eal/linuxapp/eal/eal_vfio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 7cf3f0285..7afa33d3a 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -230,15 +230,15 @@ find_user_mem_map(struct user_mem_maps *user_mem_maps, uint64_t addr,
/* check start VA */
if (addr < map->addr || addr >= map_va_end)
continue;
- /* check if IOVA end is within boundaries */
- if (va_end <= map->addr || va_end >= map_va_end)
+ /* check if VA end is within boundaries */
+ if (va_end <= map->addr || va_end > map_va_end)
continue;
- /* check start PA */
+ /* check start IOVA */
if (iova < map->iova || iova >= map_iova_end)
continue;
/* check if IOVA end is within boundaries */
- if (iova_end <= map->iova || iova_end >= map_iova_end)
+ if (iova_end <= map->iova || iova_end > map_iova_end)
continue;
/* we've found our map */
--
2.15.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vfio: fix boundary check in region search
2018-04-20 15:10 [dpdk-dev] [PATCH] vfio: fix boundary check in region search Xiao Wang
@ 2018-04-20 15:23 ` Burakov, Anatoly
2018-04-23 19:26 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Burakov, Anatoly @ 2018-04-20 15:23 UTC (permalink / raw)
To: Xiao Wang; +Cc: dev
On 20-Apr-18 4:10 PM, Xiao Wang wrote:
> A previously mapped region is skipped during the search, leading to
> DMA unmap fails.
>
> This patch fixes it and rewords the comment.
>
> Fixes: 73a639085938 ("vfio: allow to map other memory regions")
>
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
<insert Homer Simpson "D'oh!" pic here>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vfio: fix boundary check in region search
2018-04-20 15:23 ` Burakov, Anatoly
@ 2018-04-23 19:26 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-04-23 19:26 UTC (permalink / raw)
To: Xiao Wang; +Cc: dev, Burakov, Anatoly
20/04/2018 17:23, Burakov, Anatoly:
> On 20-Apr-18 4:10 PM, Xiao Wang wrote:
> > A previously mapped region is skipped during the search, leading to
> > DMA unmap fails.
> >
> > This patch fixes it and rewords the comment.
> >
> > Fixes: 73a639085938 ("vfio: allow to map other memory regions")
> >
> > Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> > ---
>
> <insert Homer Simpson "D'oh!" pic here>
_ ,___,-'",-=-.
__,-- _ _,-'_)_ (""`'-._\ `.
_,' __ |,' ,-' __) ,- /. |
,'_,--' | -' _)/ `\
,',' ,' ,-'_,` :
,' ,-' ,(,-( :
,' ,-' , _ ;
/ ,-._/`---' /
/ (____)(----. ) ,'
/ ( `.__, /\ /,
: ;-.___ /__\/|
| ,' `--. -,\ |
: / \ .__/
\ (__ \ |_
\ ,`-, * / _|,\
\ ,' `-. ,'_,-' \
(_\,-' ,'\")--,'-' __\
\ / // ,'| ,--' `-.
`-. `-/ \' | _,' `.
`-._ / `--'/ \
-hrr- ,' | \
/ | \
,-' | /
/ | -'
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-23 19:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20 15:10 [dpdk-dev] [PATCH] vfio: fix boundary check in region search Xiao Wang
2018-04-20 15:23 ` Burakov, Anatoly
2018-04-23 19:26 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).