* HVM (hypercall_grant_table_op) Problem
@ 2011-11-17 16:52 马耀
2011-11-24 11:58 ` Tim Deegan
2012-01-03 20:30 ` Konrad Rzeszutek Wilk
0 siblings, 2 replies; 3+ messages in thread
From: 马耀 @ 2011-11-17 16:52 UTC (permalink / raw)
To: Xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1517 bytes --]
Hi:
I modified the netfont.c of Linux HVM domU installed PVonHVM.In it, I call hypercall_grant_table_op
(GNTTABOP_map_grant_ref...), then dom0 shutdown and restart at once.
I'm confused about this.
Before Xen 3.4.3, Xen/arch/x86/HVM/hvm.c look like this:
static long hvm_grant_table_op(unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
{
if ( (cmd != GNTTABOP_query_size) && (cmd != GNTTABOP_setup_table) )
return -ENOSYS; /* all other commands need auditing */
return do_grant_table_op(cmd, uop, count);
}
I know it hadn't support all grant_table_op but only two:GNTTABOP_query_size and GNTTABOP_setup_table.
Now, after Xen4.0.0 and later, it look like below:
static long hvm_grant_table_op( unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
{
if ( !grant_table_op_is_allowed(cmd) )
return -ENOSYS; /* all other commands need auditing */
return do_grant_table_op(cmd, uop, count);
}
static int grant_table_op_is_allowed(unsigned int cmd)
{
switch (cmd) {
case GNTTABOP_query_size:
case GNTTABOP_setup_table:
case GNTTABOP_set_version:
case GNTTABOP_copy:
case GNTTABOP_map_grant_ref:
case GNTTABOP_unmap_grant_ref:
return 1;
default:
/* all other commands need auditing */
return 0;
}
}
From above, I conclude that I can map a HVM's page to another HVM, just like two PVs.
Am I wrong? Who can give me some suggestion?
[-- Attachment #1.2: Type: text/html, Size: 2169 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] 3+ messages in thread* Re: HVM (hypercall_grant_table_op) Problem
2011-11-17 16:52 HVM (hypercall_grant_table_op) Problem 马耀
@ 2011-11-24 11:58 ` Tim Deegan
2012-01-03 20:30 ` Konrad Rzeszutek Wilk
1 sibling, 0 replies; 3+ messages in thread
From: Tim Deegan @ 2011-11-24 11:58 UTC (permalink / raw)
To: ????; +Cc: Xen-devel
Hi,
At 00:52 +0800 on 18 Nov (1321577533), ???? wrote:
> Hi:
> I modified the netfont.c of Linux HVM domU installed PVonHVM.In it, I call hypercall_grant_table_op
> (GNTTABOP_map_grant_ref...), then dom0 shutdown and restart at once.
Do you have a serial line attached to the machine to capture the console
output when this happens? Without that it's hard to knwo what the bug is.
> From above, I conclude that I can map a HVM's page to another HVM, just like two PVs.
> Am I wrong? Who can give me some suggestion?
Yes, HVM guests can now map granted frames, but not quite 'just like pv'.
The grant hypercall maps the granted frame into the HVM guest's p2m map,
instead of into the pagetables. That is, you pass in a PFN, and when
the grant succeeds, you still need to map that PFN in your pagetables to
access the page.
The checkin that added the feature came with this comment:
After some discussion, here's a second version of the patch I posted a
couple of weeks back to map grant references into HVM guests. As
before, this is done by modifying the P2M map, but this time there's
no new hypercall to do it. Instead, the existing GNTTABOP_map is
overloaded to perform a P2M mapping if called from a shadow mode
translate guest. This matches the IA64 API.
http://xenbits.xen.org/hg/xen-unstable.hg/rev/c0cb307d927f
Tim.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: HVM (hypercall_grant_table_op) Problem
2011-11-17 16:52 HVM (hypercall_grant_table_op) Problem 马耀
2011-11-24 11:58 ` Tim Deegan
@ 2012-01-03 20:30 ` Konrad Rzeszutek Wilk
1 sibling, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-03 20:30 UTC (permalink / raw)
To: 马耀; +Cc: Xen-devel
On Fri, Nov 18, 2011 at 12:52:13AM +0800, 马耀 wrote:
> Hi:
> I modified the netfont.c of Linux HVM domU installed PVonHVM.In it, I call hypercall_grant_table_op
> (GNTTABOP_map_grant_ref...), then dom0 shutdown and restart at once.
> I'm confused about this.
> Before Xen 3.4.3, Xen/arch/x86/HVM/hvm.c look like this:
> static long hvm_grant_table_op(unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
> {
> if ( (cmd != GNTTABOP_query_size) && (cmd != GNTTABOP_setup_table) )
> return -ENOSYS; /* all other commands need auditing */
> return do_grant_table_op(cmd, uop, count);
> }
> I know it hadn't support all grant_table_op but only two:GNTTABOP_query_size and GNTTABOP_setup_table.
>
> Now, after Xen4.0.0 and later, it look like below:
> static long hvm_grant_table_op( unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
> {
> if ( !grant_table_op_is_allowed(cmd) )
> return -ENOSYS; /* all other commands need auditing */
> return do_grant_table_op(cmd, uop, count);
> }
> static int grant_table_op_is_allowed(unsigned int cmd)
> {
> switch (cmd) {
> case GNTTABOP_query_size:
> case GNTTABOP_setup_table:
> case GNTTABOP_set_version:
> case GNTTABOP_copy:
> case GNTTABOP_map_grant_ref:
> case GNTTABOP_unmap_grant_ref:
> return 1;
> default:
> /* all other commands need auditing */
> return 0;
> }
> }
> From above, I conclude that I can map a HVM's page to another HVM, just like two PVs.
> Am I wrong? Who can give me some suggestion?
I am not sure if we ever came to a conclusion on what might be the trouble. Are you still experiencing
problems?
Thanks
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-03 20:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 16:52 HVM (hypercall_grant_table_op) Problem 马耀
2011-11-24 11:58 ` Tim Deegan
2012-01-03 20:30 ` Konrad Rzeszutek Wilk
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).