* Grant Tables & mm.c
@ 2007-07-04 10:16 Koripella Srinivas
2007-07-04 10:20 ` Keir Fraser
2007-07-04 14:13 ` Mark Williamson
0 siblings, 2 replies; 8+ messages in thread
From: Koripella Srinivas @ 2007-07-04 10:16 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 529 bytes --]
Hi,
I am using grant tables to set up a shared memory between two guests.
One problem i am facing is that as soon as the shared memory is set up one of the domain crashes with the log message
"Attempt to implicitly unmap a granted PTE".
the message is from function "put_page_from_l1e" in mm.c(arch/x86).
what could be the reason? Any pointers would be of great help
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/
[-- Attachment #1.2: Type: text/html, Size: 778 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Grant Tables & mm.c
2007-07-04 10:16 Grant Tables & mm.c Koripella Srinivas
@ 2007-07-04 10:20 ` Keir Fraser
2007-07-04 18:42 ` Jeremy Fitzhardinge
2007-07-04 14:13 ` Mark Williamson
1 sibling, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2007-07-04 10:20 UTC (permalink / raw)
To: Koripella Srinivas, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 977 bytes --]
You must explicitly unmap grants. So the domain which uses
GNTTABOP_map_grant_ref must subsequently unmap it with
GNTTABOP_unmap_grant_ref. You cannot just zap the pte!
-- Keir
On 4/7/07 11:16, "Koripella Srinivas" <talkwithsrinivas@yahoo.co.in> wrote:
> Hi,
> I am using grant tables to set up a shared memory between two guests.
> One problem i am facing is that as soon as the shared memory is set up one of
> the domain crashes with the log message
> "Attempt to implicitly unmap a granted PTE".
> the message is from function "put_page_from_l1e" in mm.c(arch/x86).
>
> what could be the reason? Any pointers would be of great help
>
>
>
>
> Here¹s a new way to find what you're looking for - Yahoo! Answers
> <http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 1805 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Grant Tables & mm.c
2007-07-04 10:20 ` Keir Fraser
@ 2007-07-04 18:42 ` Jeremy Fitzhardinge
2007-07-04 19:04 ` Keir Fraser
0 siblings, 1 reply; 8+ messages in thread
From: Jeremy Fitzhardinge @ 2007-07-04 18:42 UTC (permalink / raw)
To: Keir Fraser; +Cc: Koripella Srinivas, xen-devel
Keir Fraser wrote:
> You must explicitly unmap grants. So the domain which uses
> GNTTABOP_map_grant_ref must subsequently unmap it with
> GNTTABOP_unmap_grant_ref. You cannot just zap the pte!
Does that just apply to the last pte, or any pte?
J
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Grant Tables & mm.c
2007-07-04 18:42 ` Jeremy Fitzhardinge
@ 2007-07-04 19:04 ` Keir Fraser
0 siblings, 0 replies; 8+ messages in thread
From: Keir Fraser @ 2007-07-04 19:04 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Koripella Srinivas, xen-devel
On 4/7/07 19:42, "Jeremy Fitzhardinge" <jeremy@goop.org> wrote:
>> You must explicitly unmap grants. So the domain which uses
>> GNTTABOP_map_grant_ref must subsequently unmap it with
>> GNTTABOP_unmap_grant_ref. You cannot just zap the pte!
>
> Does that just apply to the last pte, or any pte?
Any pte that was created via GNTTABOP_map_grant_ref.
-- Keir
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Grant Tables & mm.c
2007-07-04 10:16 Grant Tables & mm.c Koripella Srinivas
2007-07-04 10:20 ` Keir Fraser
@ 2007-07-04 14:13 ` Mark Williamson
1 sibling, 0 replies; 8+ messages in thread
From: Mark Williamson @ 2007-07-04 14:13 UTC (permalink / raw)
To: xen-devel; +Cc: Koripella Srinivas, Keir Fraser
> I am using grant tables to set up a shared memory between two guests.
> One problem i am facing is that as soon as the shared memory is set up one
> of the domain crashes with the log message "Attempt to implicitly unmap a
> granted PTE".
> the message is from function "put_page_from_l1e" in mm.c(arch/x86).
>
> what could be the reason? Any pointers would be of great help
This means that something is attempting to zero the PTE pointing to the
granted page without doing an explicit grant unmap hypercall; this is not
allowed by Xen.
Do you have any idea what might be causing this? Are you mapping pages to
userspace? Linux tends to zap userspace page mappings quite cheerfully
unless you do something to stop it, could this be your problem?
Cheers,
Mark
--
Dave: Just a question. What use is a unicyle with no seat? And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <469219.20698.qm@web94111.mail.in2.yahoo.com>]
* Re: Grant Tables & mm.c
[not found] <469219.20698.qm@web94111.mail.in2.yahoo.com>
@ 2007-07-06 4:25 ` Mark Williamson
0 siblings, 0 replies; 8+ messages in thread
From: Mark Williamson @ 2007-07-06 4:25 UTC (permalink / raw)
To: Koripella Srinivas; +Cc: xen-devel
> " Linux tends to zap userspace page mappings quite cheerfully
> unless you do something to stop it, could this be your problem?"
>
> What does this mean exactly??
Linux "zaps" mappings when it removes them from pagetables. Really this
corresponds to zeroing a pte corresponding to that mapping.
Unless you do something to stop the Linux mm system from treating the grant
table mappins like "normal" RAM, it will eventually want to simply zero them.
This will break for grant mappings, since it is not a permitted means of
unmapping granted memory.
> Any way i can prevent it from happening?
It depends on what you're trying to do...
Have you looked at the userspace grantables driver in our Linux tree? This
provides a device for mapping granted memory safely into userspace, handling
cleanup correctly. Even if that's not directly useful, maybe you can find
some code in there that'll help you.
Cheers,
Mark
--
Dave: Just a question. What use is a unicyle with no seat? And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Grant Tables & mm.c
@ 2007-07-07 13:44 Koripella Srinivas
2007-07-07 15:19 ` Derek Murray
0 siblings, 1 reply; 8+ messages in thread
From: Koripella Srinivas @ 2007-07-07 13:44 UTC (permalink / raw)
To: Mark Williamson; +Cc: derek.murray, xen-devel, keir
[-- Attachment #1.1: Type: text/plain, Size: 1788 bytes --]
I was looking at the user space grant tables but i did not find any code calling the function
"remap_pfn_range" to map the kmalloc ed allocated memory into user space.
What could be the reason?? Or am i missing something
Thanks Mark.
----- Original Message ----
From: Mark Williamson <mark.williamson@cl.cam.ac.uk>
To: Koripella Srinivas <talkwithsrinivas@yahoo.co.in>
Cc: xen-devel@lists.xensource.com
Sent: Friday, 6 July, 2007 9:55:48 AM
Subject: Re: [Xen-devel] Grant Tables & mm.c
> " Linux tends to zap userspace page mappings quite cheerfully
> unless you do something to stop it, could this be your problem?"
>
> What does this mean exactly??
Linux "zaps" mappings when it removes them from pagetables. Really this
corresponds to zeroing a pte corresponding to that mapping.
Unless you do something to stop the Linux mm system from treating the grant
table mappins like "normal" RAM, it will eventually want to simply zero them.
This will break for grant mappings, since it is not a permitted means of
unmapping granted memory.
> Any way i can prevent it from happening?
It depends on what you're trying to do...
Have you looked at the userspace grantables driver in our Linux tree? This
provides a device for mapping granted memory safely into userspace, handling
cleanup correctly. Even if that's not directly useful, maybe you can find
some code in there that'll help you.
Cheers,
Mark
--
Dave: Just a question. What use is a unicyle with no seat? And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/
[-- Attachment #1.2: Type: text/html, Size: 2429 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Grant Tables & mm.c
2007-07-07 13:44 Koripella Srinivas
@ 2007-07-07 15:19 ` Derek Murray
0 siblings, 0 replies; 8+ messages in thread
From: Derek Murray @ 2007-07-07 15:19 UTC (permalink / raw)
To: Koripella Srinivas; +Cc: keir, xen-devel, Mark Williamson
On 7 Jul 2007, at 14:44, Koripella Srinivas wrote:
> I was looking at the user space grant tables but i did not find any
> code calling the function
> "remap_pfn_range" to map the kmalloc ed allocated memory into user
> space.
> What could be the reason?? Or am i missing something
The mapping takes place in drivers/xen/gntdev/gntdev.c, in the
function gntdev_mmap(). In the normal case (no shadow page tables),
the page is mapped into user space by calling
HYPERVISOR_grant_table_op, with the GNTTABOP_map_grant_ref operation,
and (amongst other things) a pointer to the page table entry to be
rewritten. Therefore, it is not necessary to call remap_pfn_range().
I'm not sure what you mean by "the kmalloc ed allocated memory". The
memory is allocated by another domain, and inserted in the grant
table. In the kernel that carries out the mapping, kmalloc is used
only for allocating kernel-private data structures.
Regards,
Derek Murray.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-07-07 15:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04 10:16 Grant Tables & mm.c Koripella Srinivas
2007-07-04 10:20 ` Keir Fraser
2007-07-04 18:42 ` Jeremy Fitzhardinge
2007-07-04 19:04 ` Keir Fraser
2007-07-04 14:13 ` Mark Williamson
[not found] <469219.20698.qm@web94111.mail.in2.yahoo.com>
2007-07-06 4:25 ` Mark Williamson
-- strict thread matches above, loose matches on Subject: below --
2007-07-07 13:44 Koripella Srinivas
2007-07-07 15:19 ` Derek Murray
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.