DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Alejandro Lucero <alejandro.lucero@netronome.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev <dev@dpdk.org>, Felix Marti <felix@chelsio.com>,
	Nirranjan Kirubaharan <nirranjan@chelsio.com>,
	Kumar Sanghvi <kumaras@chelsio.com>
Subject: Re: [dpdk-dev] [PATCH v2] vfio: Fix overflow while assigning vfio BAR region offset and size
Date: Wed, 1 Jul 2015 10:00:13 +0000	[thread overview]
Message-ID: <C6ECDF3AB251BE4894318F4E4512369780CCD04C@IRSMSX109.ger.corp.intel.com> (raw)
In-Reply-To: <CAD+H993L17VVuf91kE8p_ev0TtrZxh7J_yhe+bE1kjUa_fM8Wg@mail.gmail.com>

Hi all,

> The last patch from Rahul does not solve the problem. For those cases where the MSI-X table is in one of the BARs to map, the memreg array is still in use.

Rahul's initial patch was pretty much what you have submitted, it just didn't build on a 32-bit system.

> My fix was using unsigned long instead of uint32_t for the memreg array as this is used as  a parameter for mmap system call which expects such a type for the offset (and size).

Maybe use off_t? That would at least be guaranteed to compile on any system...

> In a 32-bit system mmap system call and VFIO mmap implementation will get an unsigned long offset, as it does the struct vma_area_struct for vm_pgoff.
> VFIO will not be able to map the right BAR except for BAR 0.
> 
> So, basically, VFIO kernel code does not work for 32 bit systems.
> 
> I think we should define memreg as unsigned long and to report this problem to the VFIO kernel maintainer.

If that's the case, this should indeed be taken up with the kernel maintainers. I don't have a 32-bit system handy to test it, unfortunately.

Thanks,
Anatoly

  reply	other threads:[~2015-07-01 10:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 14:16 [dpdk-dev] [PATCH] " Rahul Lakkireddy
2015-06-17 12:09 ` Thomas Monjalon
2015-06-18 14:23   ` Rahul Lakkireddy
2015-06-23 15:00 ` [dpdk-dev] [PATCH v2] " Rahul Lakkireddy
2015-06-30 21:12   ` Thomas Monjalon
2015-07-01  8:34     ` Alejandro Lucero
2015-07-01 10:00       ` Burakov, Anatoly [this message]
2015-07-06 15:45         ` Alejandro Lucero
2015-07-07  7:56           ` Rahul Lakkireddy
2015-07-07  9:08           ` Burakov, Anatoly
2015-07-07 10:40             ` Rahul Lakkireddy
2015-07-07 10:50               ` Burakov, Anatoly
2015-07-10  9:54                 ` Rahul Lakkireddy
2015-07-10 17:27                   ` Alejandro Lucero
2015-07-13  8:51   ` [dpdk-dev] [PATCH v3] " Rahul Lakkireddy
2015-07-14  8:56     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C6ECDF3AB251BE4894318F4E4512369780CCD04C@IRSMSX109.ger.corp.intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=alejandro.lucero@netronome.com \
    --cc=dev@dpdk.org \
    --cc=felix@chelsio.com \
    --cc=kumaras@chelsio.com \
    --cc=nirranjan@chelsio.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).