From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v6] Userspace grant communication
Date: Tue, 8 Feb 2011 16:49:58 -0500 [thread overview]
Message-ID: <20110208214958.GA8176@dumpdata.com> (raw)
In-Reply-To: <20110207231416.GA12956@dumpdata.com>
On Mon, Feb 07, 2011 at 06:14:16PM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Feb 03, 2011 at 12:18:58PM -0500, Daniel De Graaf wrote:
> > Changes since v5:
> > - Added a tested xen version to workaround in #4
> > - Cleaned up variable names & structures
> > - Clarified some of the cleanup in gntalloc
> > - Removed copyright statement from public-domain files
> >
> > [PATCH 1/6] xen-gntdev: Change page limit to be global instead of per-open
> > [PATCH 2/6] xen-gntdev: Use find_vma rather than iterating our vma list manually
> > [PATCH 3/6] xen-gntdev: Add reference counting to maps
> > [PATCH 4/6] xen-gntdev: Support mapping in HVM domains
> > [PATCH 5/6] xen-gntalloc: Userspace grant allocation driver
> > [PATCH 6/6] xen/gntalloc,gntdev: Add unmap notify ioctl
> >
> > Test/Demo code (also updated):
>
> I played with this (two PV domains) and I got two failures:
With your latest patch the issue described earlier disappear,
but if I try to map an non-existed page (say I am confused) I get
this:
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 75f8037..2dd2efa 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#undef DEBUG
+#define DEBUG 1
#include <linux/module.h>
#include <linux/kernel.h>
@@ -304,12 +304,16 @@ static int unmap_grant_pages(struct grant_map *map, int offset, int pages)
pr_debug("map %d+%d [%d+%d]\n", map->index, map->count, offset, pages);
err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset, pages);
- if (err)
+ if (err) {
+ printk(KERN_WARNING "grant unmapping hypercall failed: %d\n", err);
return err;
-
+ }
for (i = 0; i < pages; i++) {
- if (map->unmap_ops[offset+i].status)
+ if (map->unmap_ops[offset+i].status) {
+ printk(KERN_WARNING "%lx is still active: %d\n",
+ offset+i, map->unmap_ops[offset+i].status);
err = -EINVAL;
+ }
map->unmap_ops[offset+i].handle = 0;
}
return err;
(it differs from #master with this patch):
> map 1 9
[ 234.522158] priv ffff88001afac420, add 1
[ 234.522742] gntdev_print_maps: maps list (priv ffff88001afac420)
[ 234.523061] index 0, count 1 [new]
[ 234.523892] map 0+1 at 7fdee5890000 (pgoff 0)
[ 234.524464] map 0+1
Could not map grant 1.9: Invalid argument (map failed)
> map 1 8
[ 236.313135] priv ffff88001afac420, add 1
[ 236.313739] gntdev_print_maps: maps list (priv ffff88001afac420)
[ 236.314062] index 0, count 1
[ 236.314062] index 1, count 1 [new]
[ 236.315521] map 1+1 at 7fdee588f000 (pgoff 1)
[ 236.316120] map 1+1
Mapped grant 1.8 as 4096=0x7fdee588f000
> map 1 10
[ 242.833149] priv ffff88001afac420, add 1
[ 242.833813] gntdev_print_maps: maps list (priv ffff88001afac420)
[ 242.834063] index 0, count 1
[ 242.834063] index 1, count 1
[ 242.834063] index 2, count 1 [new]
[ 242.836265] map 2+1 at 7fdee588e000 (pgoff 2)
[ 242.836866] map 2+1
Could not map grant 1.10: Invalid argument (map failed)
> map 3 10
[ 247.224151] priv ffff88001afac420, add 1
[ 247.224808] gntdev_print_maps: maps list (priv ffff88001afac420)
[ 247.225062] index 0, count 1
[ 247.225062] index 1, count 1
[ 247.225062] index 2, count 1
[ 247.225062] index 3, count 1 [new][ 247.227637] map 3+1 at 7fdee588d000 (pgoff 3)
[ 247.228180] map 3+1
Could not map grant 3.10: Invalid argument (map failed)
> unmap 140366365671424
Unmapped page at 0x7fa9975d4000
> show
00(140595310424064,4096): id 99c6b8b4567 n=11000000 b=adjakasdaadaskda
END
> ^C[ 252.265142] map 0+1 (7fdee588f000 7fdee5890000)
[ 252.265724] map 0+1 [0+1]
[ 252.296327] 0 is still active: -1
[ 252.296834] ------------[ cut here ]------------
[ 252.297310] WARNING: at /home/konrad/ssd/linux/drivers/xen/gntdev.c:396 mn_release+0x6e/0x90()
[ 252.297310] Modules linked in: xen_evtchn fbcon tileblit font bitblit softcursor ttm drm_kms_helper xen_blkfront xen_netfront xen_fbfront fb_sys_fops sysimgblt sysfillrect syscopyarea xen_kbdfront xenfs [last unloaded: dump_dma]
[ 252.297310] Pid: 2313, comm: test_gnt Tainted: G W 2.6.38-rc4-xtt-00169-gb68565e-dirty #3
[ 252.297310] Call Trace:
[ 252.297310] [<ffffffff81049580>] ? warn_slowpath_common+0x80/0x98
[ 252.297310] [<ffffffff810495ad>] ? warn_slowpath_null+0x15/0x17
[ 252.297310] [<ffffffff8126dcd6>] ? mn_release+0x6e/0x90
[ 252.297310] [<ffffffff810ec5f1>] ? __mmu_notifier_release+0x51/0x85
[ 252.297310] [<ffffffff810d9886>] ? exit_mmap+0x27/0x101
[ 252.297310] [<ffffffff810473c2>] ? mmput+0x30/0xd7
[ 252.297310] [<ffffffff8104b197>] ? exit_mm+0x129/0x136
[ 252.297310] [<ffffffff8104cc3f>] ? do_exit+0x208/0x7aa
[ 252.297310] [<ffffffff81006689>] ? xen_force_evtchn_callback+0xd/0xf
[ 252.297310] [<ffffffff81006cd2>] ? check_events+0x12/0x20
[ 252.297310] [<ffffffff8127ad0a>] ? put_ldisc+0xac/0xb1
[ 252.297310] [<ffffffff8127adf9>] ? tty_ldisc_deref+0x9/0xb
[ 252.297310] [<ffffffff81273a97>] ? tty_read+0x8c/0xc8
[ 252.297310] [<ffffffff8100a598>] ? do_notify_resume+0x27/0x5f
[ 252.297310] [<ffffffff8100ac60>] ? int_signal+0x12/0x17
[ 252.297310] ---[ end trace e3791f053b755549 ]---
[ 252.297310] map 1+1 (7fdee588f000 7fdee5890000)
[ 252.297310] map 1+1 [0+1]
[ 252.315756] map 2+1 (7fdee588d000 7fdee588e000)
[ 252.316341] map 2+1 [0+1]
[ 252.346990] 0 is still active: -4
[ 252.347569] ------------[ cut here ]------------
[ 252.347976] WARNING: at /home/konrad/ssd/linux/drivers/xen/gntdev.c:396 mn_release+0x6e/0x90()
[ 252.347976] Modules linked in: xen_evtchn fbcon tileblit font bitblit softcursor ttm drm_kms_helper xen_blkfront xen_netfront xen_fbfront fb_sys_fops sysimgblt sysfillrect syscopyarea xen_kbdfront xenfs [last unloaded: dump_dma]
[ 252.347976] Pid: 2313, comm: test_gnt Tainted: G W 2.6.38-rc4-xtt-00169-gb68565e-dirty #3
[ 252.347976] Call Trace:
[ 252.347976] [<ffffffff81049580>] ? warn_slowpath_common+0x80/0x98
[ 252.347976] [<ffffffff810495ad>] ? warn_slowpath_null+0x15/0x17
[ 252.347976] [<ffffffff8126dcd6>] ? mn_release+0x6e/0x90
[ 252.347976] [<ffffffff810ec5f1>] ? __mmu_notifier_release+0x51/0x85
[ 252.347976] [<ffffffff810d9886>] ? exit_mmap+0x27/0x101
[ 252.347976] [<ffffffff810473c2>] ? mmput+0x30/0xd7
[ 252.347976] [<ffffffff8104b197>] ? exit_mm+0x129/0x136
[ 252.347976] [<ffffffff8104cc3f>] ? do_exit+0x208/0x7aa
[ 252.347976] [<ffffffff81006689>] ? xen_force_evtchn_callback+0xd/0xf
[ 252.347976] [<ffffffff81006cd2>] ? check_events+0x12/0x20
[ 252.347976] [<ffffffff811fd1ff>] ? do_raw_spin_lock+0x6b/0x120
[ 252.347976] [<ffffffff8104d253>] ? do_group_exit+0x72/0x9a
[ 252.347976] [<ffffffff81059fcd>] ? get_signal_to_deliver+0x360/0x37f
[ 252.347976] [<ffffffff812785e6>] ? n_tty_read+0x6d5/0x7ad
[ 252.347976] [<ffffffff81009f53>] ? do_signal+0x6d/0x68b
[ 252.347976] [<ffffffff8103dbd8>] ? __wake_up+0x3f/0x48
[ 252.347976] [<ffffffff8127ad0a>] ? put_ldisc+0xac/0xb1
[ 252.347976] [<ffffffff8127adf9>] ? tty_ldisc_deref+0x9/0xb
[ 252.347976] [<ffffffff81273a97>] ? tty_read+0x8c/0xc8
[ 252.347976] [<ffffffff8100a598>] ? do_notify_resume+0x27/0x5f
[ 252.347976] [<ffffffff8100ac60>] ? int_signal+0x12/0x17
[ 252.347976] map 3+1 (7fdee588d000 7fdee588e000)
[ 252.347976] map 3+1 [0+1]
[ 252.396334] 0 is still active: -4
[ 252.396925] ------------[ cut here ]------------
[ 252.397301] WARNING: at /home/konrad/ssd/linux/drivers/xen/gntdev.c:396 mn_release+0x6e/0x90()
[ 252.397301] Modules linked in: xen_evtchn fbcon tileblit font bitblit softcursor ttm drm_kms_helper xen_blkfront xen_netfront xen_fbfront fb_sys_fops sysimgblt sysfillrect syscopyarea xen_kbdfront xenfs [last unloaded: dump_dma]
[ 252.397301] Pid: 2313, comm: test_gnt Tainted: G W 2.6.38-rc4-xtt-00169-gb68565e-dirty #3
[ 252.397301] Call Trace:
[ 252.397301] [<ffffffff81049580>] ? warn_slowpath_common+0x80/0x98
[ 252.397301] [<ffffffff810495ad>] ? warn_slowpath_null+0x15/0x17
[ 252.397301] [<ffffffff8126dcd6>] ? mn_release+0x6e/0x90
[ 252.397301] [<ffffffff810ec5f1>] ? __mmu_notifier_release+0x51/0x85
[ 252.397301] [<ffffffff810d9886>] ? exit_mmap+0x27/0x101
[ 252.397301] [<ffffffff810473c2>] ? mmput+0x30/0xd7
[ 252.397301] [<ffffffff8104b197>] ? exit_mm+0x129/0x136
[ 252.397301] [<ffffffff8104cc3f>] ? do_exit+0x208/0x7aa
[ 252.397301] [<ffffffff81006689>] ? xen_force_evtchn_callback+0xd/0xf
[ 252.397301] [<ffffffff81006cd2>] ? check_events+0x12/0x20
[ 252.397301] [<ffffffff811fd1ff>] ? do_raw_spin_lock+0x6b/0x120
[ 252.397301] [<ffffffff8104d253>] ? do_group_exit+0x72/0x9a
[ 252.397301] [<ffffffff81059fcd>] ? get_signal_to_deliver+0x360/0x37f
[ 252.397301] [<ffffffff812785e6>] ? n_tty_read+0x6d5/0x7ad
[ 252.397301] [<ffffffff81009f53>] ? do_signal+0x6d/0x68b
[ 252.397301] [<ffffffff8103dbd8>] ? __wake_up+0x3f/0x48
[ 252.397301] [<ffffffff8127ad0a>] ? put_ldisc+0xac/0xb1
[ 252.397301] [<ffffffff8127adf9>] ? tty_ldisc_deref+0x9/0xb
[ 252.397301] [<ffffffff81273a97>] ? tty_read+0x8c/0xc8
[ 252.397301] [<ffffffff8100a598>] ? do_notify_resume+0x27/0x5f
[ 252.397301] [<ffffffff8100ac60>] ? int_signal+0x12/0x17
[ 252.397301] ---[ end trace e3791f053b75554b ]---
[ 252.414807] close ffff88001e35ea10
[ 252.415439] priv ffff88001afac420
next prev parent reply other threads:[~2011-02-08 21:49 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 17:18 [PATCH v6] Userspace grant communication Daniel De Graaf
2011-02-03 17:18 ` [PATCH 1/6] xen-gntdev: Change page limit to be global instead of per-open Daniel De Graaf
2011-02-03 17:19 ` [PATCH 2/6] xen-gntdev: Use find_vma rather than iterating our vma list manually Daniel De Graaf
2011-02-03 17:19 ` [PATCH 3/6] xen-gntdev: Add reference counting to maps Daniel De Graaf
2011-02-03 17:19 ` [PATCH 4/6] xen-gntdev: Support mapping in HVM domains Daniel De Graaf
2011-02-14 15:51 ` Konrad Rzeszutek Wilk
2011-02-14 17:43 ` Daniel De Graaf
2011-02-14 18:52 ` Konrad Rzeszutek Wilk
2011-02-03 17:19 ` [PATCH 5/6] xen-gntalloc: Userspace grant allocation driver Daniel De Graaf
2011-02-08 22:48 ` Konrad Rzeszutek Wilk
2011-02-09 18:52 ` Daniel De Graaf
2011-02-03 17:19 ` [PATCH 6/6] xen/gntalloc, gntdev: Add unmap notify ioctl Daniel De Graaf
2011-02-14 15:37 ` Konrad Rzeszutek Wilk
2011-02-14 18:07 ` Daniel De Graaf
2011-02-03 19:16 ` [PATCH] xen-gntdev: Fix memory leak when mmap fails Daniel De Graaf
2011-02-07 23:14 ` [PATCH v6] Userspace grant communication Konrad Rzeszutek Wilk
2011-02-08 14:14 ` [PATCH] xen-gntdev: Fix unmap notify on PV domains Daniel De Graaf
2011-02-08 22:58 ` Konrad Rzeszutek Wilk
2011-02-09 20:33 ` [PATCH] xen-gntdev: prevent using UNMAP_NOTIFY_CLEAR_BYTE on read-only mappings Daniel De Graaf
2011-02-09 21:09 ` [PATCH v2] " Daniel De Graaf
2011-02-09 22:22 ` [PATCH] " Jeremy Fitzhardinge
2011-02-09 23:11 ` Daniel De Graaf
2011-02-09 23:15 ` [PATCH v3] " Daniel De Graaf
2011-02-08 21:49 ` Konrad Rzeszutek Wilk [this message]
2011-02-09 20:11 ` [PATCH] xen-gntdev: Use map->vma for checking map validity Daniel De Graaf
2011-02-09 20:12 ` [PATCH] xen-gntdev: Avoid unmapping ranges twice Daniel De Graaf
2011-02-09 21:11 ` [PATCH] xen-gntdev: Avoid double-mapping memory Daniel De Graaf
2011-02-14 16:14 ` [PATCH v6] Userspace grant communication Konrad Rzeszutek Wilk
2011-02-14 16:38 ` Konrad Rzeszutek Wilk
2011-02-14 17:56 ` Daniel De Graaf
2011-02-14 19:21 ` Konrad Rzeszutek Wilk
2011-02-14 20:55 ` Daniel De Graaf
2011-02-14 17:55 ` Daniel De Graaf
2011-02-14 19:04 ` Konrad Rzeszutek Wilk
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=20110208214958.GA8176@dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=jeremy@goop.org \
--cc=xen-devel@lists.xensource.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 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.