expandable grant table bug?
Hi All,
Grant table had been expanded before.
As a result, it is thought that it came to be able to use four VNIF or more.
The PV domain operated without trouble.
However, VNIF can be only used up to three in DomVTx(x86).
# xm network-attach 27 # xm network-attach 27 # xm network-attach 27 # xm network-attach 27 # xm network-list 27 Idx BE MAC Addr. handle state evt-ch tx-/rx-ring-ref BE-path 0 0 02:17:42:2f:01:11 0 4 5 1280 /1281 /local/domain/0/backend/vif/27/0 1 0 02:17:42:2f:03:11 1 4 6 1282 /1283 /local/domain/0/backend/vif/27/1 2 0 00:16:3e:4d:2f:0e 2 4 7 1792 /1793 /local/domain/0/backend/vif/27/2 3 0 00:16:3e:11:35:e0 3 6 -1 -1 /-1 /local/domain/0/backend/vif/27/3
The test environment is as follows.
- xen-unstable.hg : cs15072
- DomVTx(X86) with PV-ON-HVM
This problem was investigated a little.
The cause is not to be able to execute HYPERVISOR_grant_table_op from the hvm domain. Therefore, the number of boot_max_nr_grant_frames is four.
・unmodified_drivers/linux-2.6/platform-pci/platform-pci.c platform_pci_init()
-> ・linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
gnttab_init()
__max_nr_grant_frames()The size of the grant table is acquired here.
404 static unsigned int __max_nr_grant_frames(void) 405 {
406 struct gnttab_query_size query;
407 int rc;
408
409 query.dom = DOMID_SELF;
410
411 rc = HYPERVISOR_grant_table_op(GNTTABOP_query_size, &query, 1); <<== This
412 if ((rc < 0) || (query.status != GNTST_okay))
413 return 4; /* Legacy max supported number of frames */
414
415 return query.max_nr_frames;
416 }
=> ・xen/arch/x86/hvm/hvm.c
736 int hvm_do_hypercall(struct cpu_user_regs *regs) 737 {
...
759 if ( (eax >= NR_hypercalls) || !hvm_hypercall32_table[eax] )
760 {
761 if ( eax != __HYPERVISOR_grant_table_op )
762 gdprintk(XENLOG_WARNING, "HVM vcpu %d:%d bad hypercall %u.\n",
763 current->domain->domain_id, current->vcpu_id, eax);
764 regs->eax = -ENOSYS;
765 return HVM_HCALL_completed;
766 }
hvm_hypercall32_table is as follows.
Therefore, grant_table_op cannot be called.
726 static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
727 HYPERCALL_COMPAT32(memory_op), 728 HYPERCALL(xen_version), 729 HYPERCALL(event_channel_op), 730 HYPERCALL(sched_op), 731 HYPERCALL(hvm_op)
732 };
Cannot grant_table_op make it call from the hvm domain?
How should we correct it if so?
Best Regard,
--
Takanori Kasai
Quoted 3 lines · Kasai Takanori
Cannot
grant_table_opmake it call from the hvm domain?How should we correct it if so?
Fix grant_table_op to be callable from HVM guests.
-- Keir
Hi Keir,
Thank you for reply.
Quoted 1 line
Fix
grant_table_opto be callable from HVM guests.
It is not necessary to use all functions of grant_table_op from hvm domain.
It is necessary only to acquire the query size. Is the method of acquiring the query size by HYPERCALL of hvm_op better?
Best Regards,
--
Takanori Kasai
Quoted 5 lines · Kasai Takanori
Quoted 1 line
Fix
grant_table_opto be callable from HVM guests.It is not necessary to use all functions of
grant_table_opfrom hvm domain. It is necessary only to acquire the query size.
Is the method of acquiring the query size by HYPERCALL ofhvm_opbetter?
Some people do want to be able to do grant_table_ops in the near future. So working around that doesn't really make sense.
-- Keir